@telcomdev/ui 0.1.27 → 0.1.29

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.
@@ -1,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { ChangeDetectionStrategy, Component, Injectable, inject, HostBinding, Input, booleanAttribute, EventEmitter, Output, ViewChild, Injector, ChangeDetectorRef, signal, input, model, output, computed, forwardRef, InjectionToken, ElementRef, HostListener, Directive, EnvironmentInjector, DestroyRef, effect, TemplateRef, ViewChildren, ContentChildren, ViewContainerRef, Renderer2, numberAttribute } from '@angular/core';
2
+ import { ChangeDetectionStrategy, Component, Injectable, inject, HostBinding, Input, booleanAttribute, EventEmitter, Output, ViewChild, Injector, ChangeDetectorRef, signal, input, model, output, computed, forwardRef, InjectionToken, ElementRef, HostListener, Directive, EnvironmentInjector, ContentChild, DestroyRef, effect, TemplateRef, ViewChildren, ContentChildren, ViewContainerRef, Renderer2, numberAttribute } from '@angular/core';
3
3
  import * as i1 from '@angular/forms';
4
4
  import { NG_VALUE_ACCESSOR, FormsModule } from '@angular/forms';
5
5
  import { FORM_FIELD } from '@angular/forms/signals';
@@ -5718,6 +5718,250 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.4", ngImpor
5718
5718
  type: Input
5719
5719
  }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }] } });
5720
5720
 
