@kris701/ez-ui 1.2.10 → 1.2.11

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.
@@ -5451,8 +5451,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.0", ngImpor
5451
5451
 
5452
5452
  class EzUISideBarItem {
5453
5453
  item;
5454
+ onItemClick = new EventEmitter();
5454
5455
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.0", ngImport: i0, type: EzUISideBarItem, deps: [], target: i0.ɵɵFactoryTarget.Component });
5455
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.0", type: EzUISideBarItem, isStandalone: true, selector: "ezui-sidebar-item", inputs: { item: "item" }, ngImport: i0, template: `
5456
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.0", type: EzUISideBarItem, isStandalone: true, selector: "ezui-sidebar-item", inputs: { item: "item" }, outputs: { onItemClick: "onItemClick" }, ngImport: i0, template: `
5456
5457
  @if(item && item.visible){
5457
5458
  @if(item.items && item.items.length > 0){
5458
5459
  <tui-aside-group [(open)]="item.expanded">
@@ -5466,7 +5467,7 @@ class EzUISideBarItem {
5466
5467
 
5467
5468
  <ng-template>
5468
5469
  @for(subitem of item.items; track subitem){
5469
- <ezui-sidebar-item [item]="subitem"/>
5470
+ <ezui-sidebar-item [item]="subitem" (onItemClick)="onItemClick.emit()"/>
5470
5471
  }
5471
5472
  </ng-template>
5472
5473
  </button>
@@ -5480,13 +5481,13 @@ class EzUISideBarItem {
5480
5481
  [routerLinkActiveOptions]="{ exact:true }"
5481
5482
  [routerLink]="item.routerLink"
5482
5483
  [queryParams]="item.queryParams"
5483
- (click)="item.command && item.command()"
5484
+ (click)="item.command && item.command();onItemClick.emit()"
5484
5485
  >
5485
5486
  {{item.label}}
5486
5487
  </button>
5487
5488
  }
5488
5489
  }
5489
- `, isInline: true, dependencies: [{ kind: "component", type: EzUISideBarItem, selector: "ezui-sidebar-item", inputs: ["item"] }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "browserUrl", "routerLink"] }, { kind: "component", type: i4$2.TuiAsideGroupComponent, selector: "tui-aside-group", inputs: ["open"], outputs: ["openChange"] }, { kind: "directive", type: i4$2.TuiAsideItemDirective, selector: "[tuiAsideItem]" }, { kind: "directive", type: TuiChevron, selector: "[tuiChevron]", inputs: ["tuiChevron"] }] });
5490
+ `, isInline: true, dependencies: [{ kind: "component", type: EzUISideBarItem, selector: "ezui-sidebar-item", inputs: ["item"], outputs: ["onItemClick"] }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "browserUrl", "routerLink"] }, { kind: "component", type: i4$2.TuiAsideGroupComponent, selector: "tui-aside-group", inputs: ["open"], outputs: ["openChange"] }, { kind: "directive", type: i4$2.TuiAsideItemDirective, selector: "[tuiAsideItem]" }, { kind: "directive", type: TuiChevron, selector: "[tuiChevron]", inputs: ["tuiChevron"] }] });
5490
5491
  }
5491
5492
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.0", ngImport: i0, type: EzUISideBarItem, decorators: [{
5492
5493
  type: Component,
@@ -5508,7 +5509,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.0", ngImpor
5508
5509
 
5509
5510
  <ng-template>
5510
5511
  @for(subitem of item.items; track subitem){
5511
- <ezui-sidebar-item [item]="subitem"/>
5512
+ <ezui-sidebar-item [item]="subitem" (onItemClick)="onItemClick.emit()"/>
5512
5513
  }
5513
5514
  </ng-template>
5514
5515
  </button>
@@ -5522,7 +5523,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.0", ngImpor
5522
5523
  [routerLinkActiveOptions]="{ exact:true }"
5523
5524
  [routerLink]="item.routerLink"
5524
5525
  [queryParams]="item.queryParams"
5525
- (click)="item.command && item.command()"
5526
+ (click)="item.command && item.command();onItemClick.emit()"
5526
5527
  >
5527
5528
  {{item.label}}
