@neural-ui/core 1.7.5 → 1.8.0
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/neural-ui-core-accordion.mjs +22 -8
- package/fesm2022/neural-ui-core-accordion.mjs.map +1 -1
- package/fesm2022/neural-ui-core-alert.mjs +1 -1
- package/fesm2022/neural-ui-core-alert.mjs.map +1 -1
- package/fesm2022/neural-ui-core-autocomplete.mjs +50 -9
- package/fesm2022/neural-ui-core-autocomplete.mjs.map +1 -1
- package/fesm2022/neural-ui-core-button.mjs +1 -1
- package/fesm2022/neural-ui-core-button.mjs.map +1 -1
- package/fesm2022/neural-ui-core-calendar.mjs +26 -18
- package/fesm2022/neural-ui-core-calendar.mjs.map +1 -1
- package/fesm2022/neural-ui-core-card.mjs +2 -2
- package/fesm2022/neural-ui-core-card.mjs.map +1 -1
- package/fesm2022/neural-ui-core-command-palette.mjs +22 -8
- package/fesm2022/neural-ui-core-command-palette.mjs.map +1 -1
- package/fesm2022/neural-ui-core-context-menu.mjs +24 -8
- package/fesm2022/neural-ui-core-context-menu.mjs.map +1 -1
- package/fesm2022/neural-ui-core-empty-state.mjs +1 -1
- package/fesm2022/neural-ui-core-empty-state.mjs.map +1 -1
- package/fesm2022/neural-ui-core-icon.mjs +9 -2
- package/fesm2022/neural-ui-core-icon.mjs.map +1 -1
- package/fesm2022/neural-ui-core-inline-editor.mjs +1 -1
- package/fesm2022/neural-ui-core-inline-editor.mjs.map +1 -1
- package/fesm2022/neural-ui-core-input-mask.mjs +2 -2
- package/fesm2022/neural-ui-core-input-mask.mjs.map +1 -1
- package/fesm2022/neural-ui-core-input.mjs +1 -1
- package/fesm2022/neural-ui-core-input.mjs.map +1 -1
- package/fesm2022/neural-ui-core-listbox.mjs +50 -5
- package/fesm2022/neural-ui-core-listbox.mjs.map +1 -1
- package/fesm2022/neural-ui-core-menu.mjs +38 -16
- package/fesm2022/neural-ui-core-menu.mjs.map +1 -1
- package/fesm2022/neural-ui-core-modal.mjs +1 -1
- package/fesm2022/neural-ui-core-modal.mjs.map +1 -1
- package/fesm2022/neural-ui-core-multiselect.mjs +67 -7
- package/fesm2022/neural-ui-core-multiselect.mjs.map +1 -1
- package/fesm2022/neural-ui-core-nav.mjs +1 -1
- package/fesm2022/neural-ui-core-nav.mjs.map +1 -1
- package/fesm2022/neural-ui-core-password.mjs +42 -6
- package/fesm2022/neural-ui-core-password.mjs.map +1 -1
- package/fesm2022/neural-ui-core-pick-list.mjs +43 -16
- package/fesm2022/neural-ui-core-pick-list.mjs.map +1 -1
- package/fesm2022/neural-ui-core-select.mjs +64 -5
- package/fesm2022/neural-ui-core-select.mjs.map +1 -1
- package/fesm2022/neural-ui-core-sidebar.mjs +1 -1
- package/fesm2022/neural-ui-core-sidebar.mjs.map +1 -1
- package/fesm2022/neural-ui-core-split-button.mjs +22 -8
- package/fesm2022/neural-ui-core-split-button.mjs.map +1 -1
- package/fesm2022/neural-ui-core-stats-card.mjs +1 -1
- package/fesm2022/neural-ui-core-stats-card.mjs.map +1 -1
- package/fesm2022/neural-ui-core-table.mjs +1 -1
- package/fesm2022/neural-ui-core-table.mjs.map +1 -1
- package/fesm2022/neural-ui-core-tabs.mjs +22 -9
- package/fesm2022/neural-ui-core-tabs.mjs.map +1 -1
- package/fesm2022/neural-ui-core-tags.mjs +40 -13
- package/fesm2022/neural-ui-core-tags.mjs.map +1 -1
- package/fesm2022/neural-ui-core-timeline.mjs +39 -10
- package/fesm2022/neural-ui-core-timeline.mjs.map +1 -1
- package/fesm2022/neural-ui-core-toast.mjs +1 -1
- package/fesm2022/neural-ui-core-toast.mjs.map +1 -1
- package/fesm2022/neural-ui-core-toggle-button-group.mjs +22 -8
- package/fesm2022/neural-ui-core-toggle-button-group.mjs.map +1 -1
- package/fesm2022/neural-ui-core-tree-select.mjs +86 -12
- package/fesm2022/neural-ui-core-tree-select.mjs.map +1 -1
- package/fesm2022/neural-ui-core-tree.mjs +21 -6
- package/fesm2022/neural-ui-core-tree.mjs.map +1 -1
- package/package.json +1 -1
- package/types/neural-ui-core-accordion.d.ts +16 -2
- package/types/neural-ui-core-autocomplete.d.ts +23 -2
- package/types/neural-ui-core-calendar.d.ts +18 -3
- package/types/neural-ui-core-command-palette.d.ts +24 -10
- package/types/neural-ui-core-context-menu.d.ts +17 -3
- package/types/neural-ui-core-icon.d.ts +5 -1
- package/types/neural-ui-core-listbox.d.ts +23 -2
- package/types/neural-ui-core-menu.d.ts +23 -3
- package/types/neural-ui-core-multiselect.d.ts +33 -2
- package/types/neural-ui-core-pick-list.d.ts +32 -3
- package/types/neural-ui-core-select.d.ts +30 -2
- package/types/neural-ui-core-split-button.d.ts +15 -3
- package/types/neural-ui-core-tabs.d.ts +16 -3
- package/types/neural-ui-core-tags.d.ts +35 -4
- package/types/neural-ui-core-timeline.d.ts +27 -2
- package/types/neural-ui-core-toggle-button-group.d.ts +16 -2
- package/types/neural-ui-core-tree-select.d.ts +51 -3
- package/types/neural-ui-core-tree.d.ts +18 -3
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { InjectionToken, inject, ElementRef, PLATFORM_ID, signal, effect, input, output, computed, ChangeDetectionStrategy, ViewEncapsulation, Component } from '@angular/core';
|
|
3
|
-
import { isPlatformBrowser } from '@angular/common';
|
|
2
|
+
import { InjectionToken, Directive, contentChild, inject, ElementRef, PLATFORM_ID, signal, effect, input, output, computed, ChangeDetectionStrategy, ViewEncapsulation, Component } from '@angular/core';
|
|
3
|
+
import { isPlatformBrowser, NgTemplateOutlet } from '@angular/common';
|
|
4
4
|
import { NeuUrlStateService } from '@neural-ui/core/url-state';
|
|
5
5
|
|
|
6
6
|
// ----------------------------------------------------------------
|
|
@@ -8,6 +8,18 @@ import { NeuUrlStateService } from '@neural-ui/core/url-state';
|
|
|
8
8
|
// la instancia padre sin pasar signals manualmente.
|
|
9
9
|
// ----------------------------------------------------------------
|
|
10
10
|
const NEU_TABS_CONTEXT = new InjectionToken('NeuTabsContext');
|
|
11
|
+
class NeuTabLabelDirective {
|
|
12
|
+
templateRef;
|
|
13
|
+
constructor(templateRef) {
|
|
14
|
+
this.templateRef = templateRef;
|
|
15
|
+
}
|
|
16
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: NeuTabLabelDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
17
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.17", type: NeuTabLabelDirective, isStandalone: true, selector: "ng-template[neuTabLabel]", ngImport: i0 });
|
|
18
|
+
}
|
|
19
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: NeuTabLabelDirective, decorators: [{
|
|
20
|
+
type: Directive,
|
|
21
|
+
args: [{ selector: 'ng-template[neuTabLabel]' }]
|
|
22
|
+
}], ctorParameters: () => [{ type: i0.TemplateRef }] });
|
|
11
23
|
/**
|
|
12
24
|
* NeuralUI Tabs Component
|
|
13
25
|
*
|
|
@@ -21,6 +33,7 @@ const NEU_TABS_CONTEXT = new InjectionToken('NeuTabsContext');
|
|
|
21
33
|
* </neu-tabs>
|
|
22
34
|
*/
|
|
23
35
|
class NeuTabsComponent {
|
|
36
|
+
labelTpl = contentChild(NeuTabLabelDirective, ...(ngDevMode ? [{ debugName: "labelTpl" }] : /* istanbul ignore next */ []));
|
|
24
37
|
urlState = inject(NeuUrlStateService);
|
|
25
38
|
elRef = inject(ElementRef);
|
|
26
39
|
platformId = inject(PLATFORM_ID);
|
|
@@ -193,7 +206,7 @@ class NeuTabsComponent {
|
|
|
193
206
|
btn?.focus();
|
|
194
207
|
}
|
|
195
208
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: NeuTabsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
196
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: NeuTabsComponent, isStandalone: true, selector: "neu-tabs", inputs: { tabs: { classPropertyName: "tabs", publicName: "tabs", isSignal: true, isRequired: false, transformFunction: null }, tabParam: { classPropertyName: "tabParam", publicName: "tabParam", isSignal: true, isRequired: false, transformFunction: null }, flush: { classPropertyName: "flush", publicName: "flush", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { tabChange: "tabChange" }, providers: [{ provide: NEU_TABS_CONTEXT, useExisting: NeuTabsComponent }], ngImport: i0, template: `
|
|
209
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: NeuTabsComponent, isStandalone: true, selector: "neu-tabs", inputs: { tabs: { classPropertyName: "tabs", publicName: "tabs", isSignal: true, isRequired: false, transformFunction: null }, tabParam: { classPropertyName: "tabParam", publicName: "tabParam", isSignal: true, isRequired: false, transformFunction: null }, flush: { classPropertyName: "flush", publicName: "flush", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { tabChange: "tabChange" }, providers: [{ provide: NEU_TABS_CONTEXT, useExisting: NeuTabsComponent }], queries: [{ propertyName: "labelTpl", first: true, predicate: NeuTabLabelDirective, descendants: true, isSignal: true }], ngImport: i0, template: `
|
|
197
210
|
<!-- Barra de pestañas -->
|
|
198
211
|
<div class="neu-tabs" [class.neu-tabs--flush]="flush()">
|
|
199
212
|
<div
|
|
@@ -225,7 +238,7 @@ class NeuTabsComponent {
|
|
|
225
238
|
(keydown.home)="focusTab($any($event), 'first')"
|
|
226
239
|
(keydown.end)="focusTab($any($event), 'last')"
|
|
227
240
|
>
|
|
228
|
-
{{ tab.label }}
|
|
241
|
+
@if (labelTpl()) { <ng-container [ngTemplateOutlet]="labelTpl()!.templateRef" [ngTemplateOutletContext]="{ $implicit: tab, active: activeTabId() === tab.id }" /> } @else { {{ tab.label }} }
|
|
229
242
|
@if (tab.badge) {
|
|
230
243
|
<span class="neu-tabs__tab-badge">{{ tab.badge }}</span>
|
|
231
244
|
}
|
|
@@ -240,11 +253,11 @@ class NeuTabsComponent {
|
|
|
240
253
|
<ng-content />
|
|
241
254
|
</div>
|
|
242
255
|
</div>
|
|
243
|
-
`, isInline: true, styles: [".neu-tabs{display:flex;flex-direction:column}.neu-tabs__nav{position:relative;display:flex;border-bottom:1.5px solid var(--neu-border);overflow-x:auto;cursor:grab;touch-action:pan-x;scrollbar-width:none}.neu-tabs__nav::-webkit-scrollbar{display:none}.neu-tabs__nav--dragging{cursor:grabbing;-webkit-user-select:none;user-select:none}.neu-tabs__tab{position:relative;display:inline-flex;align-items:center;gap:var(--neu-space-2);padding:var(--neu-space-3) var(--neu-space-5);background:transparent;border:none;font-family:var(--neu-font-sans);font-size:var(--neu-text-sm);font-weight:500;color:color-mix(in srgb,var(--neu-text) 72%,var(--neu-surface) 28%);cursor:pointer;white-space:nowrap;flex-shrink:0;transition:color var(--neu-transition),background-color var(--neu-transition);outline:none}.neu-tabs__tab:hover:not(:disabled){color:var(--neu-text);background:var(--neu-surface-2)}.neu-tabs__tab:focus-visible{outline:2px solid var(--neu-primary);outline-offset:-2px;border-radius:var(--neu-radius-sm) var(--neu-radius-sm) 0 0}.neu-tabs__tab--active{color:var(--neu-primary-dark, var(--neu-primary));font-weight:600}.neu-tabs__tab--disabled{opacity:.4;cursor:not-allowed}.neu-tabs__tab-badge{display:inline-flex;align-items:center;justify-content:center;min-width:18px;height:18px;padding:0 5px;border-radius:var(--neu-radius-full);background:var(--neu-primary-100);color:var(--neu-primary-dark, var(--neu-primary));font-size:10px;font-weight:700;line-height:1}.neu-tabs__indicator{position:absolute;bottom:-1.5px;height:2.5px;background:var(--neu-primary);border-radius:var(--neu-radius-full) var(--neu-radius-full) 0 0;transition:left var(--neu-transition-slow),width var(--neu-transition-slow);pointer-events:none}.neu-tabs__panels{flex:1}.neu-tab-panel{padding-top:1.5rem;animation:neu-tab-fade .18s ease}@keyframes neu-tab-fade{0%{opacity:0;transform:translateY(4px)}to{opacity:1;transform:translateY(0)}}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
256
|
+
`, isInline: true, styles: [".neu-tabs{display:flex;flex-direction:column}.neu-tabs__nav{position:relative;display:flex;border-bottom:1.5px solid var(--neu-border);overflow-x:auto;cursor:grab;touch-action:pan-x;scrollbar-width:none}.neu-tabs__nav::-webkit-scrollbar{display:none}.neu-tabs__nav--dragging{cursor:grabbing;-webkit-user-select:none;user-select:none}.neu-tabs__tab{position:relative;display:inline-flex;align-items:center;gap:var(--neu-space-2);padding:var(--neu-space-3) var(--neu-space-5);background:transparent;border:none;font-family:var(--neu-font-sans);font-size:var(--neu-text-sm);font-weight:500;color:color-mix(in srgb,var(--neu-text) 72%,var(--neu-surface) 28%);cursor:pointer;white-space:nowrap;flex-shrink:0;transition:color var(--neu-transition),background-color var(--neu-transition);outline:none}.neu-tabs__tab:hover:not(:disabled){color:var(--neu-text);background:var(--neu-surface-2)}.neu-tabs__tab:focus-visible{outline:2px solid var(--neu-primary);outline-offset:-2px;border-radius:var(--neu-radius-sm) var(--neu-radius-sm) 0 0}.neu-tabs__tab--active{color:var(--neu-primary-dark, var(--neu-primary));font-weight:600}.neu-tabs__tab--disabled{opacity:.4;cursor:not-allowed}.neu-tabs__tab-badge{display:inline-flex;align-items:center;justify-content:center;min-width:18px;height:18px;padding:0 5px;border-radius:var(--neu-radius-full);background:var(--neu-primary-100);color:var(--neu-primary-dark, var(--neu-primary));font-size:10px;font-weight:700;line-height:1}.neu-tabs__indicator{position:absolute;bottom:-1.5px;height:2.5px;background:var(--neu-primary);border-radius:var(--neu-radius-full) var(--neu-radius-full) 0 0;transition:left var(--neu-transition-slow),width var(--neu-transition-slow);pointer-events:none}.neu-tabs__panels{flex:1}.neu-tab-panel{padding-top:1.5rem;animation:neu-tab-fade .18s ease}@keyframes neu-tab-fade{0%{opacity:0;transform:translateY(4px)}to{opacity:1;transform:translateY(0)}}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
244
257
|
}
|
|
245
258
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: NeuTabsComponent, decorators: [{
|
|
246
259
|
type: Component,
|
|
247
|
-
args: [{ selector: 'neu-tabs', imports: [], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, providers: [{ provide: NEU_TABS_CONTEXT, useExisting: NeuTabsComponent }], template: `
|
|
260
|
+
args: [{ selector: 'neu-tabs', imports: [NgTemplateOutlet], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, providers: [{ provide: NEU_TABS_CONTEXT, useExisting: NeuTabsComponent }], template: `
|
|
248
261
|
<!-- Barra de pestañas -->
|
|
249
262
|
<div class="neu-tabs" [class.neu-tabs--flush]="flush()">
|
|
250
263
|
<div
|
|
@@ -276,7 +289,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImpo
|
|
|
276
289
|
(keydown.home)="focusTab($any($event), 'first')"
|
|
277
290
|
(keydown.end)="focusTab($any($event), 'last')"
|
|
278
291
|
>
|
|
279
|
-
{{ tab.label }}
|
|
292
|
+
@if (labelTpl()) { <ng-container [ngTemplateOutlet]="labelTpl()!.templateRef" [ngTemplateOutletContext]="{ $implicit: tab, active: activeTabId() === tab.id }" /> } @else { {{ tab.label }} }
|
|
280
293
|
@if (tab.badge) {
|
|
281
294
|
<span class="neu-tabs__tab-badge">{{ tab.badge }}</span>
|
|
282
295
|
}
|
|
@@ -292,7 +305,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImpo
|
|
|
292
305
|
</div>
|
|
293
306
|
</div>
|
|
294
307
|
`, styles: [".neu-tabs{display:flex;flex-direction:column}.neu-tabs__nav{position:relative;display:flex;border-bottom:1.5px solid var(--neu-border);overflow-x:auto;cursor:grab;touch-action:pan-x;scrollbar-width:none}.neu-tabs__nav::-webkit-scrollbar{display:none}.neu-tabs__nav--dragging{cursor:grabbing;-webkit-user-select:none;user-select:none}.neu-tabs__tab{position:relative;display:inline-flex;align-items:center;gap:var(--neu-space-2);padding:var(--neu-space-3) var(--neu-space-5);background:transparent;border:none;font-family:var(--neu-font-sans);font-size:var(--neu-text-sm);font-weight:500;color:color-mix(in srgb,var(--neu-text) 72%,var(--neu-surface) 28%);cursor:pointer;white-space:nowrap;flex-shrink:0;transition:color var(--neu-transition),background-color var(--neu-transition);outline:none}.neu-tabs__tab:hover:not(:disabled){color:var(--neu-text);background:var(--neu-surface-2)}.neu-tabs__tab:focus-visible{outline:2px solid var(--neu-primary);outline-offset:-2px;border-radius:var(--neu-radius-sm) var(--neu-radius-sm) 0 0}.neu-tabs__tab--active{color:var(--neu-primary-dark, var(--neu-primary));font-weight:600}.neu-tabs__tab--disabled{opacity:.4;cursor:not-allowed}.neu-tabs__tab-badge{display:inline-flex;align-items:center;justify-content:center;min-width:18px;height:18px;padding:0 5px;border-radius:var(--neu-radius-full);background:var(--neu-primary-100);color:var(--neu-primary-dark, var(--neu-primary));font-size:10px;font-weight:700;line-height:1}.neu-tabs__indicator{position:absolute;bottom:-1.5px;height:2.5px;background:var(--neu-primary);border-radius:var(--neu-radius-full) var(--neu-radius-full) 0 0;transition:left var(--neu-transition-slow),width var(--neu-transition-slow);pointer-events:none}.neu-tabs__panels{flex:1}.neu-tab-panel{padding-top:1.5rem;animation:neu-tab-fade .18s ease}@keyframes neu-tab-fade{0%{opacity:0;transform:translateY(4px)}to{opacity:1;transform:translateY(0)}}\n"] }]
|
|
295
|
-
}], ctorParameters: () => [], propDecorators: { tabs: [{ type: i0.Input, args: [{ isSignal: true, alias: "tabs", required: false }] }], tabParam: [{ type: i0.Input, args: [{ isSignal: true, alias: "tabParam", required: false }] }], flush: [{ type: i0.Input, args: [{ isSignal: true, alias: "flush", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], tabChange: [{ type: i0.Output, args: ["tabChange"] }] } });
|
|
308
|
+
}], ctorParameters: () => [], propDecorators: { labelTpl: [{ type: i0.ContentChild, args: [i0.forwardRef(() => NeuTabLabelDirective), { isSignal: true }] }], tabs: [{ type: i0.Input, args: [{ isSignal: true, alias: "tabs", required: false }] }], tabParam: [{ type: i0.Input, args: [{ isSignal: true, alias: "tabParam", required: false }] }], flush: [{ type: i0.Input, args: [{ isSignal: true, alias: "flush", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], tabChange: [{ type: i0.Output, args: ["tabChange"] }] } });
|
|
296
309
|
// ----------------------------------------------------------------
|
|
297
310
|
// NeuTabPanelComponent — panel individual (usa DI para el contexto)
|
|
298
311
|
// ----------------------------------------------------------------
|
|
@@ -350,5 +363,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImpo
|
|
|
350
363
|
* Generated bundle index. Do not edit.
|
|
351
364
|
*/
|
|
352
365
|
|
|
353
|
-
export { NEU_TABS_CONTEXT, NeuTabPanelComponent, NeuTabsComponent };
|
|
366
|
+
export { NEU_TABS_CONTEXT, NeuTabLabelDirective, NeuTabPanelComponent, NeuTabsComponent };
|
|
354
367
|
//# sourceMappingURL=neural-ui-core-tabs.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"neural-ui-core-tabs.mjs","sources":["../../../../projects/ui-core/tabs/neu-tabs.component.ts","../../../../projects/ui-core/tabs/neural-ui-core-tabs.ts"],"sourcesContent":["import {\n AfterViewInit,\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n InjectionToken,\n OnDestroy,\n PLATFORM_ID,\n Signal,\n ViewEncapsulation,\n computed,\n effect,\n inject,\n input,\n output,\n signal,\n} from '@angular/core';\nimport { isPlatformBrowser } from '@angular/common';\nimport { NeuUrlStateService } from '@neural-ui/core/url-state';\n\n// ----------------------------------------------------------------\n// Token de contexto — permite a NeuTabPanelComponent inyectar\n// la instancia padre sin pasar signals manualmente.\n// ----------------------------------------------------------------\nexport const NEU_TABS_CONTEXT = new InjectionToken<NeuTabsComponent>('NeuTabsContext');\n\nexport interface NeuTab {\n /** ID único de la pestaña — se usa como valor en la URL / Unique tab ID — used as the URL value */\n id: string;\n /** Etiqueta visible / Visible label */\n label: string;\n /** Badge opcional junto al label / Optional badge next to the label */\n badge?: string;\n /** Deshabilita la pestaña sin ocultarla / Disables the tab without hiding it */\n disabled?: boolean;\n}\n\n/**\n * NeuralUI Tabs Component\n *\n * Sistema de pestañas con estado sincronizado a la URL via NeuUrlStateService. / Tab system with state synchronized to the URL via NeuUrlStateService.\n * El panel activo se determina por ?{tabParam}={tabId}. / The active panel is determined by ?{tabParam}={tabId}.\n *\n * Uso:\n * <neu-tabs [tabs]=\"tabs\" tabParam=\"tab\">\n * <neu-tab-panel tabId=\"preview\">...</neu-tab-panel>\n * <neu-tab-panel tabId=\"api\">...</neu-tab-panel>\n * </neu-tabs>\n */\n@Component({\n selector: 'neu-tabs',\n imports: [],\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [{ provide: NEU_TABS_CONTEXT, useExisting: NeuTabsComponent }],\n template: `\n <!-- Barra de pestañas -->\n <div class=\"neu-tabs\" [class.neu-tabs--flush]=\"flush()\">\n <div\n class=\"neu-tabs__nav\"\n role=\"tablist\"\n [attr.aria-label]=\"ariaLabel()\"\n [class.neu-tabs__nav--dragging]=\"isDraggingNav()\"\n #navRef\n (pointerdown)=\"startNavDrag($event)\"\n (pointermove)=\"moveNavDrag($event)\"\n (pointerup)=\"endNavDrag($event)\"\n (pointercancel)=\"endNavDrag($event)\"\n >\n @for (tab of tabs(); track tab.id) {\n <button\n class=\"neu-tabs__tab\"\n [class.neu-tabs__tab--active]=\"activeTabId() === tab.id\"\n [class.neu-tabs__tab--disabled]=\"tab.disabled\"\n role=\"tab\"\n [id]=\"'neu-tab-' + tab.id\"\n [attr.aria-selected]=\"activeTabId() === tab.id\"\n [attr.aria-controls]=\"'neu-tabpanel-' + tab.id\"\n [attr.tabindex]=\"activeTabId() === tab.id ? '0' : '-1'\"\n [disabled]=\"tab.disabled\"\n type=\"button\"\n (click)=\"handleTabClick($event, tab)\"\n (keydown.arrowRight)=\"focusTab($any($event), 1)\"\n (keydown.arrowLeft)=\"focusTab($any($event), -1)\"\n (keydown.home)=\"focusTab($any($event), 'first')\"\n (keydown.end)=\"focusTab($any($event), 'last')\"\n >\n {{ tab.label }}\n @if (tab.badge) {\n <span class=\"neu-tabs__tab-badge\">{{ tab.badge }}</span>\n }\n </button>\n }\n <!-- Indicador deslizante -->\n <span class=\"neu-tabs__indicator\" [style]=\"indicatorStyle()\"></span>\n </div>\n\n <!-- Paneles (proyectados desde NeuTabPanelComponent) -->\n <div class=\"neu-tabs__panels\">\n <ng-content />\n </div>\n </div>\n `,\n styleUrl: './neu-tabs.component.scss',\n})\nexport class NeuTabsComponent implements AfterViewInit, OnDestroy {\n private readonly urlState = inject(NeuUrlStateService);\n private readonly elRef = inject(ElementRef);\n private readonly platformId = inject(PLATFORM_ID);\n private resizeObserver?: ResizeObserver;\n private readonly _urlParamSignals = new Map<string, Signal<string | null>>();\n private _dragPointerId: number | null = null;\n private _dragStartX = 0;\n private _dragStartScrollLeft = 0;\n private _suppressNextClick = false;\n private readonly _optimisticActiveTabId = signal<string | null>(null);\n readonly isDraggingNav = signal(false);\n\n private _getUrlParamSignal(key: string): Signal<string | null> {\n let paramSignal = this._urlParamSignals.get(key);\n if (!paramSignal) {\n paramSignal = this.urlState.getParam(key);\n this._urlParamSignals.set(key, paramSignal);\n }\n return paramSignal;\n }\n\n private _readUrlParam(key: string): string | null {\n return this._getUrlParamSignal(key)();\n }\n\n private _requestFrame(callback: FrameRequestCallback): void {\n if (isPlatformBrowser(this.platformId)) {\n requestAnimationFrame(callback);\n }\n }\n\n constructor() {\n // Actualizar indicador cuando activeTabId cambie — debe estar en el constructor (injection context)\n effect(() => {\n this.activeTabId(); // dependencia reactiva\n this._requestFrame(() => this._updateIndicator());\n });\n }\n\n /** Definición de pestañas / Tab definitions */\n tabs = input<NeuTab[]>([]);\n\n /** QueryParam que almacena la pestaña activa / QueryParam that stores the active tab */\n tabParam = input<string>('tab');\n\n /** Si true, elimina el padding interno de los paneles / If true, removes the internal padding from panels */\n flush = input<boolean>(false);\n\n /** Etiqueta accesible del rol tablist / Accessible label for the tablist role */\n ariaLabel = input<string>('Pestañas de contenido');\n\n /** Emite al cambiar de pestaña / Emits when the tab changes */\n tabChange = output<string>();\n\n /** ID de la pestaña activa (de la URL o la primera disponible) / Active tab ID (from the URL or the first available) */\n readonly activeTabId = computed(() => {\n const tabList = this.tabs();\n const fromUrl = this._readUrlParam(this.tabParam());\n const available = tabList.find((t) => t.id === fromUrl && !t.disabled);\n if (available) return available.id;\n\n const optimistic = this._optimisticActiveTabId();\n const optimisticAvailable = tabList.find((t) => t.id === optimistic && !t.disabled);\n if (optimisticAvailable) return optimisticAvailable.id;\n\n // Fallback: primera pestaña no deshabilitada\n return tabList.find((t) => !t.disabled)?.id ?? '';\n });\n\n /** Posición del indicador calculada mediante medición DOM / Indicator position calculated via DOM measurement */\n private readonly _indicatorLeft = signal('0px');\n private readonly _indicatorWidth = signal('0px');\n\n readonly indicatorStyle = computed(\n () => `left: ${this._indicatorLeft()}; width: ${this._indicatorWidth()}`,\n );\n\n ngAfterViewInit(): void {\n this._updateIndicator();\n // Actualizar cuando cambie el tamaño del nav (p.ej. resize de ventana)\n const nav = this.elRef.nativeElement.querySelector('.neu-tabs__nav');\n if (nav && typeof ResizeObserver !== 'undefined') {\n this.resizeObserver = new ResizeObserver(() => this._updateIndicator());\n this.resizeObserver.observe(nav);\n }\n }\n\n ngOnDestroy(): void {\n this.resizeObserver?.disconnect();\n }\n\n private _updateIndicator(): void {\n const nav: HTMLElement | null = this.elRef.nativeElement.querySelector('.neu-tabs__nav');\n if (!nav) return;\n const tabEls = nav.querySelectorAll<HTMLElement>('.neu-tabs__tab');\n const idx = this.tabs().findIndex((t) => t.id === this.activeTabId());\n const tabEl = tabEls[idx];\n if (tabEl) {\n this._indicatorLeft.set(tabEl.offsetLeft + 'px');\n this._indicatorWidth.set(tabEl.offsetWidth + 'px');\n if (typeof tabEl.scrollIntoView === 'function') {\n tabEl.scrollIntoView({\n behavior: 'smooth',\n block: 'nearest',\n inline: 'nearest',\n });\n }\n }\n }\n\n handleTabClick(event: Event, tab: NeuTab): void {\n if (this._suppressNextClick) {\n event.preventDefault();\n event.stopPropagation();\n this._suppressNextClick = false;\n return;\n }\n this.selectTab(tab);\n }\n\n selectTab(tab: NeuTab): void {\n if (tab.disabled) return;\n this._optimisticActiveTabId.set(tab.id);\n this.urlState.setParam(this.tabParam(), tab.id);\n this.tabChange.emit(tab.id);\n this._requestFrame(() => this._updateIndicator());\n }\n\n startNavDrag(event: PointerEvent): void {\n if (event.pointerType === 'mouse' && event.button !== 0) return;\n const target = event.target as HTMLElement | null;\n if (!target?.closest('.neu-tabs__nav')) return;\n if (target.closest('.neu-tabs__tab')) return;\n\n const nav = event.currentTarget as HTMLElement;\n this._dragPointerId = event.pointerId;\n this._dragStartX = event.clientX;\n this._dragStartScrollLeft = nav.scrollLeft;\n this.isDraggingNav.set(false);\n nav.setPointerCapture(event.pointerId);\n }\n\n moveNavDrag(event: PointerEvent): void {\n if (this._dragPointerId !== event.pointerId) return;\n\n const nav = event.currentTarget as HTMLElement;\n const deltaX = event.clientX - this._dragStartX;\n if (!this.isDraggingNav() && Math.abs(deltaX) > 6) {\n this.isDraggingNav.set(true);\n this._suppressNextClick = true;\n }\n if (!this.isDraggingNav()) return;\n\n nav.scrollLeft = this._dragStartScrollLeft - deltaX;\n event.preventDefault();\n }\n\n endNavDrag(event: PointerEvent): void {\n if (this._dragPointerId !== event.pointerId) return;\n\n const nav = event.currentTarget as HTMLElement;\n if (nav.hasPointerCapture(event.pointerId)) {\n nav.releasePointerCapture(event.pointerId);\n }\n this._dragPointerId = null;\n if (this.isDraggingNav()) {\n this._requestFrame(() => this.isDraggingNav.set(false));\n }\n }\n\n /** Mueve el foco entre tabs con flechas (roving tabindex — WAI-ARIA Tabs Pattern) / Moves focus between tabs with arrows (roving tabindex — WAI-ARIA Tabs Pattern) */\n focusTab(event: Event, dir: 1 | -1 | 'first' | 'last'): void {\n event.preventDefault();\n const enabledTabs = this.tabs().filter((t) => !t.disabled);\n const currentIdx = enabledTabs.findIndex((t) => t.id === this.activeTabId());\n let nextIdx: number;\n if (dir === 'first') {\n nextIdx = 0;\n } else if (dir === 'last') {\n nextIdx = enabledTabs.length - 1;\n } else {\n nextIdx = (currentIdx + dir + enabledTabs.length) % enabledTabs.length;\n }\n const next = enabledTabs[nextIdx];\n this.selectTab(next);\n const btn = (this.elRef.nativeElement as HTMLElement).querySelector(\n `#neu-tab-${next.id}`,\n ) as HTMLElement | null;\n btn?.focus();\n }\n}\n\n// ----------------------------------------------------------------\n// NeuTabPanelComponent — panel individual (usa DI para el contexto)\n// ----------------------------------------------------------------\n\n/**\n * NeuralUI Tab Panel\n *\n * Panel de contenido asociado a una pestaña de NeuTabsComponent. / Content panel associated with a NeuTabsComponent tab.\n * Solo se renderiza (no oculta con CSS) cuando la pestaña está activa. / Only rendered (not hidden with CSS) when the tab is active.\n *\n * Uso: hijo directo de <neu-tabs>\n * <neu-tab-panel tabId=\"api\">...</neu-tab-panel>\n */\n@Component({\n selector: 'neu-tab-panel',\n imports: [],\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n template: `\n @if (isActive()) {\n <div\n class=\"neu-tab-panel\"\n role=\"tabpanel\"\n [id]=\"'neu-tabpanel-' + tabId()\"\n [attr.aria-labelledby]=\"'neu-tab-' + tabId()\"\n >\n <ng-content />\n </div>\n }\n `,\n})\nexport class NeuTabPanelComponent {\n private readonly tabs = inject(NEU_TABS_CONTEXT, { optional: true });\n\n /** ID que debe coincidir con NeuTab.id del padre / ID that must match the parent NeuTab.id */\n tabId = input.required<string>();\n\n readonly isActive = computed(() => this.tabs?.activeTabId() === this.tabId());\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;AAoBA;AACA;AACA;AACA;MACa,gBAAgB,GAAG,IAAI,cAAc,CAAmB,gBAAgB;AAarF;;;;;;;;;;;AAWG;MAyDU,gBAAgB,CAAA;AACV,IAAA,QAAQ,GAAG,MAAM,CAAC,kBAAkB,CAAC;AACrC,IAAA,KAAK,GAAG,MAAM,CAAC,UAAU,CAAC;AAC1B,IAAA,UAAU,GAAG,MAAM,CAAC,WAAW,CAAC;AACzC,IAAA,cAAc;AACL,IAAA,gBAAgB,GAAG,IAAI,GAAG,EAAiC;IACpE,cAAc,GAAkB,IAAI;IACpC,WAAW,GAAG,CAAC;IACf,oBAAoB,GAAG,CAAC;IACxB,kBAAkB,GAAG,KAAK;AACjB,IAAA,sBAAsB,GAAG,MAAM,CAAgB,IAAI,6FAAC;AAC5D,IAAA,aAAa,GAAG,MAAM,CAAC,KAAK,oFAAC;AAE9B,IAAA,kBAAkB,CAAC,GAAW,EAAA;QACpC,IAAI,WAAW,GAAG,IAAI,CAAC,gBAAgB,CAAC,GAAG,CAAC,GAAG,CAAC;QAChD,IAAI,CAAC,WAAW,EAAE;YAChB,WAAW,GAAG,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,GAAG,CAAC;YACzC,IAAI,CAAC,gBAAgB,CAAC,GAAG,CAAC,GAAG,EAAE,WAAW,CAAC;QAC7C;AACA,QAAA,OAAO,WAAW;IAC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A,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EAbrB;;;;;;;;;;;AAWT,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,aAAA,EAAA,EAAA,CAAA,iBAAA,CAAA,IAAA,EAAA,CAAA;;4FAEU,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBAlBhC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,eAAe;AACzB,oBAAA,OAAO,EAAE,EAAE;oBACX,aAAa,EAAE,iBAAiB,CAAC,IAAI;oBACrC,eAAe,EAAE,uBAAuB,CAAC,MAAM;AAC/C,oBAAA,QAAQ,EAAE;;;;;;;;;;;AAWT,EAAA,CAAA;AACF,iBAAA;;;ACxUD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"neural-ui-core-tabs.mjs","sources":["../../../../projects/ui-core/tabs/neu-tabs.component.ts","../../../../projects/ui-core/tabs/neural-ui-core-tabs.ts"],"sourcesContent":["import {\n AfterViewInit,\n ChangeDetectionStrategy,\n Component,\n Directive,\n ElementRef,\n InjectionToken,\n OnDestroy,\n PLATFORM_ID,\n Signal,\n TemplateRef,\n ViewEncapsulation,\n computed,\n contentChild,\n effect,\n inject,\n input,\n output,\n signal,\n} from '@angular/core';\nimport { isPlatformBrowser, NgTemplateOutlet } from '@angular/common';\nimport { NeuUrlStateService } from '@neural-ui/core/url-state';\n\n// ----------------------------------------------------------------\n// Token de contexto — permite a NeuTabPanelComponent inyectar\n// la instancia padre sin pasar signals manualmente.\n// ----------------------------------------------------------------\nexport const NEU_TABS_CONTEXT = new InjectionToken<NeuTabsComponent>('NeuTabsContext');\n\nexport interface NeuTab {\n /** ID único de la pestaña — se usa como valor en la URL / Unique tab ID — used as the URL value */\n id: string;\n /** Etiqueta visible / Visible label */\n label: string;\n /** Badge opcional junto al label / Optional badge next to the label */\n badge?: string;\n /** Deshabilita la pestaña sin ocultarla / Disables the tab without hiding it */\n disabled?: boolean;\n}\n@Directive({ selector: 'ng-template[neuTabLabel]' })\nexport class NeuTabLabelDirective { constructor(readonly templateRef: TemplateRef<{ $implicit: NeuTab; active: boolean }>) {} }\n\n/**\n * NeuralUI Tabs Component\n *\n * Sistema de pestañas con estado sincronizado a la URL via NeuUrlStateService. / Tab system with state synchronized to the URL via NeuUrlStateService.\n * El panel activo se determina por ?{tabParam}={tabId}. / The active panel is determined by ?{tabParam}={tabId}.\n *\n * Uso:\n * <neu-tabs [tabs]=\"tabs\" tabParam=\"tab\">\n * <neu-tab-panel tabId=\"preview\">...</neu-tab-panel>\n * <neu-tab-panel tabId=\"api\">...</neu-tab-panel>\n * </neu-tabs>\n */\n@Component({\n selector: 'neu-tabs',\n imports: [NgTemplateOutlet],\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [{ provide: NEU_TABS_CONTEXT, useExisting: NeuTabsComponent }],\n template: `\n <!-- Barra de pestañas -->\n <div class=\"neu-tabs\" [class.neu-tabs--flush]=\"flush()\">\n <div\n class=\"neu-tabs__nav\"\n role=\"tablist\"\n [attr.aria-label]=\"ariaLabel()\"\n [class.neu-tabs__nav--dragging]=\"isDraggingNav()\"\n #navRef\n (pointerdown)=\"startNavDrag($event)\"\n (pointermove)=\"moveNavDrag($event)\"\n (pointerup)=\"endNavDrag($event)\"\n (pointercancel)=\"endNavDrag($event)\"\n >\n @for (tab of tabs(); track tab.id) {\n <button\n class=\"neu-tabs__tab\"\n [class.neu-tabs__tab--active]=\"activeTabId() === tab.id\"\n [class.neu-tabs__tab--disabled]=\"tab.disabled\"\n role=\"tab\"\n [id]=\"'neu-tab-' + tab.id\"\n [attr.aria-selected]=\"activeTabId() === tab.id\"\n [attr.aria-controls]=\"'neu-tabpanel-' + tab.id\"\n [attr.tabindex]=\"activeTabId() === tab.id ? '0' : '-1'\"\n [disabled]=\"tab.disabled\"\n type=\"button\"\n (click)=\"handleTabClick($event, tab)\"\n (keydown.arrowRight)=\"focusTab($any($event), 1)\"\n (keydown.arrowLeft)=\"focusTab($any($event), -1)\"\n (keydown.home)=\"focusTab($any($event), 'first')\"\n (keydown.end)=\"focusTab($any($event), 'last')\"\n >\n @if (labelTpl()) { <ng-container [ngTemplateOutlet]=\"labelTpl()!.templateRef\" [ngTemplateOutletContext]=\"{ $implicit: tab, active: activeTabId() === tab.id }\" /> } @else { {{ tab.label }} }\n @if (tab.badge) {\n <span class=\"neu-tabs__tab-badge\">{{ tab.badge }}</span>\n }\n </button>\n }\n <!-- Indicador deslizante -->\n <span class=\"neu-tabs__indicator\" [style]=\"indicatorStyle()\"></span>\n </div>\n\n <!-- Paneles (proyectados desde NeuTabPanelComponent) -->\n <div class=\"neu-tabs__panels\">\n <ng-content />\n </div>\n </div>\n `,\n styleUrl: './neu-tabs.component.scss',\n})\nexport class NeuTabsComponent implements AfterViewInit, OnDestroy {\n readonly labelTpl = contentChild(NeuTabLabelDirective);\n private readonly urlState = inject(NeuUrlStateService);\n private readonly elRef = inject(ElementRef);\n private readonly platformId = inject(PLATFORM_ID);\n private resizeObserver?: ResizeObserver;\n private readonly _urlParamSignals = new Map<string, Signal<string | null>>();\n private _dragPointerId: number | null = null;\n private _dragStartX = 0;\n private _dragStartScrollLeft = 0;\n private _suppressNextClick = false;\n private readonly _optimisticActiveTabId = signal<string | null>(null);\n readonly isDraggingNav = signal(false);\n\n private _getUrlParamSignal(key: string): Signal<string | null> {\n let paramSignal = this._urlParamSignals.get(key);\n if (!paramSignal) {\n paramSignal = this.urlState.getParam(key);\n this._urlParamSignals.set(key, paramSignal);\n }\n return paramSignal;\n }\n\n private _readUrlParam(key: string): string | null {\n return this._getUrlParamSignal(key)();\n }\n\n private _requestFrame(callback: FrameRequestCallback): void {\n if (isPlatformBrowser(this.platformId)) {\n requestAnimationFrame(callback);\n }\n }\n\n constructor() {\n // Actualizar indicador cuando activeTabId cambie — debe estar en el constructor (injection context)\n effect(() => {\n this.activeTabId(); // dependencia reactiva\n this._requestFrame(() => this._updateIndicator());\n });\n }\n\n /** Definición de pestañas / Tab definitions */\n tabs = input<NeuTab[]>([]);\n\n /** QueryParam que almacena la pestaña activa / QueryParam that stores the active tab */\n tabParam = input<string>('tab');\n\n /** Si true, elimina el padding interno de los paneles / If true, removes the internal padding from panels */\n flush = input<boolean>(false);\n\n /** Etiqueta accesible del rol tablist / Accessible label for the tablist role */\n ariaLabel = input<string>('Pestañas de contenido');\n\n /** Emite al cambiar de pestaña / Emits when the tab changes */\n tabChange = output<string>();\n\n /** ID de la pestaña activa (de la URL o la primera disponible) / Active tab ID (from the URL or the first available) */\n readonly activeTabId = computed(() => {\n const tabList = this.tabs();\n const fromUrl = this._readUrlParam(this.tabParam());\n const available = tabList.find((t) => t.id === fromUrl && !t.disabled);\n if (available) return available.id;\n\n const optimistic = this._optimisticActiveTabId();\n const optimisticAvailable = tabList.find((t) => t.id === optimistic && !t.disabled);\n if (optimisticAvailable) return optimisticAvailable.id;\n\n // Fallback: primera pestaña no deshabilitada\n return tabList.find((t) => !t.disabled)?.id ?? '';\n });\n\n /** Posición del indicador calculada mediante medición DOM / Indicator position calculated via DOM measurement */\n private readonly _indicatorLeft = signal('0px');\n private readonly _indicatorWidth = signal('0px');\n\n readonly indicatorStyle = computed(\n () => `left: ${this._indicatorLeft()}; width: ${this._indicatorWidth()}`,\n );\n\n ngAfterViewInit(): void {\n this._updateIndicator();\n // Actualizar cuando cambie el tamaño del nav (p.ej. resize de ventana)\n const nav = this.elRef.nativeElement.querySelector('.neu-tabs__nav');\n if (nav && typeof ResizeObserver !== 'undefined') {\n this.resizeObserver = new ResizeObserver(() => this._updateIndicator());\n this.resizeObserver.observe(nav);\n }\n }\n\n ngOnDestroy(): void {\n this.resizeObserver?.disconnect();\n }\n\n private _updateIndicator(): void {\n const nav: HTMLElement | null = this.elRef.nativeElement.querySelector('.neu-tabs__nav');\n if (!nav) return;\n const tabEls = nav.querySelectorAll<HTMLElement>('.neu-tabs__tab');\n const idx = this.tabs().findIndex((t) => t.id === this.activeTabId());\n const tabEl = tabEls[idx];\n if (tabEl) {\n this._indicatorLeft.set(tabEl.offsetLeft + 'px');\n this._indicatorWidth.set(tabEl.offsetWidth + 'px');\n if (typeof tabEl.scrollIntoView === 'function') {\n tabEl.scrollIntoView({\n behavior: 'smooth',\n block: 'nearest',\n inline: 'nearest',\n });\n }\n }\n }\n\n handleTabClick(event: Event, tab: NeuTab): void {\n if (this._suppressNextClick) {\n event.preventDefault();\n event.stopPropagation();\n this._suppressNextClick = false;\n return;\n }\n this.selectTab(tab);\n }\n\n selectTab(tab: NeuTab): void {\n if (tab.disabled) return;\n this._optimisticActiveTabId.set(tab.id);\n this.urlState.setParam(this.tabParam(), tab.id);\n this.tabChange.emit(tab.id);\n this._requestFrame(() => this._updateIndicator());\n }\n\n startNavDrag(event: PointerEvent): void {\n if (event.pointerType === 'mouse' && event.button !== 0) return;\n const target = event.target as HTMLElement | null;\n if (!target?.closest('.neu-tabs__nav')) return;\n if (target.closest('.neu-tabs__tab')) return;\n\n const nav = event.currentTarget as HTMLElement;\n this._dragPointerId = event.pointerId;\n this._dragStartX = event.clientX;\n this._dragStartScrollLeft = nav.scrollLeft;\n this.isDraggingNav.set(false);\n nav.setPointerCapture(event.pointerId);\n }\n\n moveNavDrag(event: PointerEvent): void {\n if (this._dragPointerId !== event.pointerId) return;\n\n const nav = event.currentTarget as HTMLElement;\n const deltaX = event.clientX - this._dragStartX;\n if (!this.isDraggingNav() && Math.abs(deltaX) > 6) {\n this.isDraggingNav.set(true);\n this._suppressNextClick = true;\n }\n if (!this.isDraggingNav()) return;\n\n nav.scrollLeft = this._dragStartScrollLeft - deltaX;\n event.preventDefault();\n }\n\n endNavDrag(event: PointerEvent): void {\n if (this._dragPointerId !== event.pointerId) return;\n\n const nav = event.currentTarget as HTMLElement;\n if (nav.hasPointerCapture(event.pointerId)) {\n nav.releasePointerCapture(event.pointerId);\n }\n this._dragPointerId = null;\n if (this.isDraggingNav()) {\n this._requestFrame(() => this.isDraggingNav.set(false));\n }\n }\n\n /** Mueve el foco entre tabs con flechas (roving tabindex — WAI-ARIA Tabs Pattern) / Moves focus between tabs with arrows (roving tabindex — WAI-ARIA Tabs Pattern) */\n focusTab(event: Event, dir: 1 | -1 | 'first' | 'last'): void {\n event.preventDefault();\n const enabledTabs = this.tabs().filter((t) => !t.disabled);\n const currentIdx = enabledTabs.findIndex((t) => t.id === this.activeTabId());\n let nextIdx: number;\n if (dir === 'first') {\n nextIdx = 0;\n } else if (dir === 'last') {\n nextIdx = enabledTabs.length - 1;\n } else {\n nextIdx = (currentIdx + dir + enabledTabs.length) % enabledTabs.length;\n }\n const next = enabledTabs[nextIdx];\n this.selectTab(next);\n const btn = (this.elRef.nativeElement as HTMLElement).querySelector(\n `#neu-tab-${next.id}`,\n ) as HTMLElement | null;\n btn?.focus();\n }\n}\n\n// ----------------------------------------------------------------\n// NeuTabPanelComponent — panel individual (usa DI para el contexto)\n// ----------------------------------------------------------------\n\n/**\n * NeuralUI Tab Panel\n *\n * Panel de contenido asociado a una pestaña de NeuTabsComponent. / Content panel associated with a NeuTabsComponent tab.\n * Solo se renderiza (no oculta con CSS) cuando la pestaña está activa. / Only rendered (not hidden with CSS) when the tab is active.\n *\n * Uso: hijo directo de <neu-tabs>\n * <neu-tab-panel tabId=\"api\">...</neu-tab-panel>\n */\n@Component({\n selector: 'neu-tab-panel',\n imports: [],\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n template: `\n @if (isActive()) {\n <div\n class=\"neu-tab-panel\"\n role=\"tabpanel\"\n [id]=\"'neu-tabpanel-' + tabId()\"\n [attr.aria-labelledby]=\"'neu-tab-' + tabId()\"\n >\n <ng-content />\n </div>\n }\n `,\n})\nexport class NeuTabPanelComponent {\n private readonly tabs = inject(NEU_TABS_CONTEXT, { optional: true });\n\n /** ID que debe coincidir con NeuTab.id del padre / ID that must match the parent NeuTab.id */\n tabId = input.required<string>();\n\n readonly isActive = computed(() => this.tabs?.activeTabId() === this.tabId());\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;AAuBA;AACA;AACA;AACA;MACa,gBAAgB,GAAG,IAAI,cAAc,CAAmB,gBAAgB;MAaxE,oBAAoB,CAAA;AAAwB,IAAA,WAAA;AAArB,IAAA,WAAA,CAAqB,WAAgE,EAAA;QAAhE,IAAA,CAAA,WAAW,GAAX,WAAW;IAAwD;wGAA/G,oBAAoB,EAAA,IAAA,EAAA,CAAA,EAAA,KAAA,EAAA,EAAA,CAAA,WAAA,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;4FAApB,oBAAoB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,0BAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;4FAApB,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBADhC,SAAS;mBAAC,EAAE,QAAQ,EAAE,0BAA0B,EAAE;;AAGnD;;;;;;;;;;;AAWG;MAyDU,gBAAgB,CAAA;AAClB,IAAA,QAAQ,GAAG,YAAY,CAAC,oBAAoB,+EAAC;AACrC,IAAA,QAAQ,GAAG,MAAM,CAAC,kBAAkB,CAAC;AACrC,IAAA,KAAK,GAAG,MAAM,CAAC,UAAU,CAAC;AAC1B,IAAA,UAAU,GAAG,MAAM,CAAC,WAAW,CAAC;AACzC,IAAA,cAAc;AACL,IAAA,gBAAgB,GAAG,IAAI,GAAG,EAAiC;IACpE,cAAc,GAAkB,IAAI;IACpC,WAAW,GAAG,CAAC;IACf,oBAAoB,GAAG,CAAC;IACxB,kBAAkB,GAAG,KAAK;AACjB,IAAA,sBAAsB,GAAG,MAAM,CAAgB,IAAI,6FAAC;AAC5D,IAAA,aAAa,GAAG,MAAM,CAAC,KAAK,oFAAC;AAE9B,IAAA,kBAAkB,CAAC,GAAW,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AA,EAAA,CAAA;AAApB,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,IAAA,EAAA,oBAAoB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,eAAA,EAAA,MAAA,EAAA,EAAA,KAAA,EAAA,EAAA,iBAAA,EAAA,OAAA,EAAA,UAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EAbrB;;;;;;;;;;;AAWT,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,aAAA,EAAA,EAAA,CAAA,iBAAA,CAAA,IAAA,EAAA,CAAA;;4FAEU,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBAlBhC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,eAAe;AACzB,oBAAA,OAAO,EAAE,EAAE;oBACX,aAAa,EAAE,iBAAiB,CAAC,IAAI;oBACrC,eAAe,EAAE,uBAAuB,CAAC,MAAM;AAC/C,oBAAA,QAAQ,EAAE;;;;;;;;;;;AAWT,EAAA,CAAA;AACF,iBAAA;;;AC9UD;;AAEG;;;;"}
|
|
@@ -1,8 +1,35 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { input, output, signal, computed, forwardRef, ChangeDetectionStrategy, ViewEncapsulation, Component } from '@angular/core';
|
|
2
|
+
import { Directive, contentChild, input, output, signal, computed, forwardRef, ChangeDetectionStrategy, ViewEncapsulation, Component } from '@angular/core';
|
|
3
|
+
import { NgTemplateOutlet } from '@angular/common';
|
|
3
4
|
import { NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
4
5
|
|
|
6
|
+
class NeuTagItemDirective {
|
|
7
|
+
templateRef;
|
|
8
|
+
constructor(templateRef) {
|
|
9
|
+
this.templateRef = templateRef;
|
|
10
|
+
}
|
|
11
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: NeuTagItemDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
12
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.17", type: NeuTagItemDirective, isStandalone: true, selector: "ng-template[neuTagItem]", ngImport: i0 });
|
|
13
|
+
}
|
|
14
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: NeuTagItemDirective, decorators: [{
|
|
15
|
+
type: Directive,
|
|
16
|
+
args: [{ selector: 'ng-template[neuTagItem]' }]
|
|
17
|
+
}], ctorParameters: () => [{ type: i0.TemplateRef }] });
|
|
18
|
+
class NeuTagSuggestionDirective {
|
|
19
|
+
templateRef;
|
|
20
|
+
constructor(templateRef) {
|
|
21
|
+
this.templateRef = templateRef;
|
|
22
|
+
}
|
|
23
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: NeuTagSuggestionDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
24
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.17", type: NeuTagSuggestionDirective, isStandalone: true, selector: "ng-template[neuTagSuggestion]", ngImport: i0 });
|
|
25
|
+
}
|
|
26
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: NeuTagSuggestionDirective, decorators: [{
|
|
27
|
+
type: Directive,
|
|
28
|
+
args: [{ selector: 'ng-template[neuTagSuggestion]' }]
|
|
29
|
+
}], ctorParameters: () => [{ type: i0.TemplateRef }] });
|
|
5
30
|
class NeuTagsComponent {
|
|
31
|
+
tagTpl = contentChild(NeuTagItemDirective, ...(ngDevMode ? [{ debugName: "tagTpl" }] : /* istanbul ignore next */ []));
|
|
32
|
+
suggestionTpl = contentChild(NeuTagSuggestionDirective, ...(ngDevMode ? [{ debugName: "suggestionTpl" }] : /* istanbul ignore next */ []));
|
|
6
33
|
label = input('', ...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
|
|
7
34
|
placeholder = input('Add tag...', ...(ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []));
|
|
8
35
|
disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
@@ -16,7 +43,7 @@ class NeuTagsComponent {
|
|
|
16
43
|
cvaDisabled = signal(false, ...(ngDevMode ? [{ debugName: "cvaDisabled" }] : /* istanbul ignore next */ []));
|
|
17
44
|
filteredSuggestions = computed(() => {
|
|
18
45
|
const q = this.draft().toLowerCase();
|
|
19
|
-
return this.suggestions().filter((item) => item.toLowerCase().includes(q) && !this.value().includes(item));
|
|
46
|
+
return this.suggestions().map((item) => typeof item === 'string' ? { label: item, value: item } : item).filter((item) => item.label.toLowerCase().includes(q) && !this.value().includes(item.value));
|
|
20
47
|
}, ...(ngDevMode ? [{ debugName: "filteredSuggestions" }] : /* istanbul ignore next */ []));
|
|
21
48
|
onChange = () => { };
|
|
22
49
|
onTouched = () => { };
|
|
@@ -63,14 +90,14 @@ class NeuTagsComponent {
|
|
|
63
90
|
this.valueChange.emit(value);
|
|
64
91
|
}
|
|
65
92
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: NeuTagsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
66
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: NeuTagsComponent, isStandalone: true, selector: "neu-tags", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, suggestions: { classPropertyName: "suggestions", publicName: "suggestions", isSignal: true, isRequired: false, transformFunction: null }, separators: { classPropertyName: "separators", publicName: "separators", isSignal: true, isRequired: false, transformFunction: null }, removeLabel: { classPropertyName: "removeLabel", publicName: "removeLabel", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { valueChange: "valueChange" }, host: { classAttribute: "neu-tags" }, providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => NeuTagsComponent), multi: true }], ngImport: i0, template: `
|
|
93
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: NeuTagsComponent, isStandalone: true, selector: "neu-tags", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, suggestions: { classPropertyName: "suggestions", publicName: "suggestions", isSignal: true, isRequired: false, transformFunction: null }, separators: { classPropertyName: "separators", publicName: "separators", isSignal: true, isRequired: false, transformFunction: null }, removeLabel: { classPropertyName: "removeLabel", publicName: "removeLabel", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { valueChange: "valueChange" }, host: { classAttribute: "neu-tags" }, providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => NeuTagsComponent), multi: true }], queries: [{ propertyName: "tagTpl", first: true, predicate: NeuTagItemDirective, descendants: true, isSignal: true }, { propertyName: "suggestionTpl", first: true, predicate: NeuTagSuggestionDirective, descendants: true, isSignal: true }], ngImport: i0, template: `
|
|
67
94
|
@if (label()) {
|
|
68
95
|
<label class="neu-tags__label" [for]="inputId">{{ label() }}</label>
|
|
69
96
|
}
|
|
70
97
|
<div class="neu-tags__box" [class.neu-tags__box--disabled]="disabled() || cvaDisabled()">
|
|
71
98
|
@for (tag of value(); track tag) {
|
|
72
99
|
<span class="neu-tags__tag">
|
|
73
|
-
{{ tag }}
|
|
100
|
+
@if (tagTpl()) { <ng-container [ngTemplateOutlet]="tagTpl()!.templateRef" [ngTemplateOutletContext]="{ $implicit: tag, remove: remove.bind(this, tag) }" /> } @else { {{ tag }} }
|
|
74
101
|
<button type="button" [attr.aria-label]="removeLabel() + ' ' + tag" (click)="remove(tag)">×</button>
|
|
75
102
|
</span>
|
|
76
103
|
}
|
|
@@ -86,23 +113,23 @@ class NeuTagsComponent {
|
|
|
86
113
|
</div>
|
|
87
114
|
@if (suggestions().length && draft()) {
|
|
88
115
|
<div class="neu-tags__suggestions">
|
|
89
|
-
@for (suggestion of filteredSuggestions(); track suggestion) {
|
|
90
|
-
<button type="button" (click)="add(suggestion)"
|
|
116
|
+
@for (suggestion of filteredSuggestions(); track suggestion.value) {
|
|
117
|
+
<button type="button" (click)="add(suggestion.value)">@if (suggestionTpl()) { <ng-container [ngTemplateOutlet]="suggestionTpl()!.templateRef" [ngTemplateOutletContext]="{ $implicit: suggestion }" /> } @else { {{ suggestion.label }} }</button>
|
|
91
118
|
}
|
|
92
119
|
</div>
|
|
93
120
|
}
|
|
94
|
-
`, isInline: true, styles: [".neu-tags{display:grid;gap:.375rem}.neu-tags__label{font-size:.875rem;font-weight:600;color:var(--neu-text, #111827)}.neu-tags__box{display:flex;flex-wrap:wrap;gap:.375rem;align-items:center;min-height:2.5rem;border:1px solid var(--neu-border, #d1d5db);border-radius:.625rem;background:var(--neu-surface, #fff);padding:.25rem}.neu-tags__tag{display:inline-flex;align-items:center;gap:.25rem;border-radius:999px;background:var(--neu-surface-2, #f3f4f6);color:var(--neu-text, #111827);padding:.25rem .5rem}.neu-tags__tag button,.neu-tags__suggestions button{border:0;background:transparent;color:inherit}.neu-tags__box input{flex:1;min-width:8rem;border:0;outline:0;background:transparent;color:inherit}.neu-tags__suggestions{display:flex;flex-wrap:wrap;gap:.375rem}.neu-tags__suggestions button{border:1px solid var(--neu-border, #d1d5db);color:var(--neu-text, #111827);border-radius:999px;padding:.25rem .5rem}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
121
|
+
`, isInline: true, styles: [".neu-tags{display:grid;gap:.375rem}.neu-tags__label{font-size:.875rem;font-weight:600;color:var(--neu-text, #111827)}.neu-tags__box{display:flex;flex-wrap:wrap;gap:.375rem;align-items:center;min-height:2.5rem;border:1px solid var(--neu-border, #d1d5db);border-radius:.625rem;background:var(--neu-surface, #fff);padding:.25rem}.neu-tags__tag{display:inline-flex;align-items:center;gap:.25rem;border-radius:999px;background:var(--neu-surface-2, #f3f4f6);color:var(--neu-text, #111827);padding:.25rem .5rem}.neu-tags__tag button,.neu-tags__suggestions button{border:0;background:transparent;color:inherit}.neu-tags__box input{flex:1;min-width:8rem;border:0;outline:0;background:transparent;color:inherit}.neu-tags__suggestions{display:flex;flex-wrap:wrap;gap:.375rem}.neu-tags__suggestions button{border:1px solid var(--neu-border, #d1d5db);color:var(--neu-text, #111827);border-radius:999px;padding:.25rem .5rem}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
95
122
|
}
|
|
96
123
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: NeuTagsComponent, decorators: [{
|
|
97
124
|
type: Component,
|
|
98
|
-
args: [{ selector: 'neu-tags', imports: [], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => NeuTagsComponent), multi: true }], host: { class: 'neu-tags' }, template: `
|
|
125
|
+
args: [{ selector: 'neu-tags', imports: [NgTemplateOutlet], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => NeuTagsComponent), multi: true }], host: { class: 'neu-tags' }, template: `
|
|
99
126
|
@if (label()) {
|
|
100
127
|
<label class="neu-tags__label" [for]="inputId">{{ label() }}</label>
|
|
101
128
|
}
|
|
102
129
|
<div class="neu-tags__box" [class.neu-tags__box--disabled]="disabled() || cvaDisabled()">
|
|
103
130
|
@for (tag of value(); track tag) {
|
|
104
131
|
<span class="neu-tags__tag">
|
|
105
|
-
{{ tag }}
|
|
132
|
+
@if (tagTpl()) { <ng-container [ngTemplateOutlet]="tagTpl()!.templateRef" [ngTemplateOutletContext]="{ $implicit: tag, remove: remove.bind(this, tag) }" /> } @else { {{ tag }} }
|
|
106
133
|
<button type="button" [attr.aria-label]="removeLabel() + ' ' + tag" (click)="remove(tag)">×</button>
|
|
107
134
|
</span>
|
|
108
135
|
}
|
|
@@ -118,17 +145,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImpo
|
|
|
118
145
|
</div>
|
|
119
146
|
@if (suggestions().length && draft()) {
|
|
120
147
|
<div class="neu-tags__suggestions">
|
|
121
|
-
@for (suggestion of filteredSuggestions(); track suggestion) {
|
|
122
|
-
<button type="button" (click)="add(suggestion)"
|
|
148
|
+
@for (suggestion of filteredSuggestions(); track suggestion.value) {
|
|
149
|
+
<button type="button" (click)="add(suggestion.value)">@if (suggestionTpl()) { <ng-container [ngTemplateOutlet]="suggestionTpl()!.templateRef" [ngTemplateOutletContext]="{ $implicit: suggestion }" /> } @else { {{ suggestion.label }} }</button>
|
|
123
150
|
}
|
|
124
151
|
</div>
|
|
125
152
|
}
|
|
126
153
|
`, styles: [".neu-tags{display:grid;gap:.375rem}.neu-tags__label{font-size:.875rem;font-weight:600;color:var(--neu-text, #111827)}.neu-tags__box{display:flex;flex-wrap:wrap;gap:.375rem;align-items:center;min-height:2.5rem;border:1px solid var(--neu-border, #d1d5db);border-radius:.625rem;background:var(--neu-surface, #fff);padding:.25rem}.neu-tags__tag{display:inline-flex;align-items:center;gap:.25rem;border-radius:999px;background:var(--neu-surface-2, #f3f4f6);color:var(--neu-text, #111827);padding:.25rem .5rem}.neu-tags__tag button,.neu-tags__suggestions button{border:0;background:transparent;color:inherit}.neu-tags__box input{flex:1;min-width:8rem;border:0;outline:0;background:transparent;color:inherit}.neu-tags__suggestions{display:flex;flex-wrap:wrap;gap:.375rem}.neu-tags__suggestions button{border:1px solid var(--neu-border, #d1d5db);color:var(--neu-text, #111827);border-radius:999px;padding:.25rem .5rem}\n"] }]
|
|
127
|
-
}], propDecorators: { label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], suggestions: [{ type: i0.Input, args: [{ isSignal: true, alias: "suggestions", required: false }] }], separators: [{ type: i0.Input, args: [{ isSignal: true, alias: "separators", required: false }] }], removeLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "removeLabel", required: false }] }], valueChange: [{ type: i0.Output, args: ["valueChange"] }] } });
|
|
154
|
+
}], propDecorators: { tagTpl: [{ type: i0.ContentChild, args: [i0.forwardRef(() => NeuTagItemDirective), { isSignal: true }] }], suggestionTpl: [{ type: i0.ContentChild, args: [i0.forwardRef(() => NeuTagSuggestionDirective), { isSignal: true }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], suggestions: [{ type: i0.Input, args: [{ isSignal: true, alias: "suggestions", required: false }] }], separators: [{ type: i0.Input, args: [{ isSignal: true, alias: "separators", required: false }] }], removeLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "removeLabel", required: false }] }], valueChange: [{ type: i0.Output, args: ["valueChange"] }] } });
|
|
128
155
|
|
|
129
156
|
/**
|
|
130
157
|
* Generated bundle index. Do not edit.
|
|
131
158
|
*/
|
|
132
159
|
|
|
133
|
-
export { NeuTagsComponent };
|
|
160
|
+
export { NeuTagItemDirective, NeuTagSuggestionDirective, NeuTagsComponent };
|
|
134
161
|
//# sourceMappingURL=neural-ui-core-tags.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"neural-ui-core-tags.mjs","sources":["../../../../projects/ui-core/tags/neu-tags.component.ts","../../../../projects/ui-core/tags/neural-ui-core-tags.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, ViewEncapsulation, computed, forwardRef, input, output, signal } from '@angular/core';\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\n\n@Component({\n selector: 'neu-tags',\n imports: [],\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => NeuTagsComponent), multi: true }],\n host: { class: 'neu-tags' },\n template: `\n @if (label()) {\n <label class=\"neu-tags__label\" [for]=\"inputId\">{{ label() }}</label>\n }\n <div class=\"neu-tags__box\" [class.neu-tags__box--disabled]=\"disabled() || cvaDisabled()\">\n @for (tag of value(); track tag) {\n <span class=\"neu-tags__tag\">\n {{ tag }}\n <button type=\"button\" [attr.aria-label]=\"removeLabel() + ' ' + tag\" (click)=\"remove(tag)\">×</button>\n </span>\n }\n <input\n [id]=\"inputId\"\n [placeholder]=\"value().length ? '' : placeholder()\"\n [value]=\"draft()\"\n [disabled]=\"disabled() || cvaDisabled()\"\n (input)=\"draft.set($any($event.target).value)\"\n (keydown)=\"onKeyDown($event)\"\n (blur)=\"commitDraft()\"\n />\n </div>\n @if (suggestions().length && draft()) {\n <div class=\"neu-tags__suggestions\">\n @for (suggestion of filteredSuggestions(); track suggestion) {\n <button type=\"button\" (click)=\"add(suggestion)\">{{ suggestion }}</button>\n }\n </div>\n }\n `,\n styleUrl: './neu-tags.component.scss',\n})\nexport class NeuTagsComponent implements ControlValueAccessor {\n readonly label = input('');\n readonly placeholder = input('Add tag...');\n readonly disabled = input(false);\n readonly suggestions = input<string[]>([]);\n readonly separators = input<string[]>(['Enter', ',']);\n readonly removeLabel = input('Remove');\n readonly valueChange = output<string[]>();\n readonly inputId = `neu-tags-${Math.random().toString(36).slice(2)}`;\n readonly value = signal<string[]>([]);\n readonly draft = signal('');\n readonly cvaDisabled = signal(false);\n readonly filteredSuggestions = computed(() => {\n const q = this.draft().toLowerCase();\n return this.suggestions().filter((item) => item.toLowerCase().includes(q) && !this.value().includes(item));\n });\n private onChange: (value: string[]) => void = () => {};\n private onTouched: () => void = () => {};\n\n writeValue(value: string[] | null): void {\n this.value.set(value ?? []);\n }\n registerOnChange(fn: (value: string[]) => void): void {\n this.onChange = fn;\n }\n registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n setDisabledState(isDisabled: boolean): void {\n this.cvaDisabled.set(isDisabled);\n }\n onKeyDown(event: KeyboardEvent): void {\n if (this.separators().includes(event.key)) {\n event.preventDefault();\n this.commitDraft();\n }\n if (event.key === 'Backspace' && !this.draft() && this.value().length) {\n this.remove(this.value()[this.value().length - 1]!);\n }\n }\n commitDraft(): void {\n const tag = this.draft().trim().replace(/,$/, '');\n if (tag) {\n this.add(tag);\n }\n this.onTouched();\n }\n add(tag: string): void {\n if (!this.value().includes(tag)) {\n this.commit([...this.value(), tag]);\n }\n this.draft.set('');\n }\n remove(tag: string): void {\n this.commit(this.value().filter((item) => item !== tag));\n }\n private commit(value: string[]): void {\n this.value.set(value);\n this.onChange(value);\n this.valueChange.emit(value);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;MAyCa,gBAAgB,CAAA;AAClB,IAAA,KAAK,G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AA,CAAA,EAAA;;;ACtCH;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"neural-ui-core-tags.mjs","sources":["../../../../projects/ui-core/tags/neu-tags.component.ts","../../../../projects/ui-core/tags/neural-ui-core-tags.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, Directive, TemplateRef, ViewEncapsulation, computed, contentChild, forwardRef, input, output, signal } from '@angular/core';\nimport { NgTemplateOutlet } from '@angular/common';\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\nexport interface NeuTagSuggestion { label: string; value: string; data?: unknown; }\n@Directive({ selector: 'ng-template[neuTagItem]' })\nexport class NeuTagItemDirective { constructor(readonly templateRef: TemplateRef<{ $implicit: string; remove: () => void }>) {} }\n@Directive({ selector: 'ng-template[neuTagSuggestion]' })\nexport class NeuTagSuggestionDirective { constructor(readonly templateRef: TemplateRef<{ $implicit: NeuTagSuggestion }>) {} }\n\n@Component({\n selector: 'neu-tags',\n imports: [NgTemplateOutlet],\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => NeuTagsComponent), multi: true }],\n host: { class: 'neu-tags' },\n template: `\n @if (label()) {\n <label class=\"neu-tags__label\" [for]=\"inputId\">{{ label() }}</label>\n }\n <div class=\"neu-tags__box\" [class.neu-tags__box--disabled]=\"disabled() || cvaDisabled()\">\n @for (tag of value(); track tag) {\n <span class=\"neu-tags__tag\">\n @if (tagTpl()) { <ng-container [ngTemplateOutlet]=\"tagTpl()!.templateRef\" [ngTemplateOutletContext]=\"{ $implicit: tag, remove: remove.bind(this, tag) }\" /> } @else { {{ tag }} }\n <button type=\"button\" [attr.aria-label]=\"removeLabel() + ' ' + tag\" (click)=\"remove(tag)\">×</button>\n </span>\n }\n <input\n [id]=\"inputId\"\n [placeholder]=\"value().length ? '' : placeholder()\"\n [value]=\"draft()\"\n [disabled]=\"disabled() || cvaDisabled()\"\n (input)=\"draft.set($any($event.target).value)\"\n (keydown)=\"onKeyDown($event)\"\n (blur)=\"commitDraft()\"\n />\n </div>\n @if (suggestions().length && draft()) {\n <div class=\"neu-tags__suggestions\">\n @for (suggestion of filteredSuggestions(); track suggestion.value) {\n <button type=\"button\" (click)=\"add(suggestion.value)\">@if (suggestionTpl()) { <ng-container [ngTemplateOutlet]=\"suggestionTpl()!.templateRef\" [ngTemplateOutletContext]=\"{ $implicit: suggestion }\" /> } @else { {{ suggestion.label }} }</button>\n }\n </div>\n }\n `,\n styleUrl: './neu-tags.component.scss',\n})\nexport class NeuTagsComponent implements ControlValueAccessor {\n readonly tagTpl = contentChild(NeuTagItemDirective);\n readonly suggestionTpl = contentChild(NeuTagSuggestionDirective);\n readonly label = input('');\n readonly placeholder = input('Add tag...');\n readonly disabled = input(false);\n readonly suggestions = input<Array<string | NeuTagSuggestion>>([]);\n readonly separators = input<string[]>(['Enter', ',']);\n readonly removeLabel = input('Remove');\n readonly valueChange = output<string[]>();\n readonly inputId = `neu-tags-${Math.random().toString(36).slice(2)}`;\n readonly value = signal<string[]>([]);\n readonly draft = signal('');\n readonly cvaDisabled = signal(false);\n readonly filteredSuggestions = computed(() => {\n const q = this.draft().toLowerCase();\n return this.suggestions().map((item) => typeof item === 'string' ? { label: item, value: item } : item).filter((item) => item.label.toLowerCase().includes(q) && !this.value().includes(item.value));\n });\n private onChange: (value: string[]) => void = () => {};\n private onTouched: () => void = () => {};\n\n writeValue(value: string[] | null): void {\n this.value.set(value ?? []);\n }\n registerOnChange(fn: (value: string[]) => void): void {\n this.onChange = fn;\n }\n registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n setDisabledState(isDisabled: boolean): void {\n this.cvaDisabled.set(isDisabled);\n }\n onKeyDown(event: KeyboardEvent): void {\n if (this.separators().includes(event.key)) {\n event.preventDefault();\n this.commitDraft();\n }\n if (event.key === 'Backspace' && !this.draft() && this.value().length) {\n this.remove(this.value()[this.value().length - 1]!);\n }\n }\n commitDraft(): void {\n const tag = this.draft().trim().replace(/,$/, '');\n if (tag) {\n this.add(tag);\n }\n this.onTouched();\n }\n add(tag: string): void {\n if (!this.value().includes(tag)) {\n this.commit([...this.value(), tag]);\n }\n this.draft.set('');\n }\n remove(tag: string): void {\n this.commit(this.value().filter((item) => item !== tag));\n }\n private commit(value: string[]): void {\n this.value.set(value);\n this.onChange(value);\n this.valueChange.emit(value);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;MAKa,mBAAmB,CAAA;AAAwB,IAAA,WAAA;AAArB,IAAA,WAAA,CAAqB,WAAmE,EAAA;QAAnE,IAAA,CAAA,WAAW,GAAX,WAAW;IAA2D;wGAAjH,mBAAmB,EAAA,IAAA,EAAA,CAAA,EAAA,KAAA,EAAA,EAAA,CAAA,WAAA,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;4FAAnB,mBAAmB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,yBAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;4FAAnB,mBAAmB,EAAA,UAAA,EAAA,CAAA;kBAD/B,SAAS;mBAAC,EAAE,QAAQ,EAAE,yBAAyB,EAAE;;MAGrC,yBAAyB,CAAA;AAAwB,IAAA,WAAA;AAArB,IAAA,WAAA,CAAqB,WAAyD,EAAA;QAAzD,IAAA,CAAA,WAAW,GAAX,WAAW;IAAiD;wGAA7G,yBAAyB,EAAA,IAAA,EAAA,CAAA,EAAA,KAAA,EAAA,EAAA,CAAA,WAAA,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;4FAAzB,yBAAyB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,+BAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;4FAAzB,yBAAyB,EAAA,UAAA,EAAA,CAAA;kBADrC,SAAS;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
+
import { Directive, contentChild, input, ChangeDetectionStrategy, ViewEncapsulation, Component } from '@angular/core';
|
|
3
|
+
import { NgTemplateOutlet } from '@angular/common';
|
|
3
4
|
|
|
5
|
+
class NeuTimelineItemDirective {
|
|
6
|
+
templateRef;
|
|
7
|
+
constructor(templateRef) {
|
|
8
|
+
this.templateRef = templateRef;
|
|
9
|
+
}
|
|
10
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: NeuTimelineItemDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
11
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.17", type: NeuTimelineItemDirective, isStandalone: true, selector: "ng-template[neuTimelineItem]", ngImport: i0 });
|
|
12
|
+
}
|
|
13
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: NeuTimelineItemDirective, decorators: [{
|
|
14
|
+
type: Directive,
|
|
15
|
+
args: [{ selector: 'ng-template[neuTimelineItem]' }]
|
|
16
|
+
}], ctorParameters: () => [{ type: i0.TemplateRef }] });
|
|
17
|
+
class NeuTimelineMarkerDirective {
|
|
18
|
+
templateRef;
|
|
19
|
+
constructor(templateRef) {
|
|
20
|
+
this.templateRef = templateRef;
|
|
21
|
+
}
|
|
22
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: NeuTimelineMarkerDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
23
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.17", type: NeuTimelineMarkerDirective, isStandalone: true, selector: "ng-template[neuTimelineMarker]", ngImport: i0 });
|
|
24
|
+
}
|
|
25
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: NeuTimelineMarkerDirective, decorators: [{
|
|
26
|
+
type: Directive,
|
|
27
|
+
args: [{ selector: 'ng-template[neuTimelineMarker]' }]
|
|
28
|
+
}], ctorParameters: () => [{ type: i0.TemplateRef }] });
|
|
4
29
|
/**
|
|
5
30
|
* NeuralUI Timeline Component
|
|
6
31
|
*
|
|
@@ -11,10 +36,12 @@ import { input, ChangeDetectionStrategy, ViewEncapsulation, Component } from '@a
|
|
|
11
36
|
* <neu-timeline [items]="events" align="right" />
|
|
12
37
|
*/
|
|
13
38
|
class NeuTimelineComponent {
|
|
39
|
+
itemTpl = contentChild(NeuTimelineItemDirective, ...(ngDevMode ? [{ debugName: "itemTpl" }] : /* istanbul ignore next */ []));
|
|
40
|
+
markerTpl = contentChild(NeuTimelineMarkerDirective, ...(ngDevMode ? [{ debugName: "markerTpl" }] : /* istanbul ignore next */ []));
|
|
14
41
|
/** Eventos a mostrar / Events to display */
|
|
15
42
|
items = input([], ...(ngDevMode ? [{ debugName: "items" }] : /* istanbul ignore next */ []));
|
|
16
43
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: NeuTimelineComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
17
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: NeuTimelineComponent, isStandalone: true, selector: "neu-timeline", inputs: { items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
|
|
44
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: NeuTimelineComponent, isStandalone: true, selector: "neu-timeline", inputs: { items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: false, transformFunction: null } }, queries: [{ propertyName: "itemTpl", first: true, predicate: NeuTimelineItemDirective, descendants: true, isSignal: true }, { propertyName: "markerTpl", first: true, predicate: NeuTimelineMarkerDirective, descendants: true, isSignal: true }], ngImport: i0, template: `
|
|
18
45
|
<ol class="neu-timeline">
|
|
19
46
|
@for (item of items(); track item.title; let last = $last) {
|
|
20
47
|
<li class="neu-timeline__item" [class.neu-timeline__item--last]="last">
|
|
@@ -24,7 +51,7 @@ class NeuTimelineComponent {
|
|
|
24
51
|
class="neu-timeline__dot"
|
|
25
52
|
[class]="'neu-timeline__dot--' + (item.variant ?? 'default')"
|
|
26
53
|
>
|
|
27
|
-
@if (item.icon) {
|
|
54
|
+
@if (markerTpl()) { <ng-container [ngTemplateOutlet]="markerTpl()!.templateRef" [ngTemplateOutletContext]="{ $implicit: item }" /> } @else if (item.icon) {
|
|
28
55
|
<svg
|
|
29
56
|
class="neu-timeline__dot-icon"
|
|
30
57
|
viewBox="0 0 24 24"
|
|
@@ -45,7 +72,7 @@ class NeuTimelineComponent {
|
|
|
45
72
|
|
|
46
73
|
<!-- Contenido -->
|
|
47
74
|
<div class="neu-timeline__content">
|
|
48
|
-
<div class="neu-timeline__header">
|
|
75
|
+
@if (itemTpl()) { <ng-container [ngTemplateOutlet]="itemTpl()!.templateRef" [ngTemplateOutletContext]="{ $implicit: item, index: $index }" /> } @else { <div class="neu-timeline__header">
|
|
49
76
|
<span class="neu-timeline__title">{{ item.title }}</span>
|
|
50
77
|
@if (item.time) {
|
|
51
78
|
<span class="neu-timeline__time">{{ item.time }}</span>
|
|
@@ -54,15 +81,16 @@ class NeuTimelineComponent {
|
|
|
54
81
|
@if (item.description) {
|
|
55
82
|
<p class="neu-timeline__desc">{{ item.description }}</p>
|
|
56
83
|
}
|
|
84
|
+
}
|
|
57
85
|
</div>
|
|
58
86
|
</li>
|
|
59
87
|
}
|
|
60
88
|
</ol>
|
|
61
|
-
`, isInline: true, styles: [".neu-timeline{list-style:none;margin:0;padding:0;font-family:var(--neu-font-sans)}.neu-timeline__item{display:flex;gap:var(--neu-space-4);min-height:56px}.neu-timeline__axis{display:flex;flex-direction:column;align-items:center;flex-shrink:0;width:24px}.neu-timeline__dot{width:24px;height:24px;border-radius:50%;display:flex;align-items:center;justify-content:center;flex-shrink:0;border:2.5px solid;background:var(--neu-surface)}.neu-timeline__dot--default{border-color:var(--neu-border);color:var(--neu-text-disabled);background:var(--neu-surface-2)}.neu-timeline__dot--success{border-color:var(--neu-success);color:var(--neu-success)}.neu-timeline__dot--warning{border-color:var(--neu-warning);color:var(--neu-warning)}.neu-timeline__dot--danger{border-color:var(--neu-error);color:var(--neu-error)}.neu-timeline__dot--info{border-color:var(--neu-primary);color:var(--neu-primary)}.neu-timeline__dot-icon{width:12px;height:12px}.neu-timeline__line{width:2px;flex:1;background:var(--neu-border);margin:4px 0;min-height:16px}.neu-timeline__content{flex:1;padding-bottom:var(--neu-space-5);padding-top:2px}.neu-timeline__header{display:flex;align-items:baseline;justify-content:space-between;gap:var(--neu-space-3);margin-bottom:4px}.neu-timeline__title{font-size:var(--neu-text-sm);font-weight:600;color:var(--neu-text)}.neu-timeline__time{font-size:var(--neu-text-xs);color:var(--neu-text-disabled);white-space:nowrap;flex-shrink:0}.neu-timeline__desc{font-size:var(--neu-text-sm);color:var(--neu-text-muted);line-height:1.6;margin:0}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
89
|
+
`, isInline: true, styles: [".neu-timeline{list-style:none;margin:0;padding:0;font-family:var(--neu-font-sans)}.neu-timeline__item{display:flex;gap:var(--neu-space-4);min-height:56px}.neu-timeline__axis{display:flex;flex-direction:column;align-items:center;flex-shrink:0;width:24px}.neu-timeline__dot{width:24px;height:24px;border-radius:50%;display:flex;align-items:center;justify-content:center;flex-shrink:0;border:2.5px solid;background:var(--neu-surface)}.neu-timeline__dot--default{border-color:var(--neu-border);color:var(--neu-text-disabled);background:var(--neu-surface-2)}.neu-timeline__dot--success{border-color:var(--neu-success);color:var(--neu-success)}.neu-timeline__dot--warning{border-color:var(--neu-warning);color:var(--neu-warning)}.neu-timeline__dot--danger{border-color:var(--neu-error);color:var(--neu-error)}.neu-timeline__dot--info{border-color:var(--neu-primary);color:var(--neu-primary)}.neu-timeline__dot-icon{width:12px;height:12px}.neu-timeline__line{width:2px;flex:1;background:var(--neu-border);margin:4px 0;min-height:16px}.neu-timeline__content{flex:1;padding-bottom:var(--neu-space-5);padding-top:2px}.neu-timeline__header{display:flex;align-items:baseline;justify-content:space-between;gap:var(--neu-space-3);margin-bottom:4px}.neu-timeline__title{font-size:var(--neu-text-sm);font-weight:600;color:var(--neu-text)}.neu-timeline__time{font-size:var(--neu-text-xs);color:var(--neu-text-disabled);white-space:nowrap;flex-shrink:0}.neu-timeline__desc{font-size:var(--neu-text-sm);color:var(--neu-text-muted);line-height:1.6;margin:0}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
62
90
|
}
|
|
63
91
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: NeuTimelineComponent, decorators: [{
|
|
64
92
|
type: Component,
|
|
65
|
-
args: [{ selector: 'neu-timeline', imports: [], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, template: `
|
|
93
|
+
args: [{ selector: 'neu-timeline', imports: [NgTemplateOutlet], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, template: `
|
|
66
94
|
<ol class="neu-timeline">
|
|
67
95
|
@for (item of items(); track item.title; let last = $last) {
|
|
68
96
|
<li class="neu-timeline__item" [class.neu-timeline__item--last]="last">
|
|
@@ -72,7 +100,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImpo
|
|
|
72
100
|
class="neu-timeline__dot"
|
|
73
101
|
[class]="'neu-timeline__dot--' + (item.variant ?? 'default')"
|
|
74
102
|
>
|
|
75
|
-
@if (item.icon) {
|
|
103
|
+
@if (markerTpl()) { <ng-container [ngTemplateOutlet]="markerTpl()!.templateRef" [ngTemplateOutletContext]="{ $implicit: item }" /> } @else if (item.icon) {
|
|
76
104
|
<svg
|
|
77
105
|
class="neu-timeline__dot-icon"
|
|
78
106
|
viewBox="0 0 24 24"
|
|
@@ -93,7 +121,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImpo
|
|
|
93
121
|
|
|
94
122
|
<!-- Contenido -->
|
|
95
123
|
<div class="neu-timeline__content">
|
|
96
|
-
<div class="neu-timeline__header">
|
|
124
|
+
@if (itemTpl()) { <ng-container [ngTemplateOutlet]="itemTpl()!.templateRef" [ngTemplateOutletContext]="{ $implicit: item, index: $index }" /> } @else { <div class="neu-timeline__header">
|
|
97
125
|
<span class="neu-timeline__title">{{ item.title }}</span>
|
|
98
126
|
@if (item.time) {
|
|
99
127
|
<span class="neu-timeline__time">{{ item.time }}</span>
|
|
@@ -102,16 +130,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImpo
|
|
|
102
130
|
@if (item.description) {
|
|
103
131
|
<p class="neu-timeline__desc">{{ item.description }}</p>
|
|
104
132
|
}
|
|
133
|
+
}
|
|
105
134
|
</div>
|
|
106
135
|
</li>
|
|
107
136
|
}
|
|
108
137
|
</ol>
|
|
109
138
|
`, styles: [".neu-timeline{list-style:none;margin:0;padding:0;font-family:var(--neu-font-sans)}.neu-timeline__item{display:flex;gap:var(--neu-space-4);min-height:56px}.neu-timeline__axis{display:flex;flex-direction:column;align-items:center;flex-shrink:0;width:24px}.neu-timeline__dot{width:24px;height:24px;border-radius:50%;display:flex;align-items:center;justify-content:center;flex-shrink:0;border:2.5px solid;background:var(--neu-surface)}.neu-timeline__dot--default{border-color:var(--neu-border);color:var(--neu-text-disabled);background:var(--neu-surface-2)}.neu-timeline__dot--success{border-color:var(--neu-success);color:var(--neu-success)}.neu-timeline__dot--warning{border-color:var(--neu-warning);color:var(--neu-warning)}.neu-timeline__dot--danger{border-color:var(--neu-error);color:var(--neu-error)}.neu-timeline__dot--info{border-color:var(--neu-primary);color:var(--neu-primary)}.neu-timeline__dot-icon{width:12px;height:12px}.neu-timeline__line{width:2px;flex:1;background:var(--neu-border);margin:4px 0;min-height:16px}.neu-timeline__content{flex:1;padding-bottom:var(--neu-space-5);padding-top:2px}.neu-timeline__header{display:flex;align-items:baseline;justify-content:space-between;gap:var(--neu-space-3);margin-bottom:4px}.neu-timeline__title{font-size:var(--neu-text-sm);font-weight:600;color:var(--neu-text)}.neu-timeline__time{font-size:var(--neu-text-xs);color:var(--neu-text-disabled);white-space:nowrap;flex-shrink:0}.neu-timeline__desc{font-size:var(--neu-text-sm);color:var(--neu-text-muted);line-height:1.6;margin:0}\n"] }]
|
|
110
|
-
}], propDecorators: { items: [{ type: i0.Input, args: [{ isSignal: true, alias: "items", required: false }] }] } });
|
|
139
|
+
}], propDecorators: { itemTpl: [{ type: i0.ContentChild, args: [i0.forwardRef(() => NeuTimelineItemDirective), { isSignal: true }] }], markerTpl: [{ type: i0.ContentChild, args: [i0.forwardRef(() => NeuTimelineMarkerDirective), { isSignal: true }] }], items: [{ type: i0.Input, args: [{ isSignal: true, alias: "items", required: false }] }] } });
|
|
111
140
|
|
|
112
141
|
/**
|
|
113
142
|
* Generated bundle index. Do not edit.
|
|
114
143
|
*/
|
|
115
144
|
|
|
116
|
-
export { NeuTimelineComponent };
|
|
145
|
+
export { NeuTimelineComponent, NeuTimelineItemDirective, NeuTimelineMarkerDirective };
|
|
117
146
|
//# sourceMappingURL=neural-ui-core-timeline.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"neural-ui-core-timeline.mjs","sources":["../../../../projects/ui-core/timeline/neu-timeline.component.ts","../../../../projects/ui-core/timeline/neural-ui-core-timeline.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, ViewEncapsulation, input } from '@angular/core';\n\nexport type NeuTimelineItemVariant = 'default' | 'success' | 'warning' | 'danger' | 'info';\n\nexport interface NeuTimelineItem {\n /** Etiqueta de tiempo (ej. \"Hace 2h\", \"12 Mar\") / Time label (e.g. \"2h ago\", \"Mar 12\") */\n time?: string;\n /** Título del evento / Event title */\n title: string;\n /** Descripción opcional / Optional description */\n description?: string;\n /** Variante de color del punto / Dot color variant */\n variant?: NeuTimelineItemVariant;\n /** Icono SVG path opcional / Optional SVG path icon */\n icon?: string;\n}\n\n/**\n * NeuralUI Timeline Component\n *\n * Lista vertical de eventos cronológicos con línea conectora. / Vertical list of chronological events with a connector line.\n *\n * Uso:\n * <neu-timeline [items]=\"events\" />\n * <neu-timeline [items]=\"events\" align=\"right\" />\n */\n@Component({\n selector: 'neu-timeline',\n imports: [],\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n template: `\n <ol class=\"neu-timeline\">\n @for (item of items(); track item.title; let last = $last) {\n <li class=\"neu-timeline__item\" [class.neu-timeline__item--last]=\"last\">\n <!-- Eje izquierdo (punto + línea) -->\n <div class=\"neu-timeline__axis\">\n <div\n class=\"neu-timeline__dot\"\n [class]=\"'neu-timeline__dot--' + (item.variant ?? 'default')\"\n >\n @if (item.icon) {\n <svg\n class=\"neu-timeline__dot-icon\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n aria-hidden=\"true\"\n >\n <path [attr.d]=\"item.icon\" />\n </svg>\n }\n </div>\n @if (!last) {\n <div class=\"neu-timeline__line\"></div>\n }\n </div>\n\n <!-- Contenido -->\n <div class=\"neu-timeline__content\">\n <div class=\"neu-timeline__header\">\n <span class=\"neu-timeline__title\">{{ item.title }}</span>\n @if (item.time) {\n <span class=\"neu-timeline__time\">{{ item.time }}</span>\n }\n </div>\n @if (item.description) {\n <p class=\"neu-timeline__desc\">{{ item.description }}</p>\n }\n </div>\n </li>\n }\n </ol>\n `,\n styleUrl: './neu-timeline.component.scss',\n})\nexport class NeuTimelineComponent {\n /** Eventos a mostrar / Events to display */\n items = input<NeuTimelineItem[]>([]);\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"neural-ui-core-timeline.mjs","sources":["../../../../projects/ui-core/timeline/neu-timeline.component.ts","../../../../projects/ui-core/timeline/neural-ui-core-timeline.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, Directive, TemplateRef, ViewEncapsulation, contentChild, input } from '@angular/core';\nimport { NgTemplateOutlet } from '@angular/common';\n\nexport type NeuTimelineItemVariant = 'default' | 'success' | 'warning' | 'danger' | 'info';\n\nexport interface NeuTimelineItem {\n /** Etiqueta de tiempo (ej. \"Hace 2h\", \"12 Mar\") / Time label (e.g. \"2h ago\", \"Mar 12\") */\n time?: string;\n /** Título del evento / Event title */\n title: string;\n /** Descripción opcional / Optional description */\n description?: string;\n /** Variante de color del punto / Dot color variant */\n variant?: NeuTimelineItemVariant;\n /** Icono SVG path opcional / Optional SVG path icon */\n icon?: string;\n}\n@Directive({ selector: 'ng-template[neuTimelineItem]' })\nexport class NeuTimelineItemDirective { constructor(readonly templateRef: TemplateRef<{ $implicit: NeuTimelineItem; index: number }>) {} }\n@Directive({ selector: 'ng-template[neuTimelineMarker]' })\nexport class NeuTimelineMarkerDirective { constructor(readonly templateRef: TemplateRef<{ $implicit: NeuTimelineItem }>) {} }\n\n/**\n * NeuralUI Timeline Component\n *\n * Lista vertical de eventos cronológicos con línea conectora. / Vertical list of chronological events with a connector line.\n *\n * Uso:\n * <neu-timeline [items]=\"events\" />\n * <neu-timeline [items]=\"events\" align=\"right\" />\n */\n@Component({\n selector: 'neu-timeline',\n imports: [NgTemplateOutlet],\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n template: `\n <ol class=\"neu-timeline\">\n @for (item of items(); track item.title; let last = $last) {\n <li class=\"neu-timeline__item\" [class.neu-timeline__item--last]=\"last\">\n <!-- Eje izquierdo (punto + línea) -->\n <div class=\"neu-timeline__axis\">\n <div\n class=\"neu-timeline__dot\"\n [class]=\"'neu-timeline__dot--' + (item.variant ?? 'default')\"\n >\n @if (markerTpl()) { <ng-container [ngTemplateOutlet]=\"markerTpl()!.templateRef\" [ngTemplateOutletContext]=\"{ $implicit: item }\" /> } @else if (item.icon) {\n <svg\n class=\"neu-timeline__dot-icon\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n aria-hidden=\"true\"\n >\n <path [attr.d]=\"item.icon\" />\n </svg>\n }\n </div>\n @if (!last) {\n <div class=\"neu-timeline__line\"></div>\n }\n </div>\n\n <!-- Contenido -->\n <div class=\"neu-timeline__content\">\n @if (itemTpl()) { <ng-container [ngTemplateOutlet]=\"itemTpl()!.templateRef\" [ngTemplateOutletContext]=\"{ $implicit: item, index: $index }\" /> } @else { <div class=\"neu-timeline__header\">\n <span class=\"neu-timeline__title\">{{ item.title }}</span>\n @if (item.time) {\n <span class=\"neu-timeline__time\">{{ item.time }}</span>\n }\n </div>\n @if (item.description) {\n <p class=\"neu-timeline__desc\">{{ item.description }}</p>\n }\n }\n </div>\n </li>\n }\n </ol>\n `,\n styleUrl: './neu-timeline.component.scss',\n})\nexport class NeuTimelineComponent {\n readonly itemTpl = contentChild(NeuTimelineItemDirective);\n readonly markerTpl = contentChild(NeuTimelineMarkerDirective);\n /** Eventos a mostrar / Events to display */\n items = input<NeuTimelineItem[]>([]);\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;MAkBa,wBAAwB,CAAA;AAAwB,IAAA,WAAA;AAArB,IAAA,WAAA,CAAqB,WAAuE,EAAA;QAAvE,IAAA,CAAA,WAAW,GAAX,WAAW;IAA+D;wGAA1H,wBAAwB,EAAA,IAAA,EAAA,CAAA,EAAA,KAAA,EAAA,EAAA,CAAA,WAAA,EAAA,CAAA,EAAA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AAA,CAAA,qgDAAA,CAAA,EAAA;AAI+B,SAAA,CAAA,EAAA,cAAA,EAAA,EAAA,OAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,YAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,UAAA,CAAA,MAAA,wBAAwB,2FACtB,0BAA0B,CAAA,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,KAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,OAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;ACtF9D;;AAEG;;;;"}
|
|
@@ -133,7 +133,7 @@ class NeuToastContainerComponent {
|
|
|
133
133
|
</button>
|
|
134
134
|
</div>
|
|
135
135
|
}
|
|
136
|
-
`, isInline: true, styles: [".neu-toast-container{position:fixed;z-index:var(--neu-z-toast);display:flex;flex-direction:column;gap:var(--neu-space-3);pointer-events:none;bottom:var(--neu-space-6);left:50%;transform:translate(-50%);width:calc(100vw - var(--neu-space-8));max-width:400px;align-items:stretch}@media(min-width:400px){.neu-toast-container{bottom:auto;left:auto;transform:none;width:360px;align-items:flex-end}}@media(min-width:400px){.neu-toast-container--top-right{top:calc(var(--neu-header-height, 64px) + var(--neu-space-4));right:var(--neu-space-6);align-items:flex-end}.neu-toast-container--top-left{top:calc(var(--neu-header-height, 64px) + var(--neu-space-4));left:var(--neu-space-6);align-items:flex-start}.neu-toast-container--bottom-right{top:auto;bottom:var(--neu-space-6);right:var(--neu-space-6);align-items:flex-end}.neu-toast-container--bottom-left{top:auto;bottom:var(--neu-space-6);left:var(--neu-space-6);align-items:flex-start}}.neu-toast{display:flex;align-items:flex-start;gap:var(--neu-space-3);padding:var(--neu-space-4);background:var(--neu-toast-bg, var(--neu-surface));border-radius:var(--neu-toast-radius, 10px);box-shadow:var(--neu-toast-shadow, 0 8px 24px rgba(15, 23, 42, .12), 0 2px 6px rgba(15, 23, 42, .06));border-left:3px solid transparent;pointer-events:all;animation:neu-toast-in .25s cubic-bezier(.34,1.56,.64,1) forwards;width:100%}.neu-toast--success{border-color:var(--neu-success)}.neu-toast--success .neu-toast__icon-wrap{color:var(--neu-success)}.neu-toast--error{border-color:var(--neu-error)}.neu-toast--error .neu-toast__icon-wrap{color:var(--neu-error)}.neu-toast--warning{border-color:var(--neu-warning)}.neu-toast--warning .neu-toast__icon-wrap{color:var(--neu-warning)}.neu-toast--info{border-color:var(--neu-info)}.neu-toast--info .neu-toast__icon-wrap{color:var(--neu-info)}.neu-toast__icon-wrap{flex-shrink:0;display:flex;align-items:center;margin-top:1px}.neu-toast__body{flex:1;min-width:0}.neu-toast__title{margin:0 0 var(--neu-space-1);font-family:var(--neu-font-sans);font-size:var(--neu-text-sm);font-weight:600;color:var(--neu-text);line-height:1.3}.neu-toast__message{margin:0;font-family:var(--neu-font-sans);font-size:var(--neu-text-sm);color:var(--neu-text-muted);line-height:1.4;word-break:break-word}.neu-toast__close{flex-shrink:0;display:flex;align-items:center;justify-content:center;width:24px;height:24px;padding:0;background:transparent;border:none;border-radius:var(--neu-radius-sm);color:var(--neu-text-muted);cursor:pointer;transition:background-color var(--neu-transition),color var(--neu-transition);margin-top:-2px;margin-right:-4px}.neu-toast__close:hover{background:var(--neu-surface-2);color:var(--neu-text)}.neu-toast__close:focus-visible{outline:2px solid var(--neu-primary);outline-offset:1px}@keyframes neu-toast-in{0%{opacity:0;transform:translateY(12px) scale(.96)}to{opacity:1;transform:translateY(0) scale(1)}}@media(min-width:400px){@keyframes neu-toast-in{0%{opacity:0;transform:translate(20px) scale(.96)}to{opacity:1;transform:translate(0) scale(1)}}}\n"], dependencies: [{ kind: "component", type: NeuIconComponent, selector: "neu-icon", inputs: ["name", "strokeWidth", "size"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
136
|
+
`, isInline: true, styles: [".neu-toast-container{position:fixed;z-index:var(--neu-z-toast);display:flex;flex-direction:column;gap:var(--neu-space-3);pointer-events:none;bottom:var(--neu-space-6);left:50%;transform:translate(-50%);width:calc(100vw - var(--neu-space-8));max-width:400px;align-items:stretch}@media(min-width:400px){.neu-toast-container{bottom:auto;left:auto;transform:none;width:360px;align-items:flex-end}}@media(min-width:400px){.neu-toast-container--top-right{top:calc(var(--neu-header-height, 64px) + var(--neu-space-4));right:var(--neu-space-6);align-items:flex-end}.neu-toast-container--top-left{top:calc(var(--neu-header-height, 64px) + var(--neu-space-4));left:var(--neu-space-6);align-items:flex-start}.neu-toast-container--bottom-right{top:auto;bottom:var(--neu-space-6);right:var(--neu-space-6);align-items:flex-end}.neu-toast-container--bottom-left{top:auto;bottom:var(--neu-space-6);left:var(--neu-space-6);align-items:flex-start}}.neu-toast{display:flex;align-items:flex-start;gap:var(--neu-space-3);padding:var(--neu-space-4);background:var(--neu-toast-bg, var(--neu-surface));border-radius:var(--neu-toast-radius, 10px);box-shadow:var(--neu-toast-shadow, 0 8px 24px rgba(15, 23, 42, .12), 0 2px 6px rgba(15, 23, 42, .06));border-left:3px solid transparent;pointer-events:all;animation:neu-toast-in .25s cubic-bezier(.34,1.56,.64,1) forwards;width:100%}.neu-toast--success{border-color:var(--neu-success)}.neu-toast--success .neu-toast__icon-wrap{color:var(--neu-success)}.neu-toast--error{border-color:var(--neu-error)}.neu-toast--error .neu-toast__icon-wrap{color:var(--neu-error)}.neu-toast--warning{border-color:var(--neu-warning)}.neu-toast--warning .neu-toast__icon-wrap{color:var(--neu-warning)}.neu-toast--info{border-color:var(--neu-info)}.neu-toast--info .neu-toast__icon-wrap{color:var(--neu-info)}.neu-toast__icon-wrap{flex-shrink:0;display:flex;align-items:center;margin-top:1px}.neu-toast__body{flex:1;min-width:0}.neu-toast__title{margin:0 0 var(--neu-space-1);font-family:var(--neu-font-sans);font-size:var(--neu-text-sm);font-weight:600;color:var(--neu-text);line-height:1.3}.neu-toast__message{margin:0;font-family:var(--neu-font-sans);font-size:var(--neu-text-sm);color:var(--neu-text-muted);line-height:1.4;word-break:break-word}.neu-toast__close{flex-shrink:0;display:flex;align-items:center;justify-content:center;width:24px;height:24px;padding:0;background:transparent;border:none;border-radius:var(--neu-radius-sm);color:var(--neu-text-muted);cursor:pointer;transition:background-color var(--neu-transition),color var(--neu-transition);margin-top:-2px;margin-right:-4px}.neu-toast__close:hover{background:var(--neu-surface-2);color:var(--neu-text)}.neu-toast__close:focus-visible{outline:2px solid var(--neu-primary);outline-offset:1px}@keyframes neu-toast-in{0%{opacity:0;transform:translateY(12px) scale(.96)}to{opacity:1;transform:translateY(0) scale(1)}}@media(min-width:400px){@keyframes neu-toast-in{0%{opacity:0;transform:translate(20px) scale(.96)}to{opacity:1;transform:translate(0) scale(1)}}}\n"], dependencies: [{ kind: "component", type: NeuIconComponent, selector: "neu-icon", inputs: ["name", "decorative", "ariaLabel", "strokeWidth", "size"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
137
137
|
}
|
|
138
138
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: NeuToastContainerComponent, decorators: [{
|
|
139
139
|
type: Component,
|