@telcomdev/ui 0.1.27 → 0.1.28

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,272 @@ 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
+ return this.headerSpan === 'full';
5811
+ }
5812
+ footerFullWidth() {
5813
+ return this.footerSpan === 'full';
5814
+ }
5815
+ openSidebar() {
5816
+ this.setSidebarOpen(true);
5817
+ }
5818
+ closeSidebar() {
5819
+ this.setSidebarOpen(false);
5820
+ }
5821
+ toggleSidebar() {
5822
+ this.setSidebarOpen(!this.sidebarOpen);
5823
+ }
5824
+ setSidebarOpen(value) {
5825
+ if (this.sidebarOpen === value) {
5826
+ return;
5827
+ }
5828
+ this.sidebarOpenState.set(value);
5829
+ this.sidebarOpenChange.emit(value);
5830
+ }
5831
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.4", ngImport: i0, type: TdLayout, deps: [], target: i0.ɵɵFactoryTarget.Component });
5832
+ 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: `
5833
+ <div
5834
+ class="td-layout"
5835
+ [class.td-layout--viewport]="fillViewport"
5836
+ [class.td-layout--mobile]="mobile()"
5837
+ [class.td-layout--sidebar]="hasSidebar"
5838
+ [class.td-layout--sidebar-overlay]="sidebarAsOverlay()"
5839
+ [class.td-layout--sidebar-open]="sidebarOpen"
5840
+ [class.td-layout--header-full]="headerFullWidth()"
5841
+ [class.td-layout--footer-full]="footerFullWidth()"
5842
+ >
5843
+ @if (hasHeader && headerFullWidth()) {
5844
+ <div class="td-layout__header td-layout__header--full">
5845
+ <ng-content select="[tdLayoutHeader]"></ng-content>
5846
+ </div>
5847
+ }
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 (hasSidebar) {
5860
+ <aside class="td-layout__sidebar" [attr.aria-hidden]="sidebarAsOverlay() && !sidebarOpen">
5861
+ <ng-content select="[tdLayoutSidebar]"></ng-content>
5862
+ </aside>
5863
+ }
5864
+
5865
+ <div class="td-layout__main">
5866
+ @if (hasHeader && !headerFullWidth()) {
5867
+ <div class="td-layout__header td-layout__header--content">
5868
+ <ng-content select="[tdLayoutHeader]"></ng-content>
5869
+ </div>
5870
+ }
5871
+
5872
+ <main class="td-layout__content">
5873
+ <ng-content select="[tdLayoutContent]"></ng-content>
5874
+ <ng-content></ng-content>
5875
+ </main>
5876
+
5877
+ @if (hasFooter && !footerFullWidth()) {
5878
+ <div class="td-layout__footer td-layout__footer--content">
5879
+ <ng-content select="[tdLayoutFooter]"></ng-content>
5880
+ </div>
5881
+ }
5882
+ </div>
5883
+ </div>
5884
+
5885
+ @if (hasFooter && footerFullWidth()) {
5886
+ <div class="td-layout__footer td-layout__footer--full">
5887
+ <ng-content select="[tdLayoutFooter]"></ng-content>
5888
+ </div>
5889
+ }
5890
+ </div>
5891
+ `, isInline: true, styles: [":host{display:block;min-width:0}.td-layout,.td-layout *{box-sizing:border-box}.td-layout{position:relative;display:grid;min-width:0;min-height:0;grid-template-rows:auto minmax(0,1fr) auto}.td-layout--viewport{min-height:100dvh}.td-layout__header,.td-layout__body,.td-layout__main,.td-layout__content,.td-layout__footer{min-width:0}.td-layout__body{position:relative;display:grid;min-width:0;min-height:0;grid-template-columns:auto minmax(0,1fr)}.td-layout__main{display:grid;min-width:0;min-height:0;grid-template-rows:auto minmax(0,1fr) auto}.td-layout__content,.td-layout__sidebar{min-width:0;min-height:0}.td-layout__sidebar{position:relative;z-index:4}.td-layout__header,.td-layout__footer{position:relative;z-index: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--mobile.td-layout--sidebar-overlay .td-layout__body{grid-template-columns:minmax(0,1fr)}.td-layout--mobile.td-layout--sidebar-overlay .td-layout__sidebar{position:absolute;inset:0 auto 0 0;width:min(86vw,22rem);max-width:100%;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 });
5892
+ }
5893
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.4", ngImport: i0, type: TdLayout, decorators: [{
5894
+ type: Component,
5895
+ args: [{ selector: 'td-layout, td-shell', template: `
5896
+ <div
5897
+ class="td-layout"
5898
+ [class.td-layout--viewport]="fillViewport"
5899
+ [class.td-layout--mobile]="mobile()"
5900
+ [class.td-layout--sidebar]="hasSidebar"
5901
+ [class.td-layout--sidebar-overlay]="sidebarAsOverlay()"
5902
+ [class.td-layout--sidebar-open]="sidebarOpen"
5903
+ [class.td-layout--header-full]="headerFullWidth()"
5904
+ [class.td-layout--footer-full]="footerFullWidth()"
5905
+ >
5906
+ @if (hasHeader && headerFullWidth()) {
5907
+ <div class="td-layout__header td-layout__header--full">
5908
+ <ng-content select="[tdLayoutHeader]"></ng-content>
5909
+ </div>
5910
+ }
5911
+
5912
+ <div class="td-layout__body">
5913
+ @if (hasSidebar && sidebarAsOverlay() && sidebarOpen && closeSidebarOnBackdrop) {
5914
+ <button
5915
+ type="button"
5916
+ class="td-layout__backdrop"
5917
+ aria-label="Cerrar navegación"
5918
+ (click)="closeSidebar()"
5919
+ ></button>
5920
+ }
5921
+
5922
+ @if (hasSidebar) {
5923
+ <aside class="td-layout__sidebar" [attr.aria-hidden]="sidebarAsOverlay() && !sidebarOpen">
5924
+ <ng-content select="[tdLayoutSidebar]"></ng-content>
5925
+ </aside>
5926
+ }
5927
+
5928
+ <div class="td-layout__main">
5929
+ @if (hasHeader && !headerFullWidth()) {
5930
+ <div class="td-layout__header td-layout__header--content">
5931
+ <ng-content select="[tdLayoutHeader]"></ng-content>
5932
+ </div>
5933
+ }
5934
+
5935
+ <main class="td-layout__content">
5936
+ <ng-content select="[tdLayoutContent]"></ng-content>
5937
+ <ng-content></ng-content>
5938
+ </main>
5939
+
5940
+ @if (hasFooter && !footerFullWidth()) {
5941
+ <div class="td-layout__footer td-layout__footer--content">
5942
+ <ng-content select="[tdLayoutFooter]"></ng-content>
5943
+ </div>
5944
+ }
5945
+ </div>
5946
+ </div>
5947
+
5948
+ @if (hasFooter && footerFullWidth()) {
5949
+ <div class="td-layout__footer td-layout__footer--full">
5950
+ <ng-content select="[tdLayoutFooter]"></ng-content>
5951
+ </div>
5952
+ }
5953
+ </div>
5954
+ `, changeDetection: ChangeDetectionStrategy.OnPush, styles: [":host{display:block;min-width:0}.td-layout,.td-layout *{box-sizing:border-box}.td-layout{position:relative;display:grid;min-width:0;min-height:0;grid-template-rows:auto minmax(0,1fr) auto}.td-layout--viewport{min-height:100dvh}.td-layout__header,.td-layout__body,.td-layout__main,.td-layout__content,.td-layout__footer{min-width:0}.td-layout__body{position:relative;display:grid;min-width:0;min-height:0;grid-template-columns:auto minmax(0,1fr)}.td-layout__main{display:grid;min-width:0;min-height:0;grid-template-rows:auto minmax(0,1fr) auto}.td-layout__content,.td-layout__sidebar{min-width:0;min-height:0}.td-layout__sidebar{position:relative;z-index:4}.td-layout__header,.td-layout__footer{position:relative;z-index: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--mobile.td-layout--sidebar-overlay .td-layout__body{grid-template-columns:minmax(0,1fr)}.td-layout--mobile.td-layout--sidebar-overlay .td-layout__sidebar{position:absolute;inset:0 auto 0 0;width:min(86vw,22rem);max-width:100%;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"] }]
5955
+ }], propDecorators: { headerSlot: [{
5956
+ type: ContentChild,
5957
+ args: [TdLayoutHeaderSlot]
5958
+ }], sidebarSlot: [{
5959
+ type: ContentChild,
5960
+ args: [TdLayoutSidebarSlot]
5961
+ }], footerSlot: [{
5962
+ type: ContentChild,
5963
+ args: [TdLayoutFooterSlot]
5964
+ }], fillViewport: [{
5965
+ type: Input,
5966
+ args: [{ transform: booleanAttribute }]
5967
+ }], closeSidebarOnBackdrop: [{
5968
+ type: Input,
5969
+ args: [{ transform: booleanAttribute }]
5970
+ }], mobileBreakpoint: [{
5971
+ type: Input
5972
+ }], sidebarPlacement: [{
5973
+ type: Input
5974
+ }], headerSpan: [{
5975
+ type: Input
5976
+ }], footerSpan: [{
5977
+ type: Input
5978
+ }], sidebarOpen: [{
5979
+ type: Input
5980
+ }], sidebarOpenChange: [{
5981
+ type: Output
5982
+ }], syncViewport: [{
5983
+ type: HostListener,
5984
+ args: ['window:resize']
5985
+ }] } });
5986
+
5721
5987
  let radioSequence = 0;
5722
5988
  class TdRadioGroup {
5723
5989
  cdr = inject(ChangeDetectorRef);
@@ -8137,5 +8403,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.4", ngImpor
8137
8403
  * Generated bundle index. Do not edit.
8138
8404
  */
8139
8405
 
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 };
8406
+ 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
8407
  //# sourceMappingURL=telcomdev-ui.mjs.map