5528
5529
  </button>
@@ -5532,6 +5533,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.0", ngImpor
5532
5533
  }]
5533
5534
  }], propDecorators: { item: [{
5534
5535
  type: Input
5536
+ }], onItemClick: [{
5537
+ type: Output
5535
5538
  }] } });
5536
5539
 
5537
5540
  class EzUILayoutService {
@@ -5660,22 +5663,33 @@ class EzUISideBar {
5660
5663
  }
5661
5664
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.0", ngImport: i0, type: EzUISideBar, deps: [{ token: EzUILayoutService }, { token: i2$2.Router }], target: i0.ɵɵFactoryTarget.Component });
5662
5665
  static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.0", type: EzUISideBar, isStandalone: true, selector: "ezui-sidebar", inputs: { sidebarItems: "sidebarItems", sidebarFooterItems: "sidebarFooterItems", baseRoute: "baseRoute" }, ngImport: i0, template: `
5663
- <aside
5664
- style="height:100%"
5665
- tuitheme=""
5666
- [tuiNavigationAside]="layoutService.isMenuExpanded()"
5667
- >
5668
- @for(item of sidebarItems(); track item){
5669
- <ezui-sidebar-item [item]="item"/>
5670
- }
5671
-
5672
- <footer>
5673
- @for(item of sidebarFooterItems(); track item){
5666
+ @if(layoutService.isDesktop()){
5667
+ <aside style="height:100%" tuitheme="" [tuiNavigationAside]="layoutService.isMenuExpanded()">
5668
+ @for(item of sidebarItems(); track item){
5674
5669
  <ezui-sidebar-item [item]="item"/>
5675
5670
  }
5676
- </footer>
5677
- </aside>
5678
- `, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: i4$2.TuiAsideComponent, selector: "aside[tuiNavigationAside]", inputs: ["tuiNavigationAside"] }, { kind: "component", type: EzUISideBarItem, selector: "ezui-sidebar-item", inputs: ["item"] }] });
5671
+
5672
+ <footer>
5673
+ @for(item of sidebarFooterItems(); track item){
5674
+ <ezui-sidebar-item [item]="item"/>
5675
+ }
5676
+ </footer>
5677
+ </aside>
5678
+ }
5679
+ @else {
5680
+ <aside style="height:100%" tuitheme="" [tuiNavigationAside]="true" [style.display]="layoutService.isMenuExpanded() ? '' : 'none'">
5681
+ @for(item of sidebarItems(); track item){
5682
+ <ezui-sidebar-item [item]="item" (onItemClick)="layoutService.isMenuExpanded.set(false)"/>
5683
+ }
5684
+
5685
+ <footer>
5686
+ @for(item of sidebarFooterItems(); track item){
5687
+ <ezui-sidebar-item [item]="item" (onItemClick)="layoutService.isMenuExpanded.set(false)"/>
5688
+ }
5689
+ </footer>
5690
+ </aside>
5691
+ }
5692
+ `, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: i4$2.TuiAsideComponent, selector: "aside[tuiNavigationAside]", inputs: ["tuiNavigationAside"] }, { kind: "component", type: EzUISideBarItem, selector: "ezui-sidebar-item", inputs: ["item"], outputs: ["onItemClick"] }] });
5679
5693
  }
5680
5694
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.0", ngImport: i0, type: EzUISideBar, decorators: [{
5681
5695
  type: Component,
@@ -5684,21 +5698,32 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.0", ngImpor
5684
5698
  standalone: true,
5685
5699
  imports: [CommonModule, TuiNavigation, EzUISideBarItem],
