@egose/shadcn-theme-ng 0.0.26 → 0.0.27
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/LICENSE +201 -0
- package/README.md +107 -2
- package/alert/fesm2022/alert.mjs +19 -19
- package/alert/fesm2022/alert.mjs.map +1 -1
- package/badge/fesm2022/badge.mjs +4 -4
- package/badge/fesm2022/badge.mjs.map +1 -1
- package/basic-alert/fesm2022/basic-alert.mjs +4 -4
- package/basic-alert/fesm2022/basic-alert.mjs.map +1 -1
- package/button/fesm2022/button.mjs +8 -8
- package/button/fesm2022/button.mjs.map +1 -1
- package/calendar/fesm2022/calendar.mjs +16 -16
- package/calendar/fesm2022/calendar.mjs.map +1 -1
- package/date-picker/fesm2022/date-picker.mjs +19 -19
- package/date-picker/fesm2022/date-picker.mjs.map +1 -1
- package/form-date-picker/fesm2022/form-date-picker.mjs +4 -4
- package/form-date-picker/fesm2022/form-date-picker.mjs.map +1 -1
- package/form-field/fesm2022/form-field.mjs +16 -16
- package/form-field/fesm2022/form-field.mjs.map +1 -1
- package/form-field-simple/fesm2022/form-field-simple.mjs +4 -4
- package/form-field-simple/fesm2022/form-field-simple.mjs.map +1 -1
- package/form-select/fesm2022/form-select.mjs +5 -5
- package/form-select/fesm2022/form-select.mjs.map +1 -1
- package/form-text-input/fesm2022/form-text-input.mjs +8 -8
- package/form-text-input/fesm2022/form-text-input.mjs.map +1 -1
- package/form-textarea/fesm2022/form-textarea.mjs +4 -4
- package/form-textarea/fesm2022/form-textarea.mjs.map +1 -1
- package/icon/fesm2022/icon.mjs +8 -8
- package/icon/fesm2022/icon.mjs.map +1 -1
- package/input/fesm2022/input.mjs +8 -8
- package/input/fesm2022/input.mjs.map +1 -1
- package/label/fesm2022/label.mjs +8 -8
- package/label/fesm2022/label.mjs.map +1 -1
- package/package.json +7 -57
- package/popover/fesm2022/popover.mjs +12 -12
- package/popover/fesm2022/popover.mjs.map +1 -1
- package/select/fesm2022/select.mjs +40 -40
- package/select/fesm2022/select.mjs.map +1 -1
- package/separator/fesm2022/separator.mjs +8 -8
- package/separator/fesm2022/separator.mjs.map +1 -1
- package/sheet/fesm2022/sheet.mjs +36 -37
- package/sheet/fesm2022/sheet.mjs.map +1 -1
- package/sonner/fesm2022/sonner.mjs +8 -8
- package/sonner/fesm2022/sonner.mjs.map +1 -1
- package/spinner/fesm2022/spinner.mjs +8 -8
- package/spinner/fesm2022/spinner.mjs.map +1 -1
- package/switch/fesm2022/switch.mjs +12 -12
- package/switch/fesm2022/switch.mjs.map +1 -1
- package/accordion/README.md +0 -64
- package/accordion/fesm2022/accordion.mjs +0 -155
- package/accordion/fesm2022/accordion.mjs.map +0 -1
- package/accordion/index.d.ts +0 -49
- package/autocomplete/README.md +0 -64
- package/autocomplete/fesm2022/autocomplete.mjs +0 -543
- package/autocomplete/fesm2022/autocomplete.mjs.map +0 -1
- package/autocomplete/index.d.ts +0 -162
- package/checkbox/README.md +0 -64
- package/checkbox/fesm2022/checkbox.mjs +0 -146
- package/checkbox/fesm2022/checkbox.mjs.map +0 -1
- package/checkbox/index.d.ts +0 -55
- package/confirmation-dialog/README.md +0 -64
- package/confirmation-dialog/fesm2022/confirmation-dialog.mjs +0 -93
- package/confirmation-dialog/fesm2022/confirmation-dialog.mjs.map +0 -1
- package/confirmation-dialog/index.d.ts +0 -24
- package/dialog/README.md +0 -64
- package/dialog/fesm2022/dialog.mjs +0 -278
- package/dialog/fesm2022/dialog.mjs.map +0 -1
- package/dialog/index.d.ts +0 -89
- package/exports.json +0 -1
- package/form-checkbox/README.md +0 -64
- package/form-checkbox/fesm2022/form-checkbox.mjs +0 -137
- package/form-checkbox/fesm2022/form-checkbox.mjs.map +0 -1
- package/form-checkbox/index.d.ts +0 -27
- package/form-searchable-multiselect/README.md +0 -64
- package/form-searchable-multiselect/fesm2022/form-searchable-multiselect.mjs +0 -139
- package/form-searchable-multiselect/fesm2022/form-searchable-multiselect.mjs.map +0 -1
- package/form-searchable-multiselect/index.d.ts +0 -30
- package/layout-simple/README.md +0 -64
- package/layout-simple/fesm2022/layout-simple.mjs +0 -606
- package/layout-simple/fesm2022/layout-simple.mjs.map +0 -1
- package/layout-simple/index.d.ts +0 -142
- package/menu/README.md +0 -64
- package/menu/fesm2022/menu.mjs +0 -449
- package/menu/fesm2022/menu.mjs.map +0 -1
- package/menu/index.d.ts +0 -137
- package/radio-group/README.md +0 -64
- package/radio-group/fesm2022/radio-group.mjs +0 -170
- package/radio-group/fesm2022/radio-group.mjs.map +0 -1
- package/radio-group/index.d.ts +0 -63
- package/searchable-multiselect/README.md +0 -64
- package/searchable-multiselect/fesm2022/searchable-multiselect.mjs +0 -221
- package/searchable-multiselect/fesm2022/searchable-multiselect.mjs.map +0 -1
- package/searchable-multiselect/index.d.ts +0 -50
- package/tabs/README.md +0 -64
- package/tabs/fesm2022/tabs.mjs +0 -258
- package/tabs/fesm2022/tabs.mjs.map +0 -1
- package/tabs/index.d.ts +0 -71
- package/tooltip/README.md +0 -64
- package/tooltip/fesm2022/tooltip.mjs +0 -93
- package/tooltip/fesm2022/tooltip.mjs.map +0 -1
- package/tooltip/index.d.ts +0 -21
|
@@ -1,606 +0,0 @@
|
|
|
1
|
-
import * as i0 from '@angular/core';
|
|
2
|
-
import { input, Component, viewChild, output, inject, signal, resource, ChangeDetectionStrategy, effect, computed } from '@angular/core';
|
|
3
|
-
import { RouterLink, RouterModule } from '@angular/router';
|
|
4
|
-
import * as i1$2 from '@angular/cdk/layout';
|
|
5
|
-
import { Breakpoints } from '@angular/cdk/layout';
|
|
6
|
-
import { NgIcon, provideIcons } from '@ng-icons/core';
|
|
7
|
-
import { lucideUser, lucideMenu } from '@ng-icons/lucide';
|
|
8
|
-
import { hlm } from '@egose/shadcn-theme-ng/utils';
|
|
9
|
-
import * as i4 from '@egose/shadcn-theme-ng/button';
|
|
10
|
-
import { HlmButton, HlmButtonImports } from '@egose/shadcn-theme-ng/button';
|
|
11
|
-
import { HlmMenu, HlmMenuItem, HlmMenuLabel, HlmMenuSeparator, HlmMenuGroup } from '@egose/shadcn-theme-ng/menu';
|
|
12
|
-
import * as i1 from '@angular/common';
|
|
13
|
-
import { CommonModule } from '@angular/common';
|
|
14
|
-
import { BrnMenuTrigger } from '@spartan-ng/brain/menu';
|
|
15
|
-
import * as i2 from '@angular/forms';
|
|
16
|
-
import { FormBuilder, Validators, ReactiveFormsModule } from '@angular/forms';
|
|
17
|
-
import * as i1$1 from '@egose/shadcn-theme-ng/autocomplete';
|
|
18
|
-
import { provideHlmAutocompleteConfig, HlmAutocompleteImports } from '@egose/shadcn-theme-ng/autocomplete';
|
|
19
|
-
import { HlmSpinner } from '@egose/shadcn-theme-ng/spinner';
|
|
20
|
-
import * as i2$1 from '@spartan-ng/brain/sheet';
|
|
21
|
-
import { BrnSheet, BrnSheetImports } from '@spartan-ng/brain/sheet';
|
|
22
|
-
import { HlmLabelImports } from '@egose/shadcn-theme-ng/label';
|
|
23
|
-
import * as i3 from '@egose/shadcn-theme-ng/sheet';
|
|
24
|
-
import { HlmSheetImports } from '@egose/shadcn-theme-ng/sheet';
|
|
25
|
-
|
|
26
|
-
class EgLayoutSimpleUserMenu {
|
|
27
|
-
hlm = hlm;
|
|
28
|
-
lucideUser = lucideUser;
|
|
29
|
-
menus = input([], ...(ngDevMode ? [{ debugName: "menus" }] : []));
|
|
30
|
-
menuTrigger = input(...(ngDevMode ? [undefined, { debugName: "menuTrigger" }] : []));
|
|
31
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: EgLayoutSimpleUserMenu, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
32
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.1", type: EgLayoutSimpleUserMenu, isStandalone: true, selector: "eg-layout-simple-user-menu", inputs: { menus: { classPropertyName: "menus", publicName: "menus", isSignal: true, isRequired: false, transformFunction: null }, menuTrigger: { classPropertyName: "menuTrigger", publicName: "menuTrigger", isSignal: true, isRequired: false, transformFunction: null } }, providers: [
|
|
33
|
-
provideIcons({
|
|
34
|
-
lucideUser,
|
|
35
|
-
}),
|
|
36
|
-
], ngImport: i0, template: `
|
|
37
|
-
<ng-template #iconTemplate>
|
|
38
|
-
<ng-icon [svg]="lucideUser" size="1.5rem" class="[&_svg]:w-[inherit]! [&_svg]:h-[inherit]!" />
|
|
39
|
-
</ng-template>
|
|
40
|
-
|
|
41
|
-
@let _menuTrigger = menuTrigger();
|
|
42
|
-
|
|
43
|
-
<div class="flex w-full items-center justify-center">
|
|
44
|
-
@if (_menuTrigger) {
|
|
45
|
-
<div [brnMenuTriggerFor]="menu"><ng-container *ngTemplateOutlet="_menuTrigger"></ng-container></div>
|
|
46
|
-
} @else {
|
|
47
|
-
<button
|
|
48
|
-
hlmButton
|
|
49
|
-
variant="primary"
|
|
50
|
-
size="icon"
|
|
51
|
-
align="end"
|
|
52
|
-
[brnMenuTriggerFor]="menu"
|
|
53
|
-
[icon]="iconTemplate"
|
|
54
|
-
class="rounded-full border border-gray-400"
|
|
55
|
-
></button>
|
|
56
|
-
}
|
|
57
|
-
</div>
|
|
58
|
-
|
|
59
|
-
<ng-template #menu>
|
|
60
|
-
<hlm-menu class="w-56">
|
|
61
|
-
@for (section of menus(); track section) {
|
|
62
|
-
@if (section.label) {
|
|
63
|
-
<hlm-menu-label>{{ section.label }}</hlm-menu-label>
|
|
64
|
-
}
|
|
65
|
-
@if (section.items?.length) {
|
|
66
|
-
<hlm-menu-group>
|
|
67
|
-
@for (item of section.items; track item) {
|
|
68
|
-
@if (item.link) {
|
|
69
|
-
<a
|
|
70
|
-
hlmMenuItem
|
|
71
|
-
[routerLink]="item.link"
|
|
72
|
-
[class]="hlm('cursor-pointer no-underline', item.class)"
|
|
73
|
-
>
|
|
74
|
-
@if (item.icon) {
|
|
75
|
-
<ng-icon
|
|
76
|
-
[svg]="item.icon"
|
|
77
|
-
size="1rem"
|
|
78
|
-
[class]="
|
|
79
|
-
hlm('[_svg]:text-[inherit]! [_svg]:bg-[inherit]! cursor-pointer mr-2', item.class)
|
|
80
|
-
"
|
|
81
|
-
/>
|
|
82
|
-
}
|
|
83
|
-
<span>{{ item.label }}</span>
|
|
84
|
-
</a>
|
|
85
|
-
} @else {
|
|
86
|
-
<button
|
|
87
|
-
hlmMenuItem
|
|
88
|
-
(click)="item.action?.()"
|
|
89
|
-
[class]="hlm('cursor-pointer no-underline', item.class)"
|
|
90
|
-
>
|
|
91
|
-
@if (item.icon) {
|
|
92
|
-
<ng-icon
|
|
93
|
-
[svg]="item.icon"
|
|
94
|
-
size="1rem"
|
|
95
|
-
[class]="
|
|
96
|
-
hlm('[_svg]:text-[inherit]! [_svg]:bg-[inherit]! cursor-pointer mr-2', item.class)
|
|
97
|
-
"
|
|
98
|
-
/>
|
|
99
|
-
}
|
|
100
|
-
<span>{{ item.label }}</span>
|
|
101
|
-
</button>
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
</hlm-menu-group>
|
|
105
|
-
}
|
|
106
|
-
@if (section.separator) {
|
|
107
|
-
<hlm-menu-separator />
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
</hlm-menu>
|
|
111
|
-
</ng-template>
|
|
112
|
-
`, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: BrnMenuTrigger, selector: "[brnMenuTriggerFor]", inputs: ["align"] }, { kind: "component", type: HlmMenu, selector: "hlm-menu", inputs: ["class", "variant"] }, { kind: "directive", type: HlmMenuItem, selector: "[hlmMenuItem]", inputs: ["variant", "inset", "class"] }, { kind: "component", type: HlmMenuLabel, selector: "hlm-menu-label", inputs: ["inset", "class"] }, { kind: "component", type: HlmMenuSeparator, selector: "hlm-menu-separator", inputs: ["class"] }, { kind: "component", type: HlmMenuGroup, selector: "hlm-menu-group" }, { kind: "component", type: HlmButton, selector: "button[hlmButton], a[hlmButton]", inputs: ["variant", "size", "appearance", "loading", "icon", "iconPosition", "class", "spinnerUserClass", "disabled", "type"] }, { kind: "component", type: NgIcon, selector: "ng-icon", inputs: ["name", "svg", "size", "strokeWidth", "color"] }, { kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }] });
|
|
113
|
-
}
|
|
114
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: EgLayoutSimpleUserMenu, decorators: [{
|
|
115
|
-
type: Component,
|
|
116
|
-
args: [{
|
|
117
|
-
selector: 'eg-layout-simple-user-menu',
|
|
118
|
-
imports: [
|
|
119
|
-
CommonModule,
|
|
120
|
-
BrnMenuTrigger,
|
|
121
|
-
HlmMenu,
|
|
122
|
-
HlmMenuItem,
|
|
123
|
-
HlmMenuLabel,
|
|
124
|
-
HlmMenuSeparator,
|
|
125
|
-
HlmMenuGroup,
|
|
126
|
-
HlmButton,
|
|
127
|
-
NgIcon,
|
|
128
|
-
RouterLink,
|
|
129
|
-
],
|
|
130
|
-
providers: [
|
|
131
|
-
provideIcons({
|
|
132
|
-
lucideUser,
|
|
133
|
-
}),
|
|
134
|
-
],
|
|
135
|
-
template: `
|
|
136
|
-
<ng-template #iconTemplate>
|
|
137
|
-
<ng-icon [svg]="lucideUser" size="1.5rem" class="[&_svg]:w-[inherit]! [&_svg]:h-[inherit]!" />
|
|
138
|
-
</ng-template>
|
|
139
|
-
|
|
140
|
-
@let _menuTrigger = menuTrigger();
|
|
141
|
-
|
|
142
|
-
<div class="flex w-full items-center justify-center">
|
|
143
|
-
@if (_menuTrigger) {
|
|
144
|
-
<div [brnMenuTriggerFor]="menu"><ng-container *ngTemplateOutlet="_menuTrigger"></ng-container></div>
|
|
145
|
-
} @else {
|
|
146
|
-
<button
|
|
147
|
-
hlmButton
|
|
148
|
-
variant="primary"
|
|
149
|
-
size="icon"
|
|
150
|
-
align="end"
|
|
151
|
-
[brnMenuTriggerFor]="menu"
|
|
152
|
-
[icon]="iconTemplate"
|
|
153
|
-
class="rounded-full border border-gray-400"
|
|
154
|
-
></button>
|
|
155
|
-
}
|
|
156
|
-
</div>
|
|
157
|
-
|
|
158
|
-
<ng-template #menu>
|
|
159
|
-
<hlm-menu class="w-56">
|
|
160
|
-
@for (section of menus(); track section) {
|
|
161
|
-
@if (section.label) {
|
|
162
|
-
<hlm-menu-label>{{ section.label }}</hlm-menu-label>
|
|
163
|
-
}
|
|
164
|
-
@if (section.items?.length) {
|
|
165
|
-
<hlm-menu-group>
|
|
166
|
-
@for (item of section.items; track item) {
|
|
167
|
-
@if (item.link) {
|
|
168
|
-
<a
|
|
169
|
-
hlmMenuItem
|
|
170
|
-
[routerLink]="item.link"
|
|
171
|
-
[class]="hlm('cursor-pointer no-underline', item.class)"
|
|
172
|
-
>
|
|
173
|
-
@if (item.icon) {
|
|
174
|
-
<ng-icon
|
|
175
|
-
[svg]="item.icon"
|
|
176
|
-
size="1rem"
|
|
177
|
-
[class]="
|
|
178
|
-
hlm('[_svg]:text-[inherit]! [_svg]:bg-[inherit]! cursor-pointer mr-2', item.class)
|
|
179
|
-
"
|
|
180
|
-
/>
|
|
181
|
-
}
|
|
182
|
-
<span>{{ item.label }}</span>
|
|
183
|
-
</a>
|
|
184
|
-
} @else {
|
|
185
|
-
<button
|
|
186
|
-
hlmMenuItem
|
|
187
|
-
(click)="item.action?.()"
|
|
188
|
-
[class]="hlm('cursor-pointer no-underline', item.class)"
|
|
189
|
-
>
|
|
190
|
-
@if (item.icon) {
|
|
191
|
-
<ng-icon
|
|
192
|
-
[svg]="item.icon"
|
|
193
|
-
size="1rem"
|
|
194
|
-
[class]="
|
|
195
|
-
hlm('[_svg]:text-[inherit]! [_svg]:bg-[inherit]! cursor-pointer mr-2', item.class)
|
|
196
|
-
"
|
|
197
|
-
/>
|
|
198
|
-
}
|
|
199
|
-
<span>{{ item.label }}</span>
|
|
200
|
-
</button>
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
</hlm-menu-group>
|
|
204
|
-
}
|
|
205
|
-
@if (section.separator) {
|
|
206
|
-
<hlm-menu-separator />
|
|
207
|
-
}
|
|
208
|
-
}
|
|
209
|
-
</hlm-menu>
|
|
210
|
-
</ng-template>
|
|
211
|
-
`,
|
|
212
|
-
}]
|
|
213
|
-
}] });
|
|
214
|
-
|
|
215
|
-
const transformValueToSearchMap = {};
|
|
216
|
-
class EgGenericAutocomplete {
|
|
217
|
-
defaultOptionTemplate = viewChild('defaultOption', ...(ngDevMode ? [{ debugName: "defaultOptionTemplate" }] : []));
|
|
218
|
-
controlId = input(crypto.randomUUID(), ...(ngDevMode ? [{ debugName: "controlId" }] : []));
|
|
219
|
-
placeholderText = input('Select an option', ...(ngDevMode ? [{ debugName: "placeholderText" }] : []));
|
|
220
|
-
emptyText = input('No options found', ...(ngDevMode ? [{ debugName: "emptyText" }] : []));
|
|
221
|
-
optionTemplate = input(this.defaultOptionTemplate, ...(ngDevMode ? [{ debugName: "optionTemplate" }] : []));
|
|
222
|
-
loaderFn = input(async () => [], ...(ngDevMode ? [{ debugName: "loaderFn" }] : []));
|
|
223
|
-
transformValueToSearch = input((value) => String(value), ...(ngDevMode ? [{ debugName: "transformValueToSearch" }] : []));
|
|
224
|
-
optionChange = output();
|
|
225
|
-
_formBuilder = inject(FormBuilder);
|
|
226
|
-
form = this._formBuilder.group({
|
|
227
|
-
option: [null, Validators.required],
|
|
228
|
-
});
|
|
229
|
-
search = signal('', ...(ngDevMode ? [{ debugName: "search" }] : []));
|
|
230
|
-
options = resource({
|
|
231
|
-
defaultValue: [],
|
|
232
|
-
params: () => ({ search: this.search(), negajjang: '1111' }),
|
|
233
|
-
loader: async ({ params }) => {
|
|
234
|
-
const fn = this.loaderFn();
|
|
235
|
-
if (!fn) {
|
|
236
|
-
return [];
|
|
237
|
-
}
|
|
238
|
-
return fn(params);
|
|
239
|
-
},
|
|
240
|
-
});
|
|
241
|
-
ngOnInit() {
|
|
242
|
-
transformValueToSearchMap[this.controlId()] = this.transformValueToSearch();
|
|
243
|
-
this.form.controls['option'].valueChanges.subscribe((value) => {
|
|
244
|
-
if (value !== null) {
|
|
245
|
-
this.optionChange.emit(value);
|
|
246
|
-
}
|
|
247
|
-
});
|
|
248
|
-
}
|
|
249
|
-
ngOnDestroy() {
|
|
250
|
-
delete transformValueToSearchMap[this.controlId()];
|
|
251
|
-
}
|
|
252
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: EgGenericAutocomplete, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
253
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "20.3.1", type: EgGenericAutocomplete, isStandalone: true, selector: "eg-generic-autocomplete", inputs: { controlId: { classPropertyName: "controlId", publicName: "controlId", isSignal: true, isRequired: false, transformFunction: null }, placeholderText: { classPropertyName: "placeholderText", publicName: "placeholderText", isSignal: true, isRequired: false, transformFunction: null }, emptyText: { classPropertyName: "emptyText", publicName: "emptyText", isSignal: true, isRequired: false, transformFunction: null }, optionTemplate: { classPropertyName: "optionTemplate", publicName: "optionTemplate", isSignal: true, isRequired: false, transformFunction: null }, loaderFn: { classPropertyName: "loaderFn", publicName: "loaderFn", isSignal: true, isRequired: false, transformFunction: null }, transformValueToSearch: { classPropertyName: "transformValueToSearch", publicName: "transformValueToSearch", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { optionChange: "optionChange" }, viewQueries: [{ propertyName: "defaultOptionTemplate", first: true, predicate: ["defaultOption"], descendants: true, isSignal: true }], ngImport: i0, template: `
|
|
254
|
-
<form [formGroup]="form" class="space-y-8">
|
|
255
|
-
<hlm-autocomplete
|
|
256
|
-
[inputId]="controlId()"
|
|
257
|
-
[filteredOptions]="options.value()"
|
|
258
|
-
[optionTemplate]="optionTemplate()"
|
|
259
|
-
[loading]="options.isLoading()"
|
|
260
|
-
[(search)]="search"
|
|
261
|
-
[searchPlaceholderText]="placeholderText()"
|
|
262
|
-
[emptyText]="emptyText()"
|
|
263
|
-
formControlName="option"
|
|
264
|
-
class="bg-white"
|
|
265
|
-
>
|
|
266
|
-
<hlm-spinner loading />
|
|
267
|
-
</hlm-autocomplete>
|
|
268
|
-
</form>
|
|
269
|
-
<ng-template #defaultOption let-option>
|
|
270
|
-
{{ option }}
|
|
271
|
-
</ng-template>
|
|
272
|
-
`, isInline: true, dependencies: [{ kind: "component", type: HlmSpinner, selector: "hlm-spinner", inputs: ["size", "show", "class", "spinnerClass"] }, { kind: "component", type: i1$1.HlmAutocomplete, selector: "hlm-autocomplete", inputs: ["onSelect", "class", "autocompleteListClass", "autocompleteEmptyClass", "filteredOptions", "value", "search", "transformValueToSearch", "optionTemplate", "loading", "searchPlaceholderText", "loadingText", "emptyText", "ariaLabelToggleButton", "inputId", "disabled"], outputs: ["valueChange", "searchChange"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }], viewProviders: [
|
|
273
|
-
provideHlmAutocompleteConfig({
|
|
274
|
-
transformValueToSearch: (params, inputId) => {
|
|
275
|
-
const fn = transformValueToSearchMap[inputId];
|
|
276
|
-
return fn(params);
|
|
277
|
-
},
|
|
278
|
-
}),
|
|
279
|
-
], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
280
|
-
}
|
|
281
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: EgGenericAutocomplete, decorators: [{
|
|
282
|
-
type: Component,
|
|
283
|
-
args: [{
|
|
284
|
-
selector: 'eg-generic-autocomplete',
|
|
285
|
-
imports: [HlmSpinner, HlmAutocompleteImports, ReactiveFormsModule],
|
|
286
|
-
template: `
|
|
287
|
-
<form [formGroup]="form" class="space-y-8">
|
|
288
|
-
<hlm-autocomplete
|
|
289
|
-
[inputId]="controlId()"
|
|
290
|
-
[filteredOptions]="options.value()"
|
|
291
|
-
[optionTemplate]="optionTemplate()"
|
|
292
|
-
[loading]="options.isLoading()"
|
|
293
|
-
[(search)]="search"
|
|
294
|
-
[searchPlaceholderText]="placeholderText()"
|
|
295
|
-
[emptyText]="emptyText()"
|
|
296
|
-
formControlName="option"
|
|
297
|
-
class="bg-white"
|
|
298
|
-
>
|
|
299
|
-
<hlm-spinner loading />
|
|
300
|
-
</hlm-autocomplete>
|
|
301
|
-
</form>
|
|
302
|
-
<ng-template #defaultOption let-option>
|
|
303
|
-
{{ option }}
|
|
304
|
-
</ng-template>
|
|
305
|
-
`,
|
|
306
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
307
|
-
viewProviders: [
|
|
308
|
-
provideHlmAutocompleteConfig({
|
|
309
|
-
transformValueToSearch: (params, inputId) => {
|
|
310
|
-
const fn = transformValueToSearchMap[inputId];
|
|
311
|
-
return fn(params);
|
|
312
|
-
},
|
|
313
|
-
}),
|
|
314
|
-
],
|
|
315
|
-
}]
|
|
316
|
-
}] });
|
|
317
|
-
|
|
318
|
-
class EgLayoutSimpleSidebar {
|
|
319
|
-
viewchildSheetRef = viewChild(BrnSheet, ...(ngDevMode ? [{ debugName: "viewchildSheetRef" }] : []));
|
|
320
|
-
side = input('left', ...(ngDevMode ? [{ debugName: "side" }] : []));
|
|
321
|
-
title = input('', ...(ngDevMode ? [{ debugName: "title" }] : []));
|
|
322
|
-
content = input(...(ngDevMode ? [undefined, { debugName: "content" }] : []));
|
|
323
|
-
contentContext = input(...(ngDevMode ? [undefined, { debugName: "contentContext" }] : []));
|
|
324
|
-
constructor() {
|
|
325
|
-
effect(() => { });
|
|
326
|
-
}
|
|
327
|
-
openSheet() {
|
|
328
|
-
this.viewchildSheetRef()?.open();
|
|
329
|
-
}
|
|
330
|
-
closeSheet() {
|
|
331
|
-
this.viewchildSheetRef()?.close();
|
|
332
|
-
}
|
|
333
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: EgLayoutSimpleSidebar, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
334
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.1", type: EgLayoutSimpleSidebar, isStandalone: true, selector: "eg-layout-simple-sidebar", inputs: { side: { classPropertyName: "side", publicName: "side", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, content: { classPropertyName: "content", publicName: "content", isSignal: true, isRequired: false, transformFunction: null }, contentContext: { classPropertyName: "contentContext", publicName: "contentContext", isSignal: true, isRequired: false, transformFunction: null } }, viewQueries: [{ propertyName: "viewchildSheetRef", first: true, predicate: BrnSheet, descendants: true, isSignal: true }], ngImport: i0, template: `
|
|
335
|
-
@let _title = title();
|
|
336
|
-
@let _content = content();
|
|
337
|
-
|
|
338
|
-
<hlm-sheet [side]="side() ?? 'left'">
|
|
339
|
-
<hlm-sheet-content *brnSheetContent="let ctx" class="gap-0">
|
|
340
|
-
@if (_title) {
|
|
341
|
-
<hlm-sheet-header>
|
|
342
|
-
<h3 hlmSheetTitle>{{ _title }}</h3>
|
|
343
|
-
</hlm-sheet-header>
|
|
344
|
-
}
|
|
345
|
-
|
|
346
|
-
@if (_content) {
|
|
347
|
-
<ng-container *ngTemplateOutlet="_content; context: contentContext()"></ng-container>
|
|
348
|
-
}
|
|
349
|
-
|
|
350
|
-
<hlm-sheet-footer>
|
|
351
|
-
<button brnSheetClose hlmButton variant="secondary" appearance="outline-filled">Close</button>
|
|
352
|
-
</hlm-sheet-footer>
|
|
353
|
-
</hlm-sheet-content>
|
|
354
|
-
</hlm-sheet>
|
|
355
|
-
`, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: RouterModule }, { kind: "directive", type: i2$1.BrnSheetClose, selector: "button[brnSheetClose]" }, { kind: "directive", type: i2$1.BrnSheetContent, selector: "[brnSheetContent]" }, { kind: "component", type: i3.HlmSheet, selector: "hlm-sheet", exportAs: ["hlmSheet"] }, { kind: "component", type: i3.HlmSheetContent, selector: "hlm-sheet-content", inputs: ["class"] }, { kind: "component", type: i3.HlmSheetFooter, selector: "hlm-sheet-footer", inputs: ["class"] }, { kind: "component", type: i3.HlmSheetHeader, selector: "hlm-sheet-header", inputs: ["class"] }, { kind: "directive", type: i3.HlmSheetTitle, selector: "[hlmSheetTitle]", inputs: ["class"] }, { kind: "component", type: i4.HlmButton, selector: "button[hlmButton], a[hlmButton]", inputs: ["variant", "size", "appearance", "loading", "icon", "iconPosition", "class", "spinnerUserClass", "disabled", "type"] }] });
|
|
356
|
-
}
|
|
357
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: EgLayoutSimpleSidebar, decorators: [{
|
|
358
|
-
type: Component,
|
|
359
|
-
args: [{
|
|
360
|
-
selector: 'eg-layout-simple-sidebar',
|
|
361
|
-
standalone: true,
|
|
362
|
-
imports: [CommonModule, RouterModule, BrnSheetImports, HlmSheetImports, HlmButtonImports, HlmLabelImports],
|
|
363
|
-
template: `
|
|
364
|
-
@let _title = title();
|
|
365
|
-
@let _content = content();
|
|
366
|
-
|
|
367
|
-
<hlm-sheet [side]="side() ?? 'left'">
|
|
368
|
-
<hlm-sheet-content *brnSheetContent="let ctx" class="gap-0">
|
|
369
|
-
@if (_title) {
|
|
370
|
-
<hlm-sheet-header>
|
|
371
|
-
<h3 hlmSheetTitle>{{ _title }}</h3>
|
|
372
|
-
</hlm-sheet-header>
|
|
373
|
-
}
|
|
374
|
-
|
|
375
|
-
@if (_content) {
|
|
376
|
-
<ng-container *ngTemplateOutlet="_content; context: contentContext()"></ng-container>
|
|
377
|
-
}
|
|
378
|
-
|
|
379
|
-
<hlm-sheet-footer>
|
|
380
|
-
<button brnSheetClose hlmButton variant="secondary" appearance="outline-filled">Close</button>
|
|
381
|
-
</hlm-sheet-footer>
|
|
382
|
-
</hlm-sheet-content>
|
|
383
|
-
</hlm-sheet>
|
|
384
|
-
`,
|
|
385
|
-
}]
|
|
386
|
-
}], ctorParameters: () => [] });
|
|
387
|
-
|
|
388
|
-
class EgLayoutSimpleMobileMenuGroup {
|
|
389
|
-
hlm = hlm;
|
|
390
|
-
label = input('', ...(ngDevMode ? [{ debugName: "label" }] : []));
|
|
391
|
-
items = input(...(ngDevMode ? [undefined, { debugName: "items" }] : []));
|
|
392
|
-
itemClick = output();
|
|
393
|
-
handleClick(item) {
|
|
394
|
-
item.action?.();
|
|
395
|
-
this.itemClick.emit(item);
|
|
396
|
-
}
|
|
397
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: EgLayoutSimpleMobileMenuGroup, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
398
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.1", type: EgLayoutSimpleMobileMenuGroup, isStandalone: true, selector: "eg-layout-simple-mobile-menu-group", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { itemClick: "itemClick" }, providers: [], ngImport: i0, template: `
|
|
399
|
-
@let _label = label();
|
|
400
|
-
@let _items = items();
|
|
401
|
-
|
|
402
|
-
@if (_items && _items.length > 0) {
|
|
403
|
-
@if (_label) {
|
|
404
|
-
<hlm-menu-label>{{ _label }}</hlm-menu-label>
|
|
405
|
-
}
|
|
406
|
-
<hlm-menu-group>
|
|
407
|
-
@for (item of _items; track item.label) {
|
|
408
|
-
@if (item.link) {
|
|
409
|
-
<a
|
|
410
|
-
hlmMenuItem
|
|
411
|
-
[routerLink]="item.link"
|
|
412
|
-
[class]="hlm('cursor-pointer no-underline')"
|
|
413
|
-
(click)="handleClick(item)"
|
|
414
|
-
>
|
|
415
|
-
@if (item.icon) {
|
|
416
|
-
<ng-icon
|
|
417
|
-
[svg]="item.icon"
|
|
418
|
-
size="1rem"
|
|
419
|
-
[class]="hlm('[_svg]:text-[inherit]! [_svg]:bg-[inherit]! cursor-pointer mr-2')"
|
|
420
|
-
>
|
|
421
|
-
</ng-icon>
|
|
422
|
-
}
|
|
423
|
-
<span>{{ item.label }}</span>
|
|
424
|
-
</a>
|
|
425
|
-
} @else {
|
|
426
|
-
<button hlmMenuItem (click)="handleClick(item)" [class]="hlm('cursor-pointer no-underline')">
|
|
427
|
-
@if (item.icon) {
|
|
428
|
-
<ng-icon
|
|
429
|
-
[svg]="item.icon"
|
|
430
|
-
size="1rem"
|
|
431
|
-
[class]="hlm('[_svg]:text-[inherit]! [_svg]:bg-[inherit]! cursor-pointer mr-2')"
|
|
432
|
-
>
|
|
433
|
-
</ng-icon>
|
|
434
|
-
}
|
|
435
|
-
<span>{{ item.label }}</span>
|
|
436
|
-
</button>
|
|
437
|
-
}
|
|
438
|
-
}
|
|
439
|
-
</hlm-menu-group>
|
|
440
|
-
}
|
|
441
|
-
`, isInline: true, dependencies: [{ kind: "directive", type: HlmMenuItem, selector: "[hlmMenuItem]", inputs: ["variant", "inset", "class"] }, { kind: "component", type: HlmMenuLabel, selector: "hlm-menu-label", inputs: ["inset", "class"] }, { kind: "component", type: HlmMenuGroup, selector: "hlm-menu-group" }, { kind: "component", type: NgIcon, selector: "ng-icon", inputs: ["name", "svg", "size", "strokeWidth", "color"] }, { kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }] });
|
|
442
|
-
}
|
|
443
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: EgLayoutSimpleMobileMenuGroup, decorators: [{
|
|
444
|
-
type: Component,
|
|
445
|
-
args: [{
|
|
446
|
-
selector: 'eg-layout-simple-mobile-menu-group',
|
|
447
|
-
imports: [HlmMenuItem, HlmMenuLabel, HlmMenuGroup, NgIcon, RouterLink],
|
|
448
|
-
providers: [],
|
|
449
|
-
template: `
|
|
450
|
-
@let _label = label();
|
|
451
|
-
@let _items = items();
|
|
452
|
-
|
|
453
|
-
@if (_items && _items.length > 0) {
|
|
454
|
-
@if (_label) {
|
|
455
|
-
<hlm-menu-label>{{ _label }}</hlm-menu-label>
|
|
456
|
-
}
|
|
457
|
-
<hlm-menu-group>
|
|
458
|
-
@for (item of _items; track item.label) {
|
|
459
|
-
@if (item.link) {
|
|
460
|
-
<a
|
|
461
|
-
hlmMenuItem
|
|
462
|
-
[routerLink]="item.link"
|
|
463
|
-
[class]="hlm('cursor-pointer no-underline')"
|
|
464
|
-
(click)="handleClick(item)"
|
|
465
|
-
>
|
|
466
|
-
@if (item.icon) {
|
|
467
|
-
<ng-icon
|
|
468
|
-
[svg]="item.icon"
|
|
469
|
-
size="1rem"
|
|
470
|
-
[class]="hlm('[_svg]:text-[inherit]! [_svg]:bg-[inherit]! cursor-pointer mr-2')"
|
|
471
|
-
>
|
|
472
|
-
</ng-icon>
|
|
473
|
-
}
|
|
474
|
-
<span>{{ item.label }}</span>
|
|
475
|
-
</a>
|
|
476
|
-
} @else {
|
|
477
|
-
<button hlmMenuItem (click)="handleClick(item)" [class]="hlm('cursor-pointer no-underline')">
|
|
478
|
-
@if (item.icon) {
|
|
479
|
-
<ng-icon
|
|
480
|
-
[svg]="item.icon"
|
|
481
|
-
size="1rem"
|
|
482
|
-
[class]="hlm('[_svg]:text-[inherit]! [_svg]:bg-[inherit]! cursor-pointer mr-2')"
|
|
483
|
-
>
|
|
484
|
-
</ng-icon>
|
|
485
|
-
}
|
|
486
|
-
<span>{{ item.label }}</span>
|
|
487
|
-
</button>
|
|
488
|
-
}
|
|
489
|
-
}
|
|
490
|
-
</hlm-menu-group>
|
|
491
|
-
}
|
|
492
|
-
`,
|
|
493
|
-
}]
|
|
494
|
-
}] });
|
|
495
|
-
|
|
496
|
-
const commonLinkGroupClasses = 'hidden md:flex space-x-4 items-center';
|
|
497
|
-
const commonLinkClasses = 'text-left text-secondary visited:text-secondary hover:text-primary cursor-pointer no-underline';
|
|
498
|
-
class EgLayoutSimple {
|
|
499
|
-
breakpointObserver;
|
|
500
|
-
hlm = hlm;
|
|
501
|
-
menuIcon = lucideMenu;
|
|
502
|
-
sidebarEnabled = input(false, ...(ngDevMode ? [{ debugName: "sidebarEnabled" }] : []));
|
|
503
|
-
sidebarTitle = input('Menu', ...(ngDevMode ? [{ debugName: "sidebarTitle" }] : []));
|
|
504
|
-
sidebarContent = input(...(ngDevMode ? [undefined, { debugName: "sidebarContent" }] : []));
|
|
505
|
-
userMenuTrigger = input(...(ngDevMode ? [undefined, { debugName: "userMenuTrigger" }] : []));
|
|
506
|
-
/** Menu data inputs */
|
|
507
|
-
leftMenus = input([], ...(ngDevMode ? [{ debugName: "leftMenus" }] : []));
|
|
508
|
-
rightMenus = input([], ...(ngDevMode ? [{ debugName: "rightMenus" }] : []));
|
|
509
|
-
userMenus = input([], ...(ngDevMode ? [{ debugName: "userMenus" }] : []));
|
|
510
|
-
logo = input('assets/logo.png', ...(ngDevMode ? [{ debugName: "logo" }] : []));
|
|
511
|
-
logoLink = input('/', ...(ngDevMode ? [{ debugName: "logoLink" }] : []));
|
|
512
|
-
logoClass = input('', ...(ngDevMode ? [{ debugName: "logoClass", alias: 'logoClass' }] : [{ alias: 'logoClass' }]));
|
|
513
|
-
headerClass = input('', ...(ngDevMode ? [{ debugName: "headerClass", alias: 'headerClass' }] : [{ alias: 'headerClass' }]));
|
|
514
|
-
contentClass = input('', ...(ngDevMode ? [{ debugName: "contentClass", alias: 'contentClass' }] : [{ alias: 'contentClass' }]));
|
|
515
|
-
contentBottomClass = input('', ...(ngDevMode ? [{ debugName: "contentBottomClass", alias: 'contentBottomClass' }] : [{ alias: 'contentBottomClass' }]));
|
|
516
|
-
/** Container class inputs */
|
|
517
|
-
leftMenuClass = input('', ...(ngDevMode ? [{ debugName: "leftMenuClass", alias: 'leftClass' }] : [{ alias: 'leftClass' }]));
|
|
518
|
-
rightMenuClass = input('', ...(ngDevMode ? [{ debugName: "rightMenuClass", alias: 'rightClass' }] : [{ alias: 'rightClass' }]));
|
|
519
|
-
/** Link/button base class inputs */
|
|
520
|
-
leftLinkClass = input('', ...(ngDevMode ? [{ debugName: "leftLinkClass", alias: 'leftLinkClass' }] : [{ alias: 'leftLinkClass' }]));
|
|
521
|
-
rightLinkClass = input('', ...(ngDevMode ? [{ debugName: "rightLinkClass", alias: 'rightLinkClass' }] : [{ alias: 'rightLinkClass' }]));
|
|
522
|
-
searchEnabled = input(false, ...(ngDevMode ? [{ debugName: "searchEnabled" }] : []));
|
|
523
|
-
loading = input(false, ...(ngDevMode ? [{ debugName: "loading" }] : []));
|
|
524
|
-
searchPlaceholderText = input('Select an page', ...(ngDevMode ? [{ debugName: "searchPlaceholderText" }] : []));
|
|
525
|
-
searchEmptyText = input('No pages found', ...(ngDevMode ? [{ debugName: "searchEmptyText" }] : []));
|
|
526
|
-
searchOptionTemplate = input(...(ngDevMode ? [undefined, { debugName: "searchOptionTemplate" }] : []));
|
|
527
|
-
searchLoaderFn = input(...(ngDevMode ? [undefined, { debugName: "searchLoaderFn" }] : []));
|
|
528
|
-
searchTransformValueToSearch = input(...(ngDevMode ? [undefined, { debugName: "searchTransformValueToSearch" }] : []));
|
|
529
|
-
searchOptionChange = output();
|
|
530
|
-
_logoClass = computed(() => hlm('h-10', this.logoClass()), ...(ngDevMode ? [{ debugName: "_logoClass" }] : []));
|
|
531
|
-
_headerClass = computed(() => hlm('px-4 py-2 flex items-center justify-between bg-gray-100 border-b border-gray-300', this.headerClass()), ...(ngDevMode ? [{ debugName: "_headerClass" }] : []));
|
|
532
|
-
_contentClass = computed(() => hlm('p-4 flex flex-col flex-1', this.contentClass()), ...(ngDevMode ? [{ debugName: "_contentClass" }] : []));
|
|
533
|
-
_contentBottomClass = computed(() => hlm('flex-1', this.contentBottomClass()), ...(ngDevMode ? [{ debugName: "_contentBottomClass" }] : []));
|
|
534
|
-
/** Computed merged classes for containers */
|
|
535
|
-
_computedLeftClass = computed(() => hlm(commonLinkGroupClasses, this.leftMenuClass()), ...(ngDevMode ? [{ debugName: "_computedLeftClass" }] : []));
|
|
536
|
-
_computedRightClass = computed(() => hlm(commonLinkGroupClasses, this.rightMenuClass()), ...(ngDevMode ? [{ debugName: "_computedRightClass" }] : []));
|
|
537
|
-
/** Computed merged classes for link/button elements */
|
|
538
|
-
_computedLeftLinkClass = computed(() => hlm(commonLinkClasses, this.leftLinkClass()), ...(ngDevMode ? [{ debugName: "_computedLeftLinkClass" }] : []));
|
|
539
|
-
_computedRightLinkClass = computed(() => hlm(commonLinkClasses, this.rightLinkClass()), ...(ngDevMode ? [{ debugName: "_computedRightLinkClass" }] : []));
|
|
540
|
-
mobileMenuItemClass = commonLinkClasses;
|
|
541
|
-
footerEnabled = input(false, ...(ngDevMode ? [{ debugName: "footerEnabled" }] : []));
|
|
542
|
-
footerMenus = input([], ...(ngDevMode ? [{ debugName: "footerMenus" }] : []));
|
|
543
|
-
footerMenuClass = input('', ...(ngDevMode ? [{ debugName: "footerMenuClass", alias: 'footerMenuClass' }] : [{ alias: 'footerMenuClass' }]));
|
|
544
|
-
footerLinkClass = input('', ...(ngDevMode ? [{ debugName: "footerLinkClass", alias: 'footerLinkClass' }] : [{ alias: 'footerLinkClass' }]));
|
|
545
|
-
footerContent = input('© 2024 My Company', ...(ngDevMode ? [{ debugName: "footerContent" }] : []));
|
|
546
|
-
footerClass = input('', ...(ngDevMode ? [{ debugName: "footerClass", alias: 'footerClass' }] : [{ alias: 'footerClass' }]));
|
|
547
|
-
_footerClass = computed(() => hlm('px-4 py-4 bg-gray-100 border-t border-gray-300 text-sm text-gray-600', this.footerClass()), ...(ngDevMode ? [{ debugName: "_footerClass" }] : []));
|
|
548
|
-
_computedFooterMenuClass = computed(() => hlm('flex flex-wrap justify-center space-x-4', this.footerMenuClass()), ...(ngDevMode ? [{ debugName: "_computedFooterMenuClass" }] : []));
|
|
549
|
-
_computedFooterLinkClass = computed(() => hlm('text-secondary hover:text-primary cursor-pointer no-underline', this.footerLinkClass()), ...(ngDevMode ? [{ debugName: "_computedFooterLinkClass" }] : []));
|
|
550
|
-
/** Mobile menu state */
|
|
551
|
-
mobileMenuOpen = false;
|
|
552
|
-
isMobile = signal(false, ...(ngDevMode ? [{ debugName: "isMobile" }] : []));
|
|
553
|
-
constructor(breakpointObserver) {
|
|
554
|
-
this.breakpointObserver = breakpointObserver;
|
|
555
|
-
this.breakpointObserver.observe([Breakpoints.Handset]).subscribe((result) => {
|
|
556
|
-
this.isMobile.set(result.matches);
|
|
557
|
-
});
|
|
558
|
-
}
|
|
559
|
-
toggleMobileMenu() {
|
|
560
|
-
this.mobileMenuOpen = !this.mobileMenuOpen;
|
|
561
|
-
}
|
|
562
|
-
onSearchOptionChange(value) {
|
|
563
|
-
this.searchOptionChange.emit(value);
|
|
564
|
-
}
|
|
565
|
-
viewchildSheetRef = viewChild(EgLayoutSimpleSidebar, ...(ngDevMode ? [{ debugName: "viewchildSheetRef" }] : []));
|
|
566
|
-
openSidebar() {
|
|
567
|
-
this.viewchildSheetRef()?.openSheet();
|
|
568
|
-
}
|
|
569
|
-
closeSidebar() {
|
|
570
|
-
this.viewchildSheetRef()?.closeSheet();
|
|
571
|
-
}
|
|
572
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: EgLayoutSimple, deps: [{ token: i1$2.BreakpointObserver }], target: i0.ɵɵFactoryTarget.Component });
|
|
573
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.1", type: EgLayoutSimple, isStandalone: true, selector: "eg-layout-simple", inputs: { sidebarEnabled: { classPropertyName: "sidebarEnabled", publicName: "sidebarEnabled", isSignal: true, isRequired: false, transformFunction: null }, sidebarTitle: { classPropertyName: "sidebarTitle", publicName: "sidebarTitle", isSignal: true, isRequired: false, transformFunction: null }, sidebarContent: { classPropertyName: "sidebarContent", publicName: "sidebarContent", isSignal: true, isRequired: false, transformFunction: null }, userMenuTrigger: { classPropertyName: "userMenuTrigger", publicName: "userMenuTrigger", isSignal: true, isRequired: false, transformFunction: null }, leftMenus: { classPropertyName: "leftMenus", publicName: "leftMenus", isSignal: true, isRequired: false, transformFunction: null }, rightMenus: { classPropertyName: "rightMenus", publicName: "rightMenus", isSignal: true, isRequired: false, transformFunction: null }, userMenus: { classPropertyName: "userMenus", publicName: "userMenus", isSignal: true, isRequired: false, transformFunction: null }, logo: { classPropertyName: "logo", publicName: "logo", isSignal: true, isRequired: false, transformFunction: null }, logoLink: { classPropertyName: "logoLink", publicName: "logoLink", isSignal: true, isRequired: false, transformFunction: null }, logoClass: { classPropertyName: "logoClass", publicName: "logoClass", isSignal: true, isRequired: false, transformFunction: null }, headerClass: { classPropertyName: "headerClass", publicName: "headerClass", isSignal: true, isRequired: false, transformFunction: null }, contentClass: { classPropertyName: "contentClass", publicName: "contentClass", isSignal: true, isRequired: false, transformFunction: null }, contentBottomClass: { classPropertyName: "contentBottomClass", publicName: "contentBottomClass", isSignal: true, isRequired: false, transformFunction: null }, leftMenuClass: { classPropertyName: "leftMenuClass", publicName: "leftClass", isSignal: true, isRequired: false, transformFunction: null }, rightMenuClass: { classPropertyName: "rightMenuClass", publicName: "rightClass", isSignal: true, isRequired: false, transformFunction: null }, leftLinkClass: { classPropertyName: "leftLinkClass", publicName: "leftLinkClass", isSignal: true, isRequired: false, transformFunction: null }, rightLinkClass: { classPropertyName: "rightLinkClass", publicName: "rightLinkClass", isSignal: true, isRequired: false, transformFunction: null }, searchEnabled: { classPropertyName: "searchEnabled", publicName: "searchEnabled", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, searchPlaceholderText: { classPropertyName: "searchPlaceholderText", publicName: "searchPlaceholderText", isSignal: true, isRequired: false, transformFunction: null }, searchEmptyText: { classPropertyName: "searchEmptyText", publicName: "searchEmptyText", isSignal: true, isRequired: false, transformFunction: null }, searchOptionTemplate: { classPropertyName: "searchOptionTemplate", publicName: "searchOptionTemplate", isSignal: true, isRequired: false, transformFunction: null }, searchLoaderFn: { classPropertyName: "searchLoaderFn", publicName: "searchLoaderFn", isSignal: true, isRequired: false, transformFunction: null }, searchTransformValueToSearch: { classPropertyName: "searchTransformValueToSearch", publicName: "searchTransformValueToSearch", isSignal: true, isRequired: false, transformFunction: null }, footerEnabled: { classPropertyName: "footerEnabled", publicName: "footerEnabled", isSignal: true, isRequired: false, transformFunction: null }, footerMenus: { classPropertyName: "footerMenus", publicName: "footerMenus", isSignal: true, isRequired: false, transformFunction: null }, footerMenuClass: { classPropertyName: "footerMenuClass", publicName: "footerMenuClass", isSignal: true, isRequired: false, transformFunction: null }, footerLinkClass: { classPropertyName: "footerLinkClass", publicName: "footerLinkClass", isSignal: true, isRequired: false, transformFunction: null }, footerContent: { classPropertyName: "footerContent", publicName: "footerContent", isSignal: true, isRequired: false, transformFunction: null }, footerClass: { classPropertyName: "footerClass", publicName: "footerClass", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { searchOptionChange: "searchOptionChange" }, providers: [
|
|
574
|
-
provideIcons({
|
|
575
|
-
lucideMenu,
|
|
576
|
-
}),
|
|
577
|
-
], viewQueries: [{ propertyName: "viewchildSheetRef", first: true, predicate: EgLayoutSimpleSidebar, descendants: true, isSignal: true }], ngImport: i0, template: "<ng-template #menuIconTemplate>\n <ng-icon [svg]=\"menuIcon\" size=\"20px\" class=\"[&_svg]:w-[inherit]! [&_svg]:h-[inherit]!\" />\n</ng-template>\n\n<eg-layout-simple-sidebar\n [title]=\"sidebarTitle()\"\n [content]=\"sidebarContent()\"\n [contentContext]=\"{ close: closeSidebar.bind(this) }\"\n/>\n\n<div class=\"flex flex-col min-h-screen\">\n <!-- Header -->\n <header [class]=\"_headerClass()\">\n <div class=\"flex items-center space-x-4\">\n @if (sidebarEnabled()) {\n <button\n hlmButton\n variant=\"secondary\"\n appearance=\"outline\"\n size=\"icon\"\n [icon]=\"menuIconTemplate\"\n iconPosition=\"left\"\n class=\"bg-transparent! border-gray-400! hover:border-gray-500!\"\n (click)=\"openSidebar()\"\n ></button>\n }\n\n <div class=\"logo\">\n <a [routerLink]=\"logoLink()\">\n <img [src]=\"logo()\" alt=\"Logo\" [class]=\"_logoClass()\" />\n </a>\n </div>\n <!-- Left menus (desktop) -->\n <nav [class]=\"_computedLeftClass()\">\n @for (item of leftMenus(); track item.label) {\n @if (item.link) {\n <a [routerLink]=\"item.link\" [class]=\"hlm(_computedLeftLinkClass(), item.class || '')\"> {{ item.label }} </a>\n } @else {\n <button type=\"button\" (click)=\"item.action?.()\" [class]=\"hlm(_computedLeftLinkClass(), item.class || '')\">\n {{ item.label }}\n </button>\n }\n }\n </nav>\n </div>\n\n <!-- Right menus (desktop) -->\n <nav [class]=\"_computedRightClass()\">\n @if (searchEnabled()) {\n <eg-generic-autocomplete\n [optionTemplate]=\"searchOptionTemplate()\"\n [loaderFn]=\"searchLoaderFn()\"\n [transformValueToSearch]=\"searchTransformValueToSearch()\"\n [placeholderText]=\"searchPlaceholderText()\"\n [emptyText]=\"searchEmptyText()\"\n (optionChange)=\"onSearchOptionChange($event)\"\n ></eg-generic-autocomplete>\n }\n\n @for (item of rightMenus(); track item.label) {\n @if (item.link) {\n <a [routerLink]=\"item.link\" [class]=\"hlm(_computedRightLinkClass(), item.class || '')\"> {{ item.label }} </a>\n } @else {\n <button type=\"button\" (click)=\"item.action?.()\" [class]=\"hlm(_computedRightLinkClass(), item.class || '')\">\n {{ item.label }}\n </button>\n }\n }\n\n @let uMenus = userMenus();\n @if (uMenus && uMenus.length > 0) {\n <eg-layout-simple-user-menu [menus]=\"uMenus\" [menuTrigger]=\"userMenuTrigger()\" />\n }\n </nav>\n\n <!-- Mobile menu button -->\n <button\n (click)=\"toggleMobileMenu()\"\n class=\"md:hidden p-2 text-gray-700 hover:text-primary focus:outline-none cursor-pointer\"\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n class=\"h-6 w-6\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n >\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M4 6h16M4 12h16M4 18h16\" />\n </svg>\n </button>\n </header>\n\n @let _topMenus = leftMenus().concat(rightMenus());\n @let _userMenus = userMenus();\n\n <!-- Mobile menu -->\n @if (isMobile() && mobileMenuOpen) {\n <hlm-menu class=\"w-full border-none\">\n <eg-layout-simple-mobile-menu-group [items]=\"_topMenus\" (itemClick)=\"toggleMobileMenu()\" />\n\n @if (_topMenus.length > 0 && _userMenus.length > 0) {\n <hr class=\"border-gray-300 my-2\" />\n }\n\n @for (section of userMenus(); track section.label) {\n <eg-layout-simple-mobile-menu-group\n [items]=\"section.items\"\n [label]=\"section.label\"\n (itemClick)=\"toggleMobileMenu()\"\n ></eg-layout-simple-mobile-menu-group>\n\n @if (section.separator) {\n <hr class=\"border-gray-300 my-2\" />\n }\n }\n </hlm-menu>\n }\n\n <!-- Main content -->\n <main [class]=\"_contentClass()\">\n @if (!loading()) {\n <div class=\"flex items-center justify-center h-full\">\n <ng-content />\n </div>\n }\n <div [class]=\"_contentBottomClass()\"></div>\n </main>\n\n @if (footerEnabled()) {\n <footer [class]=\"_footerClass()\">\n <nav [class]=\"_computedFooterMenuClass()\">\n @for (item of footerMenus(); track item.label) {\n @if (item.link) {\n <a [routerLink]=\"item.link\" [class]=\"hlm(_computedFooterLinkClass(), item.class || '')\">\n {{ item.label }}\n </a>\n } @else {\n <button type=\"button\" (click)=\"item.action?.()\" [class]=\"hlm(_computedFooterLinkClass(), item.class || '')\">\n {{ item.label }}\n </button>\n }\n }\n </nav>\n\n <div class=\"mt-2 text-center\">\n {{ footerContent() }}\n </div>\n </footer>\n }\n</div>\n", dependencies: [{ kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "component", type: EgLayoutSimpleUserMenu, selector: "eg-layout-simple-user-menu", inputs: ["menus", "menuTrigger"] }, { kind: "component", type: EgLayoutSimpleSidebar, selector: "eg-layout-simple-sidebar", inputs: ["side", "title", "content", "contentContext"] }, { kind: "component", type: EgLayoutSimpleMobileMenuGroup, selector: "eg-layout-simple-mobile-menu-group", inputs: ["label", "items"], outputs: ["itemClick"] }, { kind: "component", type: EgGenericAutocomplete, selector: "eg-generic-autocomplete", inputs: ["controlId", "placeholderText", "emptyText", "optionTemplate", "loaderFn", "transformValueToSearch"], outputs: ["optionChange"] }, { kind: "component", type: HlmButton, selector: "button[hlmButton], a[hlmButton]", inputs: ["variant", "size", "appearance", "loading", "icon", "iconPosition", "class", "spinnerUserClass", "disabled", "type"] }, { kind: "component", type: HlmMenu, selector: "hlm-menu", inputs: ["class", "variant"] }, { kind: "component", type: NgIcon, selector: "ng-icon", inputs: ["name", "svg", "size", "strokeWidth", "color"] }] });
|
|
578
|
-
}
|
|
579
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: EgLayoutSimple, decorators: [{
|
|
580
|
-
type: Component,
|
|
581
|
-
args: [{ selector: 'eg-layout-simple', standalone: true, imports: [
|
|
582
|
-
RouterLink,
|
|
583
|
-
EgLayoutSimpleUserMenu,
|
|
584
|
-
EgLayoutSimpleSidebar,
|
|
585
|
-
EgLayoutSimpleMobileMenuGroup,
|
|
586
|
-
EgGenericAutocomplete,
|
|
587
|
-
HlmButton,
|
|
588
|
-
HlmMenu,
|
|
589
|
-
NgIcon,
|
|
590
|
-
], providers: [
|
|
591
|
-
provideIcons({
|
|
592
|
-
lucideMenu,
|
|
593
|
-
}),
|
|
594
|
-
], template: "<ng-template #menuIconTemplate>\n <ng-icon [svg]=\"menuIcon\" size=\"20px\" class=\"[&_svg]:w-[inherit]! [&_svg]:h-[inherit]!\" />\n</ng-template>\n\n<eg-layout-simple-sidebar\n [title]=\"sidebarTitle()\"\n [content]=\"sidebarContent()\"\n [contentContext]=\"{ close: closeSidebar.bind(this) }\"\n/>\n\n<div class=\"flex flex-col min-h-screen\">\n <!-- Header -->\n <header [class]=\"_headerClass()\">\n <div class=\"flex items-center space-x-4\">\n @if (sidebarEnabled()) {\n <button\n hlmButton\n variant=\"secondary\"\n appearance=\"outline\"\n size=\"icon\"\n [icon]=\"menuIconTemplate\"\n iconPosition=\"left\"\n class=\"bg-transparent! border-gray-400! hover:border-gray-500!\"\n (click)=\"openSidebar()\"\n ></button>\n }\n\n <div class=\"logo\">\n <a [routerLink]=\"logoLink()\">\n <img [src]=\"logo()\" alt=\"Logo\" [class]=\"_logoClass()\" />\n </a>\n </div>\n <!-- Left menus (desktop) -->\n <nav [class]=\"_computedLeftClass()\">\n @for (item of leftMenus(); track item.label) {\n @if (item.link) {\n <a [routerLink]=\"item.link\" [class]=\"hlm(_computedLeftLinkClass(), item.class || '')\"> {{ item.label }} </a>\n } @else {\n <button type=\"button\" (click)=\"item.action?.()\" [class]=\"hlm(_computedLeftLinkClass(), item.class || '')\">\n {{ item.label }}\n </button>\n }\n }\n </nav>\n </div>\n\n <!-- Right menus (desktop) -->\n <nav [class]=\"_computedRightClass()\">\n @if (searchEnabled()) {\n <eg-generic-autocomplete\n [optionTemplate]=\"searchOptionTemplate()\"\n [loaderFn]=\"searchLoaderFn()\"\n [transformValueToSearch]=\"searchTransformValueToSearch()\"\n [placeholderText]=\"searchPlaceholderText()\"\n [emptyText]=\"searchEmptyText()\"\n (optionChange)=\"onSearchOptionChange($event)\"\n ></eg-generic-autocomplete>\n }\n\n @for (item of rightMenus(); track item.label) {\n @if (item.link) {\n <a [routerLink]=\"item.link\" [class]=\"hlm(_computedRightLinkClass(), item.class || '')\"> {{ item.label }} </a>\n } @else {\n <button type=\"button\" (click)=\"item.action?.()\" [class]=\"hlm(_computedRightLinkClass(), item.class || '')\">\n {{ item.label }}\n </button>\n }\n }\n\n @let uMenus = userMenus();\n @if (uMenus && uMenus.length > 0) {\n <eg-layout-simple-user-menu [menus]=\"uMenus\" [menuTrigger]=\"userMenuTrigger()\" />\n }\n </nav>\n\n <!-- Mobile menu button -->\n <button\n (click)=\"toggleMobileMenu()\"\n class=\"md:hidden p-2 text-gray-700 hover:text-primary focus:outline-none cursor-pointer\"\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n class=\"h-6 w-6\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n >\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M4 6h16M4 12h16M4 18h16\" />\n </svg>\n </button>\n </header>\n\n @let _topMenus = leftMenus().concat(rightMenus());\n @let _userMenus = userMenus();\n\n <!-- Mobile menu -->\n @if (isMobile() && mobileMenuOpen) {\n <hlm-menu class=\"w-full border-none\">\n <eg-layout-simple-mobile-menu-group [items]=\"_topMenus\" (itemClick)=\"toggleMobileMenu()\" />\n\n @if (_topMenus.length > 0 && _userMenus.length > 0) {\n <hr class=\"border-gray-300 my-2\" />\n }\n\n @for (section of userMenus(); track section.label) {\n <eg-layout-simple-mobile-menu-group\n [items]=\"section.items\"\n [label]=\"section.label\"\n (itemClick)=\"toggleMobileMenu()\"\n ></eg-layout-simple-mobile-menu-group>\n\n @if (section.separator) {\n <hr class=\"border-gray-300 my-2\" />\n }\n }\n </hlm-menu>\n }\n\n <!-- Main content -->\n <main [class]=\"_contentClass()\">\n @if (!loading()) {\n <div class=\"flex items-center justify-center h-full\">\n <ng-content />\n </div>\n }\n <div [class]=\"_contentBottomClass()\"></div>\n </main>\n\n @if (footerEnabled()) {\n <footer [class]=\"_footerClass()\">\n <nav [class]=\"_computedFooterMenuClass()\">\n @for (item of footerMenus(); track item.label) {\n @if (item.link) {\n <a [routerLink]=\"item.link\" [class]=\"hlm(_computedFooterLinkClass(), item.class || '')\">\n {{ item.label }}\n </a>\n } @else {\n <button type=\"button\" (click)=\"item.action?.()\" [class]=\"hlm(_computedFooterLinkClass(), item.class || '')\">\n {{ item.label }}\n </button>\n }\n }\n </nav>\n\n <div class=\"mt-2 text-center\">\n {{ footerContent() }}\n </div>\n </footer>\n }\n</div>\n" }]
|
|
595
|
-
}], ctorParameters: () => [{ type: i1$2.BreakpointObserver }] });
|
|
596
|
-
|
|
597
|
-
/*
|
|
598
|
-
* Public API Surface of layout-simple
|
|
599
|
-
*/
|
|
600
|
-
|
|
601
|
-
/**
|
|
602
|
-
* Generated bundle index. Do not edit.
|
|
603
|
-
*/
|
|
604
|
-
|
|
605
|
-
export { EgGenericAutocomplete, EgLayoutSimple, EgLayoutSimpleUserMenu };
|
|
606
|
-
//# sourceMappingURL=layout-simple.mjs.map
|