ngx-com 0.0.1 → 0.0.4
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/ngx-com-components-avatar.mjs +772 -0
- package/fesm2022/ngx-com-components-avatar.mjs.map +1 -0
- package/fesm2022/ngx-com-components-badge.mjs +138 -0
- package/fesm2022/ngx-com-components-badge.mjs.map +1 -0
- package/fesm2022/ngx-com-components-button.mjs +146 -0
- package/fesm2022/ngx-com-components-button.mjs.map +1 -0
- package/fesm2022/ngx-com-components-calendar.mjs +5046 -0
- package/fesm2022/ngx-com-components-calendar.mjs.map +1 -0
- package/fesm2022/ngx-com-components-card.mjs +590 -0
- package/fesm2022/ngx-com-components-card.mjs.map +1 -0
- package/fesm2022/ngx-com-components-checkbox.mjs +344 -0
- package/fesm2022/ngx-com-components-checkbox.mjs.map +1 -0
- package/fesm2022/ngx-com-components-collapsible.mjs +612 -0
- package/fesm2022/ngx-com-components-collapsible.mjs.map +1 -0
- package/fesm2022/ngx-com-components-confirm.mjs +562 -0
- package/fesm2022/ngx-com-components-confirm.mjs.map +1 -0
- package/fesm2022/ngx-com-components-dropdown-testing.mjs +255 -0
- package/fesm2022/ngx-com-components-dropdown-testing.mjs.map +1 -0
- package/fesm2022/ngx-com-components-dropdown.mjs +2692 -0
- package/fesm2022/ngx-com-components-dropdown.mjs.map +1 -0
- package/fesm2022/ngx-com-components-empty-state.mjs +382 -0
- package/fesm2022/ngx-com-components-empty-state.mjs.map +1 -0
- package/fesm2022/ngx-com-components-form-field.mjs +924 -0
- package/fesm2022/ngx-com-components-form-field.mjs.map +1 -0
- package/fesm2022/ngx-com-components-icon.mjs +183 -0
- package/fesm2022/ngx-com-components-icon.mjs.map +1 -0
- package/fesm2022/ngx-com-components-item.mjs +578 -0
- package/fesm2022/ngx-com-components-item.mjs.map +1 -0
- package/fesm2022/ngx-com-components-menu.mjs +1200 -0
- package/fesm2022/ngx-com-components-menu.mjs.map +1 -0
- package/fesm2022/ngx-com-components-paginator.mjs +823 -0
- package/fesm2022/ngx-com-components-paginator.mjs.map +1 -0
- package/fesm2022/ngx-com-components-popover.mjs +901 -0
- package/fesm2022/ngx-com-components-popover.mjs.map +1 -0
- package/fesm2022/ngx-com-components-radio.mjs +621 -0
- package/fesm2022/ngx-com-components-radio.mjs.map +1 -0
- package/fesm2022/ngx-com-components-segmented-control.mjs +538 -0
- package/fesm2022/ngx-com-components-segmented-control.mjs.map +1 -0
- package/fesm2022/ngx-com-components-sort.mjs +368 -0
- package/fesm2022/ngx-com-components-sort.mjs.map +1 -0
- package/fesm2022/ngx-com-components-spinner.mjs +189 -0
- package/fesm2022/ngx-com-components-spinner.mjs.map +1 -0
- package/fesm2022/ngx-com-components-tabs.mjs +1522 -0
- package/fesm2022/ngx-com-components-tabs.mjs.map +1 -0
- package/fesm2022/ngx-com-components-tooltip.mjs +625 -0
- package/fesm2022/ngx-com-components-tooltip.mjs.map +1 -0
- package/fesm2022/ngx-com-components.mjs +17 -0
- package/fesm2022/ngx-com-components.mjs.map +1 -0
- package/fesm2022/ngx-com-tokens.mjs +12 -0
- package/fesm2022/ngx-com-tokens.mjs.map +1 -0
- package/fesm2022/ngx-com-utils.mjs +601 -0
- package/fesm2022/ngx-com-utils.mjs.map +1 -0
- package/fesm2022/ngx-com.mjs +9 -23
- package/fesm2022/ngx-com.mjs.map +1 -1
- package/package.json +105 -1
- package/types/ngx-com-components-avatar.d.ts +409 -0
- package/types/ngx-com-components-badge.d.ts +97 -0
- package/types/ngx-com-components-button.d.ts +69 -0
- package/types/ngx-com-components-calendar.d.ts +1665 -0
- package/types/ngx-com-components-card.d.ts +373 -0
- package/types/ngx-com-components-checkbox.d.ts +116 -0
- package/types/ngx-com-components-collapsible.d.ts +379 -0
- package/types/ngx-com-components-confirm.d.ts +160 -0
- package/types/ngx-com-components-dropdown-testing.d.ts +116 -0
- package/types/ngx-com-components-dropdown.d.ts +938 -0
- package/types/ngx-com-components-empty-state.d.ts +269 -0
- package/types/ngx-com-components-form-field.d.ts +531 -0
- package/types/ngx-com-components-icon.d.ts +94 -0
- package/types/ngx-com-components-item.d.ts +336 -0
- package/types/ngx-com-components-menu.d.ts +479 -0
- package/types/ngx-com-components-paginator.d.ts +265 -0
- package/types/ngx-com-components-popover.d.ts +309 -0
- package/types/ngx-com-components-radio.d.ts +258 -0
- package/types/ngx-com-components-segmented-control.d.ts +274 -0
- package/types/ngx-com-components-sort.d.ts +133 -0
- package/types/ngx-com-components-spinner.d.ts +120 -0
- package/types/ngx-com-components-tabs.d.ts +396 -0
- package/types/ngx-com-components-tooltip.d.ts +200 -0
- package/types/ngx-com-components.d.ts +12 -0
- package/types/ngx-com-tokens.d.ts +7 -0
- package/types/ngx-com-utils.d.ts +424 -0
- package/types/ngx-com.d.ts +10 -7
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { InputSignal, Signal } from '@angular/core';
|
|
3
|
+
|
|
4
|
+
/** Spinner size variants. */
|
|
5
|
+
type SpinnerSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
6
|
+
/** Spinner color variants. */
|
|
7
|
+
type SpinnerColor = 'current' | 'primary' | 'accent' | 'warn' | 'success' | 'muted';
|
|
8
|
+
/** Label position relative to spinner. */
|
|
9
|
+
type SpinnerLabelPosition = 'right' | 'bottom';
|
|
10
|
+
/**
|
|
11
|
+
* CVA variants for the spinning circle element.
|
|
12
|
+
*
|
|
13
|
+
* Creates a circular track with a faded ring and a colored arc that rotates.
|
|
14
|
+
* Uses `border` for the track and `border-t-*` for the spinning arc.
|
|
15
|
+
*
|
|
16
|
+
* @tokens `--color-primary`, `--color-accent`, `--color-warn`, `--color-success`, `--color-muted-foreground`
|
|
17
|
+
*/
|
|
18
|
+
declare const spinnerVariants: (props?: {
|
|
19
|
+
size?: SpinnerSize;
|
|
20
|
+
color?: SpinnerColor;
|
|
21
|
+
}) => string;
|
|
22
|
+
/**
|
|
23
|
+
* CVA variants for the spinner container layout.
|
|
24
|
+
*
|
|
25
|
+
* Controls flex direction and gap based on label position.
|
|
26
|
+
* Only applies when a visible label is present.
|
|
27
|
+
*
|
|
28
|
+
* @tokens none (layout only)
|
|
29
|
+
*/
|
|
30
|
+
declare const spinnerContainerVariants: (props?: {
|
|
31
|
+
labelPosition?: SpinnerLabelPosition;
|
|
32
|
+
}) => string;
|
|
33
|
+
/** Label font size classes mapped to spinner size. */
|
|
34
|
+
declare const SPINNER_LABEL_SIZES: Record<SpinnerSize, string>;
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* A minimal, CSS-only loading indicator.
|
|
38
|
+
*
|
|
39
|
+
* Drop-in anywhere: inside buttons, next to inline text, centered in cards,
|
|
40
|
+
* or as a page-level overlay. The animation is fast (0.6s) for a snappy feel.
|
|
41
|
+
*
|
|
42
|
+
* @tokens `--color-primary`, `--color-accent`, `--color-warn`, `--color-success`, `--color-muted-foreground`
|
|
43
|
+
*
|
|
44
|
+
* @example Simplest usage (inherits parent text color)
|
|
45
|
+
* ```html
|
|
46
|
+
* <com-spinner />
|
|
47
|
+
* ```
|
|
48
|
+
*
|
|
49
|
+
* @example Inside a button (inline, inherits button text color)
|
|
50
|
+
* ```html
|
|
51
|
+
* <button class="btn-primary" [disabled]="saving">
|
|
52
|
+
* @if (saving) {
|
|
53
|
+
* <com-spinner size="xs" />
|
|
54
|
+
* }
|
|
55
|
+
* Save
|
|
56
|
+
* </button>
|
|
57
|
+
* ```
|
|
58
|
+
*
|
|
59
|
+
* @example With visible label
|
|
60
|
+
* ```html
|
|
61
|
+
* <com-spinner label="Loading results..." />
|
|
62
|
+
* ```
|
|
63
|
+
*
|
|
64
|
+
* @example Centered in a card
|
|
65
|
+
* ```html
|
|
66
|
+
* <div class="flex items-center justify-center p-8">
|
|
67
|
+
* <com-spinner size="lg" color="primary" label="Loading..." labelPosition="bottom" />
|
|
68
|
+
* </div>
|
|
69
|
+
* ```
|
|
70
|
+
*
|
|
71
|
+
* @example Inline with text
|
|
72
|
+
* ```html
|
|
73
|
+
* <p class="text-muted-foreground">
|
|
74
|
+
* <com-spinner size="xs" /> Checking availability...
|
|
75
|
+
* </p>
|
|
76
|
+
* ```
|
|
77
|
+
*
|
|
78
|
+
* @example Color variants
|
|
79
|
+
* ```html
|
|
80
|
+
* <com-spinner color="primary" />
|
|
81
|
+
* <com-spinner color="accent" />
|
|
82
|
+
* <com-spinner color="warn" />
|
|
83
|
+
* ```
|
|
84
|
+
*
|
|
85
|
+
* @example Large page-level
|
|
86
|
+
* ```html
|
|
87
|
+
* <com-spinner size="xl" color="primary" label="Preparing your dashboard..." labelPosition="bottom" />
|
|
88
|
+
* ```
|
|
89
|
+
*/
|
|
90
|
+
declare class ComSpinner {
|
|
91
|
+
/**
|
|
92
|
+
* Optional loading text (e.g., "Loading...", "Saving...").
|
|
93
|
+
* When omitted, "Loading" is rendered for screen readers only (sr-only).
|
|
94
|
+
* When provided, the label is visible next to or below the spinner.
|
|
95
|
+
*/
|
|
96
|
+
readonly label: InputSignal<string | undefined>;
|
|
97
|
+
/**
|
|
98
|
+
* Position of the label relative to the spinner.
|
|
99
|
+
* Only relevant when a visible `label` is provided.
|
|
100
|
+
*/
|
|
101
|
+
readonly labelPosition: InputSignal<SpinnerLabelPosition>;
|
|
102
|
+
/** Size of the spinner. */
|
|
103
|
+
readonly size: InputSignal<SpinnerSize>;
|
|
104
|
+
/**
|
|
105
|
+
* Color of the spinner.
|
|
106
|
+
* `current` inherits from `currentColor` to match surrounding text.
|
|
107
|
+
*/
|
|
108
|
+
readonly color: InputSignal<SpinnerColor>;
|
|
109
|
+
/** @internal Computed classes for the spinning circle. */
|
|
110
|
+
protected readonly spinnerClasses: Signal<string>;
|
|
111
|
+
/** @internal Computed classes for the container/host. */
|
|
112
|
+
protected readonly containerClasses: Signal<string>;
|
|
113
|
+
/** @internal Computed label font size class. */
|
|
114
|
+
protected readonly labelSizeClass: Signal<string>;
|
|
115
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ComSpinner, never>;
|
|
116
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<ComSpinner, "com-spinner", ["comSpinner"], { "label": { "alias": "label"; "required": false; "isSignal": true; }; "labelPosition": { "alias": "labelPosition"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "color": { "alias": "color"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
export { ComSpinner, SPINNER_LABEL_SIZES, spinnerContainerVariants, spinnerVariants };
|
|
120
|
+
export type { SpinnerColor, SpinnerLabelPosition, SpinnerSize };
|
|
@@ -0,0 +1,396 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { TemplateRef, InputSignal, InputSignalWithTransform, OutputEmitterRef, Signal, WritableSignal, ModelSignal, ElementRef } from '@angular/core';
|
|
3
|
+
import { VariantProps } from 'class-variance-authority';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Marker directive for custom tab label templates.
|
|
7
|
+
*
|
|
8
|
+
* Provides a custom label template for rich tab headers (icons, badges, counters).
|
|
9
|
+
* Applied to an `<ng-template>` inside `<ui-tab>`.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```html
|
|
13
|
+
* <com-tab>
|
|
14
|
+
* <ng-template comTabLabel>
|
|
15
|
+
* <svg class="w-4 h-4">...</svg>
|
|
16
|
+
* <span>Settings</span>
|
|
17
|
+
* <span class="bg-warn text-warn-foreground text-xs rounded-pill px-1.5">3</span>
|
|
18
|
+
* </ng-template>
|
|
19
|
+
* <p>Tab content here.</p>
|
|
20
|
+
* </com-tab>
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
declare class TabLabelDirective {
|
|
24
|
+
readonly templateRef: TemplateRef<void>;
|
|
25
|
+
static ngTemplateContextGuard(_dir: TabLabelDirective, ctx: unknown): ctx is void;
|
|
26
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TabLabelDirective, never>;
|
|
27
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<TabLabelDirective, "ng-template[comTabLabel]", never, {}, {}, never, never, true, never>;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Marker directive for lazy tab content rendering.
|
|
32
|
+
*
|
|
33
|
+
* Content wrapped in `<ng-template comTabContent>` is only instantiated
|
|
34
|
+
* when the tab becomes active for the first time.
|
|
35
|
+
*
|
|
36
|
+
* @example Lazy loaded content
|
|
37
|
+
* ```html
|
|
38
|
+
* <com-tab label="Analytics">
|
|
39
|
+
* <ng-template comTabContent>
|
|
40
|
+
* <app-analytics-dashboard />
|
|
41
|
+
* </ng-template>
|
|
42
|
+
* </com-tab>
|
|
43
|
+
* ```
|
|
44
|
+
*
|
|
45
|
+
* @example Combined with @defer
|
|
46
|
+
* ```html
|
|
47
|
+
* <com-tab label="Reports">
|
|
48
|
+
* <ng-template comTabContent>
|
|
49
|
+
* @defer {
|
|
50
|
+
* <app-report-builder />
|
|
51
|
+
* } @loading {
|
|
52
|
+
* <p>Loading reports...</p>
|
|
53
|
+
* }
|
|
54
|
+
* </ng-template>
|
|
55
|
+
* </com-tab>
|
|
56
|
+
* ```
|
|
57
|
+
*/
|
|
58
|
+
declare class TabContentDirective {
|
|
59
|
+
readonly templateRef: TemplateRef<void>;
|
|
60
|
+
static ngTemplateContextGuard(_dir: TabContentDirective, ctx: unknown): ctx is void;
|
|
61
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TabContentDirective, never>;
|
|
62
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<TabContentDirective, "ng-template[comTabContent]", never, {}, {}, never, never, true, never>;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Individual tab definition component.
|
|
67
|
+
*
|
|
68
|
+
* This is a **definition component** — it doesn't render anything itself.
|
|
69
|
+
* It provides a label and content template to the parent `TabGroupComponent`.
|
|
70
|
+
*
|
|
71
|
+
* @example Basic usage
|
|
72
|
+
* ```html
|
|
73
|
+
* <com-tab label="Overview">
|
|
74
|
+
* <p>Overview content.</p>
|
|
75
|
+
* </com-tab>
|
|
76
|
+
* ```
|
|
77
|
+
*
|
|
78
|
+
* @example Custom label with icon
|
|
79
|
+
* ```html
|
|
80
|
+
* <com-tab>
|
|
81
|
+
* <ng-template comTabLabel>
|
|
82
|
+
* <svg class="w-4 h-4"><!-- icon --></svg>
|
|
83
|
+
* <span>Settings</span>
|
|
84
|
+
* </ng-template>
|
|
85
|
+
* <p>Settings content.</p>
|
|
86
|
+
* </com-tab>
|
|
87
|
+
* ```
|
|
88
|
+
*
|
|
89
|
+
* @example Lazy loaded content
|
|
90
|
+
* ```html
|
|
91
|
+
* <com-tab label="Analytics">
|
|
92
|
+
* <ng-template comTabContent>
|
|
93
|
+
* <app-heavy-dashboard />
|
|
94
|
+
* </ng-template>
|
|
95
|
+
* </com-tab>
|
|
96
|
+
* ```
|
|
97
|
+
*
|
|
98
|
+
* @example Closable tab
|
|
99
|
+
* ```html
|
|
100
|
+
* <com-tab label="Document" [closable]="true" (closed)="onClose()">
|
|
101
|
+
* <p>Document content.</p>
|
|
102
|
+
* </com-tab>
|
|
103
|
+
* ```
|
|
104
|
+
*/
|
|
105
|
+
declare class TabComponent {
|
|
106
|
+
/** Plain text label; ignored if `[comTabLabel]` template is provided. */
|
|
107
|
+
readonly label: InputSignal<string>;
|
|
108
|
+
/** Prevents selection when true. */
|
|
109
|
+
readonly disabled: InputSignalWithTransform<boolean, unknown>;
|
|
110
|
+
/** Shows a close/remove button on the tab. */
|
|
111
|
+
readonly closable: InputSignalWithTransform<boolean, unknown>;
|
|
112
|
+
/** Emitted when the close button is clicked. */
|
|
113
|
+
readonly closed: OutputEmitterRef<void>;
|
|
114
|
+
/** Custom label template (queried from content). */
|
|
115
|
+
readonly customLabel: Signal<TabLabelDirective | undefined>;
|
|
116
|
+
/** Lazy content template (queried from content). */
|
|
117
|
+
readonly lazyContent: Signal<TabContentDirective | undefined>;
|
|
118
|
+
/** Implicit content template from ng-content. */
|
|
119
|
+
readonly implicitContent: Signal<TemplateRef<unknown> | undefined>;
|
|
120
|
+
/** Whether this tab is currently active. Set by TabGroupComponent. */
|
|
121
|
+
readonly isActive: WritableSignal<boolean>;
|
|
122
|
+
/** Whether this tab content has been rendered at least once. */
|
|
123
|
+
readonly hasBeenActivated: WritableSignal<boolean>;
|
|
124
|
+
/**
|
|
125
|
+
* Returns the label template if provided, otherwise null.
|
|
126
|
+
* Parent uses this to decide between string label or template.
|
|
127
|
+
*/
|
|
128
|
+
readonly labelTemplate: Signal<TemplateRef<void> | null>;
|
|
129
|
+
/**
|
|
130
|
+
* Returns the content template: lazy template if present, else implicit content.
|
|
131
|
+
*/
|
|
132
|
+
readonly contentTemplate: Signal<TemplateRef<unknown> | undefined>;
|
|
133
|
+
/**
|
|
134
|
+
* Whether this tab uses lazy loading.
|
|
135
|
+
*/
|
|
136
|
+
readonly isLazy: Signal<boolean>;
|
|
137
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TabComponent, never>;
|
|
138
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<TabComponent, "com-tab", never, { "label": { "alias": "label"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "closable": { "alias": "closable"; "required": false; "isSignal": true; }; }, { "closed": "closed"; }, ["customLabel", "lazyContent"], ["*"], true, never>;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
type TabVariant = 'underline' | 'pill' | 'outline' | 'solid';
|
|
142
|
+
type TabSize = 'sm' | 'md' | 'lg';
|
|
143
|
+
type TabColor = 'primary' | 'accent' | 'muted';
|
|
144
|
+
type TabAlignment = 'start' | 'center' | 'end' | 'stretch';
|
|
145
|
+
declare const tabItemVariants: (props?: {
|
|
146
|
+
variant?: TabVariant;
|
|
147
|
+
size?: TabSize;
|
|
148
|
+
color?: TabColor;
|
|
149
|
+
active?: boolean;
|
|
150
|
+
}) => string;
|
|
151
|
+
type TabItemVariants = VariantProps<typeof tabItemVariants>;
|
|
152
|
+
declare const tabHeaderVariants: (props?: {
|
|
153
|
+
alignment?: TabAlignment;
|
|
154
|
+
variant?: TabVariant;
|
|
155
|
+
}) => string;
|
|
156
|
+
type TabHeaderVariants = VariantProps<typeof tabHeaderVariants>;
|
|
157
|
+
declare const tabScrollButtonVariants: (props?: {
|
|
158
|
+
direction?: 'left' | 'right';
|
|
159
|
+
variant?: TabVariant;
|
|
160
|
+
}) => string;
|
|
161
|
+
type TabScrollButtonVariants = VariantProps<typeof tabScrollButtonVariants>;
|
|
162
|
+
declare const tabCloseButtonVariants: (props?: {
|
|
163
|
+
size?: TabSize;
|
|
164
|
+
}) => string;
|
|
165
|
+
type TabCloseButtonVariants = VariantProps<typeof tabCloseButtonVariants>;
|
|
166
|
+
declare const tabPanelVariants: (props?: {
|
|
167
|
+
animated?: boolean;
|
|
168
|
+
}) => string;
|
|
169
|
+
type TabPanelVariants = VariantProps<typeof tabPanelVariants>;
|
|
170
|
+
|
|
171
|
+
/** Event emitted when the selected tab changes. */
|
|
172
|
+
interface TabChangeEvent {
|
|
173
|
+
index: number;
|
|
174
|
+
tab: TabComponent;
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* Tab group component — orchestrates tab state and renders header + panels.
|
|
178
|
+
*
|
|
179
|
+
* @tokens `--color-primary`, `--color-primary-foreground`, `--color-accent`, `--color-accent-foreground`,
|
|
180
|
+
* `--color-muted`, `--color-muted-foreground`, `--color-border`, `--color-ring`,
|
|
181
|
+
* `--color-disabled`, `--color-disabled-foreground`
|
|
182
|
+
*
|
|
183
|
+
* @example Basic usage
|
|
184
|
+
* ```html
|
|
185
|
+
* <com-tab-group>
|
|
186
|
+
* <com-tab label="Overview">
|
|
187
|
+
* <p>Overview content.</p>
|
|
188
|
+
* </com-tab>
|
|
189
|
+
* <com-tab label="Settings">
|
|
190
|
+
* <p>Settings content.</p>
|
|
191
|
+
* </com-tab>
|
|
192
|
+
* </com-tab-group>
|
|
193
|
+
* ```
|
|
194
|
+
*
|
|
195
|
+
* @example With variants
|
|
196
|
+
* ```html
|
|
197
|
+
* <com-tab-group variant="pill" color="accent">
|
|
198
|
+
* <com-tab label="Tab 1"><p>Pill style.</p></com-tab>
|
|
199
|
+
* <com-tab label="Tab 2"><p>Content.</p></com-tab>
|
|
200
|
+
* </com-tab-group>
|
|
201
|
+
* ```
|
|
202
|
+
*
|
|
203
|
+
* @example Two-way binding
|
|
204
|
+
* ```html
|
|
205
|
+
* <com-tab-group [(selectedIndex)]="currentTab">
|
|
206
|
+
* <com-tab label="One"><p>First.</p></com-tab>
|
|
207
|
+
* <com-tab label="Two"><p>Second.</p></com-tab>
|
|
208
|
+
* </com-tab-group>
|
|
209
|
+
* ```
|
|
210
|
+
*
|
|
211
|
+
* @example Lazy loaded content
|
|
212
|
+
* ```html
|
|
213
|
+
* <com-tab-group>
|
|
214
|
+
* <com-tab label="Summary"><p>Loads immediately.</p></com-tab>
|
|
215
|
+
* <com-tab label="Analytics">
|
|
216
|
+
* <ng-template comTabContent>
|
|
217
|
+
* <app-analytics-dashboard />
|
|
218
|
+
* </ng-template>
|
|
219
|
+
* </com-tab>
|
|
220
|
+
* </com-tab-group>
|
|
221
|
+
* ```
|
|
222
|
+
*/
|
|
223
|
+
declare class TabGroupComponent {
|
|
224
|
+
/** Unique ID for this tab group instance. */
|
|
225
|
+
readonly baseId: string;
|
|
226
|
+
/** Visual treatment of tab buttons. */
|
|
227
|
+
readonly variant: InputSignal<TabVariant>;
|
|
228
|
+
/** Controls tab button padding and font size. */
|
|
229
|
+
readonly size: InputSignal<TabSize>;
|
|
230
|
+
/** Active tab color. */
|
|
231
|
+
readonly color: InputSignal<TabColor>;
|
|
232
|
+
/** Tab alignment within the header. */
|
|
233
|
+
readonly alignment: InputSignal<TabAlignment>;
|
|
234
|
+
/** Two-way bindable selected tab index. */
|
|
235
|
+
readonly selectedIndex: ModelSignal<number>;
|
|
236
|
+
/** Enable/disable panel transition animation. */
|
|
237
|
+
readonly animationEnabled: InputSignalWithTransform<boolean, unknown>;
|
|
238
|
+
/** When true, keeps inactive tab DOM alive (hidden); when false, destroys inactive tab content. */
|
|
239
|
+
readonly preserveContent: InputSignalWithTransform<boolean, unknown>;
|
|
240
|
+
/** Emits when the selected tab changes with index and tab reference. */
|
|
241
|
+
readonly selectedTabChange: OutputEmitterRef<TabChangeEvent>;
|
|
242
|
+
/** Emits the index of the focused (not yet selected) tab for keyboard navigation feedback. */
|
|
243
|
+
readonly focusChange: OutputEmitterRef<number>;
|
|
244
|
+
/** All TabComponent children. */
|
|
245
|
+
readonly tabs: Signal<readonly TabComponent[]>;
|
|
246
|
+
/** The currently active tab. */
|
|
247
|
+
readonly activeTab: Signal<TabComponent | undefined>;
|
|
248
|
+
/** ID of the active tab button. */
|
|
249
|
+
readonly activeTabId: Signal<string>;
|
|
250
|
+
/** ID of the active panel. */
|
|
251
|
+
readonly activePanelId: Signal<string>;
|
|
252
|
+
/** Classes for panel container. */
|
|
253
|
+
readonly panelClasses: Signal<string>;
|
|
254
|
+
constructor();
|
|
255
|
+
getTabId(index: number): string;
|
|
256
|
+
getPanelId(index: number): string;
|
|
257
|
+
/**
|
|
258
|
+
* Determines whether a tab's content should be rendered.
|
|
259
|
+
* For lazy tabs, content is only rendered after first activation.
|
|
260
|
+
*/
|
|
261
|
+
shouldRenderTab(tab: TabComponent, index: number): boolean;
|
|
262
|
+
protected onTabSelected(index: number): void;
|
|
263
|
+
protected onTabFocused(index: number): void;
|
|
264
|
+
protected onTabClosed(index: number): void;
|
|
265
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TabGroupComponent, never>;
|
|
266
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<TabGroupComponent, "com-tab-group", never, { "variant": { "alias": "variant"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "color": { "alias": "color"; "required": false; "isSignal": true; }; "alignment": { "alias": "alignment"; "required": false; "isSignal": true; }; "selectedIndex": { "alias": "selectedIndex"; "required": false; "isSignal": true; }; "animationEnabled": { "alias": "animationEnabled"; "required": false; "isSignal": true; }; "preserveContent": { "alias": "preserveContent"; "required": false; "isSignal": true; }; }, { "selectedIndex": "selectedIndexChange"; "selectedTabChange": "selectedTabChange"; "focusChange": "focusChange"; }, ["tabs"], never, true, never>;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
/**
|
|
270
|
+
* Tab link directive for route-driven navigation tabs.
|
|
271
|
+
*
|
|
272
|
+
* Applied to anchor or button elements inside `com-tab-nav-bar`.
|
|
273
|
+
* Automatically detects active state from `routerLinkActive` if present.
|
|
274
|
+
*
|
|
275
|
+
* @example Basic usage with router
|
|
276
|
+
* ```html
|
|
277
|
+
* <nav com-tab-nav-bar>
|
|
278
|
+
* <a comTabLink routerLink="overview" routerLinkActive>Overview</a>
|
|
279
|
+
* <a comTabLink routerLink="settings" routerLinkActive>Settings</a>
|
|
280
|
+
* </nav>
|
|
281
|
+
* ```
|
|
282
|
+
*
|
|
283
|
+
* @example Manual active state control
|
|
284
|
+
* ```html
|
|
285
|
+
* <a comTabLink [active]="isOverviewActive">Overview</a>
|
|
286
|
+
* ```
|
|
287
|
+
*
|
|
288
|
+
* @example Disabled link
|
|
289
|
+
* ```html
|
|
290
|
+
* <a comTabLink [disabled]="true">Coming Soon</a>
|
|
291
|
+
* ```
|
|
292
|
+
*/
|
|
293
|
+
declare class TabLinkDirective {
|
|
294
|
+
private readonly routerLinkActive;
|
|
295
|
+
private readonly elementRef;
|
|
296
|
+
/** Manual active state control. */
|
|
297
|
+
readonly active: InputSignalWithTransform<boolean, unknown>;
|
|
298
|
+
/** Prevents interaction when true. */
|
|
299
|
+
readonly disabled: InputSignalWithTransform<boolean, unknown>;
|
|
300
|
+
/** Visual variant (inherited from parent nav bar or set directly). */
|
|
301
|
+
readonly variant: InputSignal<TabVariant>;
|
|
302
|
+
/** Size (inherited from parent nav bar or set directly). */
|
|
303
|
+
readonly size: InputSignal<TabSize>;
|
|
304
|
+
/** Color (inherited from parent nav bar or set directly). */
|
|
305
|
+
readonly color: InputSignal<TabColor>;
|
|
306
|
+
/** Additional CSS classes. */
|
|
307
|
+
readonly userClass: InputSignal<string>;
|
|
308
|
+
/**
|
|
309
|
+
* Reactive signal from RouterLinkActive.isActiveChange.
|
|
310
|
+
* Converts the EventEmitter to a signal for proper reactivity.
|
|
311
|
+
*/
|
|
312
|
+
private readonly routerLinkActiveState;
|
|
313
|
+
/**
|
|
314
|
+
* Resolved active state — uses routerLinkActive if available, otherwise input.
|
|
315
|
+
*/
|
|
316
|
+
readonly isActive: Signal<boolean>;
|
|
317
|
+
/** Computed host class from CVA + consumer overrides. */
|
|
318
|
+
readonly computedClass: Signal<string>;
|
|
319
|
+
/** Focus this tab link element. */
|
|
320
|
+
focus(): void;
|
|
321
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TabLinkDirective, never>;
|
|
322
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<TabLinkDirective, "a[comTabLink], button[comTabLink]", never, { "active": { "alias": "active"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "variant": { "alias": "variant"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "color": { "alias": "color"; "required": false; "isSignal": true; }; "userClass": { "alias": "class"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
/**
|
|
326
|
+
* Tab navigation bar component for route-driven tabs.
|
|
327
|
+
*
|
|
328
|
+
* Renders a styled, scrollable row of links that map to routes.
|
|
329
|
+
* Content is handled by `<router-outlet>`.
|
|
330
|
+
*
|
|
331
|
+
* @tokens `--color-primary`, `--color-accent`, `--color-muted`, `--color-muted-foreground`,
|
|
332
|
+
* `--color-border`, `--color-ring`, `--color-disabled`, `--color-disabled-foreground`
|
|
333
|
+
*
|
|
334
|
+
* @example Basic usage
|
|
335
|
+
* ```html
|
|
336
|
+
* <nav com-tab-nav-bar>
|
|
337
|
+
* <a comTabLink routerLink="overview" routerLinkActive>Overview</a>
|
|
338
|
+
* <a comTabLink routerLink="settings" routerLinkActive>Settings</a>
|
|
339
|
+
* </nav>
|
|
340
|
+
* <router-outlet />
|
|
341
|
+
* ```
|
|
342
|
+
*
|
|
343
|
+
* @example With variants
|
|
344
|
+
* ```html
|
|
345
|
+
* <nav com-tab-nav-bar variant="pill" color="accent" size="sm">
|
|
346
|
+
* <a comTabLink routerLink="grid" routerLinkActive>Grid</a>
|
|
347
|
+
* <a comTabLink routerLink="list" routerLinkActive>List</a>
|
|
348
|
+
* </nav>
|
|
349
|
+
* ```
|
|
350
|
+
*/
|
|
351
|
+
declare class TabNavBarComponent {
|
|
352
|
+
private readonly destroyRef;
|
|
353
|
+
/** Unique ID for this nav bar instance. */
|
|
354
|
+
readonly baseId: string;
|
|
355
|
+
/** Visual treatment of tab links. */
|
|
356
|
+
readonly variant: InputSignal<TabVariant>;
|
|
357
|
+
/** Controls tab link padding and font size. */
|
|
358
|
+
readonly size: InputSignal<TabSize>;
|
|
359
|
+
/** Active tab color. */
|
|
360
|
+
readonly color: InputSignal<TabColor>;
|
|
361
|
+
/** Tab alignment within the bar. */
|
|
362
|
+
readonly alignment: InputSignal<TabAlignment>;
|
|
363
|
+
/** All TabLinkDirective children. */
|
|
364
|
+
readonly tabLinks: Signal<readonly TabLinkDirective[]>;
|
|
365
|
+
readonly scrollContainer: Signal<ElementRef<HTMLElement> | undefined>;
|
|
366
|
+
private readonly scrollLeftValue;
|
|
367
|
+
private readonly containerWidth;
|
|
368
|
+
private readonly scrollWidth;
|
|
369
|
+
protected readonly indicatorLeft: WritableSignal<number>;
|
|
370
|
+
protected readonly indicatorWidth: WritableSignal<number>;
|
|
371
|
+
private keyManager;
|
|
372
|
+
private resizeObserver;
|
|
373
|
+
/** The currently active link. */
|
|
374
|
+
readonly activeLink: Signal<TabLinkDirective | undefined>;
|
|
375
|
+
readonly hasOverflow: Signal<boolean>;
|
|
376
|
+
readonly showScrollLeft: Signal<boolean>;
|
|
377
|
+
readonly showScrollRight: Signal<boolean>;
|
|
378
|
+
readonly headerClasses: Signal<string>;
|
|
379
|
+
readonly scrollLeftClasses: Signal<string>;
|
|
380
|
+
readonly scrollRightClasses: Signal<string>;
|
|
381
|
+
readonly indicatorColorClass: Signal<string>;
|
|
382
|
+
constructor();
|
|
383
|
+
scrollLeft(): void;
|
|
384
|
+
scrollRight(): void;
|
|
385
|
+
protected onScroll(): void;
|
|
386
|
+
protected onKeydown(event: KeyboardEvent): void;
|
|
387
|
+
private setupResizeObserver;
|
|
388
|
+
private updateScrollState;
|
|
389
|
+
private setupKeyManager;
|
|
390
|
+
private createKeyManagerItems;
|
|
391
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TabNavBarComponent, never>;
|
|
392
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<TabNavBarComponent, "com-tab-nav-bar, nav[com-tab-nav-bar]", never, { "variant": { "alias": "variant"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "color": { "alias": "color"; "required": false; "isSignal": true; }; "alignment": { "alias": "alignment"; "required": false; "isSignal": true; }; }, {}, ["tabLinks"], ["*"], true, never>;
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
export { TabComponent, TabContentDirective, TabGroupComponent, TabLabelDirective, TabLinkDirective, TabNavBarComponent, tabCloseButtonVariants, tabHeaderVariants, tabItemVariants, tabPanelVariants, tabScrollButtonVariants };
|
|
396
|
+
export type { TabAlignment, TabChangeEvent, TabCloseButtonVariants, TabColor, TabHeaderVariants, TabItemVariants, TabPanelVariants, TabScrollButtonVariants, TabSize, TabVariant };
|