5686
5700
  template: `
5687
- <aside
5688
- style="height:100%"
5689
- tuitheme=""
5690
- [tuiNavigationAside]="layoutService.isMenuExpanded()"
5691
- >
5692
- @for(item of sidebarItems(); track item){
5693
- <ezui-sidebar-item [item]="item"/>
5694
- }
5695
-
5696
- <footer>
5697
- @for(item of sidebarFooterItems(); track item){
5701
+ @if(layoutService.isDesktop()){
5702
+ <aside style="height:100%" tuitheme="" [tuiNavigationAside]="layoutService.isMenuExpanded()">
5703
+ @for(item of sidebarItems(); track item){
5698
5704
  <ezui-sidebar-item [item]="item"/>
5699
5705
  }
5700
- </footer>
5701
- </aside>
5706
+
5707
+ <footer>
5708
+ @for(item of sidebarFooterItems(); track item){
5709
+ <ezui-sidebar-item [item]="item"/>
5710
+ }
5711
+ </footer>
5712
+ </aside>
5713
+ }
5714
+ @else {
5715
+ <aside style="height:100%" tuitheme="" [tuiNavigationAside]="true" [style.display]="layoutService.isMenuExpanded() ? '' : 'none'">
5716
+ @for(item of sidebarItems(); track item){
5717
+ <ezui-sidebar-item [item]="item" (onItemClick)="layoutService.isMenuExpanded.set(false)"/>
5718
+ }
5719
+
5720
+ <footer>
5721
+ @for(item of sidebarFooterItems(); track item){
5722
+ <ezui-sidebar-item [item]="item" (onItemClick)="layoutService.isMenuExpanded.set(false)"/>
5723
+ }
5724
+ </footer>
5725
+ </aside>
5726
+ }
5702
5727
  `
5703
5728
  }]
5704
5729
  }], ctorParameters: () => [{ type: EzUILayoutService }, { type: i2$2.Router }], propDecorators: { sidebarItems: [{
@@ -5722,7 +5747,7 @@ class EzUITopBar {
5722
5747
  <button
5723
5748
  type="button"
5724
5749
  tuiIconButton
5725
- [iconStart]="layoutService.isMenuExpanded() ? '@tui.chevron-left' : '@tui.chevron-right'"
5750
+ [iconStart]="layoutService.isDesktop() ? (layoutService.isMenuExpanded() ? '@tui.chevron-left' : '@tui.chevron-right') : (layoutService.isMenuExpanded() ? '@tui.chevron-up' : '@tui.chevron-down')"
5726
5751
  (click)="layoutService.ToggleMenu()"
5727
5752
  >
5728
5753
  </button>
@@ -5753,7 +5778,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.0", ngImpor
5753
5778
  <button
5754
5779
  type="button"
5755
5780
  tuiIconButton
5756
- [iconStart]="layoutService.isMenuExpanded() ? '@tui.chevron-left' : '@tui.chevron-right'"
5781
+ [iconStart]="layoutService.isDesktop() ? (layoutService.isMenuExpanded() ? '@tui.chevron-left' : '@tui.chevron-right') : (layoutService.isMenuExpanded() ? '@tui.chevron-up' : '@tui.chevron-down')"
5757
5782
  (click)="layoutService.ToggleMenu()"
5758
5783
  >
5759
5784
  </button>
@@ -5776,6 +5801,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.0", ngImpor
5776
5801
  }], ctorParameters: () => [{ type: EzUILayoutService }, { type: EzUILayout }] });
5777
5802
 
