@kris701/ez-ui 1.1.0 → 1.1.2
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/kris701-ez-ui.mjs +385 -10
- package/fesm2022/kris701-ez-ui.mjs.map +1 -1
- package/package.json +1 -1
- package/types/kris701-ez-ui.d.ts +48 -10
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { EventEmitter, signal, Output, Input, Component, ViewChild, ContentChild, Directive } from '@angular/core';
|
|
2
|
+
import { EventEmitter, signal, Output, Input, Component, ViewChild, ContentChild, Directive, inject } from '@angular/core';
|
|
3
3
|
import * as i1 from '@angular/forms';
|
|
4
4
|
import { FormsModule } from '@angular/forms';
|
|
5
5
|
import * as i3$3 from '@taiga-ui/addon-mobile';
|
|
6
6
|
import { TuiDropdownSheet } from '@taiga-ui/addon-mobile';
|
|
7
7
|
import { TuiDay, TuiTime } from '@taiga-ui/cdk/date-time';
|
|
8
8
|
import * as i3$1 from '@taiga-ui/core';
|
|
9
|
-
import { TuiInput, TuiButton, TuiDropdown, TuiOption, TuiGroup, TuiScrollbar, TuiSelectLike, TuiDataList, TuiTextfield, TuiIcon, TuiHint, TuiLoader } from '@taiga-ui/core';
|
|
9
|
+
import { TuiInput, TuiButton, TuiDropdown, TuiOption, TuiGroup, TuiScrollbar, TuiSelectLike, TuiDataList, TuiTextfield, TuiIcon, TuiHint, TuiLoader, TUI_DARK_MODE, TuiRoot } from '@taiga-ui/core';
|
|
10
10
|
import * as i4$1 from '@taiga-ui/kit';
|
|
11
11
|
import { TuiInputDate, TuiInputDateTime, TuiFiles, TuiChevron, TuiTextarea, TuiMultiSelect, TuiInputNumber, TuiInputChip, TuiPassword, TuiBadge, TuiStatus, TuiDataListWrapper, TuiButtonSelect, TuiBadgeNotification, TuiStringifyContentPipe, TuiBadgedContent, TUI_CONFIRM } from '@taiga-ui/kit';
|
|
12
12
|
import * as i2 from '@taiga-ui/core/components/label';
|
|
@@ -21,10 +21,12 @@ import * as i7 from '@taiga-ui/cdk/directives/item';
|
|
|
21
21
|
import * as i3$2 from '@taiga-ui/addon-table';
|
|
22
22
|
import { TuiTablePagination, TuiTable } from '@taiga-ui/addon-table';
|
|
23
23
|
import * as i4$2 from '@taiga-ui/layout';
|
|
24
|
-
import { TuiBlockStatus } from '@taiga-ui/layout';
|
|
24
|
+
import { TuiBlockStatus, TuiNavigation, TuiAsideGroupComponent } from '@taiga-ui/layout';
|
|
25
25
|
import { v4 } from 'uuid';
|
|
26
26
|
import { firstValueFrom, switchMap } from 'rxjs';
|
|
27
27
|
import * as i1$1 from '@angular/common/http';
|
|
28
|
+
import * as i3$4 from '@angular/router';
|
|
29
|
+
import { RouterLink, NavigationEnd, RouterModule } from '@angular/router';
|
|
28
30
|
|
|
29
31
|
class EzUIDateInput {
|
|
30
32
|
icon = '';
|
|
@@ -41,7 +43,7 @@ class EzUIDateInput {
|
|
|
41
43
|
ngOnChanges(changes) {
|
|
42
44
|
if (changes['value'] && changes['value'].currentValue != changes['value'].previousValue) {
|
|
43
45
|
this.value = changes['value'].currentValue;
|
|
44
|
-
this.internalValue.set(this.toTuiDate(this.value));
|
|
46
|
+
this.internalValue.set(this.toTuiDate(this.toDateOrNull(this.value)));
|
|
45
47
|
}
|
|
46
48
|
}
|
|
47
49
|
updateValue() {
|
|
@@ -61,13 +63,18 @@ class EzUIDateInput {
|
|
|
61
63
|
}
|
|
62
64
|
return null;
|
|
63
65
|
}
|
|
66
|
+
toDateOrNull(value) {
|
|
67
|
+
if (value)
|
|
68
|
+
return new Date(value);
|
|
69
|
+
return null;
|
|
70
|
+
}
|
|
64
71
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: EzUIDateInput, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
65
72
|
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.7", type: EzUIDateInput, isStandalone: true, selector: "ezui-dateinput", inputs: { icon: "icon", label: "label", size: "size", disabled: "disabled", min: "min", max: "max", value: "value" }, outputs: { valueChange: "valueChange" }, usesOnChanges: true, ngImport: i0, template: `
|
|
66
73
|
<tui-textfield [tuiTextfieldSize]="size" [iconStart]="icon" tuiDropdownSheet>
|
|
67
74
|
@if(label){
|
|
68
75
|
<label tuiLabel>{{label}}</label>
|
|
69
76
|
}
|
|
70
|
-
<input tuiInputDate [(ngModel)]="internalValue" (ngModelChange)="updateValue()" [disabled]="disabled" [min]="toTuiDate(min)" [max]="toTuiDate(max)"/>
|
|
77
|
+
<input tuiInputDate [(ngModel)]="internalValue" (ngModelChange)="updateValue()" [disabled]="disabled" [min]="toTuiDate(toDateOrNull(min))" [max]="toTuiDate(toDateOrNull(max))"/>
|
|
71
78
|
<tui-calendar *tuiDropdown />
|
|
72
79
|
</tui-textfield>
|
|
73
80
|
`, isInline: true, styles: [""], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox]):not([ngNoCva])[formControlName],textarea:not([ngNoCva])[formControlName],input:not([type=checkbox]):not([ngNoCva])[formControl],textarea:not([ngNoCva])[formControl],input:not([type=checkbox]):not([ngNoCva])[ngModel],textarea:not([ngNoCva])[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i2.TuiLabel, selector: "label[tuiLabel]" }, { kind: "component", type: i3.TuiTextfieldComponent, selector: "tui-textfield:not([multi])", inputs: ["content", "filler"] }, { kind: "directive", type: i3.TuiTextfieldOptionsDirective, selector: "[tuiTextfieldAppearance],[tuiTextfieldSize],[tuiTextfieldCleaner]", inputs: ["tuiTextfieldAppearance", "tuiTextfieldSize", "tuiTextfieldCleaner"] }, { kind: "directive", type: i4.TuiDropdownContent, selector: "ng-template[tuiDropdown]" }, { kind: "directive", type: i4$1.TuiInputDateDirective, selector: "input[tuiInputDate]", inputs: ["max", "min"] }, { kind: "component", type: i6.TuiCalendar, selector: "tui-calendar:not([new])", inputs: ["minViewedMonth", "maxViewedMonth", "showAdjacent", "markerHandler", "initialView", "hoveredItem"], outputs: ["hoveredItemChange", "dayClick"] }, { kind: "directive", type: TuiDropdownSheet, selector: "[tuiDropdownSheet]", inputs: ["tuiDropdownSheet"] }] });
|
|
@@ -84,7 +91,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImpor
|
|
|
84
91
|
@if(label){
|
|
85
92
|
<label tuiLabel>{{label}}</label>
|
|
86
93
|
}
|
|
87
|
-
<input tuiInputDate [(ngModel)]="internalValue" (ngModelChange)="updateValue()" [disabled]="disabled" [min]="toTuiDate(min)" [max]="toTuiDate(max)"/>
|
|
94
|
+
<input tuiInputDate [(ngModel)]="internalValue" (ngModelChange)="updateValue()" [disabled]="disabled" [min]="toTuiDate(toDateOrNull(min))" [max]="toTuiDate(toDateOrNull(max))"/>
|
|
88
95
|
<tui-calendar *tuiDropdown />
|
|
89
96
|
</tui-textfield>
|
|
90
97
|
` }]
|
|
@@ -124,7 +131,7 @@ class EzUIDateTimeInput {
|
|
|
124
131
|
ngOnChanges(changes) {
|
|
125
132
|
if (changes['value'] && changes['value'].currentValue != changes['value'].previousValue) {
|
|
126
133
|
this.value = changes['value'].currentValue;
|
|
127
|
-
this.internalValue.set(this.toTuiDateTime(this.value));
|
|
134
|
+
this.internalValue.set(this.toTuiDateTime(this.toDateOrNull(this.value)));
|
|
128
135
|
const internal = this.internalValue();
|
|
129
136
|
if (!internal || !internal[1])
|
|
130
137
|
this.showDate.set(true);
|
|
@@ -184,13 +191,18 @@ class EzUIDateTimeInput {
|
|
|
184
191
|
this.updateValue();
|
|
185
192
|
}
|
|
186
193
|
}
|
|
194
|
+
toDateOrNull(value) {
|
|
195
|
+
if (value)
|
|
196
|
+
return new Date(value);
|
|
197
|
+
return null;
|
|
198
|
+
}
|
|
187
199
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: EzUIDateTimeInput, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
188
200
|
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.7", type: EzUIDateTimeInput, isStandalone: true, selector: "ezui-datetimeinput", inputs: { icon: "icon", label: "label", size: "size", disabled: "disabled", min: "min", max: "max", value: "value" }, outputs: { valueChange: "valueChange" }, usesOnChanges: true, ngImport: i0, template: `
|
|
189
201
|
<tui-textfield [tuiTextfieldSize]="size" [iconStart]="icon" tuiDropdownSheet>>
|
|
190
202
|
@if(label){
|
|
191
203
|
<label tuiLabel>{{label}}</label>
|
|
192
204
|
}
|
|
193
|
-
<input tuiInputDateTime [(ngModel)]="internalValue" (ngModelChange)="updateValue()" [disabled]="disabled" [min]="toTuiDateTime(min)" [max]="toTuiDateTime(max)"/>
|
|
205
|
+
<input tuiInputDateTime [(ngModel)]="internalValue" (ngModelChange)="updateValue()" [disabled]="disabled" [min]="toTuiDateTime(toDateOrNull(min))" [max]="toTuiDateTime(toDateOrNull(max))"/>
|
|
194
206
|
<section *tuiDropdown class="datetime-dropdown">
|
|
195
207
|
@let internal = internalValue();
|
|
196
208
|
@if(showDate()){
|
|
@@ -236,7 +248,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImpor
|
|
|
236
248
|
@if(label){
|
|
237
249
|
<label tuiLabel>{{label}}</label>
|
|
238
250
|
}
|
|
239
|
-
<input tuiInputDateTime [(ngModel)]="internalValue" (ngModelChange)="updateValue()" [disabled]="disabled" [min]="toTuiDateTime(min)" [max]="toTuiDateTime(max)"/>
|
|
251
|
+
<input tuiInputDateTime [(ngModel)]="internalValue" (ngModelChange)="updateValue()" [disabled]="disabled" [min]="toTuiDateTime(toDateOrNull(min))" [max]="toTuiDateTime(toDateOrNull(max))"/>
|
|
240
252
|
<section *tuiDropdown class="datetime-dropdown">
|
|
241
253
|
@let internal = internalValue();
|
|
242
254
|
@if(showDate()){
|
|
@@ -4592,11 +4604,374 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImpor
|
|
|
4592
4604
|
type: Directive
|
|
4593
4605
|
}], ctorParameters: () => [{ type: i1$1.HttpClient }] });
|
|
4594
4606
|
|
|
4607
|
+
class EzUISideBarItem {
|
|
4608
|
+
item;
|
|
4609
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: EzUISideBarItem, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
4610
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.7", type: EzUISideBarItem, isStandalone: true, selector: "ezui-sidebar-item", inputs: { item: "item" }, ngImport: i0, template: `
|
|
4611
|
+
@if(item && item.visible){
|
|
4612
|
+
@if(item.items && item.items.length > 0){
|
|
4613
|
+
<tui-aside-group [(open)]="item.expanded">
|
|
4614
|
+
<button
|
|
4615
|
+
[iconStart]="item.icon"
|
|
4616
|
+
tuiAsideItem
|
|
4617
|
+
tuiChevron
|
|
4618
|
+
type="button"
|
|
4619
|
+
>
|
|
4620
|
+
{{item.label}}
|
|
4621
|
+
|
|
4622
|
+
<ng-template>
|
|
4623
|
+
@for(subitem of item.items; track subitem){
|
|
4624
|
+
<ezui-sidebar-item [item]="subitem"/>
|
|
4625
|
+
}
|
|
4626
|
+
</ng-template>
|
|
4627
|
+
</button>
|
|
4628
|
+
</tui-aside-group>
|
|
4629
|
+
}
|
|
4630
|
+
@else {
|
|
4631
|
+
<button
|
|
4632
|
+
[iconStart]="item.icon"
|
|
4633
|
+
tuiAsideItem
|
|
4634
|
+
type="button"
|
|
4635
|
+
[routerLinkActiveOptions]="{ exact:true }"
|
|
4636
|
+
[routerLink]="item.routerLink"
|
|
4637
|
+
[queryParams]="item.queryParams"
|
|
4638
|
+
(click)="item.command && item.command()"
|
|
4639
|
+
>
|
|
4640
|
+
{{item.label}}
|
|
4641
|
+
</button>
|
|
4642
|
+
}
|
|
4643
|
+
}
|
|
4644
|
+
`, 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"] }] });
|
|
4645
|
+
}
|
|
4646
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: EzUISideBarItem, decorators: [{
|
|
4647
|
+
type: Component,
|
|
4648
|
+
args: [{
|
|
4649
|
+
selector: 'ezui-sidebar-item',
|
|
4650
|
+
standalone: true,
|
|
4651
|
+
imports: [CommonModule, RouterLink, TuiNavigation, TuiAsideGroupComponent, TuiChevron],
|
|
4652
|
+
template: `
|
|
4653
|
+
@if(item && item.visible){
|
|
4654
|
+
@if(item.items && item.items.length > 0){
|
|
4655
|
+
<tui-aside-group [(open)]="item.expanded">
|
|
4656
|
+
<button
|
|
4657
|
+
[iconStart]="item.icon"
|
|
4658
|
+
tuiAsideItem
|
|
4659
|
+
tuiChevron
|
|
4660
|
+
type="button"
|
|
4661
|
+
>
|
|
4662
|
+
{{item.label}}
|
|
4663
|
+
|
|
4664
|
+
<ng-template>
|
|
4665
|
+
@for(subitem of item.items; track subitem){
|
|
4666
|
+
<ezui-sidebar-item [item]="subitem"/>
|
|
4667
|
+
}
|
|
4668
|
+
</ng-template>
|
|
4669
|
+
</button>
|
|
4670
|
+
</tui-aside-group>
|
|
4671
|
+
}
|
|
4672
|
+
@else {
|
|
4673
|
+
<button
|
|
4674
|
+
[iconStart]="item.icon"
|
|
4675
|
+
tuiAsideItem
|
|
4676
|
+
type="button"
|
|
4677
|
+
[routerLinkActiveOptions]="{ exact:true }"
|
|
4678
|
+
[routerLink]="item.routerLink"
|
|
4679
|
+
[queryParams]="item.queryParams"
|
|
4680
|
+
(click)="item.command && item.command()"
|
|
4681
|
+
>
|
|
4682
|
+
{{item.label}}
|
|
4683
|
+
</button>
|
|
4684
|
+
}
|
|
4685
|
+
}
|
|
4686
|
+
`
|
|
4687
|
+
}]
|
|
4688
|
+
}], propDecorators: { item: [{
|
|
4689
|
+
type: Input
|
|
4690
|
+
}] } });
|
|
4691
|
+
|
|
4692
|
+
class EzUILayoutService {
|
|
4693
|
+
darkMode = inject(TUI_DARK_MODE);
|
|
4694
|
+
isDarkMode = signal(true, /* @ts-ignore */
|
|
4695
|
+
...(ngDevMode ? [{ debugName: "isDarkMode" }] : /* istanbul ignore next */ []));
|
|
4696
|
+
isDesktop = signal(true, /* @ts-ignore */
|
|
4697
|
+
...(ngDevMode ? [{ debugName: "isDesktop" }] : /* istanbul ignore next */ []));
|
|
4698
|
+
isMenuExpanded = signal(false, /* @ts-ignore */
|
|
4699
|
+
...(ngDevMode ? [{ debugName: "isMenuExpanded" }] : /* istanbul ignore next */ []));
|
|
4700
|
+
constructor() {
|
|
4701
|
+
const existing = localStorage.getItem("state");
|
|
4702
|
+
if (existing) {
|
|
4703
|
+
var state = JSON.parse(existing);
|
|
4704
|
+
this.isDarkMode.set(state.isDarkMode);
|
|
4705
|
+
this.isDesktop.set(state.isDesktop);
|
|
4706
|
+
this.isMenuExpanded.set(state.isMenuExpanded);
|
|
4707
|
+
}
|
|
4708
|
+
let isDesktop = this.isDesktop();
|
|
4709
|
+
let isMenuExpanded = this.isMenuExpanded();
|
|
4710
|
+
isDesktop = window.innerWidth > 991;
|
|
4711
|
+
if (isMenuExpanded) {
|
|
4712
|
+
if (!isDesktop)
|
|
4713
|
+
isMenuExpanded = false;
|
|
4714
|
+
}
|
|
4715
|
+
this.isDesktop.set(isDesktop);
|
|
4716
|
+
this.isMenuExpanded.set(isMenuExpanded);
|
|
4717
|
+
this.darkMode.update((dark) => this.isDarkMode());
|
|
4718
|
+
}
|
|
4719
|
+
ToggleDarkMode() {
|
|
4720
|
+
let isDarkMode = this.isDarkMode();
|
|
4721
|
+
this.darkMode.update((dark) => !isDarkMode);
|
|
4722
|
+
isDarkMode = !isDarkMode;
|
|
4723
|
+
this.isDarkMode.set(isDarkMode);
|
|
4724
|
+
this.saveState();
|
|
4725
|
+
}
|
|
4726
|
+
ToggleMenu() {
|
|
4727
|
+
let isMenuExpanded = this.isMenuExpanded();
|
|
4728
|
+
isMenuExpanded = !isMenuExpanded;
|
|
4729
|
+
this.isMenuExpanded.set(isMenuExpanded);
|
|
4730
|
+
this.saveState();
|
|
4731
|
+
}
|
|
4732
|
+
SetMenu(to) {
|
|
4733
|
+
let isMenuExpanded = this.isMenuExpanded();
|
|
4734
|
+
isMenuExpanded = to;
|
|
4735
|
+
this.isMenuExpanded.set(isMenuExpanded);
|
|
4736
|
+
this.saveState();
|
|
4737
|
+
}
|
|
4738
|
+
saveState() {
|
|
4739
|
+
localStorage.setItem("state", JSON.stringify({
|
|
4740
|
+
isDarkMode: this.isDarkMode(),
|
|
4741
|
+
isDesktop: this.isDesktop(),
|
|
4742
|
+
isMenuExpanded: this.isMenuExpanded(),
|
|
4743
|
+
}));
|
|
4744
|
+
}
|
|
4745
|
+
}
|
|
4746
|
+
|
|
4747
|
+
class EzUISideBar {
|
|
4748
|
+
layoutService;
|
|
4749
|
+
layout;
|
|
4750
|
+
router;
|
|
4751
|
+
haveMoved = signal(false, /* @ts-ignore */
|
|
4752
|
+
...(ngDevMode ? [{ debugName: "haveMoved" }] : /* istanbul ignore next */ []));
|
|
4753
|
+
constructor(layoutService, layout, router) {
|
|
4754
|
+
this.layoutService = layoutService;
|
|
4755
|
+
this.layout = layout;
|
|
4756
|
+
this.router = router;
|
|
4757
|
+
router.events.subscribe((val) => {
|
|
4758
|
+
if (val instanceof NavigationEnd)
|
|
4759
|
+
this.initialize();
|
|
4760
|
+
});
|
|
4761
|
+
}
|
|
4762
|
+
initialize() {
|
|
4763
|
+
this.hideEmptySections(this.layout.sidebarItems());
|
|
4764
|
+
this.hideEmptySections(this.layout.sidebarFooterItems());
|
|
4765
|
+
if (!this.haveMoved() && this.router.routerState.snapshot.url == '/')
|
|
4766
|
+
this.gotoFirstPage(this.layout.sidebarItems());
|
|
4767
|
+
this.setActiveRoute(this.layout.sidebarItems());
|
|
4768
|
+
this.setActiveRoute(this.layout.sidebarFooterItems());
|
|
4769
|
+
}
|
|
4770
|
+
hideEmptySections(menu) {
|
|
4771
|
+
menu.forEach((x) => {
|
|
4772
|
+
if (x.items) {
|
|
4773
|
+
this.hideEmptySections(x.items);
|
|
4774
|
+
if (x.items.every((x) => x.visible == false)) {
|
|
4775
|
+
x.visible = false;
|
|
4776
|
+
}
|
|
4777
|
+
;
|
|
4778
|
+
}
|
|
4779
|
+
});
|
|
4780
|
+
}
|
|
4781
|
+
setActiveRoute(menu, parent = null) {
|
|
4782
|
+
menu.forEach((x) => {
|
|
4783
|
+
if (x.routerLink) {
|
|
4784
|
+
if (x.routerLink == this.router.routerState.snapshot.url) {
|
|
4785
|
+
x.expanded = true;
|
|
4786
|
+
if (parent)
|
|
4787
|
+
parent.expanded = true;
|
|
4788
|
+
}
|
|
4789
|
+
}
|
|
4790
|
+
if (x.items)
|
|
4791
|
+
this.setActiveRoute(x.items, x);
|
|
4792
|
+
});
|
|
4793
|
+
}
|
|
4794
|
+
gotoFirstPage(menu) {
|
|
4795
|
+
var first = menu.find((x) => x.visible == true);
|
|
4796
|
+
if (first) {
|
|
4797
|
+
if (first.items) {
|
|
4798
|
+
this.gotoFirstPage(first.items);
|
|
4799
|
+
}
|
|
4800
|
+
else {
|
|
4801
|
+
this.haveMoved.set(true);
|
|
4802
|
+
this.router.navigate([first.routerLink]);
|
|
4803
|
+
}
|
|
4804
|
+
}
|
|
4805
|
+
}
|
|
4806
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: EzUISideBar, deps: [{ token: EzUILayoutService }, { token: EzUILayout }, { token: i3$4.Router }], target: i0.ɵɵFactoryTarget.Component });
|
|
4807
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.7", type: EzUISideBar, isStandalone: true, selector: "ezui-sidebar", ngImport: i0, template: `
|
|
4808
|
+
<aside
|
|
4809
|
+
style="height:100%"
|
|
4810
|
+
tuitheme=""
|
|
4811
|
+
[tuiNavigationAside]="layoutService.isMenuExpanded()"
|
|
4812
|
+
>
|
|
4813
|
+
@for(item of layout.sidebarItems(); track item){
|
|
4814
|
+
<ezui-sidebar-item [item]="item"/>
|
|
4815
|
+
}
|
|
4816
|
+
|
|
4817
|
+
<footer>
|
|
4818
|
+
@for(item of layout.sidebarFooterItems(); track item){
|
|
4819
|
+
<ezui-sidebar-item [item]="item"/>
|
|
4820
|
+
}
|
|
4821
|
+
</footer>
|
|
4822
|
+
</aside>
|
|
4823
|
+
`, 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"] }] });
|
|
4824
|
+
}
|
|
4825
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: EzUISideBar, decorators: [{
|
|
4826
|
+
type: Component,
|
|
4827
|
+
args: [{
|
|
4828
|
+
selector: 'ezui-sidebar',
|
|
4829
|
+
standalone: true,
|
|
4830
|
+
imports: [CommonModule, TuiNavigation, EzUISideBarItem],
|
|
4831
|
+
template: `
|
|
4832
|
+
<aside
|
|
4833
|
+
style="height:100%"
|
|
4834
|
+
tuitheme=""
|
|
4835
|
+
[tuiNavigationAside]="layoutService.isMenuExpanded()"
|
|
4836
|
+
>
|
|
4837
|
+
@for(item of layout.sidebarItems(); track item){
|
|
4838
|
+
<ezui-sidebar-item [item]="item"/>
|
|
4839
|
+
}
|
|
4840
|
+
|
|
4841
|
+
<footer>
|
|
4842
|
+
@for(item of layout.sidebarFooterItems(); track item){
|
|
4843
|
+
<ezui-sidebar-item [item]="item"/>
|
|
4844
|
+
}
|
|
4845
|
+
</footer>
|
|
4846
|
+
</aside>
|
|
4847
|
+
`
|
|
4848
|
+
}]
|
|
4849
|
+
}], ctorParameters: () => [{ type: EzUILayoutService }, { type: EzUILayout }, { type: i3$4.Router }] });
|
|
4850
|
+
|
|
4851
|
+
class EzUITopBar {
|
|
4852
|
+
layoutService;
|
|
4853
|
+
layout;
|
|
4854
|
+
constructor(layoutService, layout) {
|
|
4855
|
+
this.layoutService = layoutService;
|
|
4856
|
+
this.layout = layout;
|
|
4857
|
+
}
|
|
4858
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: EzUITopBar, deps: [{ token: EzUILayoutService }, { token: EzUILayout }], target: i0.ɵɵFactoryTarget.Component });
|
|
4859
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.0.7", type: EzUITopBar, isStandalone: true, selector: "ezui-topbar", ngImport: i0, template: `
|
|
4860
|
+
<header tuiNavigationHeader tuitheme="">
|
|
4861
|
+
<button
|
|
4862
|
+
type="button"
|
|
4863
|
+
tuiIconButton
|
|
4864
|
+
[iconStart]="layoutService.isMenuExpanded() ? '@tui.chevron-left' : '@tui.chevron-right'"
|
|
4865
|
+
(click)="layoutService.ToggleMenu()"
|
|
4866
|
+
>
|
|
4867
|
+
</button>
|
|
4868
|
+
<span tuiNavigationLogo>
|
|
4869
|
+
<ng-container [ngTemplateOutlet]="layout.topbarlogo"></ng-container>
|
|
4870
|
+
</span>
|
|
4871
|
+
<hr />
|
|
4872
|
+
<button
|
|
4873
|
+
[iconStart]="layoutService.isDarkMode() ? 'moon' : 'sun'"
|
|
4874
|
+
tuiIconButton
|
|
4875
|
+
type="button"
|
|
4876
|
+
(click)="layoutService.ToggleDarkMode()"
|
|
4877
|
+
>
|
|
4878
|
+
</button>
|
|
4879
|
+
|
|
4880
|
+
<ng-container [ngTemplateOutlet]="layout.topbarright"></ng-container>
|
|
4881
|
+
</header>
|
|
4882
|
+
`, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: i4$2.TuiHeaderComponent, selector: "header[tuiNavigationHeader]" }, { kind: "component", type: i4$2.TuiLogoComponent, selector: "[tuiNavigationLogo]" }, { kind: "directive", type: TuiButton, selector: "a[tuiButton],button[tuiButton],a[tuiIconButton],button[tuiIconButton]", inputs: ["size"] }] });
|
|
4883
|
+
}
|
|
4884
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: EzUITopBar, decorators: [{
|
|
4885
|
+
type: Component,
|
|
4886
|
+
args: [{
|
|
4887
|
+
selector: 'ezui-topbar',
|
|
4888
|
+
standalone: true,
|
|
4889
|
+
imports: [CommonModule, TuiNavigation, TuiButton],
|
|
4890
|
+
template: `
|
|
4891
|
+
<header tuiNavigationHeader tuitheme="">
|
|
4892
|
+
<button
|
|
4893
|
+
type="button"
|
|
4894
|
+
tuiIconButton
|
|
4895
|
+
[iconStart]="layoutService.isMenuExpanded() ? '@tui.chevron-left' : '@tui.chevron-right'"
|
|
4896
|
+
(click)="layoutService.ToggleMenu()"
|
|
4897
|
+
>
|
|
4898
|
+
</button>
|
|
4899
|
+
<span tuiNavigationLogo>
|
|
4900
|
+
<ng-container [ngTemplateOutlet]="layout.topbarlogo"></ng-container>
|
|
4901
|
+
</span>
|
|
4902
|
+
<hr />
|
|
4903
|
+
<button
|
|
4904
|
+
[iconStart]="layoutService.isDarkMode() ? 'moon' : 'sun'"
|
|
4905
|
+
tuiIconButton
|
|
4906
|
+
type="button"
|
|
4907
|
+
(click)="layoutService.ToggleDarkMode()"
|
|
4908
|
+
>
|
|
4909
|
+
</button>
|
|
4910
|
+
|
|
4911
|
+
<ng-container [ngTemplateOutlet]="layout.topbarright"></ng-container>
|
|
4912
|
+
</header>
|
|
4913
|
+
`
|
|
4914
|
+
}]
|
|
4915
|
+
}], ctorParameters: () => [{ type: EzUILayoutService }, { type: EzUILayout }] });
|
|
4916
|
+
|
|
4917
|
+
class EzUILayout {
|
|
4918
|
+
sidebarItems = signal([], /* @ts-ignore */
|
|
4919
|
+
...(ngDevMode ? [{ debugName: "sidebarItems" }] : /* istanbul ignore next */ []));
|
|
4920
|
+
sidebarFooterItems = signal([], /* @ts-ignore */
|
|
4921
|
+
...(ngDevMode ? [{ debugName: "sidebarFooterItems" }] : /* istanbul ignore next */ []));
|
|
4922
|
+
topbarright;
|
|
4923
|
+
topbarlogo;
|
|
4924
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: EzUILayout, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
4925
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.0.7", type: EzUILayout, isStandalone: true, selector: "ezui-layout", inputs: { sidebarItems: "sidebarItems", sidebarFooterItems: "sidebarFooterItems" }, queries: [{ propertyName: "topbarright", first: true, predicate: ["topbarright"], descendants: true }, { propertyName: "topbarlogo", first: true, predicate: ["topbarlogo"], descendants: true }], ngImport: i0, template: `
|
|
4926
|
+
<tui-root class="rootContainer">
|
|
4927
|
+
<div class="layout-wrapper">
|
|
4928
|
+
<ezui-topbar></ezui-topbar>
|
|
4929
|
+
<div class="layout-wrapper-split">
|
|
4930
|
+
<ezui-sidebar></ezui-sidebar>
|
|
4931
|
+
<div class="layout-main-container">
|
|
4932
|
+
<tui-scrollbar class="layout-main">
|
|
4933
|
+
<router-outlet></router-outlet>
|
|
4934
|
+
</tui-scrollbar>
|
|
4935
|
+
</div>
|
|
4936
|
+
</div>
|
|
4937
|
+
</div>
|
|
4938
|
+
</tui-root>
|
|
4939
|
+
`, isInline: true, 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"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: RouterModule }, { kind: "directive", type: i3$4.RouterOutlet, selector: "router-outlet", inputs: ["name", "routerOutletData"], outputs: ["activate", "deactivate", "attach", "detach"], exportAs: ["outlet"] }, { kind: "component", type: EzUITopBar, selector: "ezui-topbar" }, { kind: "component", type: EzUISideBar, selector: "ezui-sidebar" }, { kind: "component", type: TuiScrollbar, selector: "tui-scrollbar" }, { kind: "component", type: TuiRoot, selector: "tui-root" }] });
|
|
4940
|
+
}
|
|
4941
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: EzUILayout, decorators: [{
|
|
4942
|
+
type: Component,
|
|
4943
|
+
args: [{ selector: 'ezui-layout', standalone: true, imports: [CommonModule, RouterModule, EzUITopBar, EzUISideBar, TuiNavigation, TuiScrollbar, TuiRoot], template: `
|
|
4944
|
+
<tui-root class="rootContainer">
|
|
4945
|
+
<div class="layout-wrapper">
|
|
4946
|
+
<ezui-topbar></ezui-topbar>
|
|
4947
|
+
<div class="layout-wrapper-split">
|
|
4948
|
+
<ezui-sidebar></ezui-sidebar>
|
|
4949
|
+
<div class="layout-main-container">
|
|
4950
|
+
<tui-scrollbar class="layout-main">
|
|
4951
|
+
<router-outlet></router-outlet>
|
|
4952
|
+
</tui-scrollbar>
|
|
4953
|
+
</div>
|
|
4954
|
+
</div>
|
|
4955
|
+
</div>
|
|
4956
|
+
</tui-root>
|
|
4957
|
+
`, 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"] }]
|
|
4958
|
+
}], propDecorators: { sidebarItems: [{
|
|
4959
|
+
type: Input
|
|
4960
|
+
}], sidebarFooterItems: [{
|
|
4961
|
+
type: Input
|
|
4962
|
+
}], topbarright: [{
|
|
4963
|
+
type: ContentChild,
|
|
4964
|
+
args: ['topbarright', { static: false }]
|
|
4965
|
+
}], topbarlogo: [{
|
|
4966
|
+
type: ContentChild,
|
|
4967
|
+
args: ['topbarlogo', { static: false }]
|
|
4968
|
+
}] } });
|
|
4969
|
+
|
|
4595
4970
|
// Components
|
|
4596
4971
|
|
|
4597
4972
|
/**
|
|
4598
4973
|
* Generated bundle index. Do not edit.
|
|
4599
4974
|
*/
|
|
4600
4975
|
|
|
4601
|
-
export { BaseCRUDInterface, BaseListInterface, EzUIDateInput, EzUIDateTimeInput, EzUIFileInput, EzUIFilterHelpers, EzUIIconSelector, EzUIMarkdownEditor, EzUIMenuBar, EzUIMenuBarSubDataList, EzUIMultiSelect, EzUINumberInput, EzUIPasswordInput, EzUITTableSortableColumn, EzUITable, EzUITableDateFilter, EzUITableFilterService, EzUITableSelectFilter, EzUITableTextFilter, EzUITextInput, compressImage };
|
|
4976
|
+
export { BaseCRUDInterface, BaseListInterface, EzUIDateInput, EzUIDateTimeInput, EzUIFileInput, EzUIFilterHelpers, EzUIIconSelector, EzUILayout, EzUILayoutService, EzUIMarkdownEditor, EzUIMenuBar, EzUIMenuBarSubDataList, EzUIMultiSelect, EzUINumberInput, EzUIPasswordInput, EzUITTableSortableColumn, EzUITable, EzUITableDateFilter, EzUITableFilterService, EzUITableSelectFilter, EzUITableTextFilter, EzUITextInput, compressImage };
|
|
4602
4977
|
//# sourceMappingURL=kris701-ez-ui.mjs.map
|