@basis-ng/primitives 0.0.1-alpha.4 → 0.0.1-alpha.41
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/core/components/button/button.component.d.ts +29 -14
- package/core/components/combobox/combobox.component.d.ts +114 -0
- package/core/components/command/command-options.component.d.ts +58 -0
- package/core/components/command/command.component.d.ts +46 -0
- package/core/components/input/input.component.d.ts +10 -25
- package/core/components/input-group/input-group.component.d.ts +4 -8
- package/core/components/menu/shared/components/menu-group/menu-group.component.d.ts +9 -0
- package/core/components/menu/shared/components/menu-item/menu-item.component.d.ts +1 -1
- package/core/components/menu/shared/components/menu-item-checkbox/menu-item-checkbox.component.d.ts +1 -1
- package/core/components/menu/shared/components/menu-item-radio/menu-item-radio.component.d.ts +1 -1
- package/core/components/select/select-options.component.d.ts +51 -0
- package/core/components/select/select.component.d.ts +72 -24
- package/core/components/tabs/tab.component.d.ts +11 -0
- package/core/components/tabs/tabs.component.d.ts +19 -50
- package/core/components/tooltip/tooltip.component.d.ts +22 -22
- package/core/components/tooltip/tooltip.directive.d.ts +110 -0
- package/core/directives/overlay-trigger.directive.d.ts +23 -0
- package/core/directives/overlay.directive.d.ts +111 -0
- package/fesm2022/basis-ng-primitives.mjs +1502 -1115
- package/fesm2022/basis-ng-primitives.mjs.map +1 -1
- package/package.json +1 -1
- package/public-api.d.ts +11 -7
- package/shared/components/option.component.d.ts +22 -0
- package/shared/services/utils.service.d.ts +14 -7
- package/core/components/attached-box/attached-box.component.d.ts +0 -125
- package/core/components/attached-box/types/alignment.type.d.ts +0 -1
- package/core/components/search/search.component.d.ts +0 -121
- package/core/components/select/select-content.component.d.ts +0 -39
- package/core/components/tabs/components/tab/tab.component.d.ts +0 -25
- package/shared/components/label/label.component.d.ts +0 -30
- package/shared/components/option/option.component.d.ts +0 -10
- /package/{core/components/attached-box → shared}/types/direction.type.d.ts +0 -0
|
@@ -1,22 +1,37 @@
|
|
|
1
1
|
import { ElementRef } from '@angular/core';
|
|
2
2
|
import * as i0 from "@angular/core";
|
|
3
|
+
/**
|
|
4
|
+
* Button component that provides various styles and configurations.
|
|
5
|
+
*/
|
|
3
6
|
export declare class Button {
|
|
4
|
-
/**
|
|
7
|
+
/**
|
|
8
|
+
* Defines the visual style of the button.
|
|
9
|
+
*
|
|
10
|
+
* @defaultValue 'primary'
|
|
11
|
+
*/
|
|
5
12
|
readonly variant: import("@angular/core").InputSignal<"primary" | "secondary" | "ghost" | "outlined">;
|
|
6
|
-
/**
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
readonly
|
|
12
|
-
/**
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
/**
|
|
14
|
+
* Specifies the size of the button.
|
|
15
|
+
*
|
|
16
|
+
* @defaultValue '2'
|
|
17
|
+
*/
|
|
18
|
+
readonly size: import("@angular/core").InputSignal<"1" | "2" | "3">;
|
|
19
|
+
/**
|
|
20
|
+
* Determines whether the button has an active state enabled.
|
|
21
|
+
*
|
|
22
|
+
* @defaultValue true
|
|
23
|
+
*/
|
|
17
24
|
readonly activeEnabled: import("@angular/core").InputSignal<boolean>;
|
|
18
|
-
/**
|
|
25
|
+
/**
|
|
26
|
+
* Indicates whether the button should have squared corners.
|
|
27
|
+
*
|
|
28
|
+
* @defaultValue false
|
|
29
|
+
*/
|
|
30
|
+
readonly squared: import("@angular/core").InputSignal<boolean>;
|
|
31
|
+
/**
|
|
32
|
+
* Reference to the host DOM element.
|
|
33
|
+
*/
|
|
19
34
|
el: ElementRef<any>;
|
|
20
35
|
static ɵfac: i0.ɵɵFactoryDeclaration<Button, never>;
|
|
21
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<Button, "button[b-button]", never, { "variant": { "alias": "variant"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "
|
|
36
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<Button, "button[b-button]", never, { "variant": { "alias": "variant"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "activeEnabled": { "alias": "activeEnabled"; "required": false; "isSignal": true; }; "squared": { "alias": "squared"; "required": false; "isSignal": true; }; }, {}, never, ["*"], true, never>;
|
|
22
37
|
}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { OnInit } from '@angular/core';
|
|
2
|
+
import { Button } from '../button/button.component';
|
|
3
|
+
import { ControlValueAccessor } from '@angular/forms';
|
|
4
|
+
import { CommandComponent } from '../command/command.component';
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
/**
|
|
7
|
+
* Component representing a combobox dropdown.
|
|
8
|
+
* This component provides a button to toggle the dropdown and displays the selected option(s) with an input field.
|
|
9
|
+
*/
|
|
10
|
+
export declare class ComboboxComponent implements OnInit, ControlValueAccessor {
|
|
11
|
+
/**
|
|
12
|
+
* Placeholder text displayed when no option is selected.
|
|
13
|
+
* Defaults to 'Select an option'.
|
|
14
|
+
*/
|
|
15
|
+
readonly placeholder: import("@angular/core").InputSignal<string>;
|
|
16
|
+
/**
|
|
17
|
+
* Signal indicating whether the dropdown is currently open.
|
|
18
|
+
*/
|
|
19
|
+
readonly isOpen: import("@angular/core").WritableSignal<boolean>;
|
|
20
|
+
/**
|
|
21
|
+
* Reference to the button element used to toggle the dropdown.
|
|
22
|
+
* This is used for managing focus and interactions.
|
|
23
|
+
*/
|
|
24
|
+
readonly button: import("@angular/core").Signal<Button | undefined>;
|
|
25
|
+
/**
|
|
26
|
+
* Reference to the content component of the dropdown.
|
|
27
|
+
* This contains the list of selectable options.
|
|
28
|
+
*/
|
|
29
|
+
readonly command: import("@angular/core").Signal<CommandComponent | undefined>;
|
|
30
|
+
/**
|
|
31
|
+
* Computed signal representing the selected values from the dropdown.
|
|
32
|
+
* This is linked to the value of the `CommandComponent`.
|
|
33
|
+
*/
|
|
34
|
+
readonly value: import("@angular/core").WritableSignal<string[] | undefined>;
|
|
35
|
+
/**
|
|
36
|
+
* Linked signal for the width of the button element.
|
|
37
|
+
* This is used to set the width of the dropdown overlay.
|
|
38
|
+
*/
|
|
39
|
+
readonly buttonWidth: import("@angular/core").WritableSignal<any>;
|
|
40
|
+
/**
|
|
41
|
+
* Model indicating whether the combobox component is disabled.
|
|
42
|
+
* When disabled, the dropdown cannot be opened or interacted with.
|
|
43
|
+
*/
|
|
44
|
+
readonly disabled: import("@angular/core").ModelSignal<boolean>;
|
|
45
|
+
/**
|
|
46
|
+
* Computed signal representing the options available in the dropdown.
|
|
47
|
+
* This retrieves the options from the `CommandComponent`.
|
|
48
|
+
*/
|
|
49
|
+
readonly options: import("@angular/core").Signal<readonly import("@angular/cdk/listbox").CdkOption<any>[] | undefined>;
|
|
50
|
+
/**
|
|
51
|
+
* Computed signal representing the content of the selected option(s).
|
|
52
|
+
* If no option is selected, it returns the placeholder text.
|
|
53
|
+
*/
|
|
54
|
+
readonly content: import("@angular/core").Signal<string | undefined>;
|
|
55
|
+
/**
|
|
56
|
+
* Signal representing the delay before closing the dropdown.
|
|
57
|
+
* This is used to provide a smooth transition when closing the dropdown.
|
|
58
|
+
*/
|
|
59
|
+
readonly closeDelay: import("@angular/core").WritableSignal<number>;
|
|
60
|
+
/**
|
|
61
|
+
* Lifecycle hook that is called after the component is initialized.
|
|
62
|
+
* It sets up the necessary subscriptions for handling value changes.
|
|
63
|
+
*/
|
|
64
|
+
ngOnInit(): void;
|
|
65
|
+
/**
|
|
66
|
+
* Subscribes to the `closeEmitter` of the `CommandComponent` to handle
|
|
67
|
+
* changes to the selected value. This ensures the dropdown closes and the
|
|
68
|
+
* value is propagated to Angular Forms.
|
|
69
|
+
*/
|
|
70
|
+
handleSelectedValueChange(): void;
|
|
71
|
+
/**
|
|
72
|
+
* Focuses the input element within the command component when the overlay is attached.
|
|
73
|
+
*/
|
|
74
|
+
onOverlayAttached(): void;
|
|
75
|
+
/**
|
|
76
|
+
* Sets the width of the button element when the window is resized.
|
|
77
|
+
* This ensures that the dropdown overlay matches the width of the button.
|
|
78
|
+
*/
|
|
79
|
+
setButtonWidth(): void;
|
|
80
|
+
/**
|
|
81
|
+
* Callback function to propagate changes to the model.
|
|
82
|
+
* This is called whenever the value changes.
|
|
83
|
+
*/
|
|
84
|
+
private onChange;
|
|
85
|
+
/**
|
|
86
|
+
* Callback function to mark the component as touched.
|
|
87
|
+
* This is called when the component loses focus.
|
|
88
|
+
*/
|
|
89
|
+
private onTouched;
|
|
90
|
+
/**
|
|
91
|
+
* Writes a new value to the component.
|
|
92
|
+
* This method is called by Angular Forms to update the value of the combobox component.
|
|
93
|
+
* @param value - The new value to set.
|
|
94
|
+
*/
|
|
95
|
+
writeValue(value: string[]): void;
|
|
96
|
+
/**
|
|
97
|
+
* Registers a callback function to be called when the value changes.
|
|
98
|
+
* @param fn - The callback function.
|
|
99
|
+
*/
|
|
100
|
+
registerOnChange(fn: (value: string[]) => void): void;
|
|
101
|
+
/**
|
|
102
|
+
* Registers a callback function to be called when the component is touched.
|
|
103
|
+
* @param fn - The callback function.
|
|
104
|
+
*/
|
|
105
|
+
registerOnTouched(fn: () => void): void;
|
|
106
|
+
/**
|
|
107
|
+
* Sets the disabled state of the component.
|
|
108
|
+
* This method is called by Angular Forms to enable or disable the component.
|
|
109
|
+
* @param isDisabled - A boolean indicating whether the component should be disabled.
|
|
110
|
+
*/
|
|
111
|
+
setDisabledState(isDisabled: boolean): void;
|
|
112
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ComboboxComponent, never>;
|
|
113
|
+
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>;
|
|
114
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { ActiveDescendantKeyManager } from '@angular/cdk/a11y';
|
|
2
|
+
import { CdkListbox, CdkOption } from '@angular/cdk/listbox';
|
|
3
|
+
import { OnInit } from '@angular/core';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
import * as i1 from "@angular/cdk/listbox";
|
|
6
|
+
/**
|
|
7
|
+
* Component representing a list of command options.
|
|
8
|
+
* It uses Angular CDK's listbox and option utilities for accessibility and keyboard navigation.
|
|
9
|
+
*/
|
|
10
|
+
export declare class CommandOptionsComponent implements OnInit {
|
|
11
|
+
/**
|
|
12
|
+
* Collection of child options within the listbox.
|
|
13
|
+
*/
|
|
14
|
+
readonly options: import("@angular/core").Signal<readonly CdkOption<any>[]>;
|
|
15
|
+
/**
|
|
16
|
+
* Key manager for handling keyboard navigation and active descendant management.
|
|
17
|
+
*/
|
|
18
|
+
readonly listKeyManager: import("@angular/core").Signal<ActiveDescendantKeyManager<CdkOption<any>>>;
|
|
19
|
+
/**
|
|
20
|
+
* Signal representing the currently selected values.
|
|
21
|
+
*/
|
|
22
|
+
readonly value: import("@angular/core").WritableSignal<string[]>;
|
|
23
|
+
/**
|
|
24
|
+
* Signal representing the currently highlighted option.
|
|
25
|
+
*/
|
|
26
|
+
readonly highlightedOption: import("@angular/core").WritableSignal<string>;
|
|
27
|
+
/**
|
|
28
|
+
* Reference to the injected CDK Listbox instance.
|
|
29
|
+
*/
|
|
30
|
+
cdkListbox: CdkListbox<any>;
|
|
31
|
+
/**
|
|
32
|
+
* Emitter for closing the command options.
|
|
33
|
+
*/
|
|
34
|
+
closeEmitter: import("@angular/core").OutputEmitterRef<void>;
|
|
35
|
+
/**
|
|
36
|
+
* Lifecycle hook that initializes the component.
|
|
37
|
+
* Enables the use of active descendant for the listbox.
|
|
38
|
+
*/
|
|
39
|
+
ngOnInit(): void;
|
|
40
|
+
/**
|
|
41
|
+
* Selects the currently active option and updates the listbox value.
|
|
42
|
+
*/
|
|
43
|
+
selectOption(value?: string[]): void;
|
|
44
|
+
/**
|
|
45
|
+
* Moves the active item to the next option and updates the highlighted option.
|
|
46
|
+
*/
|
|
47
|
+
nextOption(): void;
|
|
48
|
+
/**
|
|
49
|
+
* Moves the active item to the previous option and updates the highlighted option.
|
|
50
|
+
*/
|
|
51
|
+
previousOption(): void;
|
|
52
|
+
/**
|
|
53
|
+
* Updates the CSS class of options to reflect the currently highlighted option.
|
|
54
|
+
*/
|
|
55
|
+
updateHighlightedOption(): void;
|
|
56
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CommandOptionsComponent, never>;
|
|
57
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<CommandOptionsComponent, "ul[b-command-options]", never, {}, { "closeEmitter": "closeEmitter"; }, ["options"], ["*"], true, [{ directive: typeof i1.CdkListbox; inputs: {}; outputs: { "cdkListboxValueChange": "cdkListboxValueChange"; }; }]>;
|
|
58
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { ElementRef } from '@angular/core';
|
|
2
|
+
import { CommandOptionsComponent } from './command-options.component';
|
|
3
|
+
import { BreakpointObserver } from '@angular/cdk/layout';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
/**
|
|
6
|
+
* Component representing a command input with associated options.
|
|
7
|
+
* It provides keyboard navigation and focus trapping for accessibility.
|
|
8
|
+
*/
|
|
9
|
+
export declare class CommandComponent {
|
|
10
|
+
/**
|
|
11
|
+
* Reference to the child `CommandOptionsComponent` if present.
|
|
12
|
+
* Used to interact with the options for navigation and selection.
|
|
13
|
+
*/
|
|
14
|
+
readonly commandOptions: import("@angular/core").Signal<CommandOptionsComponent | undefined>;
|
|
15
|
+
/**
|
|
16
|
+
* Input representing the maximum height of the component.
|
|
17
|
+
* This can be used to control the visual appearance of the command component.
|
|
18
|
+
*/
|
|
19
|
+
readonly maxHeight: import("@angular/core").InputSignal<string>;
|
|
20
|
+
/**
|
|
21
|
+
* Computed signal representing the selected value from the command options.
|
|
22
|
+
* This is linked to the value of the `CommandOptionsComponent`.
|
|
23
|
+
*/
|
|
24
|
+
readonly value: import("@angular/core").Signal<string[] | undefined>;
|
|
25
|
+
/**
|
|
26
|
+
* Computed signal representing the options available in the command options.
|
|
27
|
+
* This is linked to the options of the `CommandOptionsComponent`.
|
|
28
|
+
*/
|
|
29
|
+
readonly options: import("@angular/core").Signal<readonly import("@angular/cdk/listbox").CdkOption<any>[] | undefined>;
|
|
30
|
+
/**
|
|
31
|
+
* Reference to the BreakpointObserver service for responsive design.
|
|
32
|
+
*/
|
|
33
|
+
breakpointObserver: BreakpointObserver;
|
|
34
|
+
/**
|
|
35
|
+
* Signal representing whether the current viewport is desktop or not.
|
|
36
|
+
* This is determined by checking if the Handset breakpoint is matched.
|
|
37
|
+
*/
|
|
38
|
+
readonly isDesktop: import("@angular/core").WritableSignal<boolean>;
|
|
39
|
+
/**
|
|
40
|
+
* Reference to the host element of the component.
|
|
41
|
+
* This provides access to the DOM element of the command component.
|
|
42
|
+
*/
|
|
43
|
+
el: ElementRef<any>;
|
|
44
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CommandComponent, never>;
|
|
45
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<CommandComponent, "b-command", never, { "maxHeight": { "alias": "maxHeight"; "required": false; "isSignal": true; }; }, {}, ["commandOptions"], ["*"], true, never>;
|
|
46
|
+
}
|
|
@@ -5,22 +5,6 @@ export declare class Input implements AfterViewInit {
|
|
|
5
5
|
* The type of the input.
|
|
6
6
|
*/
|
|
7
7
|
readonly type: import("@angular/core").InputSignal<"number" | "text" | "password" | "email">;
|
|
8
|
-
/**
|
|
9
|
-
* The placeholder text for the input.
|
|
10
|
-
*/
|
|
11
|
-
readonly placeholder: import("@angular/core").InputSignal<string>;
|
|
12
|
-
/**
|
|
13
|
-
* The value of the input.
|
|
14
|
-
*/
|
|
15
|
-
readonly value: import("@angular/core").WritableSignal<string | number | null>;
|
|
16
|
-
/**
|
|
17
|
-
* Whether the input is invalid.
|
|
18
|
-
*/
|
|
19
|
-
readonly invalid: import("@angular/core").ModelSignal<boolean>;
|
|
20
|
-
/**
|
|
21
|
-
* Whether the input is disabled.
|
|
22
|
-
*/
|
|
23
|
-
readonly disabled: import("@angular/core").ModelSignal<boolean>;
|
|
24
8
|
/**
|
|
25
9
|
* The maximum width of the input.
|
|
26
10
|
*/
|
|
@@ -37,14 +21,6 @@ export declare class Input implements AfterViewInit {
|
|
|
37
21
|
* Whether the input type is number.
|
|
38
22
|
*/
|
|
39
23
|
readonly isNumberType: import("@angular/core").Signal<boolean>;
|
|
40
|
-
/**
|
|
41
|
-
* Whether the input is focused.
|
|
42
|
-
*/
|
|
43
|
-
readonly focused: import("@angular/core").WritableSignal<boolean>;
|
|
44
|
-
/**
|
|
45
|
-
* Event emitted when the value changes.
|
|
46
|
-
*/
|
|
47
|
-
valueChange: import("@angular/core").OutputEmitterRef<string | number | null>;
|
|
48
24
|
/**
|
|
49
25
|
* Reference to the input element.
|
|
50
26
|
*/
|
|
@@ -53,10 +29,19 @@ export declare class Input implements AfterViewInit {
|
|
|
53
29
|
* Reference to the ngModel directive.
|
|
54
30
|
*/
|
|
55
31
|
private ngModel;
|
|
32
|
+
/**
|
|
33
|
+
* The size of the input.
|
|
34
|
+
*/
|
|
35
|
+
readonly size: import("@angular/core").InputSignal<"1" | "2" | "3">;
|
|
56
36
|
/**
|
|
57
37
|
* After the view has been initialized, set the value of the select.
|
|
58
38
|
*/
|
|
59
39
|
ngAfterViewInit(): void;
|
|
40
|
+
/**
|
|
41
|
+
* Sets the value of the input element.
|
|
42
|
+
* @param value The value to set.
|
|
43
|
+
*/
|
|
44
|
+
setValue(value: string): void;
|
|
60
45
|
/**
|
|
61
46
|
* Handles the input event.
|
|
62
47
|
* @param event The input event.
|
|
@@ -74,5 +59,5 @@ export declare class Input implements AfterViewInit {
|
|
|
74
59
|
*/
|
|
75
60
|
formatNumber(value: string | null): string | null;
|
|
76
61
|
static ɵfac: i0.ɵɵFactoryDeclaration<Input, never>;
|
|
77
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<Input, "input[b-input]", never, { "type": { "alias": "type"; "required": false; "isSignal": true; }; "
|
|
62
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<Input, "input[b-input]", never, { "type": { "alias": "type"; "required": false; "isSignal": true; }; "maxWidth": { "alias": "maxWidth"; "required": false; "isSignal": true; }; "decimals": { "alias": "decimals"; "required": false; "isSignal": true; }; "numberType": { "alias": "numberType"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
78
63
|
}
|
|
@@ -1,13 +1,9 @@
|
|
|
1
1
|
import * as i0 from "@angular/core";
|
|
2
|
-
export declare class
|
|
2
|
+
export declare class InputGroupComponent {
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
5
|
-
*/
|
|
6
|
-
readonly bordered: import("@angular/core").InputSignal<boolean>;
|
|
7
|
-
/**
|
|
8
|
-
* The maximum width of the input.
|
|
4
|
+
* Sets the maximum width of the input group (e.g. 300px, 100%).
|
|
9
5
|
*/
|
|
10
6
|
readonly maxWidth: import("@angular/core").InputSignal<string>;
|
|
11
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<
|
|
12
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<
|
|
7
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<InputGroupComponent, never>;
|
|
8
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<InputGroupComponent, "b-input-group", never, { "maxWidth": { "alias": "maxWidth"; "required": false; "isSignal": true; }; }, {}, never, ["*"], true, never>;
|
|
13
9
|
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import * as i1 from "@angular/cdk/menu";
|
|
3
|
+
/**
|
|
4
|
+
* Represents a group of menu items.
|
|
5
|
+
*/
|
|
6
|
+
export declare class MenuGroupComponent {
|
|
7
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MenuGroupComponent, never>;
|
|
8
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<MenuGroupComponent, "b-menu-group", never, {}, {}, never, ["*"], true, [{ directive: typeof i1.CdkMenuGroup; inputs: {}; outputs: {}; }]>;
|
|
9
|
+
}
|
|
@@ -5,5 +5,5 @@ import * as i1 from "@angular/cdk/menu";
|
|
|
5
5
|
*/
|
|
6
6
|
export declare class MenuItemComponent {
|
|
7
7
|
static ɵfac: i0.ɵɵFactoryDeclaration<MenuItemComponent, never>;
|
|
8
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<MenuItemComponent, "b-menu-item", never, {}, {}, never, ["*"], true, [{ directive: typeof i1.CdkMenuItem; inputs: { "cdkMenuItemDisabled": "disabled"; "cdkMenuitemTypeaheadLabel": "typeaheadLabel"; }; outputs: { "cdkMenuItemTriggered": "triggered"; }; }]>;
|
|
8
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<MenuItemComponent, "button[b-menu-item]", never, {}, {}, never, ["*"], true, [{ directive: typeof i1.CdkMenuItem; inputs: { "cdkMenuItemDisabled": "disabled"; "cdkMenuitemTypeaheadLabel": "typeaheadLabel"; }; outputs: { "cdkMenuItemTriggered": "triggered"; }; }]>;
|
|
9
9
|
}
|
package/core/components/menu/shared/components/menu-item-checkbox/menu-item-checkbox.component.d.ts
CHANGED
|
@@ -5,5 +5,5 @@ import * as i1 from "@angular/cdk/menu";
|
|
|
5
5
|
*/
|
|
6
6
|
export declare class MenuItemCheckboxComponent {
|
|
7
7
|
static ɵfac: i0.ɵɵFactoryDeclaration<MenuItemCheckboxComponent, never>;
|
|
8
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<MenuItemCheckboxComponent, "b-menu-item-checkbox", never, {}, {}, never, ["*"], true, [{ directive: typeof i1.CdkMenuItemCheckbox; inputs: { "cdkMenuItemDisabled": "disabled"; "cdkMenuitemTypeaheadLabel": "typeaheadLabel"; "cdkMenuItemChecked": "active"; }; outputs: { "cdkMenuItemTriggered": "triggered"; }; }]>;
|
|
8
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<MenuItemCheckboxComponent, "button[b-menu-item-checkbox]", never, {}, {}, never, ["*"], true, [{ directive: typeof i1.CdkMenuItemCheckbox; inputs: { "cdkMenuItemDisabled": "disabled"; "cdkMenuitemTypeaheadLabel": "typeaheadLabel"; "cdkMenuItemChecked": "active"; }; outputs: { "cdkMenuItemTriggered": "triggered"; }; }]>;
|
|
9
9
|
}
|
package/core/components/menu/shared/components/menu-item-radio/menu-item-radio.component.d.ts
CHANGED
|
@@ -5,5 +5,5 @@ import * as i1 from "@angular/cdk/menu";
|
|
|
5
5
|
*/
|
|
6
6
|
export declare class MenuItemRadioComponent {
|
|
7
7
|
static ɵfac: i0.ɵɵFactoryDeclaration<MenuItemRadioComponent, never>;
|
|
8
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<MenuItemRadioComponent, "b-menu-item-radio", never, {}, {}, never, ["*"], true, [{ directive: typeof i1.CdkMenuItemRadio; inputs: { "cdkMenuItemDisabled": "disabled"; "cdkMenuitemTypeaheadLabel": "typeaheadLabel"; "cdkMenuItemChecked": "active"; }; outputs: { "cdkMenuItemTriggered": "triggered"; }; }]>;
|
|
8
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<MenuItemRadioComponent, "button[b-menu-item-radio]", never, {}, {}, never, ["*"], true, [{ directive: typeof i1.CdkMenuItemRadio; inputs: { "cdkMenuItemDisabled": "disabled"; "cdkMenuitemTypeaheadLabel": "typeaheadLabel"; "cdkMenuItemChecked": "active"; }; outputs: { "cdkMenuItemTriggered": "triggered"; }; }]>;
|
|
9
9
|
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { CdkListbox } from '@angular/cdk/listbox';
|
|
2
|
+
import { ElementRef } from '@angular/core';
|
|
3
|
+
import { OptionComponent } from '../../../shared/components/option.component';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
import * as i1 from "@angular/cdk/listbox";
|
|
6
|
+
/**
|
|
7
|
+
* Component representing the list of options in a select.
|
|
8
|
+
* This component integrates with Angular CDK Listbox to manage options and their selection.
|
|
9
|
+
*/
|
|
10
|
+
export declare class SelectOptionsComponent {
|
|
11
|
+
/**
|
|
12
|
+
* Signal representing the selected values in the listbox.
|
|
13
|
+
* This is an array of strings corresponding to the selected option values.
|
|
14
|
+
*/
|
|
15
|
+
readonly value: import("@angular/core").WritableSignal<string[]>;
|
|
16
|
+
/**
|
|
17
|
+
* Event emitter triggered when the dropdown should close.
|
|
18
|
+
* This is used to notify the parent component to close the dropdown.
|
|
19
|
+
*/
|
|
20
|
+
closeEmitter: import("@angular/core").OutputEmitterRef<void>;
|
|
21
|
+
/**
|
|
22
|
+
* Reference to the host element of the component.
|
|
23
|
+
* This provides access to the DOM element of the options list.
|
|
24
|
+
*/
|
|
25
|
+
el: ElementRef<any>;
|
|
26
|
+
/**
|
|
27
|
+
* Input for setting the maximum height of the dropdown.
|
|
28
|
+
* Defaults to '300px'. This controls the vertical size of the dropdown.
|
|
29
|
+
*/
|
|
30
|
+
readonly maxHeight: import("@angular/core").InputSignal<string>;
|
|
31
|
+
/**
|
|
32
|
+
* Reference to the CDK Listbox directive.
|
|
33
|
+
* This is used to manage the options and their selection state.
|
|
34
|
+
*/
|
|
35
|
+
listBox: CdkListbox<any>;
|
|
36
|
+
/**
|
|
37
|
+
* Reference to the list of options in the dropdown.
|
|
38
|
+
* This is a collection of `OptionComponent` instances representing the available options.
|
|
39
|
+
*/
|
|
40
|
+
readonly options: import("@angular/core").Signal<readonly OptionComponent[]>;
|
|
41
|
+
/**
|
|
42
|
+
* Handles changes to the selected value in the listbox.
|
|
43
|
+
* This method updates the `value` signal, emits the `closeEmitter` event,
|
|
44
|
+
* and ensures the parent component is notified of the selection change.
|
|
45
|
+
*
|
|
46
|
+
* @param value - The new array of selected values.
|
|
47
|
+
*/
|
|
48
|
+
handleValueChange(value: string[]): void;
|
|
49
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SelectOptionsComponent, never>;
|
|
50
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<SelectOptionsComponent, "ul[b-select-options]", never, { "maxHeight": { "alias": "maxHeight"; "required": false; "isSignal": true; }; }, { "closeEmitter": "closeEmitter"; }, ["options"], ["*"], true, [{ directive: typeof i1.CdkListbox; inputs: { "cdkListboxValue": "cdkListboxValue"; }; outputs: { "cdkListboxValueChange": "cdkListboxValueChange"; }; }]>;
|
|
51
|
+
}
|
|
@@ -1,66 +1,114 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { OnInit } from '@angular/core';
|
|
2
|
+
import { SelectOptionsComponent } from './select-options.component';
|
|
2
3
|
import { Button } from '../button/button.component';
|
|
4
|
+
import { ControlValueAccessor } from '@angular/forms';
|
|
3
5
|
import * as i0 from "@angular/core";
|
|
4
6
|
/**
|
|
5
7
|
* Component representing a custom select dropdown.
|
|
6
|
-
*
|
|
8
|
+
* This component provides a button to toggle the dropdown and displays the selected option(s).
|
|
7
9
|
*/
|
|
8
|
-
export declare class SelectComponent {
|
|
10
|
+
export declare class SelectComponent implements OnInit, ControlValueAccessor {
|
|
9
11
|
/**
|
|
10
12
|
* Placeholder text displayed when no option is selected.
|
|
11
13
|
* Defaults to 'Select an option'.
|
|
12
14
|
*/
|
|
13
15
|
readonly placeholder: import("@angular/core").InputSignal<string>;
|
|
14
16
|
/**
|
|
15
|
-
* Signal indicating whether the dropdown is open.
|
|
17
|
+
* Signal indicating whether the dropdown is currently open.
|
|
16
18
|
*/
|
|
17
19
|
readonly isOpen: import("@angular/core").WritableSignal<boolean>;
|
|
18
20
|
/**
|
|
19
21
|
* Reference to the button element used to toggle the dropdown.
|
|
22
|
+
* This is used for managing focus and interactions.
|
|
20
23
|
*/
|
|
21
24
|
readonly button: import("@angular/core").Signal<Button | undefined>;
|
|
22
25
|
/**
|
|
23
26
|
* Reference to the content component of the dropdown.
|
|
27
|
+
* This contains the list of selectable options.
|
|
24
28
|
*/
|
|
25
|
-
readonly
|
|
29
|
+
readonly optionsList: import("@angular/core").Signal<SelectOptionsComponent | undefined>;
|
|
26
30
|
/**
|
|
27
31
|
* Computed signal representing the selected values from the dropdown.
|
|
32
|
+
* This is linked to the value of the `OptionsListComponent`.
|
|
28
33
|
*/
|
|
29
|
-
readonly value: import("@angular/core").
|
|
34
|
+
readonly value: import("@angular/core").WritableSignal<string[] | undefined>;
|
|
30
35
|
/**
|
|
31
|
-
*
|
|
36
|
+
* Linked signal for the width of the button element.
|
|
37
|
+
* This is used to set the width of the dropdown overlay.
|
|
32
38
|
*/
|
|
33
|
-
readonly
|
|
39
|
+
readonly buttonWidth: import("@angular/core").WritableSignal<any>;
|
|
34
40
|
/**
|
|
35
|
-
*
|
|
36
|
-
*
|
|
41
|
+
* Model indicating whether the select component is disabled.
|
|
42
|
+
* When disabled, the dropdown cannot be opened or interacted with.
|
|
37
43
|
*/
|
|
38
|
-
readonly
|
|
44
|
+
readonly disabled: import("@angular/core").ModelSignal<boolean>;
|
|
39
45
|
/**
|
|
40
|
-
* Computed signal
|
|
46
|
+
* Computed signal representing the options available in the dropdown.
|
|
47
|
+
* This retrieves the options from the `OptionsListComponent`.
|
|
41
48
|
*/
|
|
42
|
-
readonly
|
|
49
|
+
readonly options: import("@angular/core").Signal<readonly import("@basis-ng/primitives").OptionComponent[] | undefined>;
|
|
43
50
|
/**
|
|
44
|
-
*
|
|
51
|
+
* Computed signal representing the content of the selected option(s).
|
|
52
|
+
* If no option is selected, it returns the placeholder text.
|
|
45
53
|
*/
|
|
46
|
-
readonly
|
|
54
|
+
readonly content: import("@angular/core").Signal<string | undefined>;
|
|
47
55
|
/**
|
|
48
|
-
*
|
|
56
|
+
* Signal representing the delay before closing the dropdown.
|
|
57
|
+
* This is used to provide a smooth transition when closing the dropdown.
|
|
49
58
|
*/
|
|
50
|
-
readonly
|
|
51
|
-
|
|
59
|
+
readonly closeDelay: import("@angular/core").WritableSignal<number>;
|
|
60
|
+
/**
|
|
61
|
+
* Lifecycle hook that is called after the component is initialized.
|
|
62
|
+
* It sets up the necessary subscriptions for handling value changes.
|
|
63
|
+
*/
|
|
64
|
+
ngOnInit(): void;
|
|
52
65
|
/**
|
|
53
|
-
*
|
|
66
|
+
* Subscribes to the `closeEmitter` of the `OptionsListComponent` to handle
|
|
67
|
+
* changes to the selected value. This ensures the dropdown closes and the
|
|
68
|
+
* value is propagated to Angular Forms.
|
|
54
69
|
*/
|
|
55
70
|
handleSelectedValueChange(): void;
|
|
56
71
|
/**
|
|
57
|
-
*
|
|
72
|
+
* Focuses the options list when the overlay is attached.
|
|
73
|
+
*/
|
|
74
|
+
onOverlayAttached(): void;
|
|
75
|
+
/**
|
|
76
|
+
* Sets the width of the dropdown overlay based on the button's width.
|
|
77
|
+
* This ensures that the dropdown aligns properly with the button.
|
|
78
|
+
*/
|
|
79
|
+
setButtonWidth(): void;
|
|
80
|
+
/**
|
|
81
|
+
* Callback function to propagate changes to the model.
|
|
82
|
+
* This is called whenever the value changes.
|
|
83
|
+
*/
|
|
84
|
+
private onChange;
|
|
85
|
+
/**
|
|
86
|
+
* Callback function to mark the component as touched.
|
|
87
|
+
* This is called when the component loses focus.
|
|
88
|
+
*/
|
|
89
|
+
private onTouched;
|
|
90
|
+
/**
|
|
91
|
+
* Writes a new value to the component.
|
|
92
|
+
* This method is called by Angular Forms to update the value of the select component.
|
|
93
|
+
* @param value - The new value to set.
|
|
94
|
+
*/
|
|
95
|
+
writeValue(value: string[]): void;
|
|
96
|
+
/**
|
|
97
|
+
* Registers a callback function to be called when the value changes.
|
|
98
|
+
* @param fn - The callback function.
|
|
99
|
+
*/
|
|
100
|
+
registerOnChange(fn: (value: string[]) => void): void;
|
|
101
|
+
/**
|
|
102
|
+
* Registers a callback function to be called when the component is touched.
|
|
103
|
+
* @param fn - The callback function.
|
|
58
104
|
*/
|
|
59
|
-
|
|
105
|
+
registerOnTouched(fn: () => void): void;
|
|
60
106
|
/**
|
|
61
|
-
*
|
|
107
|
+
* Sets the disabled state of the component.
|
|
108
|
+
* This method is called by Angular Forms to enable or disable the component.
|
|
109
|
+
* @param isDisabled - A boolean indicating whether the component should be disabled.
|
|
62
110
|
*/
|
|
63
|
-
|
|
111
|
+
setDisabledState(isDisabled: boolean): void;
|
|
64
112
|
static ɵfac: i0.ɵɵFactoryDeclaration<SelectComponent, never>;
|
|
65
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<SelectComponent, "b-select", never, { "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "
|
|
113
|
+
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>;
|
|
66
114
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { CdkOption } from '@angular/cdk/listbox';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
import * as i1 from "@angular/cdk/listbox";
|
|
4
|
+
export declare class TabComponent {
|
|
5
|
+
/**
|
|
6
|
+
* Reference to the injected CDK Option instance.
|
|
7
|
+
*/
|
|
8
|
+
cdkOption: CdkOption<any>;
|
|
9
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TabComponent, never>;
|
|
10
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<TabComponent, "b-tab", never, {}, {}, never, ["*"], true, [{ directive: typeof i1.CdkOption; inputs: { "cdkOption": "value"; }; outputs: {}; }]>;
|
|
11
|
+
}
|