@basis-ng/primitives 0.0.1-alpha.87 → 0.0.1-alpha.89
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/fesm2022/basis-ng-primitives.mjs +1186 -1559
- package/fesm2022/basis-ng-primitives.mjs.map +1 -1
- package/index.d.ts +565 -796
- package/package.json +1 -1
|
@@ -1,21 +1,22 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { signal, inject, RendererFactory2, PLATFORM_ID, Injectable, input, ElementRef, Component, TemplateRef, Directive, computed,
|
|
3
|
-
import { isPlatformBrowser,
|
|
2
|
+
import { signal, inject, RendererFactory2, PLATFORM_ID, Injectable, input, ElementRef, Component, TemplateRef, Directive, computed, model, linkedSignal, output, effect, contentChildren, contentChild, forwardRef, HostListener, afterRenderEffect, ViewEncapsulation, ChangeDetectorRef, Pipe } from '@angular/core';
|
|
3
|
+
import { isPlatformBrowser, NgClass, NgStyle, CommonModule } from '@angular/common';
|
|
4
4
|
import { NgModel, NG_VALUE_ACCESSOR, ControlContainer } from '@angular/forms';
|
|
5
|
-
import * as i1 from '@angular/cdk/
|
|
6
|
-
import {
|
|
7
|
-
import { DomSanitizer } from '@angular/platform-browser';
|
|
8
|
-
import { icons, createElement } from 'lucide';
|
|
9
|
-
import * as i1$1 from '@angular/cdk/overlay';
|
|
10
|
-
import { CdkOverlayOrigin, CdkConnectedOverlay, Overlay, OverlayConfig } from '@angular/cdk/overlay';
|
|
5
|
+
import * as i1 from '@angular/cdk/overlay';
|
|
6
|
+
import { CdkConnectedOverlay, Overlay, CdkOverlayOrigin } from '@angular/cdk/overlay';
|
|
11
7
|
import { ActiveDescendantKeyManager, CdkTrapFocus } from '@angular/cdk/a11y';
|
|
12
|
-
import
|
|
8
|
+
import * as i1$1 from '@angular/cdk/listbox';
|
|
9
|
+
import { CdkListbox, CdkOption } from '@angular/cdk/listbox';
|
|
10
|
+
import { ConnectedOverlay as ConnectedOverlay$1 } from 'projects/primitives/src/core/directives/connected-overlay';
|
|
11
|
+
import { NgIcon, provideIcons } from '@ng-icons/core';
|
|
12
|
+
import { lucideLoaderCircle, lucideLoader, lucideGripVertical, lucideX } from '@ng-icons/lucide';
|
|
13
13
|
import * as i1$2 from '@angular/cdk/drag-drop';
|
|
14
|
-
import {
|
|
14
|
+
import { CdkDrag, CdkDragHandle, CdkDropList, CdkDropListGroup } from '@angular/cdk/drag-drop';
|
|
15
15
|
import * as i1$3 from '@angular/cdk/menu';
|
|
16
|
-
import { CdkMenu,
|
|
16
|
+
import { CdkMenu, CdkMenuGroup, CdkMenuItem, CdkMenuItemCheckbox, CdkMenuItemRadio, CdkMenuTrigger } from '@angular/cdk/menu';
|
|
17
17
|
import { BreakpointObserver, Breakpoints } from '@angular/cdk/layout';
|
|
18
|
-
import { CdkDialogContainer, DialogRef, Dialog } from '@angular/cdk/dialog';
|
|
18
|
+
import { CdkDialogContainer, DialogRef, Dialog as Dialog$1 } from '@angular/cdk/dialog';
|
|
19
|
+
import { CdkPortalOutlet } from '@angular/cdk/portal';
|
|
19
20
|
import { HttpClient } from '@angular/common/http';
|
|
20
21
|
|
|
21
22
|
class ThemeService {
|
|
@@ -95,62 +96,66 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.3", ngImpor
|
|
|
95
96
|
}], ctorParameters: () => [] });
|
|
96
97
|
|
|
97
98
|
/**
|
|
98
|
-
* Button component
|
|
99
|
+
* Button component for displaying a clickable button element with configurable variant, size, and shape.
|
|
100
|
+
*
|
|
101
|
+
* @public
|
|
99
102
|
*/
|
|
100
|
-
class
|
|
103
|
+
class Button {
|
|
101
104
|
/**
|
|
102
|
-
*
|
|
105
|
+
* The visual variant of the button.
|
|
103
106
|
*
|
|
104
107
|
* @defaultValue 'primary'
|
|
105
108
|
*/
|
|
106
109
|
variant = input('primary', ...(ngDevMode ? [{ debugName: "variant" }] : []));
|
|
107
110
|
/**
|
|
108
|
-
*
|
|
109
|
-
*
|
|
110
|
-
* @defaultValue '2'
|
|
111
|
-
*/
|
|
112
|
-
size = input('2', ...(ngDevMode ? [{ debugName: "size" }] : []));
|
|
113
|
-
/**
|
|
114
|
-
* Determines whether the button has an active state enabled.
|
|
111
|
+
* The size of the button.
|
|
115
112
|
*
|
|
116
|
-
* @defaultValue
|
|
113
|
+
* @defaultValue 'md'
|
|
117
114
|
*/
|
|
118
|
-
|
|
115
|
+
size = input('md', ...(ngDevMode ? [{ debugName: "size" }] : []));
|
|
119
116
|
/**
|
|
120
|
-
*
|
|
117
|
+
* If true, the button will have squared edges.
|
|
121
118
|
*
|
|
122
119
|
* @defaultValue false
|
|
123
120
|
*/
|
|
124
121
|
squared = input(false, ...(ngDevMode ? [{ debugName: "squared" }] : []));
|
|
125
122
|
/**
|
|
126
|
-
* Reference to the
|
|
123
|
+
* Reference to the underlying DOM element.
|
|
127
124
|
*/
|
|
128
125
|
el = inject(ElementRef);
|
|
129
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type:
|
|
130
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.2.3", type:
|
|
126
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type: Button, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
127
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.2.3", type: Button, isStandalone: true, selector: "button[b-button]", inputs: { variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, squared: { classPropertyName: "squared", publicName: "squared", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.b-variant-primary": "variant() === \"primary\"", "class.b-variant-secondary": "variant() === \"secondary\"", "class.b-variant-ghost": "variant() === \"ghost\"", "class.b-variant-outlined": "variant() === \"outlined\"", "class.b-variant-destructive": "variant() === \"destructive\"", "class.b-size-sm": "size() === \"sm\"", "class.b-size-md": "size() === \"md\"", "class.b-size-lg": "size() === \"lg\"", "class.b-squared": "squared()" } }, ngImport: i0, template: ` <ng-content /> `, isInline: true });
|
|
131
128
|
}
|
|
132
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type:
|
|
129
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type: Button, decorators: [{
|
|
133
130
|
type: Component,
|
|
134
131
|
args: [{
|
|
135
132
|
selector: 'button[b-button]',
|
|
136
|
-
template: ` <ng-content
|
|
133
|
+
template: ` <ng-content /> `,
|
|
137
134
|
host: {
|
|
138
|
-
'[class]': 'variant()
|
|
139
|
-
'[class.
|
|
140
|
-
'[class.
|
|
135
|
+
'[class.b-variant-primary]': 'variant() === "primary"',
|
|
136
|
+
'[class.b-variant-secondary]': 'variant() === "secondary"',
|
|
137
|
+
'[class.b-variant-ghost]': 'variant() === "ghost"',
|
|
138
|
+
'[class.b-variant-outlined]': 'variant() === "outlined"',
|
|
139
|
+
'[class.b-variant-destructive]': 'variant() === "destructive"',
|
|
140
|
+
'[class.b-size-sm]': 'size() === "sm"',
|
|
141
|
+
'[class.b-size-md]': 'size() === "md"',
|
|
142
|
+
'[class.b-size-lg]': 'size() === "lg"',
|
|
143
|
+
'[class.b-squared]': 'squared()',
|
|
141
144
|
},
|
|
142
145
|
}]
|
|
143
146
|
}] });
|
|
144
147
|
|
|
145
|
-
class
|
|
148
|
+
class ButtonGroup {
|
|
146
149
|
/**
|
|
147
150
|
* Whether the buttons should be spaced.
|
|
151
|
+
*
|
|
152
|
+
* @defaultValue false
|
|
148
153
|
*/
|
|
149
154
|
spaced = input(false, ...(ngDevMode ? [{ debugName: "spaced" }] : []));
|
|
150
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type:
|
|
151
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.2.3", type:
|
|
155
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type: ButtonGroup, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
156
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.2.3", type: ButtonGroup, isStandalone: true, selector: "b-button-group", inputs: { spaced: { classPropertyName: "spaced", publicName: "spaced", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.spaced": "spaced()" }, classAttribute: "button-group" }, ngImport: i0, template: `<ng-content />`, isInline: true });
|
|
152
157
|
}
|
|
153
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type:
|
|
158
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type: ButtonGroup, decorators: [{
|
|
154
159
|
type: Component,
|
|
155
160
|
args: [{
|
|
156
161
|
selector: 'b-button-group',
|
|
@@ -175,15 +180,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.3", ngImpor
|
|
|
175
180
|
}]
|
|
176
181
|
}] });
|
|
177
182
|
|
|
178
|
-
class
|
|
183
|
+
class Input {
|
|
179
184
|
/**
|
|
180
185
|
* The type of the input.
|
|
181
186
|
*/
|
|
182
187
|
type = input('text', ...(ngDevMode ? [{ debugName: "type" }] : []));
|
|
183
|
-
/**
|
|
184
|
-
* The maximum width of the input.
|
|
185
|
-
*/
|
|
186
|
-
maxWidth = input('', ...(ngDevMode ? [{ debugName: "maxWidth" }] : []));
|
|
187
188
|
/**
|
|
188
189
|
* The number of decimal places for number input.
|
|
189
190
|
*/
|
|
@@ -207,7 +208,7 @@ class InputComponent {
|
|
|
207
208
|
/**
|
|
208
209
|
* The size of the input.
|
|
209
210
|
*/
|
|
210
|
-
size = input('
|
|
211
|
+
size = input('md', ...(ngDevMode ? [{ debugName: "size" }] : []));
|
|
211
212
|
/**
|
|
212
213
|
* After the view has been initialized, set the value of the select.
|
|
213
214
|
*/
|
|
@@ -273,264 +274,42 @@ class InputComponent {
|
|
|
273
274
|
this.setValue(formattedValue || '');
|
|
274
275
|
}
|
|
275
276
|
}
|
|
276
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type:
|
|
277
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.2.3", type:
|
|
277
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type: Input, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
278
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.2.3", type: Input, isStandalone: true, selector: "input[b-input]", inputs: { type: { classPropertyName: "type", publicName: "type", 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()", "class.b-size-sm": "size() === \"sm\"", "class.b-size-md": "size() === \"md\"", "class.b-size-lg": "size() === \"lg\"" } }, exportAs: ["bInput"], ngImport: i0, template: ``, isInline: true });
|
|
278
279
|
}
|
|
279
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type:
|
|
280
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type: Input, decorators: [{
|
|
280
281
|
type: Component,
|
|
281
282
|
args: [{
|
|
282
283
|
selector: 'input[b-input]',
|
|
283
284
|
template: ``,
|
|
284
285
|
host: {
|
|
285
286
|
'[type]': 'type()',
|
|
286
|
-
'[style.max-width]': 'maxWidth()',
|
|
287
287
|
'(input)': 'onInput($event)',
|
|
288
288
|
'(blur)': 'onBlur($event)',
|
|
289
|
-
'[class]': '
|
|
289
|
+
'[class.b-size-sm]': 'size() === "sm"',
|
|
290
|
+
'[class.b-size-md]': 'size() === "md"',
|
|
291
|
+
'[class.b-size-lg]': 'size() === "lg"',
|
|
290
292
|
},
|
|
291
293
|
exportAs: 'bInput',
|
|
292
294
|
}]
|
|
293
295
|
}] });
|
|
294
296
|
|
|
295
|
-
/**
|
|
296
|
-
* Component representing an individual option in a select or combobox.
|
|
297
|
-
* This component integrates with Angular CDK Option to manage the option's state and behavior.
|
|
298
|
-
*/
|
|
299
|
-
class OptionComponent {
|
|
300
|
-
/**
|
|
301
|
-
* The `ElementRef` of the option.
|
|
302
|
-
* This provides direct access to the DOM element of the option.
|
|
303
|
-
*/
|
|
304
|
-
el = inject(ElementRef);
|
|
305
|
-
/**
|
|
306
|
-
* The `CdkOption` instance associated with this option.
|
|
307
|
-
* This provides methods and properties for managing the option's state, such as selection and value.
|
|
308
|
-
*/
|
|
309
|
-
cdkOption = inject(CdkOption);
|
|
310
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type: OptionComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
311
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.2.3", type: OptionComponent, isStandalone: true, selector: "li[b-option]", hostDirectives: [{ directive: i1.CdkOption, inputs: ["cdkOption", "value", "cdkOptionDisabled", "disabled"] }], ngImport: i0, template: `<ng-content />`, isInline: true });
|
|
312
|
-
}
|
|
313
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type: OptionComponent, decorators: [{
|
|
314
|
-
type: Component,
|
|
315
|
-
args: [{
|
|
316
|
-
selector: 'li[b-option]',
|
|
317
|
-
imports: [],
|
|
318
|
-
template: `<ng-content />`,
|
|
319
|
-
hostDirectives: [
|
|
320
|
-
{
|
|
321
|
-
directive: CdkOption,
|
|
322
|
-
inputs: ['cdkOption: value', 'cdkOptionDisabled: disabled'],
|
|
323
|
-
},
|
|
324
|
-
],
|
|
325
|
-
}]
|
|
326
|
-
}] });
|
|
327
|
-
|
|
328
|
-
/**
|
|
329
|
-
* Component representing the list of options in a select.
|
|
330
|
-
* This component integrates with Angular CDK Listbox to manage options and their selection.
|
|
331
|
-
*/
|
|
332
|
-
class SelectOptionsComponent {
|
|
333
|
-
/**
|
|
334
|
-
* Signal representing the selected values in the listbox.
|
|
335
|
-
* This is an array of strings corresponding to the selected option values.
|
|
336
|
-
*/
|
|
337
|
-
value = signal([], ...(ngDevMode ? [{ debugName: "value" }] : []));
|
|
338
|
-
/**
|
|
339
|
-
* Event emitter triggered when the dropdown should close.
|
|
340
|
-
* This is used to notify the parent component to close the dropdown.
|
|
341
|
-
*/
|
|
342
|
-
closeEmitter = output();
|
|
343
|
-
/**
|
|
344
|
-
* Reference to the host element of the component.
|
|
345
|
-
* This provides access to the DOM element of the options list.
|
|
346
|
-
*/
|
|
347
|
-
el = inject(ElementRef);
|
|
348
|
-
/**
|
|
349
|
-
* Input for setting the maximum height of the dropdown.
|
|
350
|
-
* Defaults to '300px'. This controls the vertical size of the dropdown.
|
|
351
|
-
*/
|
|
352
|
-
maxHeight = input('300px', ...(ngDevMode ? [{ debugName: "maxHeight" }] : []));
|
|
353
|
-
/**
|
|
354
|
-
* No options message displayed when there are no available options in the dropdown.
|
|
355
|
-
*/
|
|
356
|
-
noOptionsMessage = input('', ...(ngDevMode ? [{ debugName: "noOptionsMessage" }] : []));
|
|
357
|
-
/**
|
|
358
|
-
* Signal indicating whether multiple selections are allowed.
|
|
359
|
-
* If true, the select component allows selecting multiple options.
|
|
360
|
-
*/
|
|
361
|
-
multiple = input(false, ...(ngDevMode ? [{ debugName: "multiple" }] : []));
|
|
362
|
-
/**
|
|
363
|
-
* Reference to the CDK Listbox directive.
|
|
364
|
-
* This is used to manage the options and their selection state.
|
|
365
|
-
*/
|
|
366
|
-
listBox = inject(CdkListbox);
|
|
367
|
-
/**
|
|
368
|
-
* Reference to the list of options in the dropdown.
|
|
369
|
-
* This is a collection of `OptionComponent` instances representing the available options.
|
|
370
|
-
*/
|
|
371
|
-
options = contentChildren(OptionComponent, ...(ngDevMode ? [{ debugName: "options" }] : []));
|
|
372
|
-
/**
|
|
373
|
-
* Handles changes to the selected value in the listbox.
|
|
374
|
-
* This method updates the `value` signal, emits the `closeEmitter` event,
|
|
375
|
-
* and ensures the parent component is notified of the selection change.
|
|
376
|
-
*
|
|
377
|
-
* @param value - The new array of selected values.
|
|
378
|
-
*/
|
|
379
|
-
handleValueChange(value) {
|
|
380
|
-
// If the value is an empty array or contains a single empty string, clear the selection.
|
|
381
|
-
if (value.length === 1 && value[0] === '') {
|
|
382
|
-
this.value.set([]);
|
|
383
|
-
if (!this.multiple()) {
|
|
384
|
-
this.closeEmitter.emit();
|
|
385
|
-
}
|
|
386
|
-
return;
|
|
387
|
-
}
|
|
388
|
-
this.value.set(value);
|
|
389
|
-
if (!this.multiple()) {
|
|
390
|
-
this.closeEmitter.emit();
|
|
391
|
-
}
|
|
392
|
-
}
|
|
393
|
-
onEnter() {
|
|
394
|
-
if (!this.multiple()) {
|
|
395
|
-
this.closeEmitter.emit();
|
|
396
|
-
}
|
|
397
|
-
}
|
|
398
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type: SelectOptionsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
399
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.2.3", type: SelectOptionsComponent, isStandalone: true, selector: "ul[b-select-options]", inputs: { maxHeight: { classPropertyName: "maxHeight", publicName: "maxHeight", isSignal: true, isRequired: false, transformFunction: null }, noOptionsMessage: { classPropertyName: "noOptionsMessage", publicName: "noOptionsMessage", isSignal: true, isRequired: false, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { closeEmitter: "closeEmitter" }, host: { listeners: { "cdkListboxValueChange": "handleValueChange($event.value)", "keydown.enter": "onEnter()" }, properties: { "cdkListboxValue": "value()", "style.max-height": "maxHeight()" } }, queries: [{ propertyName: "options", predicate: OptionComponent, isSignal: true }], hostDirectives: [{ directive: i1.CdkListbox, inputs: ["cdkListboxValue", "cdkListboxValue", "cdkListboxMultiple", "multiple"], outputs: ["cdkListboxValueChange", "cdkListboxValueChange"] }], ngImport: i0, template: `<ng-content />
|
|
400
|
-
@if (options().length === 0) {
|
|
401
|
-
<div class="no-options-message">
|
|
402
|
-
{{ noOptionsMessage() }}
|
|
403
|
-
</div>
|
|
404
|
-
}`, isInline: true });
|
|
405
|
-
}
|
|
406
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type: SelectOptionsComponent, decorators: [{
|
|
407
|
-
type: Component,
|
|
408
|
-
args: [{
|
|
409
|
-
selector: 'ul[b-select-options]',
|
|
410
|
-
imports: [],
|
|
411
|
-
template: `<ng-content />
|
|
412
|
-
@if (options().length === 0) {
|
|
413
|
-
<div class="no-options-message">
|
|
414
|
-
{{ noOptionsMessage() }}
|
|
415
|
-
</div>
|
|
416
|
-
}`,
|
|
417
|
-
hostDirectives: [
|
|
418
|
-
{
|
|
419
|
-
directive: CdkListbox,
|
|
420
|
-
inputs: ['cdkListboxValue', 'cdkListboxMultiple: multiple'],
|
|
421
|
-
outputs: ['cdkListboxValueChange'],
|
|
422
|
-
},
|
|
423
|
-
],
|
|
424
|
-
host: {
|
|
425
|
-
'[cdkListboxValue]': 'value()',
|
|
426
|
-
'(cdkListboxValueChange)': 'handleValueChange($event.value)',
|
|
427
|
-
'[style.max-height]': 'maxHeight()',
|
|
428
|
-
'(keydown.enter)': 'onEnter()',
|
|
429
|
-
},
|
|
430
|
-
}]
|
|
431
|
-
}] });
|
|
432
|
-
|
|
433
|
-
class IconComponent {
|
|
434
|
-
/**
|
|
435
|
-
* The sanitizer service.
|
|
436
|
-
*/
|
|
437
|
-
sanitizer = inject(DomSanitizer);
|
|
438
|
-
/**
|
|
439
|
-
* The icon of the text field.
|
|
440
|
-
*/
|
|
441
|
-
icon = input.required(...(ngDevMode ? [{ debugName: "icon" }] : []));
|
|
442
|
-
/**
|
|
443
|
-
* The size of the icon.
|
|
444
|
-
*/
|
|
445
|
-
size = input(24, ...(ngDevMode ? [{ debugName: "size" }] : []));
|
|
446
|
-
/**
|
|
447
|
-
* The stroke of the icon.
|
|
448
|
-
*/
|
|
449
|
-
strokeWidth = input(1.8, ...(ngDevMode ? [{ debugName: "strokeWidth" }] : []));
|
|
450
|
-
/**
|
|
451
|
-
* The color of the icon.
|
|
452
|
-
*/
|
|
453
|
-
color = input('var(--foreground, #798194)', ...(ngDevMode ? [{ debugName: "color" }] : []));
|
|
454
|
-
/**
|
|
455
|
-
* The svg of the icon.
|
|
456
|
-
*/
|
|
457
|
-
iconSvg = computed(() => {
|
|
458
|
-
if (!icons[this.icon()]) {
|
|
459
|
-
console.error(`Icon '${this.icon()}' not found in Lucide icons.`);
|
|
460
|
-
return this.sanitizer.bypassSecurityTrustHtml('');
|
|
461
|
-
}
|
|
462
|
-
const iconSvg = createElement(icons[this.icon()], {
|
|
463
|
-
width: this.size(),
|
|
464
|
-
height: this.size(),
|
|
465
|
-
stroke: this.color(),
|
|
466
|
-
'stroke-width': this.strokeWidth(),
|
|
467
|
-
});
|
|
468
|
-
return this.sanitizer.bypassSecurityTrustHtml(iconSvg.outerHTML);
|
|
469
|
-
}, ...(ngDevMode ? [{ debugName: "iconSvg" }] : []));
|
|
470
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type: IconComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
471
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.2.3", type: IconComponent, isStandalone: true, selector: "i[b-icon]", inputs: { icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: true, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, strokeWidth: { classPropertyName: "strokeWidth", publicName: "strokeWidth", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "innerHTML": "iconSvg()" } }, ngImport: i0, template: ``, isInline: true });
|
|
472
|
-
}
|
|
473
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type: IconComponent, decorators: [{
|
|
474
|
-
type: Component,
|
|
475
|
-
args: [{
|
|
476
|
-
selector: 'i[b-icon]',
|
|
477
|
-
imports: [],
|
|
478
|
-
template: ``,
|
|
479
|
-
host: {
|
|
480
|
-
'[innerHTML]': 'iconSvg()',
|
|
481
|
-
},
|
|
482
|
-
}]
|
|
483
|
-
}] });
|
|
484
|
-
|
|
485
|
-
/**
|
|
486
|
-
* Directive to mark an element as a trigger for an overlay.
|
|
487
|
-
* Integrates with Angular CDK's `CdkOverlayOrigin` to provide
|
|
488
|
-
* a reference point for overlay positioning.
|
|
489
|
-
*/
|
|
490
|
-
class OverlayTriggerDirective {
|
|
491
|
-
/**
|
|
492
|
-
* Reference to the `CdkOverlayOrigin` instance.
|
|
493
|
-
* Used as the origin point for overlay positioning.
|
|
494
|
-
*/
|
|
495
|
-
trigger = inject(CdkOverlayOrigin);
|
|
496
|
-
/**
|
|
497
|
-
* Reference to the `ElementRef` of the host element.
|
|
498
|
-
* This is used to access the native DOM element.
|
|
499
|
-
*/
|
|
500
|
-
el = inject(ElementRef);
|
|
501
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type: OverlayTriggerDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
502
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.2.3", type: OverlayTriggerDirective, isStandalone: true, selector: "[bOverlayTrigger]", exportAs: ["bOverlayTrigger"], hostDirectives: [{ directive: i1$1.CdkOverlayOrigin }], ngImport: i0 });
|
|
503
|
-
}
|
|
504
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type: OverlayTriggerDirective, decorators: [{
|
|
505
|
-
type: Directive,
|
|
506
|
-
args: [{
|
|
507
|
-
selector: '[bOverlayTrigger]',
|
|
508
|
-
hostDirectives: [CdkOverlayOrigin],
|
|
509
|
-
exportAs: 'bOverlayTrigger',
|
|
510
|
-
}]
|
|
511
|
-
}] });
|
|
512
|
-
|
|
513
297
|
/**
|
|
514
298
|
* Directive to manage overlay behavior and positioning.
|
|
515
299
|
* Integrates with Angular CDK's `CdkConnectedOverlay` to provide
|
|
516
300
|
* flexible overlay positioning and triggering mechanisms.
|
|
517
301
|
*/
|
|
518
|
-
class
|
|
302
|
+
class ConnectedOverlay {
|
|
519
303
|
/**
|
|
520
304
|
* Controls whether the overlay is open.
|
|
521
305
|
* @default false
|
|
522
306
|
*/
|
|
523
|
-
open =
|
|
307
|
+
open = model(false, ...(ngDevMode ? [{ debugName: "open" }] : []));
|
|
524
308
|
/**
|
|
525
309
|
* The trigger directive that activates the overlay.
|
|
526
310
|
* This input is required.
|
|
527
311
|
*/
|
|
528
312
|
trigger = input.required(...(ngDevMode ? [{ debugName: "trigger" }] : []));
|
|
529
|
-
/**
|
|
530
|
-
* Delay in milliseconds before closing the overlay.
|
|
531
|
-
* @default 0
|
|
532
|
-
*/
|
|
533
|
-
closeDelay = input(0, ...(ngDevMode ? [{ debugName: "closeDelay" }] : []));
|
|
534
313
|
/**
|
|
535
314
|
* A computed map of positions to their corresponding `ConnectedPosition` configurations.
|
|
536
315
|
*/
|
|
@@ -540,72 +319,96 @@ class OverlayDirective {
|
|
|
540
319
|
originY: 'top',
|
|
541
320
|
overlayX: 'start',
|
|
542
321
|
overlayY: 'bottom',
|
|
322
|
+
offsetX: 0,
|
|
323
|
+
offsetY: -4,
|
|
543
324
|
},
|
|
544
325
|
'top-center': {
|
|
545
326
|
originX: 'center',
|
|
546
327
|
originY: 'top',
|
|
547
328
|
overlayX: 'center',
|
|
548
329
|
overlayY: 'bottom',
|
|
330
|
+
offsetX: 0,
|
|
331
|
+
offsetY: -4,
|
|
549
332
|
},
|
|
550
333
|
'top-right': {
|
|
551
334
|
originX: 'end',
|
|
552
335
|
originY: 'top',
|
|
553
336
|
overlayX: 'end',
|
|
554
337
|
overlayY: 'bottom',
|
|
338
|
+
offsetX: 0,
|
|
339
|
+
offsetY: -4,
|
|
555
340
|
},
|
|
556
341
|
'bottom-left': {
|
|
557
342
|
originX: 'start',
|
|
558
343
|
originY: 'bottom',
|
|
559
344
|
overlayX: 'start',
|
|
560
345
|
overlayY: 'top',
|
|
346
|
+
offsetX: 0,
|
|
347
|
+
offsetY: 4,
|
|
561
348
|
},
|
|
562
349
|
'bottom-center': {
|
|
563
350
|
originX: 'center',
|
|
564
351
|
originY: 'bottom',
|
|
565
352
|
overlayX: 'center',
|
|
566
353
|
overlayY: 'top',
|
|
354
|
+
offsetX: 0,
|
|
355
|
+
offsetY: 4,
|
|
567
356
|
},
|
|
568
357
|
'bottom-right': {
|
|
569
358
|
originX: 'end',
|
|
570
359
|
originY: 'bottom',
|
|
571
360
|
overlayX: 'end',
|
|
572
361
|
overlayY: 'top',
|
|
362
|
+
offsetX: 0,
|
|
363
|
+
offsetY: 4,
|
|
573
364
|
},
|
|
574
365
|
'left-top': {
|
|
575
366
|
originX: 'start',
|
|
576
367
|
originY: 'top',
|
|
577
368
|
overlayX: 'end',
|
|
578
369
|
overlayY: 'top',
|
|
370
|
+
offsetX: -4,
|
|
371
|
+
offsetY: 0,
|
|
579
372
|
},
|
|
580
373
|
'left-center': {
|
|
581
374
|
originX: 'start',
|
|
582
375
|
originY: 'center',
|
|
583
376
|
overlayX: 'end',
|
|
584
377
|
overlayY: 'center',
|
|
378
|
+
offsetX: -4,
|
|
379
|
+
offsetY: 0,
|
|
585
380
|
},
|
|
586
381
|
'left-bottom': {
|
|
587
382
|
originX: 'start',
|
|
588
383
|
originY: 'bottom',
|
|
589
384
|
overlayX: 'end',
|
|
590
385
|
overlayY: 'bottom',
|
|
386
|
+
offsetX: -4,
|
|
387
|
+
offsetY: 0,
|
|
591
388
|
},
|
|
592
389
|
'right-top': {
|
|
593
390
|
originX: 'end',
|
|
594
391
|
originY: 'top',
|
|
595
392
|
overlayX: 'start',
|
|
596
393
|
overlayY: 'top',
|
|
394
|
+
offsetX: 4,
|
|
395
|
+
offsetY: 0,
|
|
597
396
|
},
|
|
598
397
|
'right-center': {
|
|
599
398
|
originX: 'end',
|
|
600
399
|
originY: 'center',
|
|
601
400
|
overlayX: 'start',
|
|
602
401
|
overlayY: 'center',
|
|
402
|
+
offsetX: 4,
|
|
403
|
+
offsetY: 0,
|
|
603
404
|
},
|
|
604
405
|
'right-bottom': {
|
|
605
406
|
originX: 'end',
|
|
606
407
|
originY: 'bottom',
|
|
607
408
|
overlayX: 'start',
|
|
608
409
|
overlayY: 'bottom',
|
|
410
|
+
offsetX: 4,
|
|
411
|
+
offsetY: 0,
|
|
609
412
|
},
|
|
610
413
|
}), ...(ngDevMode ? [{ debugName: "positionsMap" }] : []));
|
|
611
414
|
/**
|
|
@@ -613,6 +416,11 @@ class OverlayDirective {
|
|
|
613
416
|
* @default ['bottom-left']
|
|
614
417
|
*/
|
|
615
418
|
positions = input(['bottom-left'], ...(ngDevMode ? [{ debugName: "positions" }] : []));
|
|
419
|
+
/**
|
|
420
|
+
* Controls whether the trigger element should be focused when the overlay is closed.
|
|
421
|
+
* @default true
|
|
422
|
+
*/
|
|
423
|
+
focusTriggerOnClose = input(true, ...(ngDevMode ? [{ debugName: "focusTriggerOnClose" }] : []));
|
|
616
424
|
/**
|
|
617
425
|
* Computed list of `ConnectedPosition` objects based on the `positions` input.
|
|
618
426
|
*/
|
|
@@ -620,7 +428,7 @@ class OverlayDirective {
|
|
|
620
428
|
/**
|
|
621
429
|
* Signal to track the currently active `ConnectionPositionPair`.
|
|
622
430
|
*/
|
|
623
|
-
connectedPositionPair =
|
|
431
|
+
connectedPositionPair = linkedSignal(() => this.connectedPositions()[0]);
|
|
624
432
|
/**
|
|
625
433
|
* Injected instance of `CdkConnectedOverlay`.
|
|
626
434
|
*/
|
|
@@ -634,8 +442,6 @@ class OverlayDirective {
|
|
|
634
442
|
*/
|
|
635
443
|
direction = computed(() => {
|
|
636
444
|
const pair = this.connectedPositionPair();
|
|
637
|
-
if (!pair)
|
|
638
|
-
return undefined;
|
|
639
445
|
return Object.entries(this.positionsMap())
|
|
640
446
|
.find(([, position]) => position.originX === pair.originX &&
|
|
641
447
|
position.originY === pair.originY &&
|
|
@@ -643,6 +449,22 @@ class OverlayDirective {
|
|
|
643
449
|
position.overlayY === pair.overlayY)?.[0]
|
|
644
450
|
.split('-')[0];
|
|
645
451
|
}, ...(ngDevMode ? [{ debugName: "direction" }] : []));
|
|
452
|
+
/**
|
|
453
|
+
* Event emitter for overlay detach events.
|
|
454
|
+
*/
|
|
455
|
+
detachEmitter = output();
|
|
456
|
+
/**
|
|
457
|
+
* Event emitter for overlay attach events.
|
|
458
|
+
*/
|
|
459
|
+
attachEmitter = output();
|
|
460
|
+
/**
|
|
461
|
+
* Event emitter for overlay outside click events.
|
|
462
|
+
*/
|
|
463
|
+
outsideClickEmitter = output();
|
|
464
|
+
/**
|
|
465
|
+
* Event emitter for overlay backdrop click events.
|
|
466
|
+
*/
|
|
467
|
+
backdropClickEmitter = output();
|
|
646
468
|
/**
|
|
647
469
|
* Flag to indicate if this is the first load of the overlay.
|
|
648
470
|
*/
|
|
@@ -677,267 +499,390 @@ class OverlayDirective {
|
|
|
677
499
|
*/
|
|
678
500
|
handleOpen() {
|
|
679
501
|
if (this.open()) {
|
|
680
|
-
this.
|
|
502
|
+
this.cdkConnectedOverlay.attachOverlay();
|
|
681
503
|
}
|
|
682
504
|
else {
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
}
|
|
687
|
-
}
|
|
688
|
-
/**
|
|
689
|
-
* Opens the overlay and applies the appropriate direction class.
|
|
690
|
-
* Ensures the overlay is attached and styled correctly.
|
|
691
|
-
*/
|
|
692
|
-
handleOverlayOpen() {
|
|
693
|
-
this.cdkConnectedOverlay.attachOverlay();
|
|
694
|
-
this.applyDirectionClass();
|
|
695
|
-
}
|
|
696
|
-
/**
|
|
697
|
-
* Closes the overlay with optional animation and cleanup.
|
|
698
|
-
* If it's the first load, detaches the overlay immediately without animation.
|
|
699
|
-
*/
|
|
700
|
-
handleOverlayClose() {
|
|
701
|
-
const firstChild = this.getFirstChild();
|
|
702
|
-
if (!firstChild) {
|
|
703
|
-
this.detachOverlayWithCleanup();
|
|
704
|
-
return;
|
|
505
|
+
this.cdkConnectedOverlay.detachOverlay();
|
|
506
|
+
if (this.focusTriggerOnClose())
|
|
507
|
+
this.trigger().el.nativeElement.focus();
|
|
705
508
|
}
|
|
706
|
-
firstChild.classList.add('b-overlay-leave');
|
|
707
|
-
setTimeout(() => this.detachOverlayWithCleanup(firstChild), this.closeDelay());
|
|
708
|
-
}
|
|
709
|
-
/**
|
|
710
|
-
* Retrieves the first child element of the overlay pane.
|
|
711
|
-
* @returns The first child element or `null` if not found.
|
|
712
|
-
*/
|
|
713
|
-
getFirstChild() {
|
|
714
|
-
return (this.cdkConnectedOverlay.overlayRef?.overlayElement.querySelector('.cdk-overlay-pane > *') || null);
|
|
715
509
|
}
|
|
716
510
|
/**
|
|
717
|
-
*
|
|
718
|
-
*
|
|
511
|
+
* Toggles the open state of the overlay.
|
|
512
|
+
* If the overlay is open, it will be closed, and vice versa.
|
|
719
513
|
*/
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
if (!firstChild)
|
|
723
|
-
return;
|
|
724
|
-
this.cleanOverlayClasses(firstChild);
|
|
725
|
-
const direction = this.direction();
|
|
726
|
-
if (direction) {
|
|
727
|
-
firstChild.classList.add(`b-overlay-${direction}`);
|
|
728
|
-
}
|
|
514
|
+
toggleOverlay() {
|
|
515
|
+
this.open.set(!this.open());
|
|
729
516
|
}
|
|
730
517
|
/**
|
|
731
|
-
*
|
|
732
|
-
* Optionally cleans up classes from a provided element.
|
|
733
|
-
* @param element The element to clean up classes from (optional).
|
|
518
|
+
* Closes the overlay by setting the `open` state to false.
|
|
734
519
|
*/
|
|
735
|
-
|
|
736
|
-
this.
|
|
737
|
-
if (element) {
|
|
738
|
-
this.cleanOverlayClasses(element);
|
|
739
|
-
}
|
|
740
|
-
this.trigger().el.nativeElement.focus();
|
|
520
|
+
closeOverlay() {
|
|
521
|
+
this.open.set(false);
|
|
741
522
|
}
|
|
742
523
|
/**
|
|
743
|
-
*
|
|
744
|
-
* @param element The element to remove classes from.
|
|
524
|
+
* Opens the overlay by setting the `open` state to true.
|
|
745
525
|
*/
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
'b-overlay-leave',
|
|
749
|
-
'b-overlay-top',
|
|
750
|
-
'b-overlay-bottom',
|
|
751
|
-
'b-overlay-left',
|
|
752
|
-
'b-overlay-right',
|
|
753
|
-
];
|
|
754
|
-
element.classList.remove(...classesToRemove);
|
|
526
|
+
openOverlay() {
|
|
527
|
+
this.open.set(true);
|
|
755
528
|
}
|
|
756
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type:
|
|
757
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.2.3", type:
|
|
529
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type: ConnectedOverlay, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
530
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.2.3", type: ConnectedOverlay, isStandalone: true, selector: "[bConnectedOverlay]", inputs: { open: { classPropertyName: "open", publicName: "open", isSignal: true, isRequired: false, transformFunction: null }, trigger: { classPropertyName: "trigger", publicName: "trigger", isSignal: true, isRequired: true, transformFunction: null }, positions: { classPropertyName: "positions", publicName: "positions", isSignal: true, isRequired: false, transformFunction: null }, focusTriggerOnClose: { classPropertyName: "focusTriggerOnClose", publicName: "focusTriggerOnClose", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { open: "openChange", detachEmitter: "detachEmitter", attachEmitter: "attachEmitter", outsideClickEmitter: "outsideClickEmitter", backdropClickEmitter: "backdropClickEmitter" }, host: { listeners: { "positionChange": "connectedPositionPair.set($event.connectionPair)", "detach": "detachEmitter.emit()", "attach": "attachEmitter.emit()", "outsideClick": "outsideClickEmitter.emit()", "backdropClick": "backdropClickEmitter.emit()" } }, hostDirectives: [{ directive: i1.CdkConnectedOverlay, inputs: ["cdkConnectedOverlayWidth", "width", "cdkConnectedOverlayMinWidth", "minWidth", "cdkConnectedOverlayBackdropClass", "customBackdropClass", "cdkConnectedOverlayPanelClass", "panelClass"], outputs: ["detach", "detach", "attach", "attach", "overlayOutsideClick", "outsideClick", "backdropClick", "backdropClick", "positionChange", "positionChange"] }], ngImport: i0 });
|
|
758
531
|
}
|
|
759
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type:
|
|
532
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type: ConnectedOverlay, decorators: [{
|
|
760
533
|
type: Directive,
|
|
761
534
|
args: [{
|
|
762
|
-
selector: '[
|
|
535
|
+
selector: '[bConnectedOverlay]',
|
|
763
536
|
hostDirectives: [
|
|
764
537
|
{
|
|
765
538
|
directive: CdkConnectedOverlay,
|
|
766
539
|
inputs: [
|
|
767
540
|
'cdkConnectedOverlayWidth: width',
|
|
768
541
|
'cdkConnectedOverlayMinWidth: minWidth',
|
|
769
|
-
'cdkConnectedOverlayHasBackdrop: hasBackdrop',
|
|
770
542
|
'cdkConnectedOverlayBackdropClass: customBackdropClass',
|
|
543
|
+
'cdkConnectedOverlayPanelClass: panelClass',
|
|
771
544
|
],
|
|
772
545
|
outputs: [
|
|
773
|
-
'backdropClick: backdropClick',
|
|
774
546
|
'detach: detach',
|
|
775
547
|
'attach: attach',
|
|
776
548
|
'overlayOutsideClick: outsideClick',
|
|
549
|
+
'backdropClick: backdropClick',
|
|
777
550
|
'positionChange: positionChange',
|
|
778
551
|
],
|
|
779
552
|
},
|
|
780
553
|
],
|
|
781
554
|
host: {
|
|
782
555
|
'(positionChange)': 'connectedPositionPair.set($event.connectionPair)',
|
|
556
|
+
'(detach)': 'detachEmitter.emit()',
|
|
557
|
+
'(attach)': 'attachEmitter.emit()',
|
|
558
|
+
'(outsideClick)': 'outsideClickEmitter.emit()',
|
|
559
|
+
'(backdropClick)': 'backdropClickEmitter.emit()',
|
|
783
560
|
},
|
|
784
561
|
}]
|
|
785
562
|
}], ctorParameters: () => [] });
|
|
786
563
|
|
|
787
564
|
/**
|
|
788
|
-
* Component representing
|
|
789
|
-
*
|
|
565
|
+
* Component representing the trigger button for the select dropdown.
|
|
566
|
+
* Handles user interactions to open or close the select.
|
|
790
567
|
*/
|
|
791
|
-
class
|
|
568
|
+
class SelectTrigger {
|
|
792
569
|
/**
|
|
793
|
-
*
|
|
570
|
+
* Reference to the host element of the trigger button.
|
|
794
571
|
*/
|
|
795
|
-
|
|
796
|
-
/**
|
|
797
|
-
* Signal indicating whether the dropdown is currently open.
|
|
798
|
-
*/
|
|
799
|
-
isOpen = signal(false, ...(ngDevMode ? [{ debugName: "isOpen" }] : []));
|
|
572
|
+
el = inject(ElementRef);
|
|
800
573
|
/**
|
|
801
|
-
*
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
574
|
+
* Event emitter for button click and keydown events.
|
|
575
|
+
*/
|
|
576
|
+
buttonClicked = output();
|
|
577
|
+
/**
|
|
578
|
+
* Signal indicating whether the trigger is disabled.
|
|
579
|
+
*/
|
|
580
|
+
disabled = signal(false, ...(ngDevMode ? [{ debugName: "disabled" }] : []));
|
|
581
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type: SelectTrigger, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
582
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.2.3", type: SelectTrigger, isStandalone: true, selector: "button[b-select-trigger]", outputs: { buttonClicked: "buttonClicked" }, host: { listeners: { "keydown.arrowUp": "buttonClicked.emit()", "keydown.arrowDown": "buttonClicked.emit()", "click": "buttonClicked.emit()" }, properties: { "disabled": "disabled()" } }, ngImport: i0, template: `<ng-content />
|
|
583
|
+
<svg
|
|
584
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
585
|
+
width="16"
|
|
586
|
+
height="16"
|
|
587
|
+
viewBox="0 0 24 24"
|
|
588
|
+
fill="none"
|
|
589
|
+
stroke="currentColor"
|
|
590
|
+
stroke-width="2"
|
|
591
|
+
stroke-linecap="round"
|
|
592
|
+
stroke-linejoin="round"
|
|
593
|
+
class="lucide lucide-chevron-down-icon lucide-chevron-down">
|
|
594
|
+
<path d="m6 9 6 6 6-6" />
|
|
595
|
+
</svg> `, isInline: true });
|
|
596
|
+
}
|
|
597
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type: SelectTrigger, decorators: [{
|
|
598
|
+
type: Component,
|
|
599
|
+
args: [{
|
|
600
|
+
selector: 'button[b-select-trigger]',
|
|
601
|
+
template: `<ng-content />
|
|
602
|
+
<svg
|
|
603
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
604
|
+
width="16"
|
|
605
|
+
height="16"
|
|
606
|
+
viewBox="0 0 24 24"
|
|
607
|
+
fill="none"
|
|
608
|
+
stroke="currentColor"
|
|
609
|
+
stroke-width="2"
|
|
610
|
+
stroke-linecap="round"
|
|
611
|
+
stroke-linejoin="round"
|
|
612
|
+
class="lucide lucide-chevron-down-icon lucide-chevron-down">
|
|
613
|
+
<path d="m6 9 6 6 6-6" />
|
|
614
|
+
</svg> `,
|
|
615
|
+
host: {
|
|
616
|
+
'(keydown.arrowUp)': 'buttonClicked.emit()',
|
|
617
|
+
'(keydown.arrowDown)': 'buttonClicked.emit()',
|
|
618
|
+
'(click)': 'buttonClicked.emit()',
|
|
619
|
+
'[disabled]': 'disabled()',
|
|
620
|
+
},
|
|
621
|
+
}]
|
|
622
|
+
}] });
|
|
623
|
+
|
|
624
|
+
/**
|
|
625
|
+
* Component for displaying the selected value or a placeholder in the select dropdown.
|
|
626
|
+
*/
|
|
627
|
+
class SelectValue {
|
|
805
628
|
/**
|
|
806
|
-
* Reference to the
|
|
807
|
-
* This contains the list of selectable options.
|
|
629
|
+
* Reference to the host element of the value display.
|
|
808
630
|
*/
|
|
809
|
-
|
|
631
|
+
el = inject(ElementRef);
|
|
810
632
|
/**
|
|
811
|
-
*
|
|
812
|
-
* This is linked to the value of the `OptionsListComponent`.
|
|
633
|
+
* Signal holding the display content for the selected value.
|
|
813
634
|
*/
|
|
814
|
-
|
|
635
|
+
content = signal('', ...(ngDevMode ? [{ debugName: "content" }] : []));
|
|
815
636
|
/**
|
|
816
|
-
*
|
|
817
|
-
*
|
|
637
|
+
* Input signal for the placeholder text when no value is selected.
|
|
638
|
+
* @param value - The placeholder string to display.
|
|
818
639
|
*/
|
|
819
|
-
|
|
640
|
+
placeholder = input('Select an option', ...(ngDevMode ? [{ debugName: "placeholder" }] : []));
|
|
641
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type: SelectValue, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
642
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.2.3", type: SelectValue, isStandalone: true, selector: "b-select-value", inputs: { placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `{{ content() || placeholder() }}`, isInline: true });
|
|
643
|
+
}
|
|
644
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type: SelectValue, decorators: [{
|
|
645
|
+
type: Component,
|
|
646
|
+
args: [{
|
|
647
|
+
selector: 'b-select-value',
|
|
648
|
+
template: `{{ content() || placeholder() }}`,
|
|
649
|
+
}]
|
|
650
|
+
}] });
|
|
651
|
+
|
|
652
|
+
/**
|
|
653
|
+
* Component representing the content of a select dropdown.
|
|
654
|
+
* Manages the list of options and their selection state.
|
|
655
|
+
*/
|
|
656
|
+
class SelectContent {
|
|
820
657
|
/**
|
|
821
|
-
*
|
|
822
|
-
* When disabled, the dropdown cannot be opened or interacted with.
|
|
658
|
+
* Reference to the host element of the component.
|
|
823
659
|
*/
|
|
824
|
-
|
|
660
|
+
el = inject(ElementRef);
|
|
825
661
|
/**
|
|
826
|
-
*
|
|
827
|
-
* This retrieves the `multiple` property from the `OptionsListComponent`.
|
|
662
|
+
* Reference to the CDK Listbox directive.
|
|
828
663
|
*/
|
|
829
|
-
|
|
664
|
+
listBox = inject(CdkListbox);
|
|
830
665
|
/**
|
|
831
|
-
*
|
|
832
|
-
* This retrieves the options from the `OptionsListComponent`.
|
|
666
|
+
* Collection of CdkOption elements within the listbox.
|
|
833
667
|
*/
|
|
834
|
-
options =
|
|
668
|
+
options = contentChildren(CdkOption, ...(ngDevMode ? [{ debugName: "options" }] : []));
|
|
835
669
|
/**
|
|
836
|
-
*
|
|
837
|
-
* If no option is selected, it returns the placeholder text.
|
|
670
|
+
* Key manager for handling keyboard navigation and active descendant management.
|
|
838
671
|
*/
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
selected.length > 0 &&
|
|
843
|
-
!(selected.length === 1 && selected[0] === '')) {
|
|
844
|
-
return this.options()?.reduce((acc, option) => {
|
|
845
|
-
if (selected.includes(option.cdkOption.value)) {
|
|
846
|
-
return acc
|
|
847
|
-
? acc + ', ' + option.el.nativeElement.innerText
|
|
848
|
-
: option.el.nativeElement.innerText;
|
|
849
|
-
}
|
|
850
|
-
return acc;
|
|
851
|
-
}, '');
|
|
852
|
-
}
|
|
853
|
-
else {
|
|
854
|
-
return this.placeholder();
|
|
855
|
-
}
|
|
856
|
-
}, ...(ngDevMode ? [{ debugName: "content" }] : []));
|
|
672
|
+
listKeyManager = computed(() => new ActiveDescendantKeyManager(this.options())
|
|
673
|
+
.withWrap()
|
|
674
|
+
.withVerticalOrientation(), ...(ngDevMode ? [{ debugName: "listKeyManager" }] : []));
|
|
857
675
|
/**
|
|
858
|
-
*
|
|
859
|
-
* This is used to provide a smooth transition when closing the dropdown.
|
|
676
|
+
* Event emitter that emits when the value changes.
|
|
860
677
|
*/
|
|
861
|
-
|
|
678
|
+
changeValueEmitter = output();
|
|
862
679
|
/**
|
|
863
|
-
*
|
|
864
|
-
* It sets up the necessary subscriptions for handling value changes.
|
|
680
|
+
* Input signal indicating whether multiple selections are allowed.
|
|
865
681
|
*/
|
|
866
|
-
|
|
867
|
-
this.handleSelectedValueChange();
|
|
868
|
-
}
|
|
682
|
+
multiple = model(false, ...(ngDevMode ? [{ debugName: "multiple" }] : []));
|
|
869
683
|
/**
|
|
870
|
-
*
|
|
871
|
-
* changes to the selected value. This ensures the dropdown closes and the
|
|
872
|
-
* value is propagated to Angular Forms.
|
|
684
|
+
* Reference to the ConnectedOverlay to determine the direction of the overlay.
|
|
873
685
|
*/
|
|
874
|
-
|
|
875
|
-
this.optionsList()?.closeEmitter.subscribe(() => {
|
|
876
|
-
this.onChange(this.value());
|
|
877
|
-
this.onTouched();
|
|
878
|
-
this.isOpen.set(false);
|
|
879
|
-
});
|
|
880
|
-
}
|
|
686
|
+
overlay = inject(ConnectedOverlay$1);
|
|
881
687
|
/**
|
|
882
|
-
*
|
|
688
|
+
* Computed signal representing the direction of the overlay.
|
|
883
689
|
*/
|
|
884
|
-
|
|
885
|
-
this.buttonWidth.set(this.button()?.el.nativeElement.offsetWidth);
|
|
886
|
-
this.optionsList()?.el.nativeElement.focus();
|
|
887
|
-
}
|
|
690
|
+
direction = computed(() => this.overlay.direction(), ...(ngDevMode ? [{ debugName: "direction" }] : []));
|
|
888
691
|
/**
|
|
889
|
-
*
|
|
890
|
-
*
|
|
692
|
+
* Lifecycle hook that initializes the component.
|
|
693
|
+
* Enables the use of active descendant for the listbox.
|
|
891
694
|
*/
|
|
892
|
-
|
|
893
|
-
this.
|
|
695
|
+
ngOnInit() {
|
|
696
|
+
this.listBox.useActiveDescendant = true;
|
|
894
697
|
}
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
698
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type: SelectContent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
699
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "20.2.3", type: SelectContent, isStandalone: true, selector: "ul[b-select-content]", inputs: { multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { changeValueEmitter: "changeValueEmitter", multiple: "multipleChange" }, host: { listeners: { "cdkListboxValueChange": "changeValueEmitter.emit($event.value)" }, properties: { "animate.enter": "\"b-select-content-entering-\" + this.direction()", "animate.leave": "\"b-select-content-leaving-\" + this.direction()" } }, queries: [{ propertyName: "options", predicate: CdkOption, isSignal: true }], hostDirectives: [{ directive: i1$1.CdkListbox, inputs: ["cdkListboxMultiple", "multiple"], outputs: ["cdkListboxValueChange", "cdkListboxValueChange"] }], ngImport: i0, template: `<ng-content />`, isInline: true });
|
|
700
|
+
}
|
|
701
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type: SelectContent, decorators: [{
|
|
702
|
+
type: Component,
|
|
703
|
+
args: [{
|
|
704
|
+
selector: 'ul[b-select-content]',
|
|
705
|
+
imports: [],
|
|
706
|
+
template: `<ng-content />`,
|
|
707
|
+
hostDirectives: [
|
|
708
|
+
{
|
|
709
|
+
directive: CdkListbox,
|
|
710
|
+
inputs: ['cdkListboxMultiple: multiple'],
|
|
711
|
+
outputs: ['cdkListboxValueChange'],
|
|
712
|
+
},
|
|
713
|
+
],
|
|
714
|
+
host: {
|
|
715
|
+
'(cdkListboxValueChange)': 'changeValueEmitter.emit($event.value)',
|
|
716
|
+
'[animate.enter]': '"b-select-content-entering-" + this.direction()',
|
|
717
|
+
'[animate.leave]': '"b-select-content-leaving-" + this.direction()',
|
|
718
|
+
},
|
|
719
|
+
}]
|
|
720
|
+
}] });
|
|
721
|
+
|
|
722
|
+
/**
|
|
723
|
+
* Select component that provides a customizable dropdown selection interface.
|
|
724
|
+
* Implements ControlValueAccessor for form integration.
|
|
725
|
+
*/
|
|
726
|
+
class Select {
|
|
727
|
+
/**
|
|
728
|
+
* Reference to the overlay directive instance.
|
|
729
|
+
* Used to control the dropdown overlay for the select component.
|
|
730
|
+
*/
|
|
731
|
+
overlay = contentChild(ConnectedOverlay, ...(ngDevMode ? [{ debugName: "overlay" }] : []));
|
|
732
|
+
/**
|
|
733
|
+
* Reference to the select trigger component.
|
|
734
|
+
* Used to handle trigger events (click, keydown) for opening/closing the select.
|
|
735
|
+
*/
|
|
736
|
+
selectTrigger = contentChild(SelectTrigger, ...(ngDevMode ? [{ debugName: "selectTrigger" }] : []));
|
|
737
|
+
/**
|
|
738
|
+
* Reference to the select value component.
|
|
739
|
+
* Used to display the selected value(s).
|
|
740
|
+
*/
|
|
741
|
+
selectValue = contentChild(SelectValue, ...(ngDevMode ? [{ debugName: "selectValue" }] : []));
|
|
742
|
+
/**
|
|
743
|
+
* Reference to the select content component.
|
|
744
|
+
* Used to manage the list of selectable options.
|
|
745
|
+
*/
|
|
746
|
+
selectContent = contentChild(SelectContent, ...(ngDevMode ? [{ debugName: "selectContent" }] : []));
|
|
747
|
+
/**
|
|
748
|
+
* Input signal for the size of the select component.
|
|
749
|
+
* Can be 'sm', 'md', or 'lg'. Default is 'md'.
|
|
750
|
+
*/
|
|
751
|
+
size = input('md', ...(ngDevMode ? [{ debugName: "size" }] : []));
|
|
752
|
+
/**
|
|
753
|
+
* Input signal for a function to display the selected value(s).
|
|
754
|
+
* This function receives the value array and returns a string for display.
|
|
755
|
+
*/
|
|
756
|
+
displayWith = input.required(...(ngDevMode ? [{ debugName: "displayWith" }] : []));
|
|
757
|
+
/**
|
|
758
|
+
* Signal holding the current selected value(s).
|
|
759
|
+
*/
|
|
760
|
+
value = signal([], ...(ngDevMode ? [{ debugName: "value" }] : []));
|
|
761
|
+
/**
|
|
762
|
+
* Initializes effects for value changes and content width adjustment.
|
|
763
|
+
*/
|
|
764
|
+
constructor() {
|
|
765
|
+
effect(() => {
|
|
766
|
+
this.handleValueChanges();
|
|
767
|
+
this.handleSelectContentWidth();
|
|
768
|
+
});
|
|
769
|
+
}
|
|
770
|
+
/**
|
|
771
|
+
* Subscribes to value changes from the select content and updates the model.
|
|
772
|
+
* Closes the overlay if not in multiple selection mode.
|
|
773
|
+
*/
|
|
774
|
+
handleValueChanges() {
|
|
775
|
+
this.selectContent()?.changeValueEmitter.subscribe((value) => {
|
|
776
|
+
this.onChange(value);
|
|
777
|
+
if (!this.selectContent()?.listBox.multiple) {
|
|
778
|
+
this.overlay()?.closeOverlay();
|
|
779
|
+
}
|
|
780
|
+
this.onTouched();
|
|
781
|
+
});
|
|
782
|
+
}
|
|
783
|
+
/**
|
|
784
|
+
* Sets the minimum width of the select content to match the trigger width.
|
|
785
|
+
*/
|
|
786
|
+
handleSelectContentWidth() {
|
|
787
|
+
const selectContentEl = this.selectContent()?.el.nativeElement;
|
|
788
|
+
if (selectContentEl) {
|
|
789
|
+
selectContentEl.style.minWidth = `${this.selectTrigger()?.el.nativeElement.offsetWidth}px`;
|
|
914
790
|
}
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
791
|
+
}
|
|
792
|
+
/**
|
|
793
|
+
* Angular lifecycle hook. Sets up event handlers for overlay and trigger interactions.
|
|
794
|
+
*/
|
|
795
|
+
ngOnInit() {
|
|
796
|
+
this.handleTriggerClicks();
|
|
797
|
+
this.handleOverlayAttached();
|
|
798
|
+
this.handleOverlayDetached();
|
|
799
|
+
this.handleOverlayOutsideClick();
|
|
800
|
+
this.handleOverlayBackdropClick();
|
|
801
|
+
this.handlePanelSizeClass();
|
|
802
|
+
}
|
|
803
|
+
/**
|
|
804
|
+
* Handles clicks and keydown events on the select trigger to toggle the overlay.
|
|
805
|
+
*/
|
|
806
|
+
handleTriggerClicks() {
|
|
807
|
+
this.selectTrigger().buttonClicked.subscribe(() => {
|
|
808
|
+
this.overlay()?.toggleOverlay();
|
|
809
|
+
});
|
|
810
|
+
}
|
|
811
|
+
/**
|
|
812
|
+
* Handles overlay attachment event. Selects current values and focuses the content.
|
|
813
|
+
*/
|
|
814
|
+
handleOverlayAttached() {
|
|
815
|
+
this.overlay()?.attachEmitter.subscribe(() => {
|
|
816
|
+
if (this.value().length === 0) {
|
|
817
|
+
this.selectContent()?.el.nativeElement.focus();
|
|
818
|
+
return;
|
|
819
|
+
}
|
|
820
|
+
this.value().forEach(val => {
|
|
821
|
+
this.selectContent()?.listBox?.selectValue(val);
|
|
822
|
+
// Focus the selected option
|
|
823
|
+
this.selectContent()
|
|
824
|
+
?.options()
|
|
825
|
+
.find(opt => opt.value === val)
|
|
826
|
+
?.focus();
|
|
923
827
|
});
|
|
924
|
-
|
|
925
|
-
|
|
828
|
+
});
|
|
829
|
+
}
|
|
830
|
+
/**
|
|
831
|
+
* Handles overlay detachment event. Closes the overlay.
|
|
832
|
+
*/
|
|
833
|
+
handleOverlayDetached() {
|
|
834
|
+
this.overlay()?.detachEmitter.subscribe(() => {
|
|
835
|
+
this.overlay()?.closeOverlay();
|
|
836
|
+
});
|
|
837
|
+
}
|
|
838
|
+
/**
|
|
839
|
+
* Handles outside click event on the overlay. Closes the overlay.
|
|
840
|
+
*/
|
|
841
|
+
handleOverlayOutsideClick() {
|
|
842
|
+
this.overlay()?.outsideClickEmitter.subscribe(() => {
|
|
843
|
+
this.overlay()?.closeOverlay();
|
|
844
|
+
});
|
|
845
|
+
}
|
|
846
|
+
/**
|
|
847
|
+
* Handles backdrop click event on the overlay. Closes the overlay.
|
|
848
|
+
*/
|
|
849
|
+
handleOverlayBackdropClick() {
|
|
850
|
+
this.overlay()?.backdropClickEmitter.subscribe(() => {
|
|
851
|
+
this.overlay()?.closeOverlay();
|
|
852
|
+
});
|
|
853
|
+
}
|
|
854
|
+
/**
|
|
855
|
+
* Sets the panel size class on the overlay based on the select size input.
|
|
856
|
+
*/
|
|
857
|
+
handlePanelSizeClass() {
|
|
858
|
+
this.overlay().cdkConnectedOverlay.panelClass = `b-size-${this.size()}`;
|
|
859
|
+
}
|
|
860
|
+
// Control value accessor methods
|
|
861
|
+
/**
|
|
862
|
+
* Writes a new value to the select component.
|
|
863
|
+
* @param value - The new value array to set.
|
|
864
|
+
*/
|
|
865
|
+
writeValue(value) {
|
|
866
|
+
this.setValue(value);
|
|
926
867
|
}
|
|
868
|
+
/**
|
|
869
|
+
* Callback for value changes. Set by registerOnChange.
|
|
870
|
+
*/
|
|
871
|
+
onChange = () => undefined;
|
|
927
872
|
/**
|
|
928
873
|
* Registers a callback function to be called when the value changes.
|
|
929
874
|
* @param fn - The callback function.
|
|
930
875
|
*/
|
|
931
876
|
registerOnChange(fn) {
|
|
932
877
|
this.onChange = (val) => {
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
}
|
|
936
|
-
else {
|
|
937
|
-
fn(val?.[0] ?? '');
|
|
938
|
-
}
|
|
878
|
+
fn(val);
|
|
879
|
+
this.setValue(val);
|
|
939
880
|
};
|
|
940
881
|
}
|
|
882
|
+
/**
|
|
883
|
+
* Callback for touch events. Set by registerOnTouched.
|
|
884
|
+
*/
|
|
885
|
+
onTouched = () => undefined;
|
|
941
886
|
/**
|
|
942
887
|
* Registers a callback function to be called when the component is touched.
|
|
943
888
|
* @param fn - The callback function.
|
|
@@ -946,116 +891,152 @@ class SelectComponent {
|
|
|
946
891
|
this.onTouched = fn;
|
|
947
892
|
}
|
|
948
893
|
/**
|
|
949
|
-
* Sets the disabled state of the
|
|
950
|
-
*
|
|
951
|
-
* @param isDisabled - A boolean indicating whether the component should be disabled.
|
|
894
|
+
* Sets the disabled state of the select trigger.
|
|
895
|
+
* @param isDisabled - Whether the select should be disabled.
|
|
952
896
|
*/
|
|
953
897
|
setDisabledState(isDisabled) {
|
|
954
|
-
this.disabled.set(isDisabled);
|
|
898
|
+
this.selectTrigger()?.disabled.set(isDisabled);
|
|
899
|
+
}
|
|
900
|
+
/**
|
|
901
|
+
* Sets the value signal and updates the display value.
|
|
902
|
+
* @param value - The new value array to set.
|
|
903
|
+
*/
|
|
904
|
+
setValue(value) {
|
|
905
|
+
this.value.set(value);
|
|
906
|
+
this.selectValue()?.content.set(this.displayWith()(value));
|
|
955
907
|
}
|
|
956
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type:
|
|
957
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "20.2.3", type:
|
|
908
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type: Select, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
909
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "20.2.3", type: Select, isStandalone: true, selector: "b-select", inputs: { size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, displayWith: { classPropertyName: "displayWith", publicName: "displayWith", isSignal: true, isRequired: true, transformFunction: null } }, host: { properties: { "class.b-size-sm": "size() === \"sm\"", "class.b-size-md": "size() === \"md\"", "class.b-size-lg": "size() === \"lg\"" } }, providers: [
|
|
958
910
|
{
|
|
959
911
|
provide: NG_VALUE_ACCESSOR,
|
|
960
|
-
useExisting: forwardRef(() =>
|
|
912
|
+
useExisting: forwardRef(() => Select),
|
|
961
913
|
multi: true,
|
|
962
914
|
},
|
|
963
|
-
], queries: [{ propertyName: "
|
|
964
|
-
b-button
|
|
965
|
-
variant="outlined"
|
|
966
|
-
(click)="isOpen.set(!isOpen())"
|
|
967
|
-
(keydown.arrowUp)="!isOpen() && isOpen.set(true)"
|
|
968
|
-
(keydown.arrowDown)="!isOpen() && isOpen.set(true)"
|
|
969
|
-
[activeEnabled]="false"
|
|
970
|
-
bOverlayTrigger
|
|
971
|
-
#trigger="bOverlayTrigger"
|
|
972
|
-
[disabled]="disabled()">
|
|
973
|
-
<span>{{ content() }}</span>
|
|
974
|
-
<i b-icon icon="ChevronDown" [size]="16"></i>
|
|
975
|
-
</button>
|
|
976
|
-
<ng-template
|
|
977
|
-
bOverlay
|
|
978
|
-
[trigger]="trigger"
|
|
979
|
-
[open]="isOpen()"
|
|
980
|
-
[minWidth]="buttonWidth()"
|
|
981
|
-
[positions]="['bottom-left', 'bottom-right', 'top-left', 'top-right']"
|
|
982
|
-
[closeDelay]="closeDelay()"
|
|
983
|
-
(attach)="onOverlayAttached()"
|
|
984
|
-
(outsideClick)="isOpen.set(false)"
|
|
985
|
-
(detach)="isOpen.set(false)">
|
|
986
|
-
<ng-content />
|
|
987
|
-
</ng-template>`, isInline: true, dependencies: [{ kind: "component", type: ButtonComponent, selector: "button[b-button]", inputs: ["variant", "size", "activeEnabled", "squared"] }, { kind: "component", type: IconComponent, selector: "i[b-icon]", inputs: ["icon", "size", "strokeWidth", "color"] }, { kind: "directive", type: OverlayTriggerDirective, selector: "[bOverlayTrigger]", exportAs: ["bOverlayTrigger"] }, { kind: "directive", type: OverlayDirective, selector: "[bOverlay]", inputs: ["open", "trigger", "closeDelay", "positions"] }] });
|
|
915
|
+
], queries: [{ propertyName: "overlay", first: true, predicate: ConnectedOverlay, descendants: true, isSignal: true }, { propertyName: "selectTrigger", first: true, predicate: SelectTrigger, descendants: true, isSignal: true }, { propertyName: "selectValue", first: true, predicate: SelectValue, descendants: true, isSignal: true }, { propertyName: "selectContent", first: true, predicate: SelectContent, descendants: true, isSignal: true }], ngImport: i0, template: `<ng-content />`, isInline: true });
|
|
988
916
|
}
|
|
989
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type:
|
|
917
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type: Select, decorators: [{
|
|
990
918
|
type: Component,
|
|
991
919
|
args: [{
|
|
992
920
|
selector: 'b-select',
|
|
993
|
-
|
|
994
|
-
ButtonComponent,
|
|
995
|
-
IconComponent,
|
|
996
|
-
OverlayTriggerDirective,
|
|
997
|
-
OverlayDirective,
|
|
998
|
-
],
|
|
999
|
-
template: ` <button
|
|
1000
|
-
b-button
|
|
1001
|
-
variant="outlined"
|
|
1002
|
-
(click)="isOpen.set(!isOpen())"
|
|
1003
|
-
(keydown.arrowUp)="!isOpen() && isOpen.set(true)"
|
|
1004
|
-
(keydown.arrowDown)="!isOpen() && isOpen.set(true)"
|
|
1005
|
-
[activeEnabled]="false"
|
|
1006
|
-
bOverlayTrigger
|
|
1007
|
-
#trigger="bOverlayTrigger"
|
|
1008
|
-
[disabled]="disabled()">
|
|
1009
|
-
<span>{{ content() }}</span>
|
|
1010
|
-
<i b-icon icon="ChevronDown" [size]="16"></i>
|
|
1011
|
-
</button>
|
|
1012
|
-
<ng-template
|
|
1013
|
-
bOverlay
|
|
1014
|
-
[trigger]="trigger"
|
|
1015
|
-
[open]="isOpen()"
|
|
1016
|
-
[minWidth]="buttonWidth()"
|
|
1017
|
-
[positions]="['bottom-left', 'bottom-right', 'top-left', 'top-right']"
|
|
1018
|
-
[closeDelay]="closeDelay()"
|
|
1019
|
-
(attach)="onOverlayAttached()"
|
|
1020
|
-
(outsideClick)="isOpen.set(false)"
|
|
1021
|
-
(detach)="isOpen.set(false)">
|
|
1022
|
-
<ng-content />
|
|
1023
|
-
</ng-template>`,
|
|
921
|
+
template: `<ng-content />`,
|
|
1024
922
|
providers: [
|
|
1025
923
|
{
|
|
1026
924
|
provide: NG_VALUE_ACCESSOR,
|
|
1027
|
-
useExisting: forwardRef(() =>
|
|
925
|
+
useExisting: forwardRef(() => Select),
|
|
1028
926
|
multi: true,
|
|
1029
927
|
},
|
|
1030
928
|
],
|
|
929
|
+
host: {
|
|
930
|
+
'[class.b-size-sm]': 'size() === "sm"',
|
|
931
|
+
'[class.b-size-md]': 'size() === "md"',
|
|
932
|
+
'[class.b-size-lg]': 'size() === "lg"',
|
|
933
|
+
},
|
|
1031
934
|
}]
|
|
1032
|
-
}],
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
935
|
+
}], ctorParameters: () => [] });
|
|
936
|
+
|
|
937
|
+
/**
|
|
938
|
+
* Component representing an individual option in a select or combobox.
|
|
939
|
+
* This component integrates with Angular CDK Option to manage the option's state and behavior.
|
|
940
|
+
*/
|
|
941
|
+
class Option {
|
|
942
|
+
/**
|
|
943
|
+
* The `ElementRef` of the option.
|
|
944
|
+
* This provides direct access to the DOM element of the option.
|
|
945
|
+
*/
|
|
946
|
+
el = inject(ElementRef);
|
|
947
|
+
/**
|
|
948
|
+
* The `CdkOption` instance associated with this option.
|
|
949
|
+
* This provides methods and properties for managing the option's state, such as selection and value.
|
|
950
|
+
*/
|
|
951
|
+
cdkOption = inject(CdkOption);
|
|
952
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type: Option, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
953
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.2.3", type: Option, isStandalone: true, selector: "li[b-option]", hostDirectives: [{ directive: i1$1.CdkOption, inputs: ["cdkOption", "value", "cdkOptionDisabled", "disabled"] }], ngImport: i0, template: `<ng-content />`, isInline: true });
|
|
954
|
+
}
|
|
955
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type: Option, decorators: [{
|
|
956
|
+
type: Component,
|
|
957
|
+
args: [{
|
|
958
|
+
selector: 'li[b-option]',
|
|
959
|
+
imports: [],
|
|
960
|
+
template: `<ng-content />`,
|
|
961
|
+
hostDirectives: [
|
|
962
|
+
{
|
|
963
|
+
directive: CdkOption,
|
|
964
|
+
inputs: ['cdkOption: value', 'cdkOptionDisabled: disabled'],
|
|
965
|
+
},
|
|
966
|
+
],
|
|
967
|
+
}]
|
|
968
|
+
}] });
|
|
1036
969
|
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
970
|
+
/**
|
|
971
|
+
* Spinner component for loading indicators.
|
|
972
|
+
*
|
|
973
|
+
* Displays an animated spinner SVG. The size can be adjusted for use in buttons or standalone.
|
|
974
|
+
*/
|
|
975
|
+
class Spinner {
|
|
976
|
+
/**
|
|
977
|
+
* Size of the spinner.
|
|
978
|
+
*
|
|
979
|
+
* - 'sm': Small (for compact UI, e.g. inside buttons)
|
|
980
|
+
* - 'md': Medium (default)
|
|
981
|
+
* - 'lg': Large (for standalone loading indicators)
|
|
982
|
+
*
|
|
983
|
+
* @default 'md'
|
|
984
|
+
*/
|
|
985
|
+
size = input('md', ...(ngDevMode ? [{ debugName: "size" }] : []));
|
|
986
|
+
/**
|
|
987
|
+
* Computed size in pixels based on the size input.
|
|
988
|
+
* - 'sm': 16px
|
|
989
|
+
* - 'md': 20px
|
|
990
|
+
* - 'lg': 28px
|
|
991
|
+
*/
|
|
992
|
+
sizeInPx = computed(() => {
|
|
993
|
+
switch (this.size()) {
|
|
994
|
+
case 'sm':
|
|
995
|
+
return 16;
|
|
996
|
+
case 'md':
|
|
997
|
+
return 20;
|
|
998
|
+
case 'lg':
|
|
999
|
+
return 28;
|
|
1000
|
+
default:
|
|
1001
|
+
return 20;
|
|
1002
|
+
}
|
|
1003
|
+
}, ...(ngDevMode ? [{ debugName: "sizeInPx" }] : []));
|
|
1004
|
+
/**
|
|
1005
|
+
* Type of spinner: 'bars' (default) or 'circle'.
|
|
1006
|
+
*
|
|
1007
|
+
* - 'bars': classic spinner with bars
|
|
1008
|
+
* - 'circle': circular spinner
|
|
1009
|
+
*
|
|
1010
|
+
* @default 'bars'
|
|
1011
|
+
*/
|
|
1012
|
+
type = input('bars', ...(ngDevMode ? [{ debugName: "type" }] : []));
|
|
1013
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type: Spinner, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1014
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.2.3", type: Spinner, isStandalone: true, selector: "b-spinner", inputs: { size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null } }, providers: [provideIcons({ lucideLoader, lucideLoaderCircle })], ngImport: i0, template: `
|
|
1015
|
+
<ng-icon
|
|
1016
|
+
[name]="type() === 'bars' ? 'lucideLoader' : 'lucideLoaderCircle'"
|
|
1017
|
+
color="currentColor"
|
|
1018
|
+
[size]="sizeInPx() + 'px'" />
|
|
1019
|
+
`, isInline: true, styles: [":host{animation:b-spinner-rotate 1s linear infinite}@keyframes b-spinner-rotate{0%{transform:rotate(0)}to{transform:rotate(360deg)}}\n"], dependencies: [{ kind: "component", type: NgIcon, selector: "ng-icon", inputs: ["name", "svg", "size", "strokeWidth", "color"] }] });
|
|
1044
1020
|
}
|
|
1045
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type:
|
|
1021
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type: Spinner, decorators: [{
|
|
1046
1022
|
type: Component,
|
|
1047
|
-
args: [{ selector: 'b-spinner', imports: [
|
|
1023
|
+
args: [{ selector: 'b-spinner', imports: [NgIcon], providers: [provideIcons({ lucideLoader, lucideLoaderCircle })], template: `
|
|
1024
|
+
<ng-icon
|
|
1025
|
+
[name]="type() === 'bars' ? 'lucideLoader' : 'lucideLoaderCircle'"
|
|
1026
|
+
color="currentColor"
|
|
1027
|
+
[size]="sizeInPx() + 'px'" />
|
|
1028
|
+
`, styles: [":host{animation:b-spinner-rotate 1s linear infinite}@keyframes b-spinner-rotate{0%{transform:rotate(0)}to{transform:rotate(360deg)}}\n"] }]
|
|
1048
1029
|
}] });
|
|
1049
1030
|
|
|
1050
1031
|
class SwitchComponent {
|
|
1051
1032
|
/**
|
|
1052
1033
|
* Value of the switch.
|
|
1053
1034
|
*/
|
|
1054
|
-
value =
|
|
1035
|
+
value = signal(false, ...(ngDevMode ? [{ debugName: "value" }] : []));
|
|
1055
1036
|
/**
|
|
1056
1037
|
* The size of the switch.
|
|
1057
1038
|
*/
|
|
1058
|
-
size = input('
|
|
1039
|
+
size = input('md', ...(ngDevMode ? [{ debugName: "size" }] : []));
|
|
1059
1040
|
/**
|
|
1060
1041
|
* Reference to the switch element.
|
|
1061
1042
|
*/
|
|
@@ -1087,7 +1068,7 @@ class SwitchComponent {
|
|
|
1087
1068
|
this.valueChange.emit(newValue);
|
|
1088
1069
|
}
|
|
1089
1070
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type: SwitchComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1090
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.2.3", type: SwitchComponent, isStandalone: true, selector: "input[b-switch]", inputs: {
|
|
1071
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.2.3", type: SwitchComponent, isStandalone: true, selector: "input[b-switch]", inputs: { size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { valueChange: "valueChange" }, host: { listeners: { "click": "toggleValue()", "keydown.enter": "toggleValue()", "keydown.arrowleft": "setValue(false)", "keydown.arrowright": "setValue(true)" }, properties: { "attr.role": "switch", "attr.checked": "value()", "attr.aria-checked": "value()", "class.b-size-sm": "size() === \"sm\"", "class.b-size-md": "size() === \"md\"", "class.b-size-lg": "size() === \"lg\"" } }, ngImport: i0, template: ``, isInline: true });
|
|
1091
1072
|
}
|
|
1092
1073
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type: SwitchComponent, decorators: [{
|
|
1093
1074
|
type: Component,
|
|
@@ -1099,7 +1080,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.3", ngImpor
|
|
|
1099
1080
|
'[attr.checked]': 'value()',
|
|
1100
1081
|
'[attr.aria-checked]': 'value()',
|
|
1101
1082
|
'(click)': 'toggleValue()',
|
|
1102
|
-
'[class]': 'size()',
|
|
1083
|
+
'[class.b-size-sm]': 'size() === "sm"',
|
|
1084
|
+
'[class.b-size-md]': 'size() === "md"',
|
|
1085
|
+
'[class.b-size-lg]': 'size() === "lg"',
|
|
1103
1086
|
'(keydown.enter)': 'toggleValue()',
|
|
1104
1087
|
'(keydown.arrowleft)': 'setValue(false)',
|
|
1105
1088
|
'(keydown.arrowright)': 'setValue(true)',
|
|
@@ -1147,15 +1130,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.3", ngImpor
|
|
|
1147
1130
|
args: [{ selector: 'b-row-item', imports: [NgStyle], template: "<div [ngStyle]=\"style()\" class=\"row-item-container\">\n <ng-content />\n</div>\n" }]
|
|
1148
1131
|
}] });
|
|
1149
1132
|
|
|
1150
|
-
class
|
|
1133
|
+
class Tab {
|
|
1151
1134
|
/**
|
|
1152
1135
|
* Reference to the injected CDK Option instance.
|
|
1153
1136
|
*/
|
|
1154
1137
|
cdkOption = inject(CdkOption);
|
|
1155
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type:
|
|
1156
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.2.3", type:
|
|
1138
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type: Tab, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1139
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.2.3", type: Tab, isStandalone: true, selector: "b-tab", hostDirectives: [{ directive: i1$1.CdkOption, inputs: ["cdkOption", "value"] }], ngImport: i0, template: `<ng-content />`, isInline: true });
|
|
1157
1140
|
}
|
|
1158
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type:
|
|
1141
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type: Tab, decorators: [{
|
|
1159
1142
|
type: Component,
|
|
1160
1143
|
args: [{
|
|
1161
1144
|
selector: 'b-tab',
|
|
@@ -1170,15 +1153,21 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.3", ngImpor
|
|
|
1170
1153
|
}]
|
|
1171
1154
|
}] });
|
|
1172
1155
|
|
|
1173
|
-
class
|
|
1156
|
+
class Tabs {
|
|
1174
1157
|
/**
|
|
1175
1158
|
* Reference to the injected CDK Listbox instance.
|
|
1176
1159
|
*/
|
|
1177
1160
|
cdkListbox = inject(CdkListbox);
|
|
1161
|
+
/**
|
|
1162
|
+
* The size of the tabs.
|
|
1163
|
+
*
|
|
1164
|
+
* @defaultValue 'md'
|
|
1165
|
+
*/
|
|
1166
|
+
size = input('md', ...(ngDevMode ? [{ debugName: "size" }] : []));
|
|
1178
1167
|
/**
|
|
1179
1168
|
* Collection of child options within the listbox.
|
|
1180
1169
|
*/
|
|
1181
|
-
tabs = contentChildren(
|
|
1170
|
+
tabs = contentChildren(Tab, ...(ngDevMode ? [{ debugName: "tabs" }] : []));
|
|
1182
1171
|
/**
|
|
1183
1172
|
* Collection of cdk options within the listbox.
|
|
1184
1173
|
*/
|
|
@@ -1199,10 +1188,10 @@ class TabsComponent {
|
|
|
1199
1188
|
this.cdkListbox.useActiveDescendant = true;
|
|
1200
1189
|
this.cdkListbox.orientation = 'horizontal';
|
|
1201
1190
|
}
|
|
1202
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type:
|
|
1203
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "20.2.3", type:
|
|
1191
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type: Tabs, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1192
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "20.2.3", type: Tabs, isStandalone: true, selector: "b-tabs", inputs: { size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "keydown.arrowLeft": "previousTab()", "keydown.arrowUp": "previousTab()", "keydown.arrowRight": "nextTab()", "keydown.arrowDown": "nextTab()" }, properties: { "class.b-size-sm": "size() === \"sm\"", "class.b-size-md": "size() === \"md\"", "class.b-size-lg": "size() === \"lg\"" } }, queries: [{ propertyName: "tabs", predicate: Tab, isSignal: true }], hostDirectives: [{ directive: i1$1.CdkListbox }], ngImport: i0, template: `<ng-content />`, isInline: true });
|
|
1204
1193
|
}
|
|
1205
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type:
|
|
1194
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type: Tabs, decorators: [{
|
|
1206
1195
|
type: Component,
|
|
1207
1196
|
args: [{
|
|
1208
1197
|
selector: 'b-tabs',
|
|
@@ -1210,6 +1199,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.3", ngImpor
|
|
|
1210
1199
|
template: `<ng-content />`,
|
|
1211
1200
|
hostDirectives: [CdkListbox],
|
|
1212
1201
|
host: {
|
|
1202
|
+
'[class.b-size-sm]': 'size() === "sm"',
|
|
1203
|
+
'[class.b-size-md]': 'size() === "md"',
|
|
1204
|
+
'[class.b-size-lg]': 'size() === "lg"',
|
|
1213
1205
|
'(keydown.arrowLeft)': 'previousTab()',
|
|
1214
1206
|
'(keydown.arrowUp)': 'previousTab()',
|
|
1215
1207
|
'(keydown.arrowRight)': 'nextTab()',
|
|
@@ -1218,87 +1210,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.3", ngImpor
|
|
|
1218
1210
|
}]
|
|
1219
1211
|
}] });
|
|
1220
1212
|
|
|
1221
|
-
class InViewportService {
|
|
1222
|
-
elements = signal({}, ...(ngDevMode ? [{ debugName: "elements" }] : []));
|
|
1223
|
-
observer;
|
|
1224
|
-
/**
|
|
1225
|
-
* Register an element to be tracked by the service.
|
|
1226
|
-
* @param {string} id - The id of the element to register.
|
|
1227
|
-
*/
|
|
1228
|
-
registerElement(id, nativeElement, initialVisibility) {
|
|
1229
|
-
if (!(id in this.elements())) {
|
|
1230
|
-
this.elements.set({ ...this.elements(), [id]: initialVisibility });
|
|
1231
|
-
// Create an IntersectionObserver to track the element's visibility.
|
|
1232
|
-
this.observer = new IntersectionObserver(entries => {
|
|
1233
|
-
entries.forEach(entry => {
|
|
1234
|
-
const isVisible = entry.isIntersecting;
|
|
1235
|
-
this.updateElementVisibility(id, isVisible);
|
|
1236
|
-
});
|
|
1237
|
-
});
|
|
1238
|
-
// Start observing the element.
|
|
1239
|
-
this.observer.observe(nativeElement);
|
|
1240
|
-
}
|
|
1241
|
-
}
|
|
1242
|
-
/**
|
|
1243
|
-
* Unregister an element from being tracked by the service.
|
|
1244
|
-
* @param {string} id - The id of the element to unregister.
|
|
1245
|
-
*/
|
|
1246
|
-
unregisterElement(id) {
|
|
1247
|
-
if (id in this.elements()) {
|
|
1248
|
-
delete this.elements()[id];
|
|
1249
|
-
this.observer.disconnect();
|
|
1250
|
-
}
|
|
1251
|
-
}
|
|
1252
|
-
/**
|
|
1253
|
-
* Update the visibility of an element.
|
|
1254
|
-
* @param {string} id - The id of the element to update.
|
|
1255
|
-
* @param {boolean} isVisible - The new visibility state of the element.
|
|
1256
|
-
*/
|
|
1257
|
-
updateElementVisibility(id, isVisible) {
|
|
1258
|
-
this.elements.set({ ...this.elements(), [id]: isVisible });
|
|
1259
|
-
}
|
|
1260
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type: InViewportService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1261
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type: InViewportService, providedIn: 'root' });
|
|
1262
|
-
}
|
|
1263
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type: InViewportService, decorators: [{
|
|
1264
|
-
type: Injectable,
|
|
1265
|
-
args: [{
|
|
1266
|
-
providedIn: 'root',
|
|
1267
|
-
}]
|
|
1268
|
-
}] });
|
|
1269
|
-
|
|
1270
|
-
class InViewportDirective {
|
|
1271
|
-
inViewportId = input.required(...(ngDevMode ? [{ debugName: "inViewportId" }] : []));
|
|
1272
|
-
inViewportInitialVisibility = input(false, ...(ngDevMode ? [{ debugName: "inViewportInitialVisibility" }] : []));
|
|
1273
|
-
el = inject(ElementRef);
|
|
1274
|
-
inViewportService = inject(InViewportService);
|
|
1275
|
-
constructor() {
|
|
1276
|
-
afterNextRender({
|
|
1277
|
-
write: () => {
|
|
1278
|
-
this.inViewportService.registerElement(this.inViewportId(), this.el.nativeElement, this.inViewportInitialVisibility());
|
|
1279
|
-
},
|
|
1280
|
-
});
|
|
1281
|
-
}
|
|
1282
|
-
ngOnDestroy() {
|
|
1283
|
-
this.inViewportService.unregisterElement(this.inViewportId());
|
|
1284
|
-
}
|
|
1285
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type: InViewportDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
1286
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.2.3", type: InViewportDirective, isStandalone: true, selector: "[b-in-viewport]", inputs: { inViewportId: { classPropertyName: "inViewportId", publicName: "inViewportId", isSignal: true, isRequired: true, transformFunction: null }, inViewportInitialVisibility: { classPropertyName: "inViewportInitialVisibility", publicName: "inViewportInitialVisibility", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0 });
|
|
1287
|
-
}
|
|
1288
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type: InViewportDirective, decorators: [{
|
|
1289
|
-
type: Directive,
|
|
1290
|
-
args: [{
|
|
1291
|
-
selector: '[b-in-viewport]',
|
|
1292
|
-
}]
|
|
1293
|
-
}], ctorParameters: () => [] });
|
|
1294
|
-
|
|
1295
1213
|
/**
|
|
1296
1214
|
* A sliding sheet component that can be positioned on either side of the screen.
|
|
1297
1215
|
* The sheet slides in from the left or right edge and includes an overlay backdrop.
|
|
1298
1216
|
*
|
|
1299
1217
|
* @selector b-sheet
|
|
1300
1218
|
*/
|
|
1301
|
-
class
|
|
1219
|
+
class Sheet {
|
|
1302
1220
|
/**
|
|
1303
1221
|
* Indicates whether the sheet is open.
|
|
1304
1222
|
*/
|
|
@@ -1308,14 +1226,6 @@ class SheetComponent {
|
|
|
1308
1226
|
* Can be either 'left' or 'right'.
|
|
1309
1227
|
*/
|
|
1310
1228
|
side = input('right', ...(ngDevMode ? [{ debugName: "side" }] : []));
|
|
1311
|
-
/**
|
|
1312
|
-
* Specifies the width of the sheet.
|
|
1313
|
-
*/
|
|
1314
|
-
width = input('300px', ...(ngDevMode ? [{ debugName: "width" }] : []));
|
|
1315
|
-
/**
|
|
1316
|
-
* Computes whether the sheet is positioned on the left side.
|
|
1317
|
-
*/
|
|
1318
|
-
isLeft = computed(() => this.side() === 'left', ...(ngDevMode ? [{ debugName: "isLeft" }] : []));
|
|
1319
1229
|
/**
|
|
1320
1230
|
* Computes whether the sheet is positioned on the right side.
|
|
1321
1231
|
*/
|
|
@@ -1338,31 +1248,64 @@ class SheetComponent {
|
|
|
1338
1248
|
this.isOpen.set(false);
|
|
1339
1249
|
}
|
|
1340
1250
|
}
|
|
1341
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type:
|
|
1342
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.2.3", type:
|
|
1251
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type: Sheet, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1252
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.2.3", type: Sheet, isStandalone: true, selector: "b-sheet", inputs: { isOpen: { classPropertyName: "isOpen", publicName: "isOpen", isSignal: true, isRequired: false, transformFunction: null }, side: { classPropertyName: "side", publicName: "side", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { isOpen: "isOpenChange", closeSheet: "closeSheet" }, host: { listeners: { "document:click": "closeOnOutsideClick($event)" }, properties: { "class.left": "side() === \"left\"", "class.right": "side() === \"right\"", "class.open": "isOpen()" } }, ngImport: i0, template: `<button class="close-button" (click)="isOpen.set(false)">
|
|
1253
|
+
<svg
|
|
1254
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
1255
|
+
width="20"
|
|
1256
|
+
height="20"
|
|
1257
|
+
viewBox="0 0 24 24"
|
|
1258
|
+
fill="none"
|
|
1259
|
+
stroke="currentColor"
|
|
1260
|
+
stroke-width="0.094rem"
|
|
1261
|
+
stroke-linecap="round"
|
|
1262
|
+
stroke-linejoin="round"
|
|
1263
|
+
class="lucide lucide-x">
|
|
1264
|
+
<path d="M18 6 6 18" />
|
|
1265
|
+
<path d="m6 6 12 12" />
|
|
1266
|
+
</svg>
|
|
1267
|
+
</button>
|
|
1268
|
+
<ng-content /> `, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }] });
|
|
1343
1269
|
}
|
|
1344
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type:
|
|
1270
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type: Sheet, decorators: [{
|
|
1345
1271
|
type: Component,
|
|
1346
|
-
args: [{
|
|
1347
|
-
|
|
1348
|
-
|
|
1272
|
+
args: [{
|
|
1273
|
+
selector: 'b-sheet',
|
|
1274
|
+
standalone: true,
|
|
1275
|
+
imports: [CommonModule],
|
|
1276
|
+
template: `<button class="close-button" (click)="isOpen.set(false)">
|
|
1277
|
+
<svg
|
|
1278
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
1279
|
+
width="20"
|
|
1280
|
+
height="20"
|
|
1281
|
+
viewBox="0 0 24 24"
|
|
1282
|
+
fill="none"
|
|
1283
|
+
stroke="currentColor"
|
|
1284
|
+
stroke-width="0.094rem"
|
|
1285
|
+
stroke-linecap="round"
|
|
1286
|
+
stroke-linejoin="round"
|
|
1287
|
+
class="lucide lucide-x">
|
|
1288
|
+
<path d="M18 6 6 18" />
|
|
1289
|
+
<path d="m6 6 12 12" />
|
|
1290
|
+
</svg>
|
|
1291
|
+
</button>
|
|
1292
|
+
<ng-content /> `,
|
|
1293
|
+
host: {
|
|
1294
|
+
'[class.left]': 'side() === "left"',
|
|
1295
|
+
'[class.right]': 'side() === "right"',
|
|
1349
1296
|
'[class.open]': 'isOpen()',
|
|
1350
|
-
|
|
1351
|
-
|
|
1297
|
+
},
|
|
1298
|
+
}]
|
|
1352
1299
|
}], propDecorators: { closeOnOutsideClick: [{
|
|
1353
1300
|
type: HostListener,
|
|
1354
1301
|
args: ['document:click', ['$event']]
|
|
1355
1302
|
}] } });
|
|
1356
1303
|
|
|
1357
|
-
class
|
|
1304
|
+
class Drawer {
|
|
1358
1305
|
/**
|
|
1359
1306
|
* Indicates whether the drawer is open.
|
|
1360
1307
|
*/
|
|
1361
1308
|
isOpen = model(false, ...(ngDevMode ? [{ debugName: "isOpen" }] : []));
|
|
1362
|
-
/**
|
|
1363
|
-
* The height of the drawer.
|
|
1364
|
-
*/
|
|
1365
|
-
height = input('30dvh', ...(ngDevMode ? [{ debugName: "height" }] : []));
|
|
1366
1309
|
/**
|
|
1367
1310
|
* Event emitted when the drawer is closed.
|
|
1368
1311
|
*/
|
|
@@ -1452,13 +1395,12 @@ class DrawerComponent {
|
|
|
1452
1395
|
this.isOpen.set(true);
|
|
1453
1396
|
}
|
|
1454
1397
|
}
|
|
1455
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type:
|
|
1456
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.2.3", type:
|
|
1398
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type: Drawer, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1399
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.2.3", type: Drawer, isStandalone: true, selector: "b-drawer", inputs: { isOpen: { classPropertyName: "isOpen", publicName: "isOpen", isSignal: true, isRequired: false, transformFunction: null }, closeThreshold: { classPropertyName: "closeThreshold", publicName: "closeThreshold", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { isOpen: "isOpenChange", closeSheet: "closeSheet" }, host: { listeners: { "document:click": "closeOnOutsideClick($event)" }, properties: { "class.dragging": "isDragging()", "style.transform": "transform()", "class.open": "isOpen()" } }, ngImport: i0, template: "<div class=\"drag-section\" (pointerdown)=\"startDrag($event)\">\n <div class=\"drag-indicator\"></div>\n</div>\n<ng-content />\n", dependencies: [{ kind: "ngmodule", type: CommonModule }] });
|
|
1457
1400
|
}
|
|
1458
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type:
|
|
1401
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type: Drawer, decorators: [{
|
|
1459
1402
|
type: Component,
|
|
1460
1403
|
args: [{ selector: 'b-drawer', standalone: true, imports: [CommonModule], host: {
|
|
1461
|
-
'[style.height]': 'height()',
|
|
1462
1404
|
'[class.dragging]': 'isDragging()',
|
|
1463
1405
|
'[style.transform]': 'transform()',
|
|
1464
1406
|
'[class.open]': 'isOpen()',
|
|
@@ -1475,9 +1417,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.3", ngImpor
|
|
|
1475
1417
|
class ResponsiveService {
|
|
1476
1418
|
/** Signal that holds the breakpoint configuration */
|
|
1477
1419
|
breakpoints = signal({
|
|
1478
|
-
mobile:
|
|
1479
|
-
tablet:
|
|
1480
|
-
desktop:
|
|
1420
|
+
mobile: 640,
|
|
1421
|
+
tablet: 1024,
|
|
1422
|
+
desktop: 1280,
|
|
1481
1423
|
}, ...(ngDevMode ? [{ debugName: "breakpoints" }] : []));
|
|
1482
1424
|
/** Signal that holds the current window width */
|
|
1483
1425
|
windowWidth = signal(0, ...(ngDevMode ? [{ debugName: "windowWidth" }] : []));
|
|
@@ -1553,14 +1495,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.3", ngImpor
|
|
|
1553
1495
|
* </b-otp>
|
|
1554
1496
|
*/
|
|
1555
1497
|
/**
|
|
1556
|
-
*
|
|
1498
|
+
* Otp manages a group of digit inputs for OTP entry.
|
|
1557
1499
|
* Implements keyboard navigation, paste handling, and ControlValueAccessor for Angular Forms.
|
|
1558
1500
|
*/
|
|
1559
|
-
class
|
|
1501
|
+
class Otp {
|
|
1560
1502
|
/**
|
|
1561
|
-
* The visual size of the OTP inputs. Accepts '
|
|
1503
|
+
* The visual size of the OTP inputs. Accepts 'sm', 'md', or 'lg'. Default is 'md'.
|
|
1562
1504
|
*/
|
|
1563
|
-
size = model('
|
|
1505
|
+
size = model('md', ...(ngDevMode ? [{ debugName: "size" }] : []));
|
|
1564
1506
|
/**
|
|
1565
1507
|
* Computed signal for the number of digit inputs.
|
|
1566
1508
|
*/
|
|
@@ -1597,8 +1539,8 @@ class OtpComponent {
|
|
|
1597
1539
|
const el = input.el.nativeElement;
|
|
1598
1540
|
// maxLength y type se aplican por la directiva
|
|
1599
1541
|
el.disabled = this.disabled();
|
|
1600
|
-
el.classList.remove('size-
|
|
1601
|
-
el.classList.add(`size-${this.size()}`);
|
|
1542
|
+
el.classList.remove('b-size-sm', 'b-size-md', 'b-size-lg');
|
|
1543
|
+
el.classList.add(`b-size-${this.size()}`);
|
|
1602
1544
|
el.addEventListener('input', (event) => {
|
|
1603
1545
|
this.onInput(event, idx);
|
|
1604
1546
|
});
|
|
@@ -1752,20 +1694,20 @@ class OtpComponent {
|
|
|
1752
1694
|
this.disabled.set(isDisabled);
|
|
1753
1695
|
this.digitInputs().forEach(input => {
|
|
1754
1696
|
input.el.nativeElement.disabled = isDisabled;
|
|
1755
|
-
input.el.nativeElement.classList.remove('size-
|
|
1756
|
-
input.el.nativeElement.classList.add(`size-${this.size()}`);
|
|
1697
|
+
input.el.nativeElement.classList.remove('b-size-sm', 'b-size-md', 'b-size-lg');
|
|
1698
|
+
input.el.nativeElement.classList.add(`b-size-${this.size()}`);
|
|
1757
1699
|
});
|
|
1758
1700
|
}
|
|
1759
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type:
|
|
1760
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "20.2.3", type:
|
|
1701
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type: Otp, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1702
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "20.2.3", type: Otp, isStandalone: true, selector: "b-otp", inputs: { size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { size: "sizeChange", otpChange: "otpChange", disabled: "disabledChange" }, providers: [
|
|
1761
1703
|
{
|
|
1762
1704
|
provide: NG_VALUE_ACCESSOR,
|
|
1763
|
-
useExisting: forwardRef(() =>
|
|
1705
|
+
useExisting: forwardRef(() => Otp),
|
|
1764
1706
|
multi: true,
|
|
1765
1707
|
},
|
|
1766
1708
|
], queries: [{ propertyName: "digitInputs", predicate: OtpDigitDirective, isSignal: true }], ngImport: i0, template: `<ng-content />`, isInline: true });
|
|
1767
1709
|
}
|
|
1768
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type:
|
|
1710
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type: Otp, decorators: [{
|
|
1769
1711
|
type: Component,
|
|
1770
1712
|
args: [{
|
|
1771
1713
|
selector: 'b-otp',
|
|
@@ -1773,7 +1715,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.3", ngImpor
|
|
|
1773
1715
|
providers: [
|
|
1774
1716
|
{
|
|
1775
1717
|
provide: NG_VALUE_ACCESSOR,
|
|
1776
|
-
useExisting: forwardRef(() =>
|
|
1718
|
+
useExisting: forwardRef(() => Otp),
|
|
1777
1719
|
multi: true,
|
|
1778
1720
|
},
|
|
1779
1721
|
],
|
|
@@ -1795,21 +1737,28 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.3", ngImpor
|
|
|
1795
1737
|
}]
|
|
1796
1738
|
}] });
|
|
1797
1739
|
|
|
1798
|
-
class
|
|
1740
|
+
class Badge {
|
|
1799
1741
|
/** The variant of the badge. */
|
|
1800
1742
|
variant = input('primary', ...(ngDevMode ? [{ debugName: "variant" }] : []));
|
|
1801
1743
|
/** The size of the badge. */
|
|
1802
|
-
size = input('
|
|
1803
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type:
|
|
1804
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.2.3", type:
|
|
1744
|
+
size = input('md', ...(ngDevMode ? [{ debugName: "size" }] : []));
|
|
1745
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type: Badge, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1746
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.2.3", type: Badge, isStandalone: true, selector: "span[b-badge]", inputs: { variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.b-variant-primary": "variant() === \"primary\"", "class.b-variant-secondary": "variant() === \"secondary\"", "class.b-variant-ghost": "variant() === \"ghost\"", "class.b-variant-outlined": "variant() === \"outlined\"", "class.b-variant-destructive": "variant() === \"destructive\"", "class.b-size-sm": "size() === \"sm\"", "class.b-size-md": "size() === \"md\"", "class.b-size-lg": "size() === \"lg\"" } }, ngImport: i0, template: `<ng-content />`, isInline: true });
|
|
1805
1747
|
}
|
|
1806
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type:
|
|
1748
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type: Badge, decorators: [{
|
|
1807
1749
|
type: Component,
|
|
1808
1750
|
args: [{
|
|
1809
1751
|
selector: 'span[b-badge]',
|
|
1810
1752
|
template: `<ng-content />`,
|
|
1811
1753
|
host: {
|
|
1812
|
-
'[class]': 'variant()
|
|
1754
|
+
'[class.b-variant-primary]': 'variant() === "primary"',
|
|
1755
|
+
'[class.b-variant-secondary]': 'variant() === "secondary"',
|
|
1756
|
+
'[class.b-variant-ghost]': 'variant() === "ghost"',
|
|
1757
|
+
'[class.b-variant-outlined]': 'variant() === "outlined"',
|
|
1758
|
+
'[class.b-variant-destructive]': 'variant() === "destructive"',
|
|
1759
|
+
'[class.b-size-sm]': 'size() === "sm"',
|
|
1760
|
+
'[class.b-size-md]': 'size() === "md"',
|
|
1761
|
+
'[class.b-size-lg]': 'size() === "lg"',
|
|
1813
1762
|
},
|
|
1814
1763
|
}]
|
|
1815
1764
|
}] });
|
|
@@ -1818,7 +1767,7 @@ class Checkbox {
|
|
|
1818
1767
|
/**
|
|
1819
1768
|
* Value of the checkbox.
|
|
1820
1769
|
*/
|
|
1821
|
-
value =
|
|
1770
|
+
value = signal(false, ...(ngDevMode ? [{ debugName: "value" }] : []));
|
|
1822
1771
|
/**
|
|
1823
1772
|
* Reference to the checkbox element.
|
|
1824
1773
|
*/
|
|
@@ -1827,6 +1776,10 @@ class Checkbox {
|
|
|
1827
1776
|
* Event emitted when the value changes.
|
|
1828
1777
|
*/
|
|
1829
1778
|
valueChange = output();
|
|
1779
|
+
/**
|
|
1780
|
+
* Tamaño del checkbox: 'sm', 'md', 'lg'.
|
|
1781
|
+
*/
|
|
1782
|
+
size = model('md', ...(ngDevMode ? [{ debugName: "size" }] : []));
|
|
1830
1783
|
/**
|
|
1831
1784
|
* Initializes the checkbox value after the view is initialized.
|
|
1832
1785
|
*/
|
|
@@ -1842,7 +1795,7 @@ class Checkbox {
|
|
|
1842
1795
|
this.valueChange.emit(newValue);
|
|
1843
1796
|
}
|
|
1844
1797
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type: Checkbox, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1845
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.2.3", type: Checkbox, isStandalone: true, selector: "input[b-checkbox]", inputs: {
|
|
1798
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.2.3", type: Checkbox, isStandalone: true, selector: "input[b-checkbox]", inputs: { size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { valueChange: "valueChange", size: "sizeChange" }, host: { listeners: { "click": "toggleValue()", "keydown.enter": "toggleValue()", "keydown.space": "toggleValue()" }, properties: { "attr.role": "checkbox", "attr.checked": "value()", "attr.aria-checked": "value()", "class.b-size-sm": "size() === \"sm\"", "class.b-size-md": "size() === \"md\"", "class.b-size-lg": "size() === \"lg\"" } }, ngImport: i0, template: ``, isInline: true });
|
|
1846
1799
|
}
|
|
1847
1800
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type: Checkbox, decorators: [{
|
|
1848
1801
|
type: Component,
|
|
@@ -1856,17 +1809,20 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.3", ngImpor
|
|
|
1856
1809
|
'(click)': 'toggleValue()',
|
|
1857
1810
|
'(keydown.enter)': 'toggleValue()',
|
|
1858
1811
|
'(keydown.space)': 'toggleValue()',
|
|
1812
|
+
'[class.b-size-sm]': 'size() === "sm"',
|
|
1813
|
+
'[class.b-size-md]': 'size() === "md"',
|
|
1814
|
+
'[class.b-size-lg]': 'size() === "lg"',
|
|
1859
1815
|
},
|
|
1860
1816
|
}]
|
|
1861
1817
|
}] });
|
|
1862
1818
|
|
|
1863
1819
|
class TextareaComponent {
|
|
1864
1820
|
/**
|
|
1865
|
-
* The size of the
|
|
1821
|
+
* The size of the textarea.
|
|
1866
1822
|
*/
|
|
1867
|
-
size = input('
|
|
1823
|
+
size = input('md', ...(ngDevMode ? [{ debugName: "size" }] : []));
|
|
1868
1824
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type: TextareaComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1869
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.2.3", type: TextareaComponent, isStandalone: true, selector: "textarea[b-textarea]", inputs: { size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": " \"size
|
|
1825
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.2.3", type: TextareaComponent, isStandalone: true, selector: "textarea[b-textarea]", inputs: { size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.b-size-sm": "size() === \"sm\"", "class.b-size-md": "size() === \"md\"", "class.b-size-lg": "size() === \"lg\"" } }, ngImport: i0, template: ``, isInline: true });
|
|
1870
1826
|
}
|
|
1871
1827
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type: TextareaComponent, decorators: [{
|
|
1872
1828
|
type: Component,
|
|
@@ -1874,20 +1830,22 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.3", ngImpor
|
|
|
1874
1830
|
selector: 'textarea[b-textarea]',
|
|
1875
1831
|
template: ``,
|
|
1876
1832
|
host: {
|
|
1877
|
-
'[class]': '
|
|
1833
|
+
'[class.b-size-sm]': 'size() === "sm"',
|
|
1834
|
+
'[class.b-size-md]': 'size() === "md"',
|
|
1835
|
+
'[class.b-size-lg]': 'size() === "lg"',
|
|
1878
1836
|
},
|
|
1879
1837
|
}]
|
|
1880
1838
|
}] });
|
|
1881
1839
|
|
|
1882
|
-
class
|
|
1840
|
+
class Range {
|
|
1883
1841
|
/**
|
|
1884
1842
|
* Current value of the range.
|
|
1885
1843
|
*/
|
|
1886
1844
|
value = model('0', ...(ngDevMode ? [{ debugName: "value" }] : []));
|
|
1887
1845
|
/**
|
|
1888
|
-
*
|
|
1846
|
+
* Size of the range slider (sm, md, lg)
|
|
1889
1847
|
*/
|
|
1890
|
-
|
|
1848
|
+
size = input('md', ...(ngDevMode ? [{ debugName: "size" }] : []));
|
|
1891
1849
|
/**
|
|
1892
1850
|
* Reference to the range element.
|
|
1893
1851
|
*/
|
|
@@ -1904,375 +1862,164 @@ class RangeComponent {
|
|
|
1904
1862
|
onInput(event) {
|
|
1905
1863
|
this.value.set(event.target.value);
|
|
1906
1864
|
}
|
|
1907
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type:
|
|
1908
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.2.3", type:
|
|
1865
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type: Range, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1866
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.2.3", type: Range, isStandalone: true, selector: "input[b-range]", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, host: { listeners: { "input": "onInput($event)" }, properties: { "attr.value": "value()", "class.b-size-sm": "size() === \"sm\"", "class.b-size-md": "size() === \"md\"", "class.b-size-lg": "size() === \"lg\"" } }, ngImport: i0, template: ``, isInline: true });
|
|
1909
1867
|
}
|
|
1910
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type:
|
|
1868
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type: Range, decorators: [{
|
|
1911
1869
|
type: Component,
|
|
1912
1870
|
args: [{
|
|
1913
1871
|
selector: 'input[b-range]',
|
|
1914
1872
|
template: ``,
|
|
1915
1873
|
host: {
|
|
1916
1874
|
'[attr.value]': 'value()',
|
|
1917
|
-
'[style.max-width]': 'maxWidth()',
|
|
1918
1875
|
'(input)': 'onInput($event)',
|
|
1876
|
+
'[class.b-size-sm]': 'size() === "sm"',
|
|
1877
|
+
'[class.b-size-md]': 'size() === "md"',
|
|
1878
|
+
'[class.b-size-lg]': 'size() === "lg"',
|
|
1919
1879
|
},
|
|
1920
1880
|
}]
|
|
1921
1881
|
}] });
|
|
1922
1882
|
|
|
1923
|
-
|
|
1924
|
-
* Utility service for common operations.
|
|
1925
|
-
*/
|
|
1926
|
-
class UtilsService {
|
|
1927
|
-
debounceTimers = new Map();
|
|
1883
|
+
class TooltipTrigger {
|
|
1928
1884
|
/**
|
|
1929
|
-
*
|
|
1930
|
-
*
|
|
1931
|
-
* @param key - Unique key to identify the debounce timer.
|
|
1932
|
-
* @param func - The function to debounce.
|
|
1933
|
-
* @param delay - The delay in milliseconds before executing the function.
|
|
1885
|
+
* Emits when the tooltip should become active/visible (mouseover or focus).
|
|
1934
1886
|
*/
|
|
1935
|
-
|
|
1936
|
-
clearTimeout(this.debounceTimers.get(key));
|
|
1937
|
-
this.debounceTimers.set(key, setTimeout(func, delay));
|
|
1938
|
-
}
|
|
1887
|
+
activeEmitter = output();
|
|
1939
1888
|
/**
|
|
1940
|
-
*
|
|
1941
|
-
*
|
|
1942
|
-
* @param key - Unique key to identify the debounce timer.
|
|
1889
|
+
* Emits when the tooltip should become inactive/hidden (mouseout or blur).
|
|
1943
1890
|
*/
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
}
|
|
1948
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type: UtilsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1949
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type: UtilsService, providedIn: 'root' });
|
|
1891
|
+
inactiveEmitter = output();
|
|
1892
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type: TooltipTrigger, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
1893
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.2.3", type: TooltipTrigger, isStandalone: true, selector: "[bTooltipTrigger]", outputs: { activeEmitter: "activeEmitter", inactiveEmitter: "inactiveEmitter" }, host: { listeners: { "mouseover": "activeEmitter.emit()", "focus": "activeEmitter.emit()", "mouseout": "inactiveEmitter.emit()", "blur": "inactiveEmitter.emit()" } }, ngImport: i0 });
|
|
1950
1894
|
}
|
|
1951
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type:
|
|
1952
|
-
type:
|
|
1895
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type: TooltipTrigger, decorators: [{
|
|
1896
|
+
type: Directive,
|
|
1953
1897
|
args: [{
|
|
1954
|
-
|
|
1898
|
+
selector: '[bTooltipTrigger]',
|
|
1899
|
+
host: {
|
|
1900
|
+
'(mouseover)': 'activeEmitter.emit()',
|
|
1901
|
+
'(focus)': 'activeEmitter.emit()',
|
|
1902
|
+
'(mouseout)': 'inactiveEmitter.emit()',
|
|
1903
|
+
'(blur)': 'inactiveEmitter.emit()',
|
|
1904
|
+
},
|
|
1955
1905
|
}]
|
|
1956
1906
|
}] });
|
|
1957
1907
|
|
|
1958
|
-
|
|
1959
|
-
* Tooltip component used to display content or templates in a tooltip overlay.
|
|
1960
|
-
*/
|
|
1961
|
-
class TooltipComponent {
|
|
1962
|
-
/**
|
|
1963
|
-
* Specifies the size of the tooltip.
|
|
1964
|
-
*
|
|
1965
|
-
* @defaultValue '2'
|
|
1966
|
-
*/
|
|
1967
|
-
size = signal('2', ...(ngDevMode ? [{ debugName: "size" }] : []));
|
|
1968
|
-
/**
|
|
1969
|
-
* Direction of the tooltip (e.g., top, bottom, left, right).
|
|
1970
|
-
*/
|
|
1971
|
-
direction = signal(undefined, ...(ngDevMode ? [{ debugName: "direction" }] : []));
|
|
1972
|
-
/**
|
|
1973
|
-
* Indicates whether the tooltip is leaving (for animation purposes).
|
|
1974
|
-
*/
|
|
1975
|
-
leaving = signal(false, ...(ngDevMode ? [{ debugName: "leaving" }] : []));
|
|
1976
|
-
/**
|
|
1977
|
-
* Content of the tooltip, which can be a string or a template.
|
|
1978
|
-
*/
|
|
1979
|
-
content = signal('', ...(ngDevMode ? [{ debugName: "content" }] : []));
|
|
1908
|
+
class TooltipContent {
|
|
1980
1909
|
/**
|
|
1981
|
-
*
|
|
1910
|
+
* Reference to the ConnectedOverlay to determine the direction of the overlay.
|
|
1982
1911
|
*/
|
|
1983
|
-
|
|
1912
|
+
overlay = inject(ConnectedOverlay$1);
|
|
1984
1913
|
/**
|
|
1985
|
-
*
|
|
1914
|
+
* Computed signal representing the direction of the overlay.
|
|
1986
1915
|
*/
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type: TooltipComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1994
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.2.3", type: TooltipComponent, isStandalone: true, selector: "b-tooltip", host: { properties: { "class": "\"b-tooltip-\" + direction() + \" size-\" + size()", "class.b-tooltip-leave": "leaving()" } }, ngImport: i0, template: `
|
|
1995
|
-
@if (isString()) {
|
|
1996
|
-
{{ content() }}
|
|
1997
|
-
} @else {
|
|
1998
|
-
<ng-container *ngTemplateOutlet="template()" />
|
|
1999
|
-
}
|
|
2000
|
-
`, isInline: true, dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] });
|
|
1916
|
+
direction = computed(() => this.overlay.direction(), ...(ngDevMode ? [{ debugName: "direction" }] : []));
|
|
1917
|
+
constructor() {
|
|
1918
|
+
effect(() => console.log(this.direction()));
|
|
1919
|
+
}
|
|
1920
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type: TooltipContent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1921
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.2.3", type: TooltipContent, isStandalone: true, selector: "b-tooltip-content", host: { properties: { "animate.enter": "\"b-tooltip-content-entering-\" + this.direction()", "animate.leave": "\"b-tooltip-content-leaving-\" + this.direction()" } }, ngImport: i0, template: `<ng-content />`, isInline: true });
|
|
2001
1922
|
}
|
|
2002
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type:
|
|
1923
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type: TooltipContent, decorators: [{
|
|
2003
1924
|
type: Component,
|
|
2004
1925
|
args: [{
|
|
2005
|
-
selector: 'b-tooltip',
|
|
2006
|
-
|
|
2007
|
-
template:
|
|
2008
|
-
@if (isString()) {
|
|
2009
|
-
{{ content() }}
|
|
2010
|
-
} @else {
|
|
2011
|
-
<ng-container *ngTemplateOutlet="template()" />
|
|
2012
|
-
}
|
|
2013
|
-
`,
|
|
2014
|
-
imports: [NgTemplateOutlet],
|
|
1926
|
+
selector: 'b-tooltip-content',
|
|
1927
|
+
imports: [],
|
|
1928
|
+
template: `<ng-content />`,
|
|
2015
1929
|
host: {
|
|
2016
|
-
'[
|
|
2017
|
-
'[
|
|
1930
|
+
'[animate.enter]': '"b-tooltip-content-entering-" + this.direction()',
|
|
1931
|
+
'[animate.leave]': '"b-tooltip-content-leaving-" + this.direction()',
|
|
2018
1932
|
},
|
|
2019
1933
|
}]
|
|
2020
|
-
}] });
|
|
1934
|
+
}], ctorParameters: () => [] });
|
|
2021
1935
|
|
|
2022
|
-
|
|
2023
|
-
* Directive to attach a tooltip to an element.
|
|
2024
|
-
*/
|
|
2025
|
-
class TooltipDirective {
|
|
1936
|
+
class Tooltip {
|
|
2026
1937
|
/**
|
|
2027
|
-
*
|
|
1938
|
+
* Reference to the overlay directive instance.
|
|
1939
|
+
* Used to control the dropdown overlay for the select component.
|
|
2028
1940
|
*
|
|
2029
|
-
* @
|
|
1941
|
+
* @readonly
|
|
2030
1942
|
*/
|
|
2031
|
-
|
|
2032
|
-
alias: 'bTooltip',
|
|
2033
|
-
}]));
|
|
1943
|
+
overlay = contentChild(ConnectedOverlay, ...(ngDevMode ? [{ debugName: "overlay" }] : []));
|
|
2034
1944
|
/**
|
|
2035
|
-
*
|
|
1945
|
+
* Reference to the tooltip trigger directive.
|
|
1946
|
+
* Used to handle trigger events (click, keydown) for opening/closing the tooltip.
|
|
2036
1947
|
*
|
|
2037
|
-
* @
|
|
1948
|
+
* @readonly
|
|
2038
1949
|
*/
|
|
2039
|
-
|
|
1950
|
+
tooltipTrigger = contentChild(TooltipTrigger, ...(ngDevMode ? [{ debugName: "tooltipTrigger" }] : []));
|
|
2040
1951
|
/**
|
|
2041
|
-
*
|
|
2042
|
-
|
|
2043
|
-
origin = inject(CdkOverlayOrigin);
|
|
2044
|
-
/**
|
|
2045
|
-
* Overlay service for creating and managing overlays.
|
|
2046
|
-
*/
|
|
2047
|
-
overlay = inject(Overlay);
|
|
2048
|
-
/**
|
|
2049
|
-
* Utility service for common operations.
|
|
2050
|
-
*/
|
|
2051
|
-
utils = inject(UtilsService);
|
|
2052
|
-
/**
|
|
2053
|
-
* Whether the tooltip should appear on hover.
|
|
1952
|
+
* Reference to the tooltip content component.
|
|
1953
|
+
* Used to manage the content of the tooltip.
|
|
2054
1954
|
*
|
|
2055
|
-
* @
|
|
1955
|
+
* @readonly
|
|
2056
1956
|
*/
|
|
2057
|
-
|
|
1957
|
+
tooltipContent = contentChild(TooltipContent, ...(ngDevMode ? [{ debugName: "tooltipContent" }] : []));
|
|
2058
1958
|
/**
|
|
2059
|
-
*
|
|
1959
|
+
* Input signal to set the size of the tooltip.
|
|
1960
|
+
* Can be 'sm', 'md', or 'lg'. Default is 'md'.
|
|
2060
1961
|
*
|
|
2061
|
-
* @
|
|
2062
|
-
|
|
2063
|
-
focus = input(false, ...(ngDevMode ? [{ debugName: "focus" }] : []));
|
|
2064
|
-
/**
|
|
2065
|
-
* Reference to the overlay instance.
|
|
2066
|
-
*/
|
|
2067
|
-
overlayRef = signal(null, ...(ngDevMode ? [{ debugName: "overlayRef" }] : []));
|
|
2068
|
-
/**
|
|
2069
|
-
* Unique identifier for the tooltip instance.
|
|
2070
|
-
*/
|
|
2071
|
-
id = signal(Math.random() * 10, ...(ngDevMode ? [{ debugName: "id" }] : []));
|
|
2072
|
-
/**
|
|
2073
|
-
* Map of positions for the tooltip.
|
|
1962
|
+
* @readonly
|
|
1963
|
+
* @defaultValue 'md'
|
|
2074
1964
|
*/
|
|
2075
|
-
|
|
2076
|
-
'top-left': {
|
|
2077
|
-
originX: 'start',
|
|
2078
|
-
originY: 'top',
|
|
2079
|
-
overlayX: 'start',
|
|
2080
|
-
overlayY: 'bottom',
|
|
2081
|
-
},
|
|
2082
|
-
'top-center': {
|
|
2083
|
-
originX: 'center',
|
|
2084
|
-
originY: 'top',
|
|
2085
|
-
overlayX: 'center',
|
|
2086
|
-
overlayY: 'bottom',
|
|
2087
|
-
},
|
|
2088
|
-
'top-right': {
|
|
2089
|
-
originX: 'end',
|
|
2090
|
-
originY: 'top',
|
|
2091
|
-
overlayX: 'end',
|
|
2092
|
-
overlayY: 'bottom',
|
|
2093
|
-
},
|
|
2094
|
-
'bottom-left': {
|
|
2095
|
-
originX: 'start',
|
|
2096
|
-
originY: 'bottom',
|
|
2097
|
-
overlayX: 'start',
|
|
2098
|
-
overlayY: 'top',
|
|
2099
|
-
},
|
|
2100
|
-
'bottom-center': {
|
|
2101
|
-
originX: 'center',
|
|
2102
|
-
originY: 'bottom',
|
|
2103
|
-
overlayX: 'center',
|
|
2104
|
-
overlayY: 'top',
|
|
2105
|
-
},
|
|
2106
|
-
'bottom-right': {
|
|
2107
|
-
originX: 'end',
|
|
2108
|
-
originY: 'bottom',
|
|
2109
|
-
overlayX: 'end',
|
|
2110
|
-
overlayY: 'top',
|
|
2111
|
-
},
|
|
2112
|
-
'left-top': {
|
|
2113
|
-
originX: 'start',
|
|
2114
|
-
originY: 'top',
|
|
2115
|
-
overlayX: 'end',
|
|
2116
|
-
overlayY: 'top',
|
|
2117
|
-
},
|
|
2118
|
-
'left-center': {
|
|
2119
|
-
originX: 'start',
|
|
2120
|
-
originY: 'center',
|
|
2121
|
-
overlayX: 'end',
|
|
2122
|
-
overlayY: 'center',
|
|
2123
|
-
},
|
|
2124
|
-
'left-bottom': {
|
|
2125
|
-
originX: 'start',
|
|
2126
|
-
originY: 'bottom',
|
|
2127
|
-
overlayX: 'end',
|
|
2128
|
-
overlayY: 'bottom',
|
|
2129
|
-
},
|
|
2130
|
-
'right-top': {
|
|
2131
|
-
originX: 'end',
|
|
2132
|
-
originY: 'top',
|
|
2133
|
-
overlayX: 'start',
|
|
2134
|
-
overlayY: 'top',
|
|
2135
|
-
},
|
|
2136
|
-
'right-center': {
|
|
2137
|
-
originX: 'end',
|
|
2138
|
-
originY: 'center',
|
|
2139
|
-
overlayX: 'start',
|
|
2140
|
-
overlayY: 'center',
|
|
2141
|
-
},
|
|
2142
|
-
'right-bottom': {
|
|
2143
|
-
originX: 'end',
|
|
2144
|
-
originY: 'bottom',
|
|
2145
|
-
overlayX: 'start',
|
|
2146
|
-
overlayY: 'bottom',
|
|
2147
|
-
},
|
|
2148
|
-
}, ...(ngDevMode ? [{ debugName: "positionsMap" }] : []));
|
|
1965
|
+
size = input('md', ...(ngDevMode ? [{ debugName: "size" }] : []));
|
|
2149
1966
|
/**
|
|
2150
|
-
*
|
|
1967
|
+
* Input signal to set the visual variant of the tooltip.
|
|
1968
|
+
* Can be 'primary', 'secondary', 'ghost', 'outlined', or 'destructive'.
|
|
1969
|
+
* Default is 'primary'.
|
|
2151
1970
|
*
|
|
2152
|
-
* @
|
|
2153
|
-
|
|
2154
|
-
positions = input(['bottom-center'], ...(ngDevMode ? [{ debugName: "positions" }] : []));
|
|
2155
|
-
/**
|
|
2156
|
-
* Computed connected positions based on the positions input.
|
|
1971
|
+
* @readonly
|
|
1972
|
+
* @defaultValue 'primary'
|
|
2157
1973
|
*/
|
|
2158
|
-
|
|
1974
|
+
variant = input('primary', ...(ngDevMode ? [{ debugName: "variant" }] : []));
|
|
2159
1975
|
/**
|
|
2160
|
-
*
|
|
2161
|
-
*
|
|
2162
|
-
* @defaultValue 0
|
|
1976
|
+
* Lifecycle hook that is called after data-bound properties are initialized.
|
|
1977
|
+
* Sets up mouse event handling for the tooltip trigger.
|
|
2163
1978
|
*/
|
|
2164
|
-
|
|
1979
|
+
ngAfterContentInit() {
|
|
1980
|
+
this.handleTooltipEvents();
|
|
1981
|
+
this.handlePanelClasses();
|
|
1982
|
+
}
|
|
2165
1983
|
/**
|
|
2166
|
-
*
|
|
1984
|
+
* Sets up subscriptions to mouse events from the tooltip trigger.
|
|
1985
|
+
* Logs messages to the console on mouse over and mouse out events.
|
|
2167
1986
|
*
|
|
2168
|
-
* @
|
|
1987
|
+
* @private
|
|
2169
1988
|
*/
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
|
|
2174
|
-
|
|
2175
|
-
|
|
2176
|
-
|
|
2177
|
-
*/
|
|
2178
|
-
direction = computed(() => {
|
|
2179
|
-
const pair = this.connectedPosition();
|
|
2180
|
-
return Object.entries(this.positionsMap())
|
|
2181
|
-
.find(([, position]) => position.originX === pair?.originX &&
|
|
2182
|
-
position.originY === pair?.originY &&
|
|
2183
|
-
position.overlayX === pair?.overlayX &&
|
|
2184
|
-
position.overlayY === pair?.overlayY)?.[0]
|
|
2185
|
-
.split('-')[0];
|
|
2186
|
-
}, ...(ngDevMode ? [{ debugName: "direction" }] : []));
|
|
2187
|
-
/**
|
|
2188
|
-
* Subscription to position change events.
|
|
2189
|
-
*/
|
|
2190
|
-
positionChangeSubscription = null;
|
|
2191
|
-
/**
|
|
2192
|
-
* Reference to the tooltip component instance.
|
|
2193
|
-
*/
|
|
2194
|
-
componentRef = signal(undefined, ...(ngDevMode ? [{ debugName: "componentRef" }] : []));
|
|
2195
|
-
/**
|
|
2196
|
-
* Shows the tooltip.
|
|
2197
|
-
*/
|
|
2198
|
-
show() {
|
|
2199
|
-
if (this.overlayRef()?.hasAttached()) {
|
|
2200
|
-
return;
|
|
2201
|
-
}
|
|
2202
|
-
this.utils.debounce('tooltip-show ' + this.id(), () => {
|
|
2203
|
-
const positionStrategy = this.overlay
|
|
2204
|
-
.position()
|
|
2205
|
-
.flexibleConnectedTo(this.origin.elementRef)
|
|
2206
|
-
.withPositions(this.connectedPositions())
|
|
2207
|
-
.withPush(true);
|
|
2208
|
-
// Subscribe to position change events
|
|
2209
|
-
this.positionChangeSubscription =
|
|
2210
|
-
positionStrategy.positionChanges.subscribe(change => {
|
|
2211
|
-
this.connectedPosition.set(change.connectionPair);
|
|
2212
|
-
});
|
|
2213
|
-
const overlayConfig = new OverlayConfig({
|
|
2214
|
-
positionStrategy,
|
|
2215
|
-
scrollStrategy: this.overlay.scrollStrategies.close(),
|
|
2216
|
-
});
|
|
2217
|
-
if (!this.overlayRef()) {
|
|
2218
|
-
this.overlayRef.set(this.overlay.create(overlayConfig));
|
|
2219
|
-
}
|
|
2220
|
-
const componentPortal = new ComponentPortal(TooltipComponent);
|
|
2221
|
-
this.componentRef.set(this.overlayRef()?.attach(componentPortal));
|
|
2222
|
-
// Reset the leaving state and direction to ensure animations play
|
|
2223
|
-
const instance = this.componentRef()?.instance;
|
|
2224
|
-
instance?.leaving.set(false);
|
|
2225
|
-
instance?.direction.set(this.direction());
|
|
2226
|
-
instance?.content.set(this.content());
|
|
2227
|
-
instance?.size.set(this.size());
|
|
2228
|
-
// Trigger reflow to ensure CSS animations are applied
|
|
2229
|
-
void this.overlayRef()?.overlayElement.offsetHeight;
|
|
2230
|
-
}, this.showDelay());
|
|
2231
|
-
}
|
|
2232
|
-
/**
|
|
2233
|
-
* Hides the tooltip.
|
|
2234
|
-
*/
|
|
2235
|
-
hide() {
|
|
2236
|
-
if (!this.overlayRef()?.hasAttached()) {
|
|
2237
|
-
return; // Avoid detaching if not attached
|
|
2238
|
-
}
|
|
2239
|
-
this.componentRef()?.instance.leaving.set(true);
|
|
2240
|
-
this.utils.debounce('tooltip-hide' + this.id(), () => this.overlayRef()?.detach(), this.hideDelay());
|
|
1989
|
+
handleTooltipEvents() {
|
|
1990
|
+
this.tooltipTrigger()?.activeEmitter.subscribe(() => {
|
|
1991
|
+
this.overlay()?.openOverlay();
|
|
1992
|
+
});
|
|
1993
|
+
this.tooltipTrigger()?.inactiveEmitter.subscribe(() => {
|
|
1994
|
+
this.overlay()?.closeOverlay();
|
|
1995
|
+
});
|
|
2241
1996
|
}
|
|
2242
1997
|
/**
|
|
2243
|
-
*
|
|
1998
|
+
* Sets the panel size class on the overlay based on the tooltip size input.
|
|
2244
1999
|
*/
|
|
2245
|
-
|
|
2246
|
-
this.
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
|
|
2250
|
-
}
|
|
2251
|
-
constructor() {
|
|
2252
|
-
effect(() => this.componentRef()?.instance.direction.set(this.direction()));
|
|
2000
|
+
handlePanelClasses() {
|
|
2001
|
+
this.overlay().cdkConnectedOverlay.panelClass = [
|
|
2002
|
+
`b-size-${this.size()}`,
|
|
2003
|
+
`b-variant-${this.variant()}`,
|
|
2004
|
+
];
|
|
2253
2005
|
}
|
|
2254
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type:
|
|
2255
|
-
static
|
|
2006
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type: Tooltip, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2007
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "20.2.3", type: Tooltip, isStandalone: true, selector: "b-tooltip", inputs: { size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.b-size-sm": "size() === \"sm\"", "class.b-size-md": "size() === \"md\"", "class.b-size-lg": "size() === \"lg\"" } }, queries: [{ propertyName: "overlay", first: true, predicate: ConnectedOverlay, descendants: true, isSignal: true }, { propertyName: "tooltipTrigger", first: true, predicate: TooltipTrigger, descendants: true, isSignal: true }, { propertyName: "tooltipContent", first: true, predicate: TooltipContent, descendants: true, isSignal: true }], ngImport: i0, template: `<ng-content />`, isInline: true });
|
|
2256
2008
|
}
|
|
2257
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type:
|
|
2258
|
-
type:
|
|
2009
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type: Tooltip, decorators: [{
|
|
2010
|
+
type: Component,
|
|
2259
2011
|
args: [{
|
|
2260
|
-
selector: '
|
|
2261
|
-
|
|
2012
|
+
selector: 'b-tooltip',
|
|
2013
|
+
template: `<ng-content />`,
|
|
2262
2014
|
host: {
|
|
2263
|
-
'
|
|
2264
|
-
'
|
|
2265
|
-
'
|
|
2266
|
-
'(blur)': 'focus() && hide()',
|
|
2015
|
+
'[class.b-size-sm]': 'size() === "sm"',
|
|
2016
|
+
'[class.b-size-md]': 'size() === "md"',
|
|
2017
|
+
'[class.b-size-lg]': 'size() === "lg"',
|
|
2267
2018
|
},
|
|
2268
2019
|
}]
|
|
2269
|
-
}]
|
|
2020
|
+
}] });
|
|
2270
2021
|
|
|
2271
|
-
class
|
|
2272
|
-
/**
|
|
2273
|
-
* Specifies the maximum width of the input.
|
|
2274
|
-
*/
|
|
2275
|
-
maxWidth = input('', ...(ngDevMode ? [{ debugName: "maxWidth" }] : []));
|
|
2022
|
+
class ColorPicker {
|
|
2276
2023
|
/**
|
|
2277
2024
|
* Represents the value of the input.
|
|
2278
2025
|
*/
|
|
@@ -2310,7 +2057,7 @@ class ColorPickerComponent {
|
|
|
2310
2057
|
/**
|
|
2311
2058
|
* The size of the color picker input.
|
|
2312
2059
|
*/
|
|
2313
|
-
size = input('
|
|
2060
|
+
size = input('md', ...(ngDevMode ? [{ debugName: "size" }] : []));
|
|
2314
2061
|
/**
|
|
2315
2062
|
* A reference to the native element.
|
|
2316
2063
|
*/
|
|
@@ -2374,10 +2121,10 @@ class ColorPickerComponent {
|
|
|
2374
2121
|
const b = Math.round(rgb1.b * (1 - percentage) + rgb2.b * percentage);
|
|
2375
2122
|
return rgbToHex(r, g, b);
|
|
2376
2123
|
}
|
|
2377
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type:
|
|
2378
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "20.2.3", type:
|
|
2124
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type: ColorPicker, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2125
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "20.2.3", type: ColorPicker, isStandalone: true, selector: "input[b-color-picker]", inputs: { showColor: { classPropertyName: "showColor", publicName: "showColor", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "focus": "focused.set(true)", "blur": "focused.set(false)", "input": "value.set($event.target.value)" }, properties: { "class.focused": "focused()", "style.--value": "valueWithSingleQuotes()", "style.--text-color": "textColor()", "class.show-color": "showColor()", "class.b-size-sm": "size() === \"sm\"", "class.b-size-md": "size() === \"md\"", "class.b-size-lg": "size() === \"lg\"" } }, queries: [{ propertyName: "ngModel", first: true, predicate: NgModel, descendants: true, isSignal: true }], ngImport: i0, template: ``, isInline: true });
|
|
2379
2126
|
}
|
|
2380
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type:
|
|
2127
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type: ColorPicker, decorators: [{
|
|
2381
2128
|
type: Component,
|
|
2382
2129
|
args: [{
|
|
2383
2130
|
selector: 'input[b-color-picker]',
|
|
@@ -2385,27 +2132,168 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.3", ngImpor
|
|
|
2385
2132
|
template: ``,
|
|
2386
2133
|
host: {
|
|
2387
2134
|
'[class.focused]': 'focused()',
|
|
2388
|
-
'[style.max-width]': 'maxWidth()',
|
|
2389
2135
|
'[style.--value]': 'valueWithSingleQuotes()',
|
|
2390
2136
|
'[style.--text-color]': 'textColor()',
|
|
2391
2137
|
'[class.show-color]': 'showColor()',
|
|
2392
2138
|
'(focus)': 'focused.set(true)',
|
|
2393
2139
|
'(blur)': 'focused.set(false)',
|
|
2394
2140
|
'(input)': 'value.set($event.target.value)',
|
|
2395
|
-
'[class]': '
|
|
2141
|
+
'[class.b-size-sm]': 'size() === "sm"',
|
|
2142
|
+
'[class.b-size-md]': 'size() === "md"',
|
|
2143
|
+
'[class.b-size-lg]': 'size() === "lg"',
|
|
2396
2144
|
},
|
|
2397
2145
|
}]
|
|
2398
2146
|
}] });
|
|
2399
2147
|
|
|
2400
2148
|
/**
|
|
2401
|
-
* Represents a tree component that
|
|
2402
|
-
* and
|
|
2149
|
+
* Represents a tree node component that can be extended, collapsed,
|
|
2150
|
+
* and optionally supports drag-and-drop functionality.
|
|
2403
2151
|
*/
|
|
2404
|
-
class
|
|
2152
|
+
class TreeNode {
|
|
2153
|
+
/**
|
|
2154
|
+
* Indicates whether the node is extended (expanded).
|
|
2155
|
+
*/
|
|
2156
|
+
extended = model(false, ...(ngDevMode ? [{ debugName: "extended" }] : []));
|
|
2157
|
+
/**
|
|
2158
|
+
* Reference to the `CdkDrag` directive for drag-and-drop functionality.
|
|
2159
|
+
*/
|
|
2160
|
+
node = inject(CdkDrag);
|
|
2161
|
+
/**
|
|
2162
|
+
* Reference to a nested `Tree` component, if present.
|
|
2163
|
+
*/
|
|
2164
|
+
nestedTree = contentChild(Tree, ...(ngDevMode ? [{ debugName: "nestedTree" }] : []));
|
|
2165
|
+
/**
|
|
2166
|
+
* Emits an event when the node is closed.
|
|
2167
|
+
*/
|
|
2168
|
+
closeEmitter = output();
|
|
2405
2169
|
/**
|
|
2406
|
-
*
|
|
2170
|
+
* Lifecycle hook that is called after the component is initialized.
|
|
2407
2171
|
*/
|
|
2408
|
-
|
|
2172
|
+
ngOnInit() {
|
|
2173
|
+
this.node.lockAxis = 'y';
|
|
2174
|
+
}
|
|
2175
|
+
/**
|
|
2176
|
+
* Updates the disabled state of the node.
|
|
2177
|
+
* @param disabled - Whether the node should be disabled.
|
|
2178
|
+
*/
|
|
2179
|
+
handleNodeDisability(disabled) {
|
|
2180
|
+
this.node.disabled = disabled;
|
|
2181
|
+
}
|
|
2182
|
+
/**
|
|
2183
|
+
* Toggles the extended (expanded) state of the node.
|
|
2184
|
+
* Emits a close event if the node is collapsed and contains a nested tree.
|
|
2185
|
+
*/
|
|
2186
|
+
handleExtension() {
|
|
2187
|
+
const isExtended = this.extended();
|
|
2188
|
+
this.extended.set(!isExtended);
|
|
2189
|
+
if (isExtended && this.nestedTree()) {
|
|
2190
|
+
this.closeEmitter.emit();
|
|
2191
|
+
}
|
|
2192
|
+
}
|
|
2193
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type: TreeNode, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2194
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.2.3", type: TreeNode, isStandalone: true, selector: "b-tree-node", inputs: { extended: { classPropertyName: "extended", publicName: "extended", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { extended: "extendedChange", closeEmitter: "closeEmitter" }, providers: [
|
|
2195
|
+
provideIcons({
|
|
2196
|
+
lucideGripVertical,
|
|
2197
|
+
}),
|
|
2198
|
+
], queries: [{ propertyName: "nestedTree", first: true, predicate: Tree, descendants: true, isSignal: true }], hostDirectives: [{ directive: i1$2.CdkDrag, inputs: ["cdkDragDisabled", "disabled"] }], ngImport: i0, template: `<section>
|
|
2199
|
+
@if (!node.disabled) {
|
|
2200
|
+
<ng-icon
|
|
2201
|
+
name="lucideGripVertical"
|
|
2202
|
+
size="16"
|
|
2203
|
+
color="currentColor"
|
|
2204
|
+
cdkDragHandle />
|
|
2205
|
+
}
|
|
2206
|
+
<div
|
|
2207
|
+
class="projected-content"
|
|
2208
|
+
(click)="nestedTree() && handleExtension()"
|
|
2209
|
+
(keydown.enter)="nestedTree() && handleExtension()"
|
|
2210
|
+
(keydown.space)="nestedTree() && handleExtension()"
|
|
2211
|
+
role="button"
|
|
2212
|
+
tabindex="0">
|
|
2213
|
+
<ng-content />
|
|
2214
|
+
</div>
|
|
2215
|
+
@if (nestedTree()) {
|
|
2216
|
+
<svg
|
|
2217
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
2218
|
+
width="20"
|
|
2219
|
+
height="20"
|
|
2220
|
+
viewBox="0 0 24 24"
|
|
2221
|
+
fill="none"
|
|
2222
|
+
stroke="currentColor"
|
|
2223
|
+
stroke-width="2"
|
|
2224
|
+
stroke-linecap="round"
|
|
2225
|
+
stroke-linejoin="round">
|
|
2226
|
+
<path d="m6 9 6 6 6-6" />
|
|
2227
|
+
</svg>
|
|
2228
|
+
}
|
|
2229
|
+
</section>
|
|
2230
|
+
@if (nestedTree() && extended()) {
|
|
2231
|
+
<div class="nested">
|
|
2232
|
+
<ng-content select="b-tree" />
|
|
2233
|
+
</div>
|
|
2234
|
+
} `, isInline: true, dependencies: [{ kind: "directive", type: CdkDragHandle, selector: "[cdkDragHandle]", inputs: ["cdkDragHandleDisabled"] }, { kind: "component", type: NgIcon, selector: "ng-icon", inputs: ["name", "svg", "size", "strokeWidth", "color"] }] });
|
|
2235
|
+
}
|
|
2236
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type: TreeNode, decorators: [{
|
|
2237
|
+
type: Component,
|
|
2238
|
+
args: [{
|
|
2239
|
+
selector: 'b-tree-node',
|
|
2240
|
+
imports: [CdkDragHandle, NgIcon],
|
|
2241
|
+
template: `<section>
|
|
2242
|
+
@if (!node.disabled) {
|
|
2243
|
+
<ng-icon
|
|
2244
|
+
name="lucideGripVertical"
|
|
2245
|
+
size="16"
|
|
2246
|
+
color="currentColor"
|
|
2247
|
+
cdkDragHandle />
|
|
2248
|
+
}
|
|
2249
|
+
<div
|
|
2250
|
+
class="projected-content"
|
|
2251
|
+
(click)="nestedTree() && handleExtension()"
|
|
2252
|
+
(keydown.enter)="nestedTree() && handleExtension()"
|
|
2253
|
+
(keydown.space)="nestedTree() && handleExtension()"
|
|
2254
|
+
role="button"
|
|
2255
|
+
tabindex="0">
|
|
2256
|
+
<ng-content />
|
|
2257
|
+
</div>
|
|
2258
|
+
@if (nestedTree()) {
|
|
2259
|
+
<svg
|
|
2260
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
2261
|
+
width="20"
|
|
2262
|
+
height="20"
|
|
2263
|
+
viewBox="0 0 24 24"
|
|
2264
|
+
fill="none"
|
|
2265
|
+
stroke="currentColor"
|
|
2266
|
+
stroke-width="2"
|
|
2267
|
+
stroke-linecap="round"
|
|
2268
|
+
stroke-linejoin="round">
|
|
2269
|
+
<path d="m6 9 6 6 6-6" />
|
|
2270
|
+
</svg>
|
|
2271
|
+
}
|
|
2272
|
+
</section>
|
|
2273
|
+
@if (nestedTree() && extended()) {
|
|
2274
|
+
<div class="nested">
|
|
2275
|
+
<ng-content select="b-tree" />
|
|
2276
|
+
</div>
|
|
2277
|
+
} `,
|
|
2278
|
+
hostDirectives: [
|
|
2279
|
+
{
|
|
2280
|
+
directive: CdkDrag,
|
|
2281
|
+
inputs: ['cdkDragDisabled: disabled'],
|
|
2282
|
+
},
|
|
2283
|
+
],
|
|
2284
|
+
providers: [
|
|
2285
|
+
provideIcons({
|
|
2286
|
+
lucideGripVertical,
|
|
2287
|
+
}),
|
|
2288
|
+
],
|
|
2289
|
+
}]
|
|
2290
|
+
}] });
|
|
2291
|
+
|
|
2292
|
+
/**
|
|
2293
|
+
* Represents a tree component that supports drag-and-drop functionality
|
|
2294
|
+
* and manages nested tree nodes.
|
|
2295
|
+
*/
|
|
2296
|
+
class Tree {
|
|
2409
2297
|
/**
|
|
2410
2298
|
* Determines whether the tree is draggable.
|
|
2411
2299
|
*/
|
|
@@ -2417,7 +2305,7 @@ class TreeComponent {
|
|
|
2417
2305
|
/**
|
|
2418
2306
|
* Collection of nested `TreeNode` components.
|
|
2419
2307
|
*/
|
|
2420
|
-
nestedNodes = contentChildren(
|
|
2308
|
+
nestedNodes = contentChildren(TreeNode, ...(ngDevMode ? [{ debugName: "nestedNodes" }] : []));
|
|
2421
2309
|
/**
|
|
2422
2310
|
* Determines whether to close nodes recursively.
|
|
2423
2311
|
*/
|
|
@@ -2470,17 +2358,16 @@ class TreeComponent {
|
|
|
2470
2358
|
node.nestedTree()?.closeNestedNodes();
|
|
2471
2359
|
});
|
|
2472
2360
|
}
|
|
2473
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type:
|
|
2474
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "20.2.3", type:
|
|
2361
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type: Tree, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2362
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "20.2.3", type: Tree, isStandalone: true, selector: "b-tree", inputs: { draggable: { classPropertyName: "draggable", publicName: "draggable", isSignal: true, isRequired: false, transformFunction: null }, closeRecursively: { classPropertyName: "closeRecursively", publicName: "closeRecursively", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { dropEmitter: "dropEmitter" }, host: { listeners: { "cdkDropListDropped": "dropEmitter.emit($event)" } }, queries: [{ propertyName: "nestedNodes", predicate: TreeNode, isSignal: true }], hostDirectives: [{ directive: i1$2.CdkDropList, inputs: ["id", "id", "cdkDropListConnectedTo", "connectedTo"], outputs: ["cdkDropListDropped", "cdkDropListDropped"] }, { directive: i1$2.CdkDropListGroup }], ngImport: i0, template: `<ng-content />`, isInline: true });
|
|
2475
2363
|
}
|
|
2476
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type:
|
|
2364
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type: Tree, decorators: [{
|
|
2477
2365
|
type: Component,
|
|
2478
2366
|
args: [{
|
|
2479
2367
|
selector: 'b-tree',
|
|
2480
2368
|
template: `<ng-content />`,
|
|
2481
2369
|
host: {
|
|
2482
2370
|
'(cdkDropListDropped)': 'dropEmitter.emit($event)',
|
|
2483
|
-
'[style.max-width]': 'maxWidth()',
|
|
2484
2371
|
},
|
|
2485
2372
|
hostDirectives: [
|
|
2486
2373
|
{
|
|
@@ -2494,92 +2381,54 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.3", ngImpor
|
|
|
2494
2381
|
}], ctorParameters: () => [] });
|
|
2495
2382
|
|
|
2496
2383
|
/**
|
|
2497
|
-
* Represents a
|
|
2498
|
-
* and optionally supports drag-and-drop functionality.
|
|
2384
|
+
* Represents a menu component that can optionally float.
|
|
2499
2385
|
*/
|
|
2500
|
-
class
|
|
2501
|
-
|
|
2502
|
-
|
|
2503
|
-
|
|
2504
|
-
extended = model(false, ...(ngDevMode ? [{ debugName: "extended" }] : []));
|
|
2505
|
-
/**
|
|
2506
|
-
* Reference to the `CdkDrag` directive for drag-and-drop functionality.
|
|
2507
|
-
*/
|
|
2508
|
-
node = inject(CdkDrag);
|
|
2509
|
-
/**
|
|
2510
|
-
* Reference to a nested `Tree` component, if present.
|
|
2511
|
-
*/
|
|
2512
|
-
nestedTree = contentChild(TreeComponent, ...(ngDevMode ? [{ debugName: "nestedTree" }] : []));
|
|
2513
|
-
/**
|
|
2514
|
-
* Emits an event when the node is closed.
|
|
2515
|
-
*/
|
|
2516
|
-
closeEmitter = output();
|
|
2517
|
-
/**
|
|
2518
|
-
* Lifecycle hook that is called after the component is initialized.
|
|
2519
|
-
*/
|
|
2520
|
-
ngOnInit() {
|
|
2521
|
-
this.node.lockAxis = 'y';
|
|
2522
|
-
}
|
|
2523
|
-
/**
|
|
2524
|
-
* Updates the disabled state of the node.
|
|
2525
|
-
* @param disabled - Whether the node should be disabled.
|
|
2526
|
-
*/
|
|
2527
|
-
handleNodeDisability(disabled) {
|
|
2528
|
-
this.node.disabled = disabled;
|
|
2529
|
-
}
|
|
2530
|
-
/**
|
|
2531
|
-
* Toggles the extended (expanded) state of the node.
|
|
2532
|
-
* Emits a close event if the node is collapsed and contains a nested tree.
|
|
2533
|
-
*/
|
|
2534
|
-
handleExtension() {
|
|
2535
|
-
const isExtended = this.extended();
|
|
2536
|
-
this.extended.set(!isExtended);
|
|
2537
|
-
if (isExtended && this.nestedTree()) {
|
|
2538
|
-
this.closeEmitter.emit();
|
|
2539
|
-
}
|
|
2540
|
-
}
|
|
2541
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type: TreeNodeComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2542
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.2.3", type: TreeNodeComponent, isStandalone: true, selector: "b-tree-node", inputs: { extended: { classPropertyName: "extended", publicName: "extended", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { extended: "extendedChange", closeEmitter: "closeEmitter" }, queries: [{ propertyName: "nestedTree", first: true, predicate: TreeComponent, descendants: true, isSignal: true }], hostDirectives: [{ directive: i1$2.CdkDrag, inputs: ["cdkDragDisabled", "disabled"] }], ngImport: i0, template: "<section>\n @if (!node.disabled) {\n <i b-icon icon=\"GripVertical\" [size]=\"15\" cdkDragHandle></i>\n }\n <div\n class=\"projected-content\"\n (click)=\"nestedTree() && handleExtension()\"\n (keydown.enter)=\"nestedTree() && handleExtension()\"\n (keydown.space)=\"nestedTree() && handleExtension()\"\n role=\"button\"\n tabindex=\"0\">\n <ng-content />\n </div>\n @if (nestedTree()) {\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"20\"\n height=\"20\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\">\n <path d=\"m6 9 6 6 6-6\" />\n </svg>\n }\n</section>\n@if (nestedTree() && extended()) {\n <div class=\"nested\">\n <ng-content select=\"b-tree\" />\n </div>\n}\n", dependencies: [{ kind: "component", type: IconComponent, selector: "i[b-icon]", inputs: ["icon", "size", "strokeWidth", "color"] }, { kind: "directive", type: CdkDragHandle, selector: "[cdkDragHandle]", inputs: ["cdkDragHandleDisabled"] }] });
|
|
2386
|
+
class Menu {
|
|
2387
|
+
size = input('md', ...(ngDevMode ? [{ debugName: "size" }] : []));
|
|
2388
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type: Menu, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2389
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.2.3", type: Menu, isStandalone: true, selector: "b-menu", inputs: { size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.b-size-sm": "size() === 'sm'", "class.b-size-md": "size() === 'md'", "class.b-size-lg": "size() === 'lg'" } }, hostDirectives: [{ directive: i1$3.CdkMenu }], ngImport: i0, template: `<ng-content />`, isInline: true });
|
|
2543
2390
|
}
|
|
2544
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type:
|
|
2391
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type: Menu, decorators: [{
|
|
2545
2392
|
type: Component,
|
|
2546
|
-
args: [{
|
|
2547
|
-
|
|
2548
|
-
|
|
2549
|
-
|
|
2550
|
-
|
|
2551
|
-
|
|
2393
|
+
args: [{
|
|
2394
|
+
selector: 'b-menu',
|
|
2395
|
+
template: `<ng-content />`,
|
|
2396
|
+
hostDirectives: [CdkMenu],
|
|
2397
|
+
host: {
|
|
2398
|
+
'[class.b-size-sm]': "size() === 'sm'",
|
|
2399
|
+
'[class.b-size-md]': "size() === 'md'",
|
|
2400
|
+
'[class.b-size-lg]': "size() === 'lg'",
|
|
2401
|
+
},
|
|
2402
|
+
}]
|
|
2552
2403
|
}] });
|
|
2553
2404
|
|
|
2554
2405
|
/**
|
|
2555
|
-
* Represents a
|
|
2406
|
+
* Represents a group of menu items.
|
|
2556
2407
|
*/
|
|
2557
|
-
class
|
|
2558
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type:
|
|
2559
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.2.3", type:
|
|
2408
|
+
class MenuGroup {
|
|
2409
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type: MenuGroup, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2410
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.2.3", type: MenuGroup, isStandalone: true, selector: "b-menu-group", hostDirectives: [{ directive: i1$3.CdkMenuGroup }], ngImport: i0, template: `<ng-content />`, isInline: true });
|
|
2560
2411
|
}
|
|
2561
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type:
|
|
2412
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type: MenuGroup, decorators: [{
|
|
2562
2413
|
type: Component,
|
|
2563
2414
|
args: [{
|
|
2564
|
-
selector: 'b-menu',
|
|
2565
|
-
imports: [],
|
|
2415
|
+
selector: 'b-menu-group',
|
|
2566
2416
|
template: `<ng-content />`,
|
|
2567
|
-
hostDirectives: [
|
|
2417
|
+
hostDirectives: [CdkMenuGroup],
|
|
2568
2418
|
}]
|
|
2569
2419
|
}] });
|
|
2570
2420
|
|
|
2571
2421
|
/**
|
|
2572
2422
|
* Represents a label for a menu.
|
|
2573
2423
|
*/
|
|
2574
|
-
class
|
|
2575
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type:
|
|
2576
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.2.3", type:
|
|
2424
|
+
class MenuLabel {
|
|
2425
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type: MenuLabel, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2426
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.2.3", type: MenuLabel, isStandalone: true, selector: "b-menu-label", ngImport: i0, template: `<ng-content />`, isInline: true });
|
|
2577
2427
|
}
|
|
2578
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type:
|
|
2428
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type: MenuLabel, decorators: [{
|
|
2579
2429
|
type: Component,
|
|
2580
2430
|
args: [{
|
|
2581
2431
|
selector: 'b-menu-label',
|
|
2582
|
-
imports: [],
|
|
2583
2432
|
template: `<ng-content />`,
|
|
2584
2433
|
}]
|
|
2585
2434
|
}] });
|
|
@@ -2587,19 +2436,18 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.3", ngImpor
|
|
|
2587
2436
|
/**
|
|
2588
2437
|
* Represents a menu item with support for typeahead and disabled states.
|
|
2589
2438
|
*/
|
|
2590
|
-
class
|
|
2439
|
+
class MenuItem {
|
|
2591
2440
|
/**
|
|
2592
2441
|
* Input to set the squared state of the menu item.
|
|
2593
2442
|
*/
|
|
2594
2443
|
squared = input(false, ...(ngDevMode ? [{ debugName: "squared" }] : []));
|
|
2595
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type:
|
|
2596
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.2.3", type:
|
|
2444
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type: MenuItem, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2445
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.2.3", type: MenuItem, isStandalone: true, selector: "button[b-menu-item]", inputs: { squared: { classPropertyName: "squared", publicName: "squared", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.squared": "squared()" } }, hostDirectives: [{ directive: i1$3.CdkMenuItem, inputs: ["cdkMenuItemDisabled", "disabled", "cdkMenuitemTypeaheadLabel", "typeaheadLabel"], outputs: ["cdkMenuItemTriggered", "triggered"] }], ngImport: i0, template: `<ng-content />`, isInline: true });
|
|
2597
2446
|
}
|
|
2598
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type:
|
|
2447
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type: MenuItem, decorators: [{
|
|
2599
2448
|
type: Component,
|
|
2600
2449
|
args: [{
|
|
2601
2450
|
selector: 'button[b-menu-item]',
|
|
2602
|
-
imports: [],
|
|
2603
2451
|
template: `<ng-content />`,
|
|
2604
2452
|
hostDirectives: [
|
|
2605
2453
|
{
|
|
@@ -2617,39 +2465,21 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.3", ngImpor
|
|
|
2617
2465
|
}]
|
|
2618
2466
|
}] });
|
|
2619
2467
|
|
|
2620
|
-
/**
|
|
2621
|
-
* Represents a group of menu items.
|
|
2622
|
-
*/
|
|
2623
|
-
class MenuGroupComponent {
|
|
2624
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type: MenuGroupComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2625
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.2.3", type: MenuGroupComponent, isStandalone: true, selector: "b-menu-group", hostDirectives: [{ directive: i1$3.CdkMenuGroup }], ngImport: i0, template: `<ng-content />`, isInline: true });
|
|
2626
|
-
}
|
|
2627
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type: MenuGroupComponent, decorators: [{
|
|
2628
|
-
type: Component,
|
|
2629
|
-
args: [{
|
|
2630
|
-
selector: 'b-menu-group',
|
|
2631
|
-
imports: [],
|
|
2632
|
-
template: `<ng-content />`,
|
|
2633
|
-
hostDirectives: [CdkMenuGroup],
|
|
2634
|
-
}]
|
|
2635
|
-
}] });
|
|
2636
|
-
|
|
2637
2468
|
/**
|
|
2638
2469
|
* Represents a checkbox menu item.
|
|
2639
2470
|
*/
|
|
2640
|
-
class
|
|
2471
|
+
class MenuItemCheckbox {
|
|
2641
2472
|
/**
|
|
2642
2473
|
* Input to set the squared state of the menu item.
|
|
2643
2474
|
*/
|
|
2644
2475
|
squared = input(false, ...(ngDevMode ? [{ debugName: "squared" }] : []));
|
|
2645
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type:
|
|
2646
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.2.3", type:
|
|
2476
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type: MenuItemCheckbox, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2477
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.2.3", type: MenuItemCheckbox, isStandalone: true, selector: "button[b-menu-item-checkbox]", inputs: { squared: { classPropertyName: "squared", publicName: "squared", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.squared": "squared()" } }, hostDirectives: [{ directive: i1$3.CdkMenuItemCheckbox, inputs: ["cdkMenuItemDisabled", "disabled", "cdkMenuitemTypeaheadLabel", "typeaheadLabel", "cdkMenuItemChecked", "active"], outputs: ["cdkMenuItemTriggered", "triggered"] }], ngImport: i0, template: `<ng-content />`, isInline: true });
|
|
2647
2478
|
}
|
|
2648
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type:
|
|
2479
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type: MenuItemCheckbox, decorators: [{
|
|
2649
2480
|
type: Component,
|
|
2650
2481
|
args: [{
|
|
2651
2482
|
selector: 'button[b-menu-item-checkbox]',
|
|
2652
|
-
imports: [],
|
|
2653
2483
|
template: `<ng-content />`,
|
|
2654
2484
|
hostDirectives: [
|
|
2655
2485
|
{
|
|
@@ -2671,19 +2501,18 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.3", ngImpor
|
|
|
2671
2501
|
/**
|
|
2672
2502
|
* Represents a radio menu item.
|
|
2673
2503
|
*/
|
|
2674
|
-
class
|
|
2504
|
+
class MenuItemRadio {
|
|
2675
2505
|
/**
|
|
2676
2506
|
* Input to set the squared state of the menu item.
|
|
2677
2507
|
*/
|
|
2678
2508
|
squared = input(false, ...(ngDevMode ? [{ debugName: "squared" }] : []));
|
|
2679
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type:
|
|
2680
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.2.3", type:
|
|
2509
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type: MenuItemRadio, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2510
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.2.3", type: MenuItemRadio, isStandalone: true, selector: "button[b-menu-item-radio]", inputs: { squared: { classPropertyName: "squared", publicName: "squared", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.squared": "squared()" } }, hostDirectives: [{ directive: i1$3.CdkMenuItemRadio, inputs: ["cdkMenuItemDisabled", "disabled", "cdkMenuitemTypeaheadLabel", "typeaheadLabel", "cdkMenuItemChecked", "active"], outputs: ["cdkMenuItemTriggered", "triggered"] }], ngImport: i0, template: `<ng-content />`, isInline: true });
|
|
2681
2511
|
}
|
|
2682
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type:
|
|
2512
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type: MenuItemRadio, decorators: [{
|
|
2683
2513
|
type: Component,
|
|
2684
2514
|
args: [{
|
|
2685
2515
|
selector: 'button[b-menu-item-radio]',
|
|
2686
|
-
imports: [],
|
|
2687
2516
|
template: `<ng-content />`,
|
|
2688
2517
|
hostDirectives: [
|
|
2689
2518
|
{
|
|
@@ -2796,8 +2625,13 @@ class MenuTriggerDirective {
|
|
|
2796
2625
|
offsetX: !this.submenu() ? 5 : undefined,
|
|
2797
2626
|
},
|
|
2798
2627
|
};
|
|
2799
|
-
const
|
|
2800
|
-
|
|
2628
|
+
const pos = this.menuTriggerPosition();
|
|
2629
|
+
if (Array.isArray(pos)) {
|
|
2630
|
+
this.trigger.menuPosition = pos.map(p => positionMap[p]);
|
|
2631
|
+
}
|
|
2632
|
+
else {
|
|
2633
|
+
this.trigger.menuPosition = [positionMap[pos]];
|
|
2634
|
+
}
|
|
2801
2635
|
}
|
|
2802
2636
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type: MenuTriggerDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
2803
2637
|
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.2.3", type: MenuTriggerDirective, isStandalone: true, selector: "[menuTriggerFor]", inputs: { menuTriggerPosition: { classPropertyName: "menuTriggerPosition", publicName: "menuTriggerPosition", isSignal: true, isRequired: false, transformFunction: null }, submenu: { classPropertyName: "submenu", publicName: "submenu", isSignal: true, isRequired: false, transformFunction: null } }, hostDirectives: [{ directive: i1$3.CdkMenuTrigger, inputs: ["cdkMenuTriggerFor", "menuTriggerFor"] }], ngImport: i0 });
|
|
@@ -2815,37 +2649,72 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.3", ngImpor
|
|
|
2815
2649
|
}]
|
|
2816
2650
|
}] });
|
|
2817
2651
|
|
|
2818
|
-
class
|
|
2652
|
+
class Alert {
|
|
2819
2653
|
/** The type of the alert. */
|
|
2820
2654
|
type = input('info', ...(ngDevMode ? [{ debugName: "type" }] : []));
|
|
2821
2655
|
/** The title of the alert. */
|
|
2822
2656
|
title = input(null, ...(ngDevMode ? [{ debugName: "title" }] : []));
|
|
2823
|
-
/** The icon
|
|
2657
|
+
/** The icon name for ng-icon. */
|
|
2824
2658
|
icon = input(null, ...(ngDevMode ? [{ debugName: "icon" }] : []));
|
|
2825
2659
|
/** Whether the alert is dismissible. */
|
|
2826
2660
|
dismissible = input(false, ...(ngDevMode ? [{ debugName: "dismissible" }] : []));
|
|
2827
2661
|
/** Event emitted when the alert is dismissed. */
|
|
2828
2662
|
dismissed = output();
|
|
2829
|
-
/** The maximum width of the alert. */
|
|
2830
|
-
maxWidth = input(null, ...(ngDevMode ? [{ debugName: "maxWidth" }] : []));
|
|
2831
|
-
/** The color foreground of the alert. */
|
|
2832
|
-
colorForeground = computed(() => {
|
|
2833
|
-
return this.type() === 'info'
|
|
2834
|
-
? 'var(--secondary-foreground)'
|
|
2835
|
-
: `var(--${this.type()}-foreground)`;
|
|
2836
|
-
}, ...(ngDevMode ? [{ debugName: "colorForeground" }] : []));
|
|
2837
2663
|
dismiss() {
|
|
2838
2664
|
this.dismissed.emit();
|
|
2839
2665
|
}
|
|
2840
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type:
|
|
2841
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.2.3", type:
|
|
2666
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type: Alert, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2667
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.2.3", type: Alert, isStandalone: true, selector: "b-alert", inputs: { type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, dismissible: { classPropertyName: "dismissible", publicName: "dismissible", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { dismissed: "dismissed" }, host: { properties: { "class": "type()" } }, providers: [provideIcons({ lucideX })], ngImport: i0, template: `
|
|
2668
|
+
@if (icon()) {
|
|
2669
|
+
<div class="icon">
|
|
2670
|
+
<ng-icon [name]="icon()!" size="20" color="currentColor" />
|
|
2671
|
+
</div>
|
|
2672
|
+
}
|
|
2673
|
+
<div class="content">
|
|
2674
|
+
@if (title()) {
|
|
2675
|
+
<div class="title">{{ title() }}</div>
|
|
2676
|
+
}
|
|
2677
|
+
<div class="body">
|
|
2678
|
+
<ng-content />
|
|
2679
|
+
</div>
|
|
2680
|
+
</div>
|
|
2681
|
+
@if (dismissible()) {
|
|
2682
|
+
<button class="close-btn" (click)="dismiss()" aria-label="Close">
|
|
2683
|
+
<ng-icon name="lucideX" size="16" color="currentColor" />
|
|
2684
|
+
</button>
|
|
2685
|
+
}
|
|
2686
|
+
`, isInline: true, dependencies: [{ kind: "component", type: NgIcon, selector: "ng-icon", inputs: ["name", "svg", "size", "strokeWidth", "color"] }] });
|
|
2842
2687
|
}
|
|
2843
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type:
|
|
2688
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type: Alert, decorators: [{
|
|
2844
2689
|
type: Component,
|
|
2845
|
-
args: [{
|
|
2690
|
+
args: [{
|
|
2691
|
+
selector: 'b-alert',
|
|
2692
|
+
template: `
|
|
2693
|
+
@if (icon()) {
|
|
2694
|
+
<div class="icon">
|
|
2695
|
+
<ng-icon [name]="icon()!" size="20" color="currentColor" />
|
|
2696
|
+
</div>
|
|
2697
|
+
}
|
|
2698
|
+
<div class="content">
|
|
2699
|
+
@if (title()) {
|
|
2700
|
+
<div class="title">{{ title() }}</div>
|
|
2701
|
+
}
|
|
2702
|
+
<div class="body">
|
|
2703
|
+
<ng-content />
|
|
2704
|
+
</div>
|
|
2705
|
+
</div>
|
|
2706
|
+
@if (dismissible()) {
|
|
2707
|
+
<button class="close-btn" (click)="dismiss()" aria-label="Close">
|
|
2708
|
+
<ng-icon name="lucideX" size="16" color="currentColor" />
|
|
2709
|
+
</button>
|
|
2710
|
+
}
|
|
2711
|
+
`,
|
|
2712
|
+
imports: [NgIcon],
|
|
2713
|
+
host: {
|
|
2846
2714
|
'[class]': 'type()',
|
|
2847
|
-
|
|
2848
|
-
|
|
2715
|
+
},
|
|
2716
|
+
providers: [provideIcons({ lucideX })],
|
|
2717
|
+
}]
|
|
2849
2718
|
}] });
|
|
2850
2719
|
|
|
2851
2720
|
/**
|
|
@@ -2961,7 +2830,7 @@ class CommandOptionsComponent {
|
|
|
2961
2830
|
}
|
|
2962
2831
|
}
|
|
2963
2832
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type: CommandOptionsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2964
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.2.3", type: CommandOptionsComponent, isStandalone: true, selector: "ul[b-command-options]", inputs: { noOptionsMessage: { classPropertyName: "noOptionsMessage", publicName: "noOptionsMessage", isSignal: true, isRequired: false, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { closeEmitter: "closeEmitter" }, host: { listeners: { "cdkListboxValueChange": "handleValueChange($event.value)", "keydown.enter": "onEnter()" }, properties: { "cdkListboxValue": "value()", "cdkListboxMultiple": "multiple()" } }, queries: [{ propertyName: "options", predicate: CdkOption, isSignal: true }], hostDirectives: [{ directive: i1.CdkListbox, inputs: ["cdkListboxValue", "cdkListboxValue", "cdkListboxMultiple", "multiple"], outputs: ["cdkListboxValueChange", "cdkListboxValueChange"] }], ngImport: i0, template: `<ng-content />
|
|
2833
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.2.3", type: CommandOptionsComponent, isStandalone: true, selector: "ul[b-command-options]", inputs: { noOptionsMessage: { classPropertyName: "noOptionsMessage", publicName: "noOptionsMessage", isSignal: true, isRequired: false, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { closeEmitter: "closeEmitter" }, host: { listeners: { "cdkListboxValueChange": "handleValueChange($event.value)", "keydown.enter": "onEnter()" }, properties: { "cdkListboxValue": "value()", "cdkListboxMultiple": "multiple()" } }, queries: [{ propertyName: "options", predicate: CdkOption, isSignal: true }], hostDirectives: [{ directive: i1$1.CdkListbox, inputs: ["cdkListboxValue", "cdkListboxValue", "cdkListboxMultiple", "multiple"], outputs: ["cdkListboxValueChange", "cdkListboxValueChange"] }], ngImport: i0, template: `<ng-content />
|
|
2965
2834
|
@if (options().length === 0) {
|
|
2966
2835
|
<div class="no-options-message">
|
|
2967
2836
|
{{ noOptionsMessage() }}
|
|
@@ -2995,6 +2864,41 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.3", ngImpor
|
|
|
2995
2864
|
}]
|
|
2996
2865
|
}] });
|
|
2997
2866
|
|
|
2867
|
+
/**
|
|
2868
|
+
* Utility service for common operations.
|
|
2869
|
+
*/
|
|
2870
|
+
class UtilsService {
|
|
2871
|
+
debounceTimers = new Map();
|
|
2872
|
+
/**
|
|
2873
|
+
* Executes a function after a delay, canceling any previous calls with the same key.
|
|
2874
|
+
*
|
|
2875
|
+
* @param key - Unique key to identify the debounce timer.
|
|
2876
|
+
* @param func - The function to debounce.
|
|
2877
|
+
* @param delay - The delay in milliseconds before executing the function.
|
|
2878
|
+
*/
|
|
2879
|
+
debounce(key, func, delay) {
|
|
2880
|
+
clearTimeout(this.debounceTimers.get(key));
|
|
2881
|
+
this.debounceTimers.set(key, setTimeout(func, delay));
|
|
2882
|
+
}
|
|
2883
|
+
/**
|
|
2884
|
+
* Cancels the debounce timer for a specific key.
|
|
2885
|
+
*
|
|
2886
|
+
* @param key - Unique key to identify the debounce timer.
|
|
2887
|
+
*/
|
|
2888
|
+
stopDebounce(key) {
|
|
2889
|
+
clearTimeout(this.debounceTimers.get(key));
|
|
2890
|
+
this.debounceTimers.delete(key);
|
|
2891
|
+
}
|
|
2892
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type: UtilsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2893
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type: UtilsService, providedIn: 'root' });
|
|
2894
|
+
}
|
|
2895
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type: UtilsService, decorators: [{
|
|
2896
|
+
type: Injectable,
|
|
2897
|
+
args: [{
|
|
2898
|
+
providedIn: 'root',
|
|
2899
|
+
}]
|
|
2900
|
+
}] });
|
|
2901
|
+
|
|
2998
2902
|
/**
|
|
2999
2903
|
* Component representing a command input with associated options.
|
|
3000
2904
|
* It provides keyboard navigation and focus trapping for accessibility.
|
|
@@ -3078,13 +2982,13 @@ class CommandComponent {
|
|
|
3078
2982
|
(keydown.enter)="commandOptions()?.selectOption()"
|
|
3079
2983
|
(blur)="isDesktop() && trappedInput.el.nativeElement.focus()"
|
|
3080
2984
|
(input)="onInput($event)" />
|
|
3081
|
-
<ng-content />`, isInline: true, dependencies: [{ kind: "component", type:
|
|
2985
|
+
<ng-content />`, isInline: true, dependencies: [{ kind: "component", type: Input, selector: "input[b-input]", inputs: ["type", "decimals", "numberType", "size"], exportAs: ["bInput"] }, { kind: "directive", type: CdkTrapFocus, selector: "[cdkTrapFocus]", inputs: ["cdkTrapFocus", "cdkTrapFocusAutoCapture"], exportAs: ["cdkTrapFocus"] }] });
|
|
3082
2986
|
}
|
|
3083
2987
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type: CommandComponent, decorators: [{
|
|
3084
2988
|
type: Component,
|
|
3085
2989
|
args: [{
|
|
3086
2990
|
selector: 'b-command',
|
|
3087
|
-
imports: [
|
|
2991
|
+
imports: [Input, CdkTrapFocus],
|
|
3088
2992
|
template: `<input
|
|
3089
2993
|
type="text"
|
|
3090
2994
|
b-input
|
|
@@ -3104,421 +3008,174 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.3", ngImpor
|
|
|
3104
3008
|
}] });
|
|
3105
3009
|
|
|
3106
3010
|
/**
|
|
3107
|
-
*
|
|
3108
|
-
*
|
|
3011
|
+
* Directive to mark an element as a trigger for an overlay.
|
|
3012
|
+
* Integrates with Angular CDK's `CdkOverlayOrigin` to provide
|
|
3013
|
+
* a reference point for overlay positioning.
|
|
3109
3014
|
*/
|
|
3110
|
-
class
|
|
3111
|
-
/**
|
|
3112
|
-
* Placeholder text displayed when no option is selected.
|
|
3113
|
-
*/
|
|
3114
|
-
placeholder = input('', ...(ngDevMode ? [{ debugName: "placeholder" }] : []));
|
|
3115
|
-
/**
|
|
3116
|
-
* Signal indicating whether the dropdown is currently open.
|
|
3117
|
-
*/
|
|
3118
|
-
isOpen = signal(false, ...(ngDevMode ? [{ debugName: "isOpen" }] : []));
|
|
3119
|
-
/**
|
|
3120
|
-
* Reference to the button element used to toggle the dropdown.
|
|
3121
|
-
* This is used for managing focus and interactions.
|
|
3122
|
-
*/
|
|
3123
|
-
button = viewChild(ButtonComponent, ...(ngDevMode ? [{ debugName: "button" }] : []));
|
|
3124
|
-
/**
|
|
3125
|
-
* Reference to the content component of the dropdown.
|
|
3126
|
-
* This contains the list of selectable options.
|
|
3127
|
-
*/
|
|
3128
|
-
command = contentChild(CommandComponent, ...(ngDevMode ? [{ debugName: "command" }] : []));
|
|
3129
|
-
/**
|
|
3130
|
-
* Computed signal representing the selected values from the dropdown.
|
|
3131
|
-
* This is linked to the value of the `CommandComponent`.
|
|
3132
|
-
*/
|
|
3133
|
-
value = linkedSignal(() => this.command()?.value());
|
|
3134
|
-
/**
|
|
3135
|
-
* Linked signal for the width of the button element.
|
|
3136
|
-
* This is used to set the width of the dropdown overlay.
|
|
3137
|
-
*/
|
|
3138
|
-
buttonWidth = linkedSignal(() => this.button()?.el.nativeElement.offsetWidth);
|
|
3139
|
-
/**
|
|
3140
|
-
* Model indicating whether the combobox component is disabled.
|
|
3141
|
-
* When disabled, the dropdown cannot be opened or interacted with.
|
|
3142
|
-
*/
|
|
3143
|
-
disabled = model(false, ...(ngDevMode ? [{ debugName: "disabled" }] : []));
|
|
3144
|
-
/**
|
|
3145
|
-
* Computed signal representing the options available in the dropdown.
|
|
3146
|
-
* This retrieves the options from the `CommandComponent`.
|
|
3147
|
-
*/
|
|
3148
|
-
options = computed(() => this.command()?.options(), ...(ngDevMode ? [{ debugName: "options" }] : []));
|
|
3149
|
-
/**
|
|
3150
|
-
* Computed signal representing the content of the selected option(s).
|
|
3151
|
-
* If no option is selected, it returns the placeholder text.
|
|
3152
|
-
*/
|
|
3153
|
-
content = computed(() => {
|
|
3154
|
-
const selected = this.value();
|
|
3155
|
-
if (selected &&
|
|
3156
|
-
selected.length > 0 &&
|
|
3157
|
-
!(selected.length === 1 && selected[0] === '')) {
|
|
3158
|
-
return this.options()?.reduce((acc, option) => {
|
|
3159
|
-
if (selected.includes(option.value)) {
|
|
3160
|
-
return acc ? acc + ', ' + option.getLabel() : option.getLabel();
|
|
3161
|
-
}
|
|
3162
|
-
return acc;
|
|
3163
|
-
}, '');
|
|
3164
|
-
}
|
|
3165
|
-
else {
|
|
3166
|
-
return this.placeholder();
|
|
3167
|
-
}
|
|
3168
|
-
}, ...(ngDevMode ? [{ debugName: "content" }] : []));
|
|
3169
|
-
/**
|
|
3170
|
-
* Signal representing the delay before closing the dropdown.
|
|
3171
|
-
* This is used to provide a smooth transition when closing the dropdown.
|
|
3172
|
-
*/
|
|
3173
|
-
closeDelay = signal(150, ...(ngDevMode ? [{ debugName: "closeDelay" }] : []));
|
|
3174
|
-
/**
|
|
3175
|
-
* Lifecycle hook that is called after the component is initialized.
|
|
3176
|
-
* It sets up the necessary subscriptions for handling value changes.
|
|
3177
|
-
*/
|
|
3178
|
-
ngOnInit() {
|
|
3179
|
-
this.handleSelectedValueChange();
|
|
3180
|
-
}
|
|
3181
|
-
/**
|
|
3182
|
-
* Subscribes to the `closeEmitter` of the `CommandComponent` to handle
|
|
3183
|
-
* changes to the selected value. This ensures the dropdown closes and the
|
|
3184
|
-
* value is propagated to Angular Forms.
|
|
3185
|
-
*/
|
|
3186
|
-
handleSelectedValueChange() {
|
|
3187
|
-
this.command()
|
|
3188
|
-
?.commandOptions()
|
|
3189
|
-
?.closeEmitter.subscribe(() => {
|
|
3190
|
-
this.onChange(this.value());
|
|
3191
|
-
this.onTouched();
|
|
3192
|
-
this.isOpen.set(false);
|
|
3193
|
-
});
|
|
3194
|
-
}
|
|
3195
|
-
/**
|
|
3196
|
-
* Focuses the input element within the command component when the overlay is attached.
|
|
3197
|
-
*/
|
|
3198
|
-
onOverlayAttached() {
|
|
3199
|
-
this.buttonWidth.set(this.button()?.el.nativeElement.offsetWidth);
|
|
3200
|
-
this.command()?.el.nativeElement.querySelector('input')?.focus();
|
|
3201
|
-
}
|
|
3202
|
-
/**
|
|
3203
|
-
* Sets the width of the button element when the window is resized.
|
|
3204
|
-
* This ensures that the dropdown overlay matches the width of the button.
|
|
3205
|
-
*/
|
|
3206
|
-
setButtonWidth() {
|
|
3207
|
-
this.buttonWidth.set(this.button()?.el.nativeElement.offsetWidth);
|
|
3208
|
-
}
|
|
3209
|
-
/**
|
|
3210
|
-
* Computed signal indicando si se permite selección múltiple.
|
|
3211
|
-
* Se obtiene de CommandOptionsComponent.
|
|
3212
|
-
*/
|
|
3213
|
-
multiple = computed(() => this.command()?.commandOptions()?.multiple() ?? false, ...(ngDevMode ? [{ debugName: "multiple" }] : []));
|
|
3214
|
-
// Control Value Accessor methods
|
|
3215
|
-
/**
|
|
3216
|
-
* Callback function to propagate changes to the model.
|
|
3217
|
-
* This is called whenever the value changes.
|
|
3218
|
-
*/
|
|
3219
|
-
onChange = () => undefined;
|
|
3220
|
-
/**
|
|
3221
|
-
* Callback function to mark the component as touched.
|
|
3222
|
-
* This is called when the component loses focus.
|
|
3223
|
-
*/
|
|
3224
|
-
onTouched = () => undefined;
|
|
3225
|
-
/**
|
|
3226
|
-
* Writes a new value to the component.
|
|
3227
|
-
* Este método ahora soporta selección múltiple.
|
|
3228
|
-
*/
|
|
3229
|
-
writeValue(value) {
|
|
3230
|
-
if (!value) {
|
|
3231
|
-
return;
|
|
3232
|
-
}
|
|
3233
|
-
const values = this.multiple()
|
|
3234
|
-
? Array.isArray(value)
|
|
3235
|
-
? value
|
|
3236
|
-
: [value]
|
|
3237
|
-
: [typeof value === 'string' ? value : value?.[0]];
|
|
3238
|
-
if (values) {
|
|
3239
|
-
values.forEach(val => {
|
|
3240
|
-
this.command()?.commandOptions()?.cdkListbox?.selectValue(val);
|
|
3241
|
-
});
|
|
3242
|
-
this.value.set(values);
|
|
3243
|
-
}
|
|
3244
|
-
}
|
|
3245
|
-
/**
|
|
3246
|
-
* Registers a callback function to be called when the value changes.
|
|
3247
|
-
* Ahora soporta selección múltiple.
|
|
3248
|
-
*/
|
|
3249
|
-
registerOnChange(fn) {
|
|
3250
|
-
this.onChange = (val) => {
|
|
3251
|
-
if (this.multiple()) {
|
|
3252
|
-
fn(val);
|
|
3253
|
-
}
|
|
3254
|
-
else {
|
|
3255
|
-
fn(val?.[0] ?? '');
|
|
3256
|
-
}
|
|
3257
|
-
};
|
|
3258
|
-
}
|
|
3015
|
+
class OverlayOrigin {
|
|
3259
3016
|
/**
|
|
3260
|
-
*
|
|
3261
|
-
*
|
|
3017
|
+
* Reference to the `CdkOverlayOrigin` instance.
|
|
3018
|
+
* Used as the origin point for overlay positioning.
|
|
3262
3019
|
*/
|
|
3263
|
-
|
|
3264
|
-
this.onTouched = fn;
|
|
3265
|
-
}
|
|
3020
|
+
trigger = inject(CdkOverlayOrigin);
|
|
3266
3021
|
/**
|
|
3267
|
-
*
|
|
3268
|
-
* This
|
|
3269
|
-
* @param isDisabled - A boolean indicating whether the component should be disabled.
|
|
3022
|
+
* Reference to the `ElementRef` of the host element.
|
|
3023
|
+
* This is used to access the native DOM element.
|
|
3270
3024
|
*/
|
|
3271
|
-
|
|
3272
|
-
|
|
3273
|
-
}
|
|
3274
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type: ComboboxComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
3275
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "20.2.3", type: ComboboxComponent, isStandalone: true, selector: "b-combobox", inputs: { placeholder: { classPropertyName: "placeholder", publicName: "placeholder", 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()" } }, providers: [
|
|
3276
|
-
{
|
|
3277
|
-
provide: NG_VALUE_ACCESSOR,
|
|
3278
|
-
useExisting: forwardRef(() => ComboboxComponent),
|
|
3279
|
-
multi: true,
|
|
3280
|
-
},
|
|
3281
|
-
], queries: [{ propertyName: "command", first: true, predicate: CommandComponent, descendants: true, isSignal: true }], viewQueries: [{ propertyName: "button", first: true, predicate: ButtonComponent, descendants: true, isSignal: true }], ngImport: i0, template: ` <button
|
|
3282
|
-
b-button
|
|
3283
|
-
variant="outlined"
|
|
3284
|
-
(click)="isOpen.set(!isOpen())"
|
|
3285
|
-
(keydown.arrowUp)="!isOpen() && isOpen.set(true)"
|
|
3286
|
-
(keydown.arrowDown)="!isOpen() && isOpen.set(true)"
|
|
3287
|
-
[activeEnabled]="false"
|
|
3288
|
-
bOverlayTrigger
|
|
3289
|
-
#trigger="bOverlayTrigger"
|
|
3290
|
-
[disabled]="disabled()">
|
|
3291
|
-
<span>{{ content() }}</span>
|
|
3292
|
-
<i b-icon icon="ChevronDown" [size]="16"></i>
|
|
3293
|
-
</button>
|
|
3294
|
-
<ng-template
|
|
3295
|
-
bOverlay
|
|
3296
|
-
[trigger]="trigger"
|
|
3297
|
-
[open]="isOpen()"
|
|
3298
|
-
[minWidth]="buttonWidth()"
|
|
3299
|
-
[positions]="['bottom-left', 'bottom-right', 'top-left', 'top-right']"
|
|
3300
|
-
[closeDelay]="closeDelay()"
|
|
3301
|
-
(attach)="onOverlayAttached()"
|
|
3302
|
-
(outsideClick)="isOpen.set(false)"
|
|
3303
|
-
(detach)="isOpen.set(false)">
|
|
3304
|
-
<ng-content />
|
|
3305
|
-
</ng-template>`, isInline: true, dependencies: [{ kind: "component", type: ButtonComponent, selector: "button[b-button]", inputs: ["variant", "size", "activeEnabled", "squared"] }, { kind: "component", type: IconComponent, selector: "i[b-icon]", inputs: ["icon", "size", "strokeWidth", "color"] }, { kind: "directive", type: OverlayTriggerDirective, selector: "[bOverlayTrigger]", exportAs: ["bOverlayTrigger"] }, { kind: "directive", type: OverlayDirective, selector: "[bOverlay]", inputs: ["open", "trigger", "closeDelay", "positions"] }] });
|
|
3025
|
+
el = inject(ElementRef);
|
|
3026
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type: OverlayOrigin, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
3027
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.2.3", type: OverlayOrigin, isStandalone: true, selector: "[bOverlayOrigin]", exportAs: ["bOverlayOrigin"], hostDirectives: [{ directive: i1.CdkOverlayOrigin }], ngImport: i0 });
|
|
3306
3028
|
}
|
|
3307
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type:
|
|
3308
|
-
type:
|
|
3029
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type: OverlayOrigin, decorators: [{
|
|
3030
|
+
type: Directive,
|
|
3309
3031
|
args: [{
|
|
3310
|
-
selector: '
|
|
3311
|
-
|
|
3312
|
-
|
|
3313
|
-
IconComponent,
|
|
3314
|
-
OverlayTriggerDirective,
|
|
3315
|
-
OverlayDirective,
|
|
3316
|
-
],
|
|
3317
|
-
template: ` <button
|
|
3318
|
-
b-button
|
|
3319
|
-
variant="outlined"
|
|
3320
|
-
(click)="isOpen.set(!isOpen())"
|
|
3321
|
-
(keydown.arrowUp)="!isOpen() && isOpen.set(true)"
|
|
3322
|
-
(keydown.arrowDown)="!isOpen() && isOpen.set(true)"
|
|
3323
|
-
[activeEnabled]="false"
|
|
3324
|
-
bOverlayTrigger
|
|
3325
|
-
#trigger="bOverlayTrigger"
|
|
3326
|
-
[disabled]="disabled()">
|
|
3327
|
-
<span>{{ content() }}</span>
|
|
3328
|
-
<i b-icon icon="ChevronDown" [size]="16"></i>
|
|
3329
|
-
</button>
|
|
3330
|
-
<ng-template
|
|
3331
|
-
bOverlay
|
|
3332
|
-
[trigger]="trigger"
|
|
3333
|
-
[open]="isOpen()"
|
|
3334
|
-
[minWidth]="buttonWidth()"
|
|
3335
|
-
[positions]="['bottom-left', 'bottom-right', 'top-left', 'top-right']"
|
|
3336
|
-
[closeDelay]="closeDelay()"
|
|
3337
|
-
(attach)="onOverlayAttached()"
|
|
3338
|
-
(outsideClick)="isOpen.set(false)"
|
|
3339
|
-
(detach)="isOpen.set(false)">
|
|
3340
|
-
<ng-content />
|
|
3341
|
-
</ng-template>`,
|
|
3342
|
-
providers: [
|
|
3343
|
-
{
|
|
3344
|
-
provide: NG_VALUE_ACCESSOR,
|
|
3345
|
-
useExisting: forwardRef(() => ComboboxComponent),
|
|
3346
|
-
multi: true,
|
|
3347
|
-
},
|
|
3348
|
-
],
|
|
3032
|
+
selector: '[bOverlayOrigin]',
|
|
3033
|
+
hostDirectives: [CdkOverlayOrigin],
|
|
3034
|
+
exportAs: 'bOverlayOrigin',
|
|
3349
3035
|
}]
|
|
3350
|
-
}]
|
|
3351
|
-
type: HostListener,
|
|
3352
|
-
args: ['window:resize']
|
|
3353
|
-
}] } });
|
|
3036
|
+
}] });
|
|
3354
3037
|
|
|
3355
|
-
class
|
|
3356
|
-
|
|
3357
|
-
|
|
3358
|
-
*/
|
|
3359
|
-
maxWidth = input('100%', ...(ngDevMode ? [{ debugName: "maxWidth" }] : []));
|
|
3360
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type: InputGroupComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
3361
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.2.3", type: InputGroupComponent, isStandalone: true, selector: "b-input-group", inputs: { maxWidth: { classPropertyName: "maxWidth", publicName: "maxWidth", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "style.max-width": "maxWidth()" } }, ngImport: i0, template: `<ng-content />`, isInline: true });
|
|
3038
|
+
class InputGroup {
|
|
3039
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type: InputGroup, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
3040
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.2.3", type: InputGroup, isStandalone: true, selector: "b-input-group", ngImport: i0, template: `<ng-content />`, isInline: true });
|
|
3362
3041
|
}
|
|
3363
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type:
|
|
3042
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type: InputGroup, decorators: [{
|
|
3364
3043
|
type: Component,
|
|
3365
3044
|
args: [{
|
|
3366
3045
|
selector: 'b-input-group',
|
|
3367
3046
|
template: `<ng-content />`,
|
|
3368
|
-
host: {
|
|
3369
|
-
'[style.max-width]': 'maxWidth()',
|
|
3370
|
-
},
|
|
3371
3047
|
}]
|
|
3372
3048
|
}] });
|
|
3373
3049
|
|
|
3374
|
-
/**
|
|
3375
|
-
* DialogComponent acts as a custom container for dialogs opened via the Angular CDK Dialog module.
|
|
3376
|
-
* It provides custom close behavior (ESC key and outside click) and hosts the dialog content.
|
|
3050
|
+
/** Dialog content container that renders projected portal content for a dialog instance.
|
|
3377
3051
|
*
|
|
3378
|
-
* @
|
|
3379
|
-
* Used internally by DialogService. Not intended for direct use.
|
|
3052
|
+
* @remarks Extends CdkDialogContainer to integrate with Angular CDK dialog infrastructure.
|
|
3380
3053
|
*/
|
|
3381
|
-
class
|
|
3382
|
-
/**
|
|
3383
|
-
* Injected instance of the DialogService.
|
|
3384
|
-
* @internal
|
|
3385
|
-
*/
|
|
3386
|
-
dialogService = inject(DialogService);
|
|
3387
|
-
/**
|
|
3388
|
-
* Injected reference to the current DialogRef.
|
|
3389
|
-
* @internal
|
|
3390
|
-
*/
|
|
3054
|
+
class DialogContent extends CdkDialogContainer {
|
|
3055
|
+
/** Reference to the active dialog instance used to control lifecycle and closing. */
|
|
3391
3056
|
dialogRef = inject(DialogRef);
|
|
3392
|
-
/**
|
|
3393
|
-
|
|
3394
|
-
|
|
3395
|
-
*/
|
|
3396
|
-
el = inject(ElementRef);
|
|
3397
|
-
/**
|
|
3398
|
-
* Signal indicating if the dialog is in the process of leaving (closing).
|
|
3399
|
-
*/
|
|
3057
|
+
/** Service that orchestrates opening and closing of dialog instances. */
|
|
3058
|
+
dialogService = inject(DialogService);
|
|
3059
|
+
/** Tracks whether the dialog is in its leaving (closing) animation state. */
|
|
3400
3060
|
leaving = signal(false, ...(ngDevMode ? [{ debugName: "leaving" }] : []));
|
|
3401
|
-
/**
|
|
3402
|
-
|
|
3061
|
+
/** Initializes the dialog content component by calling the superclass constructor. */
|
|
3062
|
+
constructor() {
|
|
3063
|
+
super();
|
|
3064
|
+
}
|
|
3065
|
+
/** Initializes component logic and subscribes to dialog events. */
|
|
3066
|
+
ngOnInit() {
|
|
3067
|
+
this.handleDialogEvents();
|
|
3068
|
+
}
|
|
3069
|
+
/** Handles all dialog behavioral event subscriptions based on provided configuration data. */
|
|
3070
|
+
handleDialogEvents() {
|
|
3071
|
+
const data = this._config?.data;
|
|
3072
|
+
if (!data) {
|
|
3073
|
+
return;
|
|
3074
|
+
}
|
|
3075
|
+
this.handleBackdropClose(data);
|
|
3076
|
+
this.handleEscapeKeyClose(data);
|
|
3077
|
+
}
|
|
3078
|
+
/** Subscribes to backdrop clicks to close the dialog when enabled in config.
|
|
3079
|
+
*
|
|
3080
|
+
* @param data - Dialog configuration containing close behavior flags.
|
|
3403
3081
|
*/
|
|
3404
|
-
|
|
3405
|
-
|
|
3082
|
+
handleBackdropClose(data) {
|
|
3083
|
+
if (data.closeOnBackdropClick) {
|
|
3084
|
+
this.dialogRef.backdropClick.subscribe(() => {
|
|
3085
|
+
this.dialogService.closeDialog(this.dialogRef.id);
|
|
3086
|
+
});
|
|
3087
|
+
}
|
|
3406
3088
|
}
|
|
3407
|
-
/**
|
|
3408
|
-
*
|
|
3409
|
-
* @param
|
|
3089
|
+
/** Subscribes to keydown events to close the dialog on Escape key when enabled.
|
|
3090
|
+
*
|
|
3091
|
+
* @param data - Dialog configuration containing close behavior flags.
|
|
3410
3092
|
*/
|
|
3411
|
-
|
|
3412
|
-
if (
|
|
3413
|
-
this.
|
|
3093
|
+
handleEscapeKeyClose(data) {
|
|
3094
|
+
if (data.closeOnEscapeKey) {
|
|
3095
|
+
this.dialogRef.keydownEvents.subscribe((event) => {
|
|
3096
|
+
if (event.key === 'Escape') {
|
|
3097
|
+
this.dialogService.closeDialog(this.dialogRef.id);
|
|
3098
|
+
}
|
|
3099
|
+
});
|
|
3414
3100
|
}
|
|
3415
3101
|
}
|
|
3416
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type:
|
|
3417
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.2.3", type:
|
|
3102
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type: DialogContent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
3103
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.2.3", type: DialogContent, isStandalone: true, selector: "b-dialog-content", host: { properties: { "class.leaving": "leaving()" } }, usesInheritance: true, ngImport: i0, template: `<ng-template cdkPortalOutlet />`, isInline: true, dependencies: [{ kind: "directive", type: CdkPortalOutlet, selector: "[cdkPortalOutlet]", inputs: ["cdkPortalOutlet"], outputs: ["attached"], exportAs: ["cdkPortalOutlet"] }], encapsulation: i0.ViewEncapsulation.None });
|
|
3418
3104
|
}
|
|
3419
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type:
|
|
3105
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type: DialogContent, decorators: [{
|
|
3420
3106
|
type: Component,
|
|
3421
3107
|
args: [{
|
|
3422
|
-
selector: 'b-dialog',
|
|
3108
|
+
selector: 'b-dialog-content',
|
|
3423
3109
|
template: `<ng-template cdkPortalOutlet />`,
|
|
3424
3110
|
encapsulation: ViewEncapsulation.None,
|
|
3425
|
-
standalone: true,
|
|
3426
3111
|
imports: [CdkPortalOutlet],
|
|
3427
3112
|
host: {
|
|
3428
|
-
'(keydown.escape)': 'close("escapeKey")',
|
|
3429
3113
|
'[class.leaving]': 'leaving()',
|
|
3430
3114
|
},
|
|
3431
3115
|
}]
|
|
3432
|
-
}],
|
|
3433
|
-
type: HostListener,
|
|
3434
|
-
args: ['document:click', ['$event']]
|
|
3435
|
-
}] } });
|
|
3116
|
+
}], ctorParameters: () => [] });
|
|
3436
3117
|
|
|
3437
|
-
// dialog.service.ts
|
|
3438
3118
|
/**
|
|
3439
|
-
*
|
|
3440
|
-
* It uses the Angular CDK Dialog module internally.
|
|
3119
|
+
* Provides registration and lifecycle control for application dialogs.
|
|
3441
3120
|
*/
|
|
3442
3121
|
class DialogService {
|
|
3443
|
-
/**
|
|
3444
|
-
|
|
3445
|
-
|
|
3446
|
-
*/
|
|
3447
|
-
dialog = inject(Dialog);
|
|
3448
|
-
/**
|
|
3449
|
-
* Injected instance of the `UtilsService`.
|
|
3450
|
-
* @internal
|
|
3451
|
-
*/
|
|
3122
|
+
/** Angular CDK dialog service used to manage overlay instances. */
|
|
3123
|
+
dialog = inject(Dialog$1);
|
|
3124
|
+
/** Utility service used for debounced close behavior. */
|
|
3452
3125
|
utilsService = inject(UtilsService);
|
|
3453
|
-
/**
|
|
3454
|
-
* A map storing the registered dialog templates and their data, keyed by their unique ID.
|
|
3455
|
-
* @internal
|
|
3456
|
-
*/
|
|
3126
|
+
/** Registry mapping dialog identifiers to their data. */
|
|
3457
3127
|
dialogs = new Map();
|
|
3458
3128
|
/**
|
|
3459
|
-
*
|
|
3460
|
-
*/
|
|
3461
|
-
dialogClosed = new EventEmitter();
|
|
3462
|
-
/**
|
|
3463
|
-
* Registers a dialog template and its data with the service.
|
|
3464
|
-
* Typically called automatically by the `DialogDirective`.
|
|
3129
|
+
* Registers a dialog definition under a unique identifier, overwriting any existing entry.
|
|
3465
3130
|
*
|
|
3466
|
-
* @param id -
|
|
3467
|
-
* @param data -
|
|
3131
|
+
* @param id - Unique identifier for the dialog.
|
|
3132
|
+
* @param data - Template and configuration to register.
|
|
3468
3133
|
*/
|
|
3469
|
-
|
|
3134
|
+
registerDialog(id, data) {
|
|
3470
3135
|
if (this.dialogs.has(id)) {
|
|
3471
3136
|
console.warn(`[DialogService] Dialog with id "${id}" is already registered. Overwriting.`);
|
|
3472
3137
|
}
|
|
3473
3138
|
this.dialogs.set(id, data);
|
|
3474
3139
|
}
|
|
3475
3140
|
/**
|
|
3476
|
-
* Removes a
|
|
3477
|
-
* Typically called automatically by the `DialogDirective` when the template is destroyed.
|
|
3141
|
+
* Removes a previously registered dialog definition.
|
|
3478
3142
|
*
|
|
3479
|
-
* @param id -
|
|
3143
|
+
* @param id - Identifier of the dialog to remove.
|
|
3480
3144
|
*/
|
|
3481
3145
|
removeDialog(id) {
|
|
3482
3146
|
this.dialogs.delete(id);
|
|
3483
3147
|
}
|
|
3484
3148
|
/**
|
|
3485
|
-
* Opens
|
|
3149
|
+
* Opens a dialog using its registered template and configuration.
|
|
3486
3150
|
*
|
|
3487
|
-
* @param id -
|
|
3488
|
-
* @throws Error
|
|
3151
|
+
* @param id - Identifier of the dialog to open.
|
|
3152
|
+
* @throws Error - When no dialog is registered with the provided identifier.
|
|
3489
3153
|
*/
|
|
3490
3154
|
openDialog(id) {
|
|
3491
3155
|
const dialogData = this.dialogs.get(id);
|
|
3492
3156
|
if (!dialogData) {
|
|
3493
3157
|
throw new Error(`[DialogService] Dialog with id "${id}" not found. Ensure the bDialog directive is applied correctly.`);
|
|
3494
3158
|
}
|
|
3495
|
-
this.
|
|
3496
|
-
|
|
3497
|
-
|
|
3498
|
-
|
|
3499
|
-
|
|
3500
|
-
|
|
3501
|
-
|
|
3502
|
-
|
|
3503
|
-
}, dialogData.config.openDelay);
|
|
3159
|
+
this.dialog.open(dialogData.template, {
|
|
3160
|
+
id: id,
|
|
3161
|
+
disableClose: true,
|
|
3162
|
+
restoreFocus: dialogData.config.restoreFocus,
|
|
3163
|
+
backdropClass: 'b-dialog-content-backdrop',
|
|
3164
|
+
container: DialogContent,
|
|
3165
|
+
data: dialogData.config,
|
|
3166
|
+
});
|
|
3504
3167
|
}
|
|
3505
3168
|
/**
|
|
3506
|
-
* Closes
|
|
3507
|
-
* Does nothing if no dialog with the specified ID is currently open.
|
|
3169
|
+
* Closes a dialog by identifier applying any configured close delay.
|
|
3508
3170
|
*
|
|
3509
|
-
* @param id -
|
|
3510
|
-
* @param type - The type of closing action.
|
|
3171
|
+
* @param id - Identifier of the dialog to close.
|
|
3511
3172
|
*/
|
|
3512
|
-
closeDialog(id
|
|
3173
|
+
closeDialog(id) {
|
|
3513
3174
|
const config = this.dialogs.get(id)?.config;
|
|
3514
3175
|
if (!config) {
|
|
3515
3176
|
console.warn(`[DialogService] Attempted to close dialog with id "${id}", but no open dialog with that id was found.`);
|
|
3516
3177
|
return;
|
|
3517
3178
|
}
|
|
3518
|
-
if ((type === 'escapeKey' && !config.closeOnEscapeKey) ||
|
|
3519
|
-
(type === 'outsideClick' && !config.closeOnBackdropClick)) {
|
|
3520
|
-
return;
|
|
3521
|
-
}
|
|
3522
3179
|
const dialogRef = this.dialog.getDialogById(id);
|
|
3523
3180
|
if (dialogRef) {
|
|
3524
3181
|
const container = dialogRef.containerInstance;
|
|
@@ -3530,8 +3187,6 @@ class DialogService {
|
|
|
3530
3187
|
if (container && container.leaving) {
|
|
3531
3188
|
container.leaving.set(false);
|
|
3532
3189
|
}
|
|
3533
|
-
// Emit the closed dialog ID
|
|
3534
|
-
this.dialogClosed.emit(id);
|
|
3535
3190
|
}, config.closeDelay);
|
|
3536
3191
|
}
|
|
3537
3192
|
else {
|
|
@@ -3539,7 +3194,7 @@ class DialogService {
|
|
|
3539
3194
|
}
|
|
3540
3195
|
}
|
|
3541
3196
|
/**
|
|
3542
|
-
* Closes all currently open dialogs
|
|
3197
|
+
* Closes all currently open dialogs immediately.
|
|
3543
3198
|
*/
|
|
3544
3199
|
closeAllDialogs() {
|
|
3545
3200
|
this.dialog.closeAll();
|
|
@@ -3554,114 +3209,106 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.3", ngImpor
|
|
|
3554
3209
|
}]
|
|
3555
3210
|
}] });
|
|
3556
3211
|
|
|
3557
|
-
// dialog.directive.ts
|
|
3558
3212
|
/**
|
|
3559
|
-
* Directive
|
|
3560
|
-
* Apply this directive to an `<ng-template>` element, providing a unique ID.
|
|
3561
|
-
* The service can then open this template as a dialog by referencing the ID.
|
|
3213
|
+
* Directive that registers and controls a dialog template instance.
|
|
3562
3214
|
*
|
|
3563
|
-
* @
|
|
3564
|
-
* ```html
|
|
3565
|
-
* <ng-template bDialog="myModalId" [hasBackdrop]="false">
|
|
3566
|
-
* <h2>My Modal Content</h2>
|
|
3567
|
-
* <p>This is the content of the dialog.</p>
|
|
3568
|
-
* <button (click)="dialogService.closeDialog('myModalId')">Close</button>
|
|
3569
|
-
* </ng-template>
|
|
3570
|
-
* ```
|
|
3215
|
+
* Registers itself in the {@link DialogService} on init and exposes open/close APIs.
|
|
3571
3216
|
*/
|
|
3572
|
-
class
|
|
3217
|
+
class Dialog {
|
|
3573
3218
|
/**
|
|
3574
|
-
*
|
|
3575
|
-
* Applied as the value of the `bDialog` attribute.
|
|
3219
|
+
* Unique dialog identifier bound from the `bDialog` attribute.
|
|
3576
3220
|
*/
|
|
3577
3221
|
id = input.required(...(ngDevMode ? [{ debugName: "id", alias: 'bDialog' }] : [{ alias: 'bDialog' }]));
|
|
3578
3222
|
/**
|
|
3579
|
-
*
|
|
3223
|
+
* Whether the dialog renders a backdrop element.
|
|
3224
|
+
*
|
|
3225
|
+
* @defaultValue true
|
|
3580
3226
|
*/
|
|
3581
3227
|
hasBackdrop = input(true, ...(ngDevMode ? [{ debugName: "hasBackdrop" }] : []));
|
|
3582
3228
|
/**
|
|
3583
|
-
*
|
|
3229
|
+
* Closes the dialog when the user clicks on the backdrop.
|
|
3230
|
+
*
|
|
3231
|
+
* @defaultValue true
|
|
3584
3232
|
*/
|
|
3585
3233
|
closeOnBackdropClick = input(true, ...(ngDevMode ? [{ debugName: "closeOnBackdropClick" }] : []));
|
|
3586
3234
|
/**
|
|
3587
|
-
*
|
|
3235
|
+
* Closes the dialog when the Escape key is pressed while focused inside.
|
|
3236
|
+
*
|
|
3237
|
+
* @defaultValue true
|
|
3588
3238
|
*/
|
|
3589
3239
|
closeOnEscapeKey = input(true, ...(ngDevMode ? [{ debugName: "closeOnEscapeKey" }] : []));
|
|
3590
3240
|
/**
|
|
3591
|
-
*
|
|
3592
|
-
*
|
|
3241
|
+
* Restores focus to the previously focused element after the dialog closes.
|
|
3242
|
+
*
|
|
3243
|
+
* @defaultValue true
|
|
3593
3244
|
*/
|
|
3594
3245
|
restoreFocus = input(true, ...(ngDevMode ? [{ debugName: "restoreFocus" }] : []));
|
|
3595
3246
|
/**
|
|
3596
|
-
*
|
|
3597
|
-
*
|
|
3247
|
+
* Delay in milliseconds before the dialog is fully closed (useful for animations).
|
|
3248
|
+
*
|
|
3249
|
+
* @defaultValue 150
|
|
3250
|
+
*/
|
|
3251
|
+
closeDelay = input(150, ...(ngDevMode ? [{ debugName: "closeDelay" }] : []));
|
|
3252
|
+
/**
|
|
3253
|
+
* Computed dialog data passed to the service containing template and configuration.
|
|
3598
3254
|
*/
|
|
3599
3255
|
data = computed(() => ({
|
|
3600
3256
|
template: this.templateRef,
|
|
3601
3257
|
config: {
|
|
3602
3258
|
hasBackdrop: this.hasBackdrop(),
|
|
3603
|
-
openDelay: this.openDelay(),
|
|
3604
|
-
closeDelay: this.closeDelay(),
|
|
3605
3259
|
restoreFocus: this.restoreFocus(),
|
|
3260
|
+
closeDelay: this.closeDelay(),
|
|
3606
3261
|
closeOnBackdropClick: this.closeOnBackdropClick(),
|
|
3607
3262
|
closeOnEscapeKey: this.closeOnEscapeKey(),
|
|
3608
3263
|
},
|
|
3609
3264
|
}), ...(ngDevMode ? [{ debugName: "data" }] : []));
|
|
3610
3265
|
/**
|
|
3611
|
-
* Delay in milliseconds before the dialog
|
|
3266
|
+
* Delay in milliseconds before opening the dialog (for entrance timing / animations).
|
|
3267
|
+
*
|
|
3268
|
+
* @defaultValue 0
|
|
3612
3269
|
*/
|
|
3613
3270
|
openDelay = input(0, ...(ngDevMode ? [{ debugName: "openDelay" }] : []));
|
|
3614
3271
|
/**
|
|
3615
|
-
*
|
|
3616
|
-
*/
|
|
3617
|
-
closeDelay = input(150, ...(ngDevMode ? [{ debugName: "closeDelay" }] : []));
|
|
3618
|
-
/**
|
|
3619
|
-
* Emits when the dialog is closed.
|
|
3272
|
+
* Event emitted after the dialog has been programmatically or automatically closed.
|
|
3620
3273
|
*/
|
|
3621
3274
|
closed = output();
|
|
3622
3275
|
/**
|
|
3623
|
-
*
|
|
3624
|
-
* @internal
|
|
3276
|
+
* Reference to the dialog service handling registration and state.
|
|
3625
3277
|
*/
|
|
3626
3278
|
dialogService = inject(DialogService);
|
|
3627
3279
|
/**
|
|
3628
|
-
*
|
|
3629
|
-
* @internal
|
|
3280
|
+
* Template reference representing the dialog content projected when opened.
|
|
3630
3281
|
*/
|
|
3631
|
-
templateRef = inject((TemplateRef));
|
|
3282
|
+
templateRef = inject((TemplateRef));
|
|
3632
3283
|
/**
|
|
3633
|
-
* Lifecycle hook
|
|
3634
|
-
* Registers the dialog template and its configuration with the `DialogService`.
|
|
3284
|
+
* Lifecycle hook that registers the dialog with the dialog service.
|
|
3635
3285
|
*/
|
|
3636
3286
|
ngOnInit() {
|
|
3637
|
-
this.dialogService.
|
|
3287
|
+
this.dialogService.registerDialog(this.id(), this.data());
|
|
3638
3288
|
}
|
|
3639
3289
|
/**
|
|
3640
|
-
* Opens the dialog
|
|
3641
|
-
* This method can be called to programmatically open the dialog.
|
|
3290
|
+
* Opens the dialog via the dialog service using its identifier.
|
|
3642
3291
|
*/
|
|
3643
3292
|
open() {
|
|
3644
3293
|
this.dialogService.openDialog(this.id());
|
|
3645
3294
|
}
|
|
3646
3295
|
/**
|
|
3647
|
-
* Closes the dialog
|
|
3648
|
-
* This method can be called to programmatically close the dialog.
|
|
3296
|
+
* Closes the dialog and emits the `closed` output.
|
|
3649
3297
|
*/
|
|
3650
3298
|
close() {
|
|
3651
|
-
this.dialogService.closeDialog(this.id()
|
|
3299
|
+
this.dialogService.closeDialog(this.id());
|
|
3652
3300
|
this.closed.emit();
|
|
3653
3301
|
}
|
|
3654
3302
|
/**
|
|
3655
|
-
* Lifecycle hook
|
|
3656
|
-
* Removes the dialog registration from the `DialogService`.
|
|
3303
|
+
* Lifecycle hook that removes the dialog from the dialog service registry.
|
|
3657
3304
|
*/
|
|
3658
3305
|
ngOnDestroy() {
|
|
3659
3306
|
this.dialogService.removeDialog(this.id());
|
|
3660
3307
|
}
|
|
3661
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type:
|
|
3662
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.2.3", type:
|
|
3308
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type: Dialog, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
3309
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.2.3", type: Dialog, isStandalone: true, selector: "[bDialog]", inputs: { id: { classPropertyName: "id", publicName: "bDialog", isSignal: true, isRequired: true, transformFunction: null }, hasBackdrop: { classPropertyName: "hasBackdrop", publicName: "hasBackdrop", isSignal: true, isRequired: false, transformFunction: null }, closeOnBackdropClick: { classPropertyName: "closeOnBackdropClick", publicName: "closeOnBackdropClick", isSignal: true, isRequired: false, transformFunction: null }, closeOnEscapeKey: { classPropertyName: "closeOnEscapeKey", publicName: "closeOnEscapeKey", isSignal: true, isRequired: false, transformFunction: null }, restoreFocus: { classPropertyName: "restoreFocus", publicName: "restoreFocus", isSignal: true, isRequired: false, transformFunction: null }, closeDelay: { classPropertyName: "closeDelay", publicName: "closeDelay", isSignal: true, isRequired: false, transformFunction: null }, openDelay: { classPropertyName: "openDelay", publicName: "openDelay", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { closed: "closed" }, host: { listeners: { "keydown.escape": "closeOnEscapeKey() ? close() : null" } }, exportAs: ["bDialog"], ngImport: i0 });
|
|
3663
3310
|
}
|
|
3664
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type:
|
|
3311
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type: Dialog, decorators: [{
|
|
3665
3312
|
type: Directive,
|
|
3666
3313
|
args: [{
|
|
3667
3314
|
selector: '[bDialog]',
|
|
@@ -3672,31 +3319,23 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.3", ngImpor
|
|
|
3672
3319
|
}]
|
|
3673
3320
|
}] });
|
|
3674
3321
|
|
|
3675
|
-
class
|
|
3676
|
-
|
|
3677
|
-
|
|
3678
|
-
* @default '80vw'
|
|
3679
|
-
*/
|
|
3680
|
-
maxWidth = input('80vw', ...(ngDevMode ? [{ debugName: "maxWidth" }] : []));
|
|
3681
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type: CardComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
3682
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.2.3", type: CardComponent, isStandalone: true, selector: "b-card", inputs: { maxWidth: { classPropertyName: "maxWidth", publicName: "maxWidth", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "style.maxWidth": "maxWidth()" } }, ngImport: i0, template: ` <ng-content /> `, isInline: true });
|
|
3322
|
+
class Card {
|
|
3323
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type: Card, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
3324
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.2.3", type: Card, isStandalone: true, selector: "b-card", ngImport: i0, template: ` <ng-content /> `, isInline: true });
|
|
3683
3325
|
}
|
|
3684
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type:
|
|
3326
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type: Card, decorators: [{
|
|
3685
3327
|
type: Component,
|
|
3686
3328
|
args: [{
|
|
3687
3329
|
selector: 'b-card',
|
|
3688
3330
|
template: ` <ng-content /> `,
|
|
3689
|
-
host: {
|
|
3690
|
-
'[style.maxWidth]': 'maxWidth()',
|
|
3691
|
-
},
|
|
3692
3331
|
}]
|
|
3693
3332
|
}] });
|
|
3694
3333
|
|
|
3695
|
-
class
|
|
3696
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type:
|
|
3697
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.2.3", type:
|
|
3334
|
+
class CardHeader {
|
|
3335
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type: CardHeader, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
3336
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.2.3", type: CardHeader, isStandalone: true, selector: "b-card-header", ngImport: i0, template: ` <ng-content /> `, isInline: true });
|
|
3698
3337
|
}
|
|
3699
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type:
|
|
3338
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type: CardHeader, decorators: [{
|
|
3700
3339
|
type: Component,
|
|
3701
3340
|
args: [{
|
|
3702
3341
|
selector: 'b-card-header',
|
|
@@ -3704,11 +3343,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.3", ngImpor
|
|
|
3704
3343
|
}]
|
|
3705
3344
|
}] });
|
|
3706
3345
|
|
|
3707
|
-
class
|
|
3708
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type:
|
|
3709
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.2.3", type:
|
|
3346
|
+
class CardTitle {
|
|
3347
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type: CardTitle, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
3348
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.2.3", type: CardTitle, isStandalone: true, selector: "b-card-title", ngImport: i0, template: ` <ng-content /> `, isInline: true });
|
|
3710
3349
|
}
|
|
3711
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type:
|
|
3350
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type: CardTitle, decorators: [{
|
|
3712
3351
|
type: Component,
|
|
3713
3352
|
args: [{
|
|
3714
3353
|
selector: 'b-card-title',
|
|
@@ -3716,23 +3355,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.3", ngImpor
|
|
|
3716
3355
|
}]
|
|
3717
3356
|
}] });
|
|
3718
3357
|
|
|
3719
|
-
class
|
|
3720
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type:
|
|
3721
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.2.3", type:
|
|
3722
|
-
}
|
|
3723
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type: CardSubtitleComponent, decorators: [{
|
|
3724
|
-
type: Component,
|
|
3725
|
-
args: [{
|
|
3726
|
-
selector: 'b-card-subtitle',
|
|
3727
|
-
template: ` <ng-content /> `,
|
|
3728
|
-
}]
|
|
3729
|
-
}] });
|
|
3730
|
-
|
|
3731
|
-
class CardDescriptionComponent {
|
|
3732
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type: CardDescriptionComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
3733
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.2.3", type: CardDescriptionComponent, isStandalone: true, selector: "b-card-description", ngImport: i0, template: ` <ng-content /> `, isInline: true });
|
|
3358
|
+
class CardDescription {
|
|
3359
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type: CardDescription, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
3360
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.2.3", type: CardDescription, isStandalone: true, selector: "b-card-description", ngImport: i0, template: ` <ng-content /> `, isInline: true });
|
|
3734
3361
|
}
|
|
3735
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type:
|
|
3362
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type: CardDescription, decorators: [{
|
|
3736
3363
|
type: Component,
|
|
3737
3364
|
args: [{
|
|
3738
3365
|
selector: 'b-card-description',
|
|
@@ -3740,11 +3367,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.3", ngImpor
|
|
|
3740
3367
|
}]
|
|
3741
3368
|
}] });
|
|
3742
3369
|
|
|
3743
|
-
class
|
|
3744
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type:
|
|
3745
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.2.3", type:
|
|
3370
|
+
class CardContent {
|
|
3371
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type: CardContent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
3372
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.2.3", type: CardContent, isStandalone: true, selector: "b-card-content", ngImport: i0, template: ` <ng-content /> `, isInline: true });
|
|
3746
3373
|
}
|
|
3747
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type:
|
|
3374
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type: CardContent, decorators: [{
|
|
3748
3375
|
type: Component,
|
|
3749
3376
|
args: [{
|
|
3750
3377
|
selector: 'b-card-content',
|
|
@@ -3752,11 +3379,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.3", ngImpor
|
|
|
3752
3379
|
}]
|
|
3753
3380
|
}] });
|
|
3754
3381
|
|
|
3755
|
-
class
|
|
3756
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type:
|
|
3757
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.2.3", type:
|
|
3382
|
+
class CardFooter {
|
|
3383
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type: CardFooter, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
3384
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.2.3", type: CardFooter, isStandalone: true, selector: "b-card-footer", ngImport: i0, template: ` <ng-content /> `, isInline: true });
|
|
3758
3385
|
}
|
|
3759
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type:
|
|
3386
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type: CardFooter, decorators: [{
|
|
3760
3387
|
type: Component,
|
|
3761
3388
|
args: [{
|
|
3762
3389
|
selector: 'b-card-footer',
|
|
@@ -3884,5 +3511,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.3", ngImpor
|
|
|
3884
3511
|
* Generated bundle index. Do not edit.
|
|
3885
3512
|
*/
|
|
3886
3513
|
|
|
3887
|
-
export {
|
|
3514
|
+
export { Alert, Badge, Button, ButtonGroup, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, ColorPicker, CommandComponent, CommandOptionsComponent, ConnectedOverlay, Dialog, DialogService, Drawer, Input, InputGroup, LazyContentDirective, Menu, MenuGroup, MenuItem, MenuItemCheckbox, MenuItemRadio, MenuLabel, MenuTriggerDirective, Option, Otp, OtpDigitDirective, OverlayOrigin, Range, ResponsiveService, RowComponent, RowItemComponent, Select, SelectContent, SelectTrigger, SelectValue, Sheet, Spinner, SwitchComponent, Tab, TableComponent, Tabs, TextareaComponent, ThemeService, Tooltip, TooltipContent, TooltipTrigger, TranslatePipe, TranslationService, Tree, TreeNode };
|
|
3888
3515
|
//# sourceMappingURL=basis-ng-primitives.mjs.map
|