@basis-ng/primitives 0.0.1-alpha.17 → 0.0.1-alpha.19
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/combobox/combobox.component.d.ts +11 -6
- package/core/components/input/input.component.d.ts +10 -25
- package/core/components/select/select.component.d.ts +11 -6
- package/fesm2022/basis-ng-primitives.mjs +62 -116
- package/fesm2022/basis-ng-primitives.mjs.map +1 -1
- package/package.json +1 -1
- package/public-api.d.ts +0 -1
- package/shared/components/label.component.d.ts +0 -30
|
@@ -39,10 +39,10 @@ export declare class ComboboxComponent implements OnInit, ControlValueAccessor {
|
|
|
39
39
|
*/
|
|
40
40
|
readonly maxWidth: import("@angular/core").InputSignal<string>;
|
|
41
41
|
/**
|
|
42
|
-
*
|
|
42
|
+
* Linked signal for the width of the button element.
|
|
43
43
|
* This is used to set the width of the dropdown overlay.
|
|
44
44
|
*/
|
|
45
|
-
readonly buttonWidth: import("@angular/core").
|
|
45
|
+
readonly buttonWidth: import("@angular/core").WritableSignal<any>;
|
|
46
46
|
/**
|
|
47
47
|
* Model indicating whether the combobox component is disabled.
|
|
48
48
|
* When disabled, the dropdown cannot be opened or interacted with.
|
|
@@ -90,6 +90,15 @@ export declare class ComboboxComponent implements OnInit, ControlValueAccessor {
|
|
|
90
90
|
* the transition class from the overlay panel.
|
|
91
91
|
*/
|
|
92
92
|
close(): void;
|
|
93
|
+
/**
|
|
94
|
+
* Focuses the input element within the command component when the overlay is attached.
|
|
95
|
+
*/
|
|
96
|
+
onOverlayAttached(): void;
|
|
97
|
+
/**
|
|
98
|
+
* Sets the width of the button element when the window is resized.
|
|
99
|
+
* This ensures that the dropdown overlay matches the width of the button.
|
|
100
|
+
*/
|
|
101
|
+
setButtonWidth(): void;
|
|
93
102
|
/**
|
|
94
103
|
* Callback function to propagate changes to the model.
|
|
95
104
|
* This is called whenever the value changes.
|
|
@@ -122,10 +131,6 @@ export declare class ComboboxComponent implements OnInit, ControlValueAccessor {
|
|
|
122
131
|
* @param isDisabled - A boolean indicating whether the component should be disabled.
|
|
123
132
|
*/
|
|
124
133
|
setDisabledState(isDisabled: boolean): void;
|
|
125
|
-
/**
|
|
126
|
-
* Focuses the input element within the command component when the overlay is attached.
|
|
127
|
-
*/
|
|
128
|
-
onOverlayAttached(): void;
|
|
129
134
|
static ɵfac: i0.ɵɵFactoryDeclaration<ComboboxComponent, never>;
|
|
130
135
|
static ɵcmp: i0.ɵɵComponentDeclaration<ComboboxComponent, "b-combobox", never, { "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "maxWidth": { "alias": "maxWidth"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; }, { "disabled": "disabledChange"; }, ["command"], ["*"], true, never>;
|
|
131
136
|
}
|
|
@@ -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
|
}
|
|
@@ -39,10 +39,10 @@ export declare class SelectComponent implements OnInit, ControlValueAccessor {
|
|
|
39
39
|
*/
|
|
40
40
|
readonly maxWidth: import("@angular/core").InputSignal<string>;
|
|
41
41
|
/**
|
|
42
|
-
*
|
|
42
|
+
* Linked signal for the width of the button element.
|
|
43
43
|
* This is used to set the width of the dropdown overlay.
|
|
44
44
|
*/
|
|
45
|
-
readonly buttonWidth: import("@angular/core").
|
|
45
|
+
readonly buttonWidth: import("@angular/core").WritableSignal<any>;
|
|
46
46
|
/**
|
|
47
47
|
* Model indicating whether the select component is disabled.
|
|
48
48
|
* When disabled, the dropdown cannot be opened or interacted with.
|
|
@@ -90,6 +90,15 @@ export declare class SelectComponent implements OnInit, ControlValueAccessor {
|
|
|
90
90
|
* the transition class from the overlay panel.
|
|
91
91
|
*/
|
|
92
92
|
close(): void;
|
|
93
|
+
/**
|
|
94
|
+
* Focuses the options list when the overlay is attached.
|
|
95
|
+
*/
|
|
96
|
+
onOverlayAttached(): void;
|
|
97
|
+
/**
|
|
98
|
+
* Sets the width of the dropdown overlay based on the button's width.
|
|
99
|
+
* This ensures that the dropdown aligns properly with the button.
|
|
100
|
+
*/
|
|
101
|
+
setButtonWidth(): void;
|
|
93
102
|
/**
|
|
94
103
|
* Callback function to propagate changes to the model.
|
|
95
104
|
* This is called whenever the value changes.
|
|
@@ -122,10 +131,6 @@ export declare class SelectComponent implements OnInit, ControlValueAccessor {
|
|
|
122
131
|
* @param isDisabled - A boolean indicating whether the component should be disabled.
|
|
123
132
|
*/
|
|
124
133
|
setDisabledState(isDisabled: boolean): void;
|
|
125
|
-
/**
|
|
126
|
-
* Focuses the options list when the overlay is attached.
|
|
127
|
-
*/
|
|
128
|
-
onOverlayAttached(): void;
|
|
129
134
|
static ɵfac: i0.ɵɵFactoryDeclaration<SelectComponent, never>;
|
|
130
135
|
static ɵcmp: i0.ɵɵComponentDeclaration<SelectComponent, "b-select", never, { "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "maxWidth": { "alias": "maxWidth"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; }, { "disabled": "disabledChange"; }, ["optionsList"], ["*"], true, never>;
|
|
131
136
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { signal, inject, RendererFactory2, Injectable, input, Component, ElementRef, TemplateRef, Directive,
|
|
2
|
+
import { signal, inject, RendererFactory2, Injectable, input, Component, ElementRef, TemplateRef, Directive, computed, output, contentChildren, viewChild, contentChild, linkedSignal, model, forwardRef, HostListener, effect, afterNextRender, afterRenderEffect } from '@angular/core';
|
|
3
3
|
import { NgStyle, NgClass, CommonModule } from '@angular/common';
|
|
4
4
|
import { NgModel, NG_VALUE_ACCESSOR, ControlContainer } from '@angular/forms';
|
|
5
5
|
import { CdkConnectedOverlay, CdkOverlayOrigin } from '@angular/cdk/overlay';
|
|
@@ -159,22 +159,6 @@ class Input {
|
|
|
159
159
|
* The type of the input.
|
|
160
160
|
*/
|
|
161
161
|
type = input('text');
|
|
162
|
-
/**
|
|
163
|
-
* The placeholder text for the input.
|
|
164
|
-
*/
|
|
165
|
-
placeholder = input('');
|
|
166
|
-
/**
|
|
167
|
-
* The value of the input.
|
|
168
|
-
*/
|
|
169
|
-
value = signal(null);
|
|
170
|
-
/**
|
|
171
|
-
* Whether the input is invalid.
|
|
172
|
-
*/
|
|
173
|
-
invalid = model(false);
|
|
174
|
-
/**
|
|
175
|
-
* Whether the input is disabled.
|
|
176
|
-
*/
|
|
177
|
-
disabled = model(false);
|
|
178
162
|
/**
|
|
179
163
|
* The maximum width of the input.
|
|
180
164
|
*/
|
|
@@ -191,14 +175,6 @@ class Input {
|
|
|
191
175
|
* Whether the input type is number.
|
|
192
176
|
*/
|
|
193
177
|
isNumberType = computed(() => this.type() === 'number');
|
|
194
|
-
/**
|
|
195
|
-
* Whether the input is focused.
|
|
196
|
-
*/
|
|
197
|
-
focused = signal(false);
|
|
198
|
-
/**
|
|
199
|
-
* Event emitted when the value changes.
|
|
200
|
-
*/
|
|
201
|
-
valueChange = output();
|
|
202
178
|
/**
|
|
203
179
|
* Reference to the input element.
|
|
204
180
|
*/
|
|
@@ -207,12 +183,26 @@ class Input {
|
|
|
207
183
|
* Reference to the ngModel directive.
|
|
208
184
|
*/
|
|
209
185
|
ngModel = inject(NgModel, { optional: true });
|
|
186
|
+
/**
|
|
187
|
+
* The size of the input.
|
|
188
|
+
*/
|
|
189
|
+
size = input('2');
|
|
210
190
|
/**
|
|
211
191
|
* After the view has been initialized, set the value of the select.
|
|
212
192
|
*/
|
|
213
193
|
ngAfterViewInit() {
|
|
214
194
|
const value = this.el.nativeElement.value || this.ngModel?.model;
|
|
215
|
-
|
|
195
|
+
if (this.isNumberType()) {
|
|
196
|
+
const formattedValue = this.formatNumber(value) || '';
|
|
197
|
+
this.setValue(formattedValue);
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
/**
|
|
201
|
+
* Sets the value of the input element.
|
|
202
|
+
* @param value The value to set.
|
|
203
|
+
*/
|
|
204
|
+
setValue(value) {
|
|
205
|
+
this.el.nativeElement.value = value;
|
|
216
206
|
}
|
|
217
207
|
/**
|
|
218
208
|
* Handles the input event.
|
|
@@ -222,8 +212,7 @@ class Input {
|
|
|
222
212
|
const target = event.target;
|
|
223
213
|
// If the input is not of number type, update the value and emit the value change event.
|
|
224
214
|
if (!this.isNumberType()) {
|
|
225
|
-
this.
|
|
226
|
-
this.valueChange.emit(target.value);
|
|
215
|
+
this.setValue(target.value);
|
|
227
216
|
}
|
|
228
217
|
}
|
|
229
218
|
/**
|
|
@@ -231,13 +220,10 @@ class Input {
|
|
|
231
220
|
* @param event - The blur event.
|
|
232
221
|
*/
|
|
233
222
|
onBlur(event) {
|
|
234
|
-
this.focused.set(false);
|
|
235
223
|
// If the input is of number type, format the value and emit the value change event.
|
|
236
224
|
if (this.isNumberType()) {
|
|
237
225
|
const formattedValue = this.formatNumber(event.target.value);
|
|
238
|
-
this.
|
|
239
|
-
this.value.set(formattedValue);
|
|
240
|
-
this.valueChange.emit(formattedValue);
|
|
226
|
+
this.setValue(formattedValue || '');
|
|
241
227
|
}
|
|
242
228
|
}
|
|
243
229
|
/**
|
|
@@ -257,7 +243,7 @@ class Input {
|
|
|
257
243
|
}
|
|
258
244
|
}
|
|
259
245
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: Input, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
260
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.2.7", type: Input, isStandalone: true, selector: "input[b-input]", inputs: { type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null },
|
|
246
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.2.7", type: Input, isStandalone: true, selector: "input[b-input]", inputs: { type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, maxWidth: { classPropertyName: "maxWidth", publicName: "maxWidth", isSignal: true, isRequired: false, transformFunction: null }, decimals: { classPropertyName: "decimals", publicName: "decimals", isSignal: true, isRequired: false, transformFunction: null }, numberType: { classPropertyName: "numberType", publicName: "numberType", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "input": "onInput($event)", "blur": "onBlur($event)" }, properties: { "type": "type()", "style.max-width": "maxWidth()", "class": " \"size-\" + size() " } }, ngImport: i0, template: ``, isInline: true });
|
|
261
247
|
}
|
|
262
248
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: Input, decorators: [{
|
|
263
249
|
type: Component,
|
|
@@ -266,13 +252,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.7", ngImpor
|
|
|
266
252
|
template: ``,
|
|
267
253
|
host: {
|
|
268
254
|
'[type]': 'type()',
|
|
269
|
-
'[placeholder]': 'placeholder() || ""',
|
|
270
|
-
'[class.ng-invalid]': 'invalid()',
|
|
271
|
-
'[class.disabled]': 'disabled()',
|
|
272
255
|
'[style.max-width]': 'maxWidth()',
|
|
273
256
|
'(input)': 'onInput($event)',
|
|
274
|
-
'(focus)': 'focused.set(true)',
|
|
275
257
|
'(blur)': 'onBlur($event)',
|
|
258
|
+
'[class]': ' "size-" + size() ',
|
|
276
259
|
},
|
|
277
260
|
}]
|
|
278
261
|
}] });
|
|
@@ -467,10 +450,10 @@ class SelectComponent {
|
|
|
467
450
|
*/
|
|
468
451
|
maxWidth = input('100%');
|
|
469
452
|
/**
|
|
470
|
-
*
|
|
453
|
+
* Linked signal for the width of the button element.
|
|
471
454
|
* This is used to set the width of the dropdown overlay.
|
|
472
455
|
*/
|
|
473
|
-
buttonWidth =
|
|
456
|
+
buttonWidth = linkedSignal(() => this.button()?.el.nativeElement.offsetWidth);
|
|
474
457
|
/**
|
|
475
458
|
* Model indicating whether the select component is disabled.
|
|
476
459
|
* When disabled, the dropdown cannot be opened or interacted with.
|
|
@@ -550,6 +533,19 @@ class SelectComponent {
|
|
|
550
533
|
this.button()?.el.nativeElement.focus();
|
|
551
534
|
}, this.closeDelay());
|
|
552
535
|
}
|
|
536
|
+
/**
|
|
537
|
+
* Focuses the options list when the overlay is attached.
|
|
538
|
+
*/
|
|
539
|
+
onOverlayAttached() {
|
|
540
|
+
this.optionsList()?.el.nativeElement.focus();
|
|
541
|
+
}
|
|
542
|
+
/**
|
|
543
|
+
* Sets the width of the dropdown overlay based on the button's width.
|
|
544
|
+
* This ensures that the dropdown aligns properly with the button.
|
|
545
|
+
*/
|
|
546
|
+
setButtonWidth() {
|
|
547
|
+
this.buttonWidth.set(this.button()?.el.nativeElement.offsetWidth);
|
|
548
|
+
}
|
|
553
549
|
// Control Value Accessor methods
|
|
554
550
|
/**
|
|
555
551
|
* Callback function to propagate changes to the model.
|
|
@@ -596,14 +592,8 @@ class SelectComponent {
|
|
|
596
592
|
setDisabledState(isDisabled) {
|
|
597
593
|
this.disabled.set(isDisabled);
|
|
598
594
|
}
|
|
599
|
-
/**
|
|
600
|
-
* Focuses the options list when the overlay is attached.
|
|
601
|
-
*/
|
|
602
|
-
onOverlayAttached() {
|
|
603
|
-
this.optionsList()?.el.nativeElement.focus();
|
|
604
|
-
}
|
|
605
595
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: SelectComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
606
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "19.2.7", type: SelectComponent, isStandalone: true, selector: "b-select", inputs: { placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, maxWidth: { classPropertyName: "maxWidth", publicName: "maxWidth", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { disabled: "disabledChange" }, host: { properties: { "style.max-width": "maxWidth()", "class.disabled": "disabled()" } }, providers: [
|
|
596
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "19.2.7", type: SelectComponent, isStandalone: true, selector: "b-select", inputs: { placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, maxWidth: { classPropertyName: "maxWidth", publicName: "maxWidth", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { disabled: "disabledChange" }, host: { listeners: { "window:resize": "setButtonWidth()" }, properties: { "style.max-width": "maxWidth()", "class.disabled": "disabled()" } }, providers: [
|
|
607
597
|
{
|
|
608
598
|
provide: NG_VALUE_ACCESSOR,
|
|
609
599
|
useExisting: forwardRef(() => SelectComponent),
|
|
@@ -707,7 +697,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.7", ngImpor
|
|
|
707
697
|
},
|
|
708
698
|
],
|
|
709
699
|
}]
|
|
710
|
-
}]
|
|
700
|
+
}], propDecorators: { setButtonWidth: [{
|
|
701
|
+
type: HostListener,
|
|
702
|
+
args: ['window:resize']
|
|
703
|
+
}] } });
|
|
711
704
|
|
|
712
705
|
class Switch {
|
|
713
706
|
/**
|
|
@@ -1631,63 +1624,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.7", ngImpor
|
|
|
1631
1624
|
args: ['document:click', ['$event']]
|
|
1632
1625
|
}] } });
|
|
1633
1626
|
|
|
1634
|
-
class Label {
|
|
1635
|
-
/**
|
|
1636
|
-
* The input element.
|
|
1637
|
-
*/
|
|
1638
|
-
input = contentChild(Input);
|
|
1639
|
-
/**
|
|
1640
|
-
* The switch element.
|
|
1641
|
-
*/
|
|
1642
|
-
switch = contentChild(Switch);
|
|
1643
|
-
/**
|
|
1644
|
-
* The checkbox element.
|
|
1645
|
-
*/
|
|
1646
|
-
checkbox = contentChild(Checkbox);
|
|
1647
|
-
/**
|
|
1648
|
-
* The textarea element.
|
|
1649
|
-
*/
|
|
1650
|
-
textarea = contentChild(Textarea);
|
|
1651
|
-
/**
|
|
1652
|
-
* Whether the label should be up.
|
|
1653
|
-
*/
|
|
1654
|
-
labelUp = computed(() => {
|
|
1655
|
-
const input = this.input();
|
|
1656
|
-
const textarea = this.textarea();
|
|
1657
|
-
return (input?.focused() ||
|
|
1658
|
-
input?.value() ||
|
|
1659
|
-
input?.placeholder() ||
|
|
1660
|
-
textarea?.focused() ||
|
|
1661
|
-
textarea?.value() ||
|
|
1662
|
-
textarea?.placeholder());
|
|
1663
|
-
});
|
|
1664
|
-
/**
|
|
1665
|
-
* The label width.
|
|
1666
|
-
*/
|
|
1667
|
-
maxWidth = computed(() => {
|
|
1668
|
-
const input = this.input();
|
|
1669
|
-
const textarea = this.textarea();
|
|
1670
|
-
return input?.maxWidth() || textarea?.cols();
|
|
1671
|
-
});
|
|
1672
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: Label, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1673
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "19.2.7", type: Label, isStandalone: true, selector: "b-label", host: { properties: { "class.up": "labelUp()", "style.max-width": "maxWidth()", "class.is-switch": "switch()", "class.is-checkbox": "checkbox()", "class.is-textarea": "textarea()" } }, queries: [{ propertyName: "input", first: true, predicate: Input, descendants: true, isSignal: true }, { propertyName: "switch", first: true, predicate: Switch, descendants: true, isSignal: true }, { propertyName: "checkbox", first: true, predicate: Checkbox, descendants: true, isSignal: true }, { propertyName: "textarea", first: true, predicate: Textarea, descendants: true, isSignal: true }], ngImport: i0, template: `<ng-content />`, isInline: true });
|
|
1674
|
-
}
|
|
1675
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: Label, decorators: [{
|
|
1676
|
-
type: Component,
|
|
1677
|
-
args: [{
|
|
1678
|
-
selector: 'b-label',
|
|
1679
|
-
imports: [],
|
|
1680
|
-
template: `<ng-content />`,
|
|
1681
|
-
host: {
|
|
1682
|
-
'[class.up]': 'labelUp()',
|
|
1683
|
-
'[style.max-width]': 'maxWidth()',
|
|
1684
|
-
'[class.is-switch]': 'switch()',
|
|
1685
|
-
'[class.is-checkbox]': 'checkbox()',
|
|
1686
|
-
'[class.is-textarea]': 'textarea()',
|
|
1687
|
-
},
|
|
1688
|
-
}]
|
|
1689
|
-
}] });
|
|
1690
|
-
|
|
1691
1627
|
class Badge {
|
|
1692
1628
|
/** The variant of the badge. */
|
|
1693
1629
|
variant = input('primary');
|
|
@@ -2641,7 +2577,7 @@ class CommandComponent {
|
|
|
2641
2577
|
(keydown.arrowUp)="commandOptions()?.previousOption()"
|
|
2642
2578
|
(keydown.enter)="commandOptions()?.selectOption()"
|
|
2643
2579
|
(blur)="isDesktop() && trappedInput.el.nativeElement.focus()" />
|
|
2644
|
-
<ng-content />`, isInline: true, dependencies: [{ kind: "component", type: Input, selector: "input[b-input]", inputs: ["type", "
|
|
2580
|
+
<ng-content />`, isInline: true, dependencies: [{ kind: "component", type: Input, selector: "input[b-input]", inputs: ["type", "maxWidth", "decimals", "numberType", "size"] }, { kind: "directive", type: CdkTrapFocus, selector: "[cdkTrapFocus]", inputs: ["cdkTrapFocus", "cdkTrapFocusAutoCapture"], exportAs: ["cdkTrapFocus"] }] });
|
|
2645
2581
|
}
|
|
2646
2582
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: CommandComponent, decorators: [{
|
|
2647
2583
|
type: Component,
|
|
@@ -2701,10 +2637,10 @@ class ComboboxComponent {
|
|
|
2701
2637
|
*/
|
|
2702
2638
|
maxWidth = input('100%');
|
|
2703
2639
|
/**
|
|
2704
|
-
*
|
|
2640
|
+
* Linked signal for the width of the button element.
|
|
2705
2641
|
* This is used to set the width of the dropdown overlay.
|
|
2706
2642
|
*/
|
|
2707
|
-
buttonWidth =
|
|
2643
|
+
buttonWidth = linkedSignal(() => this.button()?.el.nativeElement.offsetWidth);
|
|
2708
2644
|
/**
|
|
2709
2645
|
* Model indicating whether the combobox component is disabled.
|
|
2710
2646
|
* When disabled, the dropdown cannot be opened or interacted with.
|
|
@@ -2784,6 +2720,19 @@ class ComboboxComponent {
|
|
|
2784
2720
|
this.button()?.el.nativeElement.focus();
|
|
2785
2721
|
}, this.closeDelay());
|
|
2786
2722
|
}
|
|
2723
|
+
/**
|
|
2724
|
+
* Focuses the input element within the command component when the overlay is attached.
|
|
2725
|
+
*/
|
|
2726
|
+
onOverlayAttached() {
|
|
2727
|
+
this.command()?.el.nativeElement.querySelector('input')?.focus();
|
|
2728
|
+
}
|
|
2729
|
+
/**
|
|
2730
|
+
* Sets the width of the button element when the window is resized.
|
|
2731
|
+
* This ensures that the dropdown overlay matches the width of the button.
|
|
2732
|
+
*/
|
|
2733
|
+
setButtonWidth() {
|
|
2734
|
+
this.buttonWidth.set(this.button()?.el.nativeElement.offsetWidth);
|
|
2735
|
+
}
|
|
2787
2736
|
// Control Value Accessor methods
|
|
2788
2737
|
/**
|
|
2789
2738
|
* Callback function to propagate changes to the model.
|
|
@@ -2830,14 +2779,8 @@ class ComboboxComponent {
|
|
|
2830
2779
|
setDisabledState(isDisabled) {
|
|
2831
2780
|
this.disabled.set(isDisabled);
|
|
2832
2781
|
}
|
|
2833
|
-
/**
|
|
2834
|
-
* Focuses the input element within the command component when the overlay is attached.
|
|
2835
|
-
*/
|
|
2836
|
-
onOverlayAttached() {
|
|
2837
|
-
this.command()?.el.nativeElement.querySelector('input')?.focus();
|
|
2838
|
-
}
|
|
2839
2782
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: ComboboxComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2840
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "19.2.7", type: ComboboxComponent, isStandalone: true, selector: "b-combobox", inputs: { placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, maxWidth: { classPropertyName: "maxWidth", publicName: "maxWidth", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { disabled: "disabledChange" }, host: { properties: { "style.max-width": "maxWidth()", "class.disabled": "disabled()" } }, providers: [
|
|
2783
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "19.2.7", type: ComboboxComponent, isStandalone: true, selector: "b-combobox", inputs: { placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, maxWidth: { classPropertyName: "maxWidth", publicName: "maxWidth", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { disabled: "disabledChange" }, host: { listeners: { "window:resize": "setButtonWidth()" }, properties: { "style.max-width": "maxWidth()", "class.disabled": "disabled()" } }, providers: [
|
|
2841
2784
|
{
|
|
2842
2785
|
provide: NG_VALUE_ACCESSOR,
|
|
2843
2786
|
useExisting: forwardRef(() => ComboboxComponent),
|
|
@@ -2941,7 +2884,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.7", ngImpor
|
|
|
2941
2884
|
},
|
|
2942
2885
|
],
|
|
2943
2886
|
}]
|
|
2944
|
-
}]
|
|
2887
|
+
}], propDecorators: { setButtonWidth: [{
|
|
2888
|
+
type: HostListener,
|
|
2889
|
+
args: ['window:resize']
|
|
2890
|
+
}] } });
|
|
2945
2891
|
|
|
2946
2892
|
/*
|
|
2947
2893
|
* Public API Surface of basis-ng
|
|
@@ -2952,5 +2898,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.7", ngImpor
|
|
|
2952
2898
|
* Generated bundle index. Do not edit.
|
|
2953
2899
|
*/
|
|
2954
2900
|
|
|
2955
|
-
export { Alert, AttachedBox, Badge, BottomSheet, Button, ButtonGroup, Checkbox, ColorPicker, ComboboxComponent, CommandComponent, CommandOptionsComponent, Icon, InViewportDirective, InViewportService, Input, InputGroup,
|
|
2901
|
+
export { Alert, AttachedBox, Badge, BottomSheet, Button, ButtonGroup, Checkbox, ColorPicker, ComboboxComponent, CommandComponent, CommandOptionsComponent, Icon, InViewportDirective, InViewportService, Input, InputGroup, LazyContentDirective, Menu, MenuItemCheckboxComponent, MenuItemComponent, MenuItemRadioComponent, MenuLabel, MenuTrigger, OptionComponent, Range, ResponsiveService, Row, RowItem, SelectComponent, SelectOptionsComponent, SideSheet, Spinner, Switch, Tab, Table, Tabs, Textarea, ThemeService, TooltipComponent, Tree, TreeNode };
|
|
2956
2902
|
//# sourceMappingURL=basis-ng-primitives.mjs.map
|