@basis-ng/primitives 0.0.1-alpha.23 → 0.0.1-alpha.25

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.
@@ -1,4 +1,3 @@
1
- import { CdkConnectedOverlay } from '@angular/cdk/overlay';
2
1
  import { OnInit } from '@angular/core';
3
2
  import { Button } from '../button/button.component';
4
3
  import { ControlValueAccessor } from '@angular/forms';
@@ -14,6 +13,10 @@ export declare class ComboboxComponent implements OnInit, ControlValueAccessor {
14
13
  * Defaults to 'Select an option'.
15
14
  */
16
15
  readonly placeholder: import("@angular/core").InputSignal<string>;
16
+ /**
17
+ * Input for the offset value between the button and the dropdown.
18
+ */
19
+ readonly offset: import("@angular/core").InputSignal<number>;
17
20
  /**
18
21
  * Signal indicating whether the dropdown is currently open.
19
22
  */
@@ -58,11 +61,6 @@ export declare class ComboboxComponent implements OnInit, ControlValueAccessor {
58
61
  * This is used to provide a smooth transition when closing the dropdown.
59
62
  */
60
63
  readonly closeDelay: import("@angular/core").WritableSignal<number>;
61
- /**
62
- * Reference to the CdkConnectedOverlay directive.
63
- * This is used to manage the positioning and visibility of the dropdown overlay.
64
- */
65
- readonly cdkConnectedOverlay: import("@angular/core").Signal<CdkConnectedOverlay | undefined>;
66
64
  /**
67
65
  * Lifecycle hook that is called after the component is initialized.
68
66
  * It sets up the necessary subscriptions for handling value changes.
@@ -74,17 +72,6 @@ export declare class ComboboxComponent implements OnInit, ControlValueAccessor {
74
72
  * value is propagated to Angular Forms.
75
73
  */
76
74
  handleSelectedValueChange(): void;
77
- /**
78
- * Opens the dropdown and focuses the listbox.
79
- * This method sets the `isOpen` signal to `true` and ensures the listbox gains focus.
80
- */
81
- open(): void;
82
- /**
83
- * Closes the dropdown with a transition effect and refocuses the button.
84
- * This method sets the `isOpen` signal to `false` after a delay and removes
85
- * the transition class from the overlay panel.
86
- */
87
- close(): void;
88
75
  /**
89
76
  * Focuses the input element within the command component when the overlay is attached.
90
77
  */
@@ -127,5 +114,5 @@ export declare class ComboboxComponent implements OnInit, ControlValueAccessor {
127
114
  */
128
115
  setDisabledState(isDisabled: boolean): void;
129
116
  static ɵfac: i0.ɵɵFactoryDeclaration<ComboboxComponent, never>;
130
- static ɵcmp: i0.ɵɵComponentDeclaration<ComboboxComponent, "b-combobox", never, { "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; }, { "disabled": "disabledChange"; }, ["command"], ["*"], true, never>;
117
+ static ɵcmp: i0.ɵɵComponentDeclaration<ComboboxComponent, "b-combobox", never, { "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "offset": { "alias": "offset"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; }, { "disabled": "disabledChange"; }, ["command"], ["*"], true, never>;
131
118
  }
@@ -1,4 +1,3 @@
1
- import { CdkConnectedOverlay } from '@angular/cdk/overlay';
2
1
  import { OnInit } from '@angular/core';
3
2
  import { SelectOptionsComponent } from './select-options.component';
4
3
  import { Button } from '../button/button.component';
@@ -14,6 +13,10 @@ export declare class SelectComponent implements OnInit, ControlValueAccessor {
14
13
  * Defaults to 'Select an option'.
15
14
  */
16
15
  readonly placeholder: import("@angular/core").InputSignal<string>;
16
+ /**
17
+ * Input for the offset value between the button and the dropdown.
18
+ */
19
+ readonly offset: import("@angular/core").InputSignal<number>;
17
20
  /**
18
21
  * Signal indicating whether the dropdown is currently open.
19
22
  */
@@ -58,11 +61,6 @@ export declare class SelectComponent implements OnInit, ControlValueAccessor {
58
61
  * This is used to provide a smooth transition when closing the dropdown.
59
62
  */
60
63
  readonly closeDelay: import("@angular/core").WritableSignal<number>;
61
- /**
62
- * Reference to the CdkConnectedOverlay directive.
63
- * This is used to manage the positioning and visibility of the dropdown overlay.
64
- */
65
- readonly cdkConnectedOverlay: import("@angular/core").Signal<CdkConnectedOverlay | undefined>;
66
64
  /**
67
65
  * Lifecycle hook that is called after the component is initialized.
68
66
  * It sets up the necessary subscriptions for handling value changes.
@@ -74,17 +72,6 @@ export declare class SelectComponent implements OnInit, ControlValueAccessor {
74
72
  * value is propagated to Angular Forms.
75
73
  */
76
74
  handleSelectedValueChange(): void;
77
- /**
78
- * Opens the dropdown.
79
- * This method sets the `isOpen` signal to `true`.
80
- */
81
- open(): void;
82
- /**
83
- * Closes the dropdown with a transition effect and refocuses the button.
84
- * This method sets the `isOpen` signal to `false` after a delay and removes
85
- * the transition class from the overlay panel.
86
- */
87
- close(): void;
88
75
  /**
89
76
  * Focuses the options list when the overlay is attached.
90
77
  */
@@ -127,5 +114,5 @@ export declare class SelectComponent implements OnInit, ControlValueAccessor {
127
114
  */
128
115
  setDisabledState(isDisabled: boolean): void;
129
116
  static ɵfac: i0.ɵɵFactoryDeclaration<SelectComponent, never>;
130
- static ɵcmp: i0.ɵɵComponentDeclaration<SelectComponent, "b-select", never, { "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; }, { "disabled": "disabledChange"; }, ["optionsList"], ["*"], true, never>;
117
+ static ɵcmp: i0.ɵɵComponentDeclaration<SelectComponent, "b-select", never, { "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "offset": { "alias": "offset"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; }, { "disabled": "disabledChange"; }, ["optionsList"], ["*"], true, never>;
131
118
  }
@@ -0,0 +1,23 @@
1
+ import { CdkOverlayOrigin } from '@angular/cdk/overlay';
2
+ import { ElementRef } from '@angular/core';
3
+ import * as i0 from "@angular/core";
4
+ import * as i1 from "@angular/cdk/overlay";
5
+ /**
6
+ * Directive to mark an element as a trigger for an overlay.
7
+ * Integrates with Angular CDK's `CdkOverlayOrigin` to provide
8
+ * a reference point for overlay positioning.
9
+ */
10
+ export declare class OverlayTriggerDirective {
11
+ /**
12
+ * Reference to the `CdkOverlayOrigin` instance.
13
+ * Used as the origin point for overlay positioning.
14
+ */
15
+ trigger: CdkOverlayOrigin;
16
+ /**
17
+ * Reference to the `ElementRef` of the host element.
18
+ * This is used to access the native DOM element.
19
+ */
20
+ el: ElementRef<any>;
21
+ static ɵfac: i0.ɵɵFactoryDeclaration<OverlayTriggerDirective, never>;
22
+ static ɵdir: i0.ɵɵDirectiveDeclaration<OverlayTriggerDirective, "[bOverlayTrigger]", ["bOverlayTrigger"], {}, {}, never, never, true, [{ directive: typeof i1.CdkOverlayOrigin; inputs: {}; outputs: {}; }]>;
23
+ }
@@ -0,0 +1,77 @@
1
+ import { CdkConnectedOverlay, ConnectedPosition, ConnectionPositionPair } from '@angular/cdk/overlay';
2
+ import { OverlayTriggerDirective, Position } from '../../public-api';
3
+ import * as i0 from "@angular/core";
4
+ import * as i1 from "@angular/cdk/overlay";
5
+ /**
6
+ * Directive to manage overlay behavior and positioning.
7
+ * Integrates with Angular CDK's `CdkConnectedOverlay` to provide
8
+ * flexible overlay positioning and triggering mechanisms.
9
+ */
10
+ export declare class OverlayDirective {
11
+ /**
12
+ * Controls whether the overlay is open.
13
+ * @default false
14
+ */
15
+ readonly open: import("@angular/core").InputSignal<boolean>;
16
+ /**
17
+ * The trigger directive that activates the overlay.
18
+ * This input is required.
19
+ */
20
+ readonly trigger: import("@angular/core").InputSignal<OverlayTriggerDirective>;
21
+ /**
22
+ * Offset value for overlay positioning.
23
+ * @default 0
24
+ */
25
+ readonly offset: import("@angular/core").InputSignal<number>;
26
+ /**
27
+ * Delay in milliseconds before closing the overlay.
28
+ * @default 0
29
+ */
30
+ readonly closeDelay: import("@angular/core").InputSignal<number>;
31
+ /**
32
+ * A computed map of positions to their corresponding `ConnectedPosition` configurations.
33
+ */
34
+ readonly positionsMap: import("@angular/core").Signal<Record<Position, ConnectedPosition>>;
35
+ /**
36
+ * List of positions for the overlay.
37
+ * @default ['bottom-left']
38
+ */
39
+ readonly positions: import("@angular/core").InputSignal<Position[]>;
40
+ /**
41
+ * Computed list of `ConnectedPosition` objects based on the `positions` input.
42
+ */
43
+ readonly connectedPositions: import("@angular/core").Signal<ConnectedPosition[]>;
44
+ /**
45
+ * Signal to track the currently active `ConnectionPositionPair`.
46
+ */
47
+ readonly connectedPositionPair: import("@angular/core").WritableSignal<ConnectionPositionPair | undefined>;
48
+ /**
49
+ * Injected instance of `CdkConnectedOverlay`.
50
+ */
51
+ cdkConnectedOverlay: CdkConnectedOverlay;
52
+ /**
53
+ * Computed direction of the overlay based on the active position pair.
54
+ */
55
+ readonly direction: import("@angular/core").Signal<string | undefined>;
56
+ /**
57
+ * Constructor to initialize the directive and set up reactive effects.
58
+ */
59
+ constructor();
60
+ /**
61
+ * Handles the origin of the overlay.
62
+ * This method sets the `cdkConnectedOverlay.origin` to the trigger element.
63
+ */
64
+ handleOrigin(): void;
65
+ /**
66
+ * Handles the connected positions for the overlay.
67
+ * This method updates the `cdkConnectedOverlay` positions based on the current state.
68
+ */
69
+ handleConnectedPositions(): void;
70
+ /**
71
+ * Handles the opening and closing of the overlay based on the `open` input.
72
+ */
73
+ handleOpen(): void;
74
+ firstLoad: boolean;
75
+ static ɵfac: i0.ɵɵFactoryDeclaration<OverlayDirective, never>;
76
+ static ɵdir: i0.ɵɵDirectiveDeclaration<OverlayDirective, "[bOverlay]", never, { "open": { "alias": "open"; "required": false; "isSignal": true; }; "trigger": { "alias": "trigger"; "required": true; "isSignal": true; }; "offset": { "alias": "offset"; "required": false; "isSignal": true; }; "closeDelay": { "alias": "closeDelay"; "required": false; "isSignal": true; }; "positions": { "alias": "positions"; "required": false; "isSignal": true; }; }, {}, never, never, true, [{ directive: typeof i1.CdkConnectedOverlay; inputs: { "cdkConnectedOverlayWidth": "width"; "cdkConnectedOverlayMinWidth": "minWidth"; "cdkConnectedOverlayHasBackdrop": "hasBackdrop"; "cdkConnectedOverlayBackdropClass": "customBackdropClass"; }; outputs: { "backdropClick": "backdropClick"; "detach": "detach"; "attach": "attach"; "overlayOutsideClick": "outsideClick"; "positionChange": "positionChange"; }; }]>;
77
+ }