5778
5803
  class EzUILayout {
5804
+ layoutService;
5779
5805
  sidebarItems = signal([], /* @ts-ignore */
5780
5806
  ...(ngDevMode ? [{ debugName: "sidebarItems" }] : /* istanbul ignore next */ []));
5781
5807
  sidebarFooterItems = signal([], /* @ts-ignore */
@@ -5788,14 +5814,24 @@ class EzUILayout {
5788
5814
  ...(ngDevMode ? [{ debugName: "sidebar" }] : /* istanbul ignore next */ []));
5789
5815
  topbar = viewChild("topbar", /* @ts-ignore */
5790
5816
  ...(ngDevMode ? [{ debugName: "topbar" }] : /* istanbul ignore next */ []));
5791
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.0", ngImport: i0, type: EzUILayout, deps: [], target: i0.ɵɵFactoryTarget.Component });
5817
+ constructor(layoutService) {
5818
+ this.layoutService = layoutService;
5819
+ }
5820
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.0", ngImport: i0, type: EzUILayout, deps: [{ token: EzUILayoutService }], target: i0.ɵɵFactoryTarget.Component });
5792
5821
  static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "22.1.0", type: EzUILayout, isStandalone: true, selector: "ezui-layout", inputs: { sidebarItems: "sidebarItems", sidebarFooterItems: "sidebarFooterItems", baseRoute: "baseRoute" }, queries: [{ propertyName: "topbarright", first: true, predicate: ["topbarright"], descendants: true }, { propertyName: "topbarlogo", first: true, predicate: ["topbarlogo"], descendants: true }], viewQueries: [{ propertyName: "sidebar", first: true, predicate: ["sidebar"], descendants: true, isSignal: true }, { propertyName: "topbar", first: true, predicate: ["topbar"], descendants: true, isSignal: true }], ngImport: i0, template: `
5793
5822
  <tui-root class="rootContainer">
5794
5823
  <div class="layout-wrapper">
5795
5824
  <ezui-topbar #topbar></ezui-topbar>
5796
5825
  <div class="layout-wrapper-split">
5797
- <ezui-sidebar [sidebarItems]="sidebarItems" [sidebarFooterItems]="sidebarFooterItems" [baseRoute]="baseRoute" #sidebar></ezui-sidebar>
5798
- <div class="layout-main-container">
5826
+ <ezui-sidebar
5827
+ #sidebar
5828
+ [sidebarItems]="sidebarItems"
5829
+ [sidebarFooterItems]="sidebarFooterItems"
5830
+ [baseRoute]="baseRoute"
5831
+ [style.width]="layoutService.isDesktop() ? '' : '0px'"></ezui-sidebar>
5832
+ <div
5833
+ class="layout-main-container"
5834
+ [style.opacity]="layoutService.isDesktop() ? 1 : (layoutService.isMenuExpanded() ? 0.5 : 1)">
5799
5835
  <tui-scrollbar class="layout-main">
5800
5836
  <router-outlet></router-outlet>
5801
5837
  </tui-scrollbar>
@@ -5812,8 +5848,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.0", ngImpor
5812
5848
  <div class="layout-wrapper">
5813
5849
  <ezui-topbar #topbar></ezui-topbar>
5814
5850
  <div class="layout-wrapper-split">
5815
- <ezui-sidebar [sidebarItems]="sidebarItems" [sidebarFooterItems]="sidebarFooterItems" [baseRoute]="baseRoute" #sidebar></ezui-sidebar>
5816
- <div class="layout-main-container">
5851
+ <ezui-sidebar
5852
+ #sidebar
5853
+ [sidebarItems]="sidebarItems"
5854
+ [sidebarFooterItems]="sidebarFooterItems"
5855
+ [baseRoute]="baseRoute"
5856
+ [style.width]="layoutService.isDesktop() ? '' : '0px'"></ezui-sidebar>
5857
+ <div
5858
+ class="layout-main-container"
5859
+ [style.opacity]="layoutService.isDesktop() ? 1 : (layoutService.isMenuExpanded() ? 0.5 : 1)">
5817
5860
  <tui-scrollbar class="layout-main">
5818
5861
  <router-outlet></router-outlet>
5819
5862
  </tui-scrollbar>
@@ -5822,7 +5865,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.0", ngImpor
5822
5865
  </div>
5823
5866
  </tui-root>
5824
5867
  `, styles: ["::ng-deep .rootContainer .t-root-content{display:flex;height:100vh;width:100vw}.layout-wrapper{display:flex;flex-direction:column;height:100vh;min-height:100vh;max-height:100vh}.layout-wrapper-split{display:flex;flex-direction:row;width:100%;height:100%;overflow:hidden;max-width:100vw}.layout-main-container{display:flex;flex-direction:column;min-height:inherit;max-height:inherit;width:100%;justify-content:space-between;overflow:hidden}.layout-main{flex:1 1 auto;display:flex}::ng-deep .layout-main>.t-content{padding:1rem;display:flex;block-size:auto!important;box-sizing:border-box}\n"] }]
5825
- }], propDecorators: { sidebarItems: [{
5868
+ }], ctorParameters: () => [{ type: EzUILayoutService }], propDecorators: { sidebarItems: [{
5826
5869
  type: Input
5827
5870
  }], sidebarFooterItems: [{
5828
5871
  type: Input