5721
+ class TdLayoutHeaderSlot {
5722
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.4", ngImport: i0, type: TdLayoutHeaderSlot, deps: [], target: i0.ɵɵFactoryTarget.Directive });
5723
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.4", type: TdLayoutHeaderSlot, isStandalone: true, selector: "[tdLayoutHeader]", ngImport: i0 });
5724
+ }
5725
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.4", ngImport: i0, type: TdLayoutHeaderSlot, decorators: [{
5726
+ type: Directive,
5727
+ args: [{
5728
+ selector: '[tdLayoutHeader]',
5729
+ }]
5730
+ }] });
5731
+ class TdLayoutSidebarSlot {
5732
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.4", ngImport: i0, type: TdLayoutSidebarSlot, deps: [], target: i0.ɵɵFactoryTarget.Directive });
5733
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.4", type: TdLayoutSidebarSlot, isStandalone: true, selector: "[tdLayoutSidebar]", ngImport: i0 });
5734
+ }
5735
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.4", ngImport: i0, type: TdLayoutSidebarSlot, decorators: [{
5736
+ type: Directive,
5737
+ args: [{
5738
+ selector: '[tdLayoutSidebar]',
5739
+ }]
5740
+ }] });
5741
+ class TdLayoutContentSlot {
5742
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.4", ngImport: i0, type: TdLayoutContentSlot, deps: [], target: i0.ɵɵFactoryTarget.Directive });
5743
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.4", type: TdLayoutContentSlot, isStandalone: true, selector: "[tdLayoutContent]", ngImport: i0 });
5744
+ }
5745
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.4", ngImport: i0, type: TdLayoutContentSlot, decorators: [{
5746
+ type: Directive,
5747
+ args: [{
5748
+ selector: '[tdLayoutContent]',
5749
+ }]
5750
+ }] });
5751
+ class TdLayoutFooterSlot {
5752
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.4", ngImport: i0, type: TdLayoutFooterSlot, deps: [], target: i0.ɵɵFactoryTarget.Directive });
5753
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.4", type: TdLayoutFooterSlot, isStandalone: true, selector: "[tdLayoutFooter]", ngImport: i0 });
5754
+ }
5755
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.4", ngImport: i0, type: TdLayoutFooterSlot, decorators: [{
5756
+ type: Directive,
5757
+ args: [{
5758
+ selector: '[tdLayoutFooter]',
5759
+ }]
5760
+ }] });
5761
+ class TdLayout {
5762
+ headerSlot;
5763
+ sidebarSlot;
5764
+ footerSlot;
5765
+ sidebarOpenState = signal(true, /* @ts-ignore */
5766
+ ...(ngDevMode ? [{ debugName: "sidebarOpenState" }] : /* istanbul ignore next */ []));
5767
+ mobile = signal(false, /* @ts-ignore */
5768
+ ...(ngDevMode ? [{ debugName: "mobile" }] : /* istanbul ignore next */ []));
5769
+ fillViewport = true;
5770
+ closeSidebarOnBackdrop = true;
5771
+ mobileBreakpoint = 960;
5772
+ sidebarPlacement = 'auto';
5773
+ headerSpan = 'content';
5774
+ footerSpan = 'content';
5775
+ set sidebarOpen(value) {
5776
+ this.sidebarOpenState.set(value);
5777
+ }
5778
+ get sidebarOpen() {
5779
+ return this.sidebarOpenState();
5780
+ }
5781
+ sidebarOpenChange = new EventEmitter();
5782
+ get hasHeader() {
5783
+ return !!this.headerSlot;
5784
+ }
5785
+ get hasSidebar() {
5786
+ return !!this.sidebarSlot;
5787
+ }
5788
+ get hasFooter() {
5789
+ return !!this.footerSlot;
5790
+ }
5791
+ ngAfterContentInit() {
5792
+ this.syncViewport();
5793
+ }
5794
+ syncViewport() {
5795
+ if (typeof window === 'undefined') {
5796
+ return;
5797
+ }
5798
+ this.mobile.set(window.innerWidth <= this.mobileBreakpoint);
5799
+ }
5800
+ sidebarAsOverlay() {
5801
+ if (this.sidebarPlacement === 'overlay') {
5802
+ return true;
5803
+ }
5804
+ if (this.sidebarPlacement === 'inline') {
5805
+ return false;
5806
+ }
5807
+ return this.mobile();
5808
+ }
5809
+ headerFullWidth() {
5810
+ if (this.mobile()) {
5811
+ return true;
5812
+ }
5813
+ return this.headerSpan === 'full';
5814
+ }
5815
+ footerFullWidth() {
5816
+ if (this.mobile()) {
5817
+ return false;
5818
+ }
5819
+ return this.footerSpan === 'full';
5820
+ }
5821
+ openSidebar() {
5822
+ this.setSidebarOpen(true);
5823
+ }
5824
+ closeSidebar() {
5825
+ this.setSidebarOpen(false);
5826
+ }
5827
+ toggleSidebar() {
5828
+ this.setSidebarOpen(!this.sidebarOpen);
5829
+ }
5830
+ setSidebarOpen(value) {
5831
+ if (this.sidebarOpen === value) {
5832
+ return;
5833
+ }
5834
+ this.sidebarOpenState.set(value);
5835
+ this.sidebarOpenChange.emit(value);
5836
+ }
5837
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.4", ngImport: i0, type: TdLayout, deps: [], target: i0.ɵɵFactoryTarget.Component });
5838
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.4", type: TdLayout, isStandalone: true, selector: "td-layout, td-shell", inputs: { fillViewport: ["fillViewport", "fillViewport", booleanAttribute], closeSidebarOnBackdrop: ["closeSidebarOnBackdrop", "closeSidebarOnBackdrop", booleanAttribute], mobileBreakpoint: "mobileBreakpoint", sidebarPlacement: "sidebarPlacement", headerSpan: "headerSpan", footerSpan: "footerSpan", sidebarOpen: "sidebarOpen" }, outputs: { sidebarOpenChange: "sidebarOpenChange" }, host: { listeners: { "window:resize": "syncViewport()" } }, queries: [{ propertyName: "headerSlot", first: true, predicate: TdLayoutHeaderSlot, descendants: true }, { propertyName: "sidebarSlot", first: true, predicate: TdLayoutSidebarSlot, descendants: true }, { propertyName: "footerSlot", first: true, predicate: TdLayoutFooterSlot, descendants: true }], ngImport: i0, template: `
5839
+ <div
5840
+ class="td-layout"
5841
+ [class.td-layout--viewport]="fillViewport"
5842
+ [class.td-layout--mobile]="mobile()"
5843
+ [class.td-layout--sidebar]="hasSidebar"
5844
+ [class.td-layout--sidebar-overlay]="sidebarAsOverlay()"
5845
+ [class.td-layout--sidebar-open]="sidebarOpen"
5846
+ [class.td-layout--header-full]="headerFullWidth()"
5847
+ [class.td-layout--footer-full]="footerFullWidth()"
5848
+ >
5849
+ <div class="td-layout__body">
5850
+ @if (hasSidebar && sidebarAsOverlay() && sidebarOpen && closeSidebarOnBackdrop) {
5851
+ <button
5852
+ type="button"
5853
+ class="td-layout__backdrop"
5854
+ aria-label="Cerrar navegación"
5855
+ (click)="closeSidebar()"
5856
+ ></button>
5857
+ }
5858
+
5859
+ @if (hasHeader) {
5860
+ <div class="td-layout__header">
5861
+ <ng-content select="[tdLayoutHeader]"></ng-content>
5862
+ </div>
5863
+ }
5864
+
5865
+ @if (hasSidebar) {
5866
+ <aside class="td-layout__sidebar" [attr.aria-hidden]="sidebarAsOverlay() && !sidebarOpen">
5867
+ <ng-content select="[tdLayoutSidebar]"></ng-content>
5868
+ </aside>
5869
+ }
5870
+
5871
+ <main class="td-layout__content">
5872
+ <ng-content select="[tdLayoutContent]"></ng-content>
5873
+ <ng-content></ng-content>
5874
+ </main>
5875
+
5876
+ @if (hasFooter) {
5877
+ <div class="td-layout__footer">
5878
+ <ng-content select="[tdLayoutFooter]"></ng-content>
5879
+ </div>
5880
+ }
5881
+ </div>
5882
+ </div>
5883
+ `, isInline: true, styles: [":host{display:block;min-width:0}.td-layout,.td-layout *{box-sizing:border-box}.td-layout{position:relative;min-width:0;min-height:0}.td-layout--viewport{min-height:100dvh}.td-layout__body{position:relative;display:grid;min-width:0;min-height:0;grid-template-columns:auto minmax(0,1fr);grid-template-rows:auto minmax(0,1fr) auto}.td-layout__header,.td-layout__sidebar,.td-layout__content,.td-layout__footer{min-width:0;min-height:0}.td-layout__header,.td-layout__footer{position:relative;z-index:3}.td-layout__sidebar{position:relative;z-index:4;grid-column:1;grid-row:1/span 3}.td-layout__header{grid-column:2;grid-row:1}.td-layout__content{grid-column:2;grid-row:2}.td-layout__footer{grid-column:2;grid-row:3}.td-layout__backdrop{position:absolute;inset:0;z-index:3;border:0;background:#0f172a57;-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px);cursor:pointer}.td-layout:not(.td-layout--sidebar) .td-layout__body{grid-template-columns:minmax(0,1fr)}.td-layout:not(.td-layout--sidebar) .td-layout__header,.td-layout:not(.td-layout--sidebar) .td-layout__content,.td-layout:not(.td-layout--sidebar) .td-layout__footer{grid-column:1}.td-layout--header-full .td-layout__header{grid-column:1/-1}.td-layout--header-full .td-layout__sidebar{grid-row:2/span 2}.td-layout--header-full .td-layout__content{grid-row:2}.td-layout--header-full .td-layout__footer{grid-row:3}.td-layout--footer-full .td-layout__footer{grid-column:1/-1}.td-layout--footer-full .td-layout__sidebar{grid-row:1/span 2}.td-layout--footer-full .td-layout__content,.td-layout--header-full.td-layout--footer-full .td-layout__sidebar{grid-row:2}.td-layout--mobile.td-layout--sidebar-overlay .td-layout__body{grid-template-columns:minmax(0,1fr)}.td-layout--mobile.td-layout--sidebar-overlay .td-layout__header,.td-layout--mobile.td-layout--sidebar-overlay .td-layout__content,.td-layout--mobile.td-layout--sidebar-overlay .td-layout__footer{grid-column:1}.td-layout--mobile.td-layout--sidebar-overlay .td-layout__sidebar{position:absolute;inset:0 auto 0 0;width:min(86vw,22rem);max-width:100%;grid-column:auto;grid-row:auto;transform:translate(-108%);transition:transform .18s ease,visibility .18s ease;visibility:hidden;pointer-events:none}.td-layout--mobile.td-layout--sidebar-overlay.td-layout--sidebar-open .td-layout__sidebar{transform:translate(0);visibility:visible;pointer-events:auto}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
5884
+ }
5885
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.4", ngImport: i0, type: TdLayout, decorators: [{
5886
+ type: Component,
5887
+ args: [{ selector: 'td-layout, td-shell', template: `
5888
+ <div
5889
+ class="td-layout"
5890
+ [class.td-layout--viewport]="fillViewport"
5891
+ [class.td-layout--mobile]="mobile()"
5892
+ [class.td-layout--sidebar]="hasSidebar"
5893
+ [class.td-layout--sidebar-overlay]="sidebarAsOverlay()"
5894
+ [class.td-layout--sidebar-open]="sidebarOpen"
5895
+ [class.td-layout--header-full]="headerFullWidth()"
5896
+ [class.td-layout--footer-full]="footerFullWidth()"
5897
+ >
5898
+ <div class="td-layout__body">
5899
+ @if (hasSidebar && sidebarAsOverlay() && sidebarOpen && closeSidebarOnBackdrop) {
5900
+ <button
5901
+ type="button"
5902
+ class="td-layout__backdrop"
5903
+ aria-label="Cerrar navegación"
5904
+ (click)="closeSidebar()"
5905
+ ></button>
5906
+ }
5907
+
5908
+ @if (hasHeader) {
5909
+ <div class="td-layout__header">
5910
+ <ng-content select="[tdLayoutHeader]"></ng-content>
5911
+ </div>
5912
+ }
5913
+
5914
+ @if (hasSidebar) {
5915
+ <aside class="td-layout__sidebar" [attr.aria-hidden]="sidebarAsOverlay() && !sidebarOpen">
5916
+ <ng-content select="[tdLayoutSidebar]"></ng-content>
5917
+ </aside>
5918
+ }
5919
+
5920
+ <main class="td-layout__content">
5921
+ <ng-content select="[tdLayoutContent]"></ng-content>
5922
+ <ng-content></ng-content>
5923
+ </main>
5924
+
5925
+ @if (hasFooter) {
5926
+ <div class="td-layout__footer">
5927
+ <ng-content select="[tdLayoutFooter]"></ng-content>
5928
+ </div>
5929
+ }
5930
+ </div>
5931
+ </div>
5932
+ `, changeDetection: ChangeDetectionStrategy.OnPush, styles: [":host{display:block;min-width:0}.td-layout,.td-layout *{box-sizing:border-box}.td-layout{position:relative;min-width:0;min-height:0}.td-layout--viewport{min-height:100dvh}.td-layout__body{position:relative;display:grid;min-width:0;min-height:0;grid-template-columns:auto minmax(0,1fr);grid-template-rows:auto minmax(0,1fr) auto}.td-layout__header,.td-layout__sidebar,.td-layout__content,.td-layout__footer{min-width:0;min-height:0}.td-layout__header,.td-layout__footer{position:relative;z-index:3}.td-layout__sidebar{position:relative;z-index:4;grid-column:1;grid-row:1/span 3}.td-layout__header{grid-column:2;grid-row:1}.td-layout__content{grid-column:2;grid-row:2}.td-layout__footer{grid-column:2;grid-row:3}.td-layout__backdrop{position:absolute;inset:0;z-index:3;border:0;background:#0f172a57;-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px);cursor:pointer}.td-layout:not(.td-layout--sidebar) .td-layout__body{grid-template-columns:minmax(0,1fr)}.td-layout:not(.td-layout--sidebar) .td-layout__header,.td-layout:not(.td-layout--sidebar) .td-layout__content,.td-layout:not(.td-layout--sidebar) .td-layout__footer{grid-column:1}.td-layout--header-full .td-layout__header{grid-column:1/-1}.td-layout--header-full .td-layout__sidebar{grid-row:2/span 2}.td-layout--header-full .td-layout__content{grid-row:2}.td-layout--header-full .td-layout__footer{grid-row:3}.td-layout--footer-full .td-layout__footer{grid-column:1/-1}.td-layout--footer-full .td-layout__sidebar{grid-row:1/span 2}.td-layout--footer-full .td-layout__content,.td-layout--header-full.td-layout--footer-full .td-layout__sidebar{grid-row:2}.td-layout--mobile.td-layout--sidebar-overlay .td-layout__body{grid-template-columns:minmax(0,1fr)}.td-layout--mobile.td-layout--sidebar-overlay .td-layout__header,.td-layout--mobile.td-layout--sidebar-overlay .td-layout__content,.td-layout--mobile.td-layout--sidebar-overlay .td-layout__footer{grid-column:1}.td-layout--mobile.td-layout--sidebar-overlay .td-layout__sidebar{position:absolute;inset:0 auto 0 0;width:min(86vw,22rem);max-width:100%;grid-column:auto;grid-row:auto;transform:translate(-108%);transition:transform .18s ease,visibility .18s ease;visibility:hidden;pointer-events:none}.td-layout--mobile.td-layout--sidebar-overlay.td-layout--sidebar-open .td-layout__sidebar{transform:translate(0);visibility:visible;pointer-events:auto}\n"] }]
5933
+ }], propDecorators: { headerSlot: [{
5934
+ type: ContentChild,
5935
+ args: [TdLayoutHeaderSlot]
5936
+ }], sidebarSlot: [{
5937
+ type: ContentChild,
5938
+ args: [TdLayoutSidebarSlot]
5939
+ }], footerSlot: [{
5940
+ type: ContentChild,
5941
+ args: [TdLayoutFooterSlot]
5942
+ }], fillViewport: [{
5943
+ type: Input,
5944
+ args: [{ transform: booleanAttribute }]
5945
+ }], closeSidebarOnBackdrop: [{
5946
+ type: Input,
5947
+ args: [{ transform: booleanAttribute }]
5948
+ }], mobileBreakpoint: [{
5949
+ type: Input
5950
+ }], sidebarPlacement: [{
5951
+ type: Input
5952
+ }], headerSpan: [{
5953
+ type: Input
5954
+ }], footerSpan: [{
5955
+ type: Input
5956
+ }], sidebarOpen: [{
5957
+ type: Input
5958
+ }], sidebarOpenChange: [{
5959
+ type: Output
5960
+ }], syncViewport: [{
5961
+ type: HostListener,
5962
+ args: ['window:resize']
5963
+ }] } });
5964
+
5721
5965
  let radioSequence = 0;
5722
5966
  class TdRadioGroup {
5723
5967
  cdr = inject(ChangeDetectorRef);
@@ -8137,5 +8381,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.4", ngImpor
8137
8381
  * Generated bundle index. Do not edit.
8138
8382
  */
8139
8383
 
8140
- export { TD_DIALOG_CONFIG, TD_DIALOG_DATA, TD_ICONOS, TD_ICONOS_NOMBRES, TD_THEME_DARK_COLORS, TD_THEME_LIGHT_COLORS, TdAlert, TdAlerta, TdAutocompleteSelect, TdBadge, TdButton, TdCheckbox, TdDataTable, TdDatePicker, TdDialog, TdDialogActions, TdDialogClose, TdDialogPrimary, TdDialogRef, TdFileUpload, TdFileViewer, TdFileViewerService, TdFooter, TdHeader, TdIcon, TdIconoRegistry, TdInput, TdMenu, TdRadioGroup, TdSelect, TdSidebar, TdTab, TdTabs, TdTextarea, TdThemeService, TdTooltip, TelcomdevUi, createTdFormControlBridge };
8384
+ export { TD_DIALOG_CONFIG, TD_DIALOG_DATA, TD_ICONOS, TD_ICONOS_NOMBRES, TD_THEME_DARK_COLORS, TD_THEME_LIGHT_COLORS, TdAlert, TdAlerta, TdAutocompleteSelect, TdBadge, TdButton, TdCheckbox, TdDataTable, TdDatePicker, TdDialog, TdDialogActions, TdDialogClose, TdDialogPrimary, TdDialogRef, TdFileUpload, TdFileViewer, TdFileViewerService, TdFooter, TdHeader, TdIcon, TdIconoRegistry, TdInput, TdLayout, TdLayoutContentSlot, TdLayoutFooterSlot, TdLayoutHeaderSlot, TdLayoutSidebarSlot, TdMenu, TdRadioGroup, TdSelect, TdSidebar, TdTab, TdTabs, TdTextarea, TdThemeService, TdTooltip, TelcomdevUi, createTdFormControlBridge };
8141
8385
  //# sourceMappingURL=telcomdev-ui.mjs.map