@area8975/ui 0.2.2-dev.48 → 0.2.2-dev.50
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/README.md +3 -2
- package/fesm2022/area8975-ui-alert.mjs +113 -0
- package/fesm2022/area8975-ui-alert.mjs.map +1 -0
- package/fesm2022/area8975-ui-avatar.mjs +157 -0
- package/fesm2022/area8975-ui-avatar.mjs.map +1 -0
- package/fesm2022/area8975-ui-badge.mjs +116 -0
- package/fesm2022/area8975-ui-badge.mjs.map +1 -0
- package/fesm2022/area8975-ui-button.mjs +314 -0
- package/fesm2022/area8975-ui-button.mjs.map +1 -0
- package/fesm2022/area8975-ui-calendar.mjs +549 -0
- package/fesm2022/area8975-ui-calendar.mjs.map +1 -0
- package/fesm2022/area8975-ui-card-header.mjs +96 -0
- package/fesm2022/area8975-ui-card-header.mjs.map +1 -0
- package/fesm2022/area8975-ui-card.mjs +73 -0
- package/fesm2022/area8975-ui-card.mjs.map +1 -0
- package/fesm2022/area8975-ui-chart-palette.mjs +225 -0
- package/fesm2022/area8975-ui-chart-palette.mjs.map +1 -0
- package/fesm2022/area8975-ui-charts.mjs +2813 -0
- package/fesm2022/area8975-ui-charts.mjs.map +1 -0
- package/fesm2022/area8975-ui-checkbox.mjs +202 -0
- package/fesm2022/area8975-ui-checkbox.mjs.map +1 -0
- package/fesm2022/area8975-ui-colour.mjs +200 -0
- package/fesm2022/area8975-ui-colour.mjs.map +1 -0
- package/fesm2022/area8975-ui-container.mjs +40 -0
- package/fesm2022/area8975-ui-container.mjs.map +1 -0
- package/fesm2022/area8975-ui-counter.mjs +246 -0
- package/fesm2022/area8975-ui-counter.mjs.map +1 -0
- package/fesm2022/area8975-ui-date-range-picker.mjs +554 -0
- package/fesm2022/area8975-ui-date-range-picker.mjs.map +1 -0
- package/fesm2022/area8975-ui-datepicker.mjs +547 -0
- package/fesm2022/area8975-ui-datepicker.mjs.map +1 -0
- package/fesm2022/area8975-ui-disclosure.mjs +279 -0
- package/fesm2022/area8975-ui-disclosure.mjs.map +1 -0
- package/fesm2022/area8975-ui-drawer.mjs +106 -0
- package/fesm2022/area8975-ui-drawer.mjs.map +1 -0
- package/fesm2022/area8975-ui-dropdown-button.mjs +141 -0
- package/fesm2022/area8975-ui-dropdown-button.mjs.map +1 -0
- package/fesm2022/area8975-ui-dropdown-menu.mjs +96 -0
- package/fesm2022/area8975-ui-dropdown-menu.mjs.map +1 -0
- package/fesm2022/area8975-ui-dropdown.mjs +208 -0
- package/fesm2022/area8975-ui-dropdown.mjs.map +1 -0
- package/fesm2022/area8975-ui-dropzone.mjs +332 -0
- package/fesm2022/area8975-ui-dropzone.mjs.map +1 -0
- package/fesm2022/area8975-ui-field.mjs +191 -0
- package/fesm2022/area8975-ui-field.mjs.map +1 -0
- package/fesm2022/area8975-ui-file-input.mjs +340 -0
- package/fesm2022/area8975-ui-file-input.mjs.map +1 -0
- package/fesm2022/area8975-ui-file.mjs +47 -0
- package/fesm2022/area8975-ui-file.mjs.map +1 -0
- package/fesm2022/area8975-ui-format.mjs +70 -0
- package/fesm2022/area8975-ui-format.mjs.map +1 -0
- package/fesm2022/area8975-ui-input-addon.mjs +42 -0
- package/fesm2022/area8975-ui-input-addon.mjs.map +1 -0
- package/fesm2022/area8975-ui-input-group.mjs +86 -0
- package/fesm2022/area8975-ui-input-group.mjs.map +1 -0
- package/fesm2022/area8975-ui-input.mjs +682 -0
- package/fesm2022/area8975-ui-input.mjs.map +1 -0
- package/fesm2022/area8975-ui-kpi.mjs +167 -0
- package/fesm2022/area8975-ui-kpi.mjs.map +1 -0
- package/fesm2022/area8975-ui-layout.mjs +63 -0
- package/fesm2022/area8975-ui-layout.mjs.map +1 -0
- package/fesm2022/area8975-ui-loading.mjs +76 -0
- package/fesm2022/area8975-ui-loading.mjs.map +1 -0
- package/fesm2022/area8975-ui-modal-close-btn.mjs +89 -0
- package/fesm2022/area8975-ui-modal-close-btn.mjs.map +1 -0
- package/fesm2022/area8975-ui-modal.mjs +235 -0
- package/fesm2022/area8975-ui-modal.mjs.map +1 -0
- package/fesm2022/area8975-ui-money.mjs +230 -0
- package/fesm2022/area8975-ui-money.mjs.map +1 -0
- package/fesm2022/area8975-ui-overlay.mjs +317 -0
- package/fesm2022/area8975-ui-overlay.mjs.map +1 -0
- package/fesm2022/area8975-ui-pagination.mjs +152 -0
- package/fesm2022/area8975-ui-pagination.mjs.map +1 -0
- package/fesm2022/area8975-ui-private.mjs +63 -0
- package/fesm2022/area8975-ui-private.mjs.map +1 -0
- package/fesm2022/area8975-ui-progress.mjs +307 -0
- package/fesm2022/area8975-ui-progress.mjs.map +1 -0
- package/fesm2022/area8975-ui-radio.mjs +199 -0
- package/fesm2022/area8975-ui-radio.mjs.map +1 -0
- package/fesm2022/area8975-ui-rich-text-editor.mjs +778 -0
- package/fesm2022/area8975-ui-rich-text-editor.mjs.map +1 -0
- package/fesm2022/area8975-ui-search.mjs +266 -0
- package/fesm2022/area8975-ui-search.mjs.map +1 -0
- package/fesm2022/area8975-ui-segmented.mjs +118 -0
- package/fesm2022/area8975-ui-segmented.mjs.map +1 -0
- package/fesm2022/area8975-ui-select.mjs +926 -0
- package/fesm2022/area8975-ui-select.mjs.map +1 -0
- package/fesm2022/area8975-ui-sidebar-group.mjs +60 -0
- package/fesm2022/area8975-ui-sidebar-group.mjs.map +1 -0
- package/fesm2022/area8975-ui-sidebar-item.mjs +107 -0
- package/fesm2022/area8975-ui-sidebar-item.mjs.map +1 -0
- package/fesm2022/area8975-ui-sidebar.mjs +109 -0
- package/fesm2022/area8975-ui-sidebar.mjs.map +1 -0
- package/fesm2022/area8975-ui-skeleton.mjs +116 -0
- package/fesm2022/area8975-ui-skeleton.mjs.map +1 -0
- package/fesm2022/area8975-ui-stat.mjs +55 -0
- package/fesm2022/area8975-ui-stat.mjs.map +1 -0
- package/fesm2022/area8975-ui-switch.mjs +132 -0
- package/fesm2022/area8975-ui-switch.mjs.map +1 -0
- package/fesm2022/area8975-ui-tab.mjs +217 -0
- package/fesm2022/area8975-ui-tab.mjs.map +1 -0
- package/fesm2022/area8975-ui-table-filters.mjs +499 -0
- package/fesm2022/area8975-ui-table-filters.mjs.map +1 -0
- package/fesm2022/area8975-ui-table.mjs +1237 -0
- package/fesm2022/area8975-ui-table.mjs.map +1 -0
- package/fesm2022/area8975-ui-textarea.mjs +375 -0
- package/fesm2022/area8975-ui-textarea.mjs.map +1 -0
- package/fesm2022/area8975-ui-theme.mjs +246 -0
- package/fesm2022/area8975-ui-theme.mjs.map +1 -0
- package/fesm2022/area8975-ui-time-select.mjs +170 -0
- package/fesm2022/area8975-ui-time-select.mjs.map +1 -0
- package/fesm2022/area8975-ui-toast.mjs +269 -0
- package/fesm2022/area8975-ui-toast.mjs.map +1 -0
- package/fesm2022/area8975-ui-toaster.mjs +117 -0
- package/fesm2022/area8975-ui-toaster.mjs.map +1 -0
- package/fesm2022/area8975-ui-tooltip.mjs +196 -0
- package/fesm2022/area8975-ui-tooltip.mjs.map +1 -0
- package/fesm2022/area8975-ui-user-menu.mjs +186 -0
- package/fesm2022/area8975-ui-user-menu.mjs.map +1 -0
- package/fesm2022/area8975-ui.mjs +0 -16269
- package/package.json +237 -1
- package/types/area8975-ui-alert.d.ts +25 -0
- package/types/area8975-ui-avatar.d.ts +40 -0
- package/types/area8975-ui-badge.d.ts +31 -0
- package/types/area8975-ui-button.d.ts +129 -0
- package/types/area8975-ui-calendar.d.ts +177 -0
- package/types/area8975-ui-card-header.d.ts +28 -0
- package/types/area8975-ui-card.d.ts +18 -0
- package/types/area8975-ui-chart-palette.d.ts +176 -0
- package/types/area8975-ui-charts.d.ts +747 -0
- package/types/area8975-ui-checkbox.d.ts +61 -0
- package/types/area8975-ui-colour.d.ts +31 -0
- package/types/area8975-ui-container.d.ts +5 -0
- package/types/area8975-ui-counter.d.ts +43 -0
- package/types/area8975-ui-date-range-picker.d.ts +132 -0
- package/types/area8975-ui-datepicker.d.ts +124 -0
- package/types/area8975-ui-disclosure.d.ts +79 -0
- package/types/area8975-ui-drawer.d.ts +25 -0
- package/types/area8975-ui-dropdown-button.d.ts +32 -0
- package/types/area8975-ui-dropdown-menu.d.ts +25 -0
- package/types/area8975-ui-dropdown.d.ts +56 -0
- package/types/area8975-ui-dropzone.d.ts +96 -0
- package/types/area8975-ui-field.d.ts +72 -0
- package/types/area8975-ui-file-input.d.ts +72 -0
- package/types/area8975-ui-file.d.ts +21 -0
- package/types/area8975-ui-format.d.ts +37 -0
- package/types/area8975-ui-input-addon.d.ts +10 -0
- package/types/area8975-ui-input-group.d.ts +18 -0
- package/types/area8975-ui-input.d.ts +224 -0
- package/types/area8975-ui-kpi.d.ts +36 -0
- package/types/area8975-ui-layout.d.ts +7 -0
- package/types/area8975-ui-loading.d.ts +16 -0
- package/types/area8975-ui-modal-close-btn.d.ts +14 -0
- package/types/area8975-ui-modal.d.ts +45 -0
- package/types/area8975-ui-money.d.ts +77 -0
- package/types/area8975-ui-overlay.d.ts +75 -0
- package/types/area8975-ui-pagination.d.ts +27 -0
- package/types/area8975-ui-private.d.ts +20 -0
- package/types/area8975-ui-progress.d.ts +127 -0
- package/types/area8975-ui-radio.d.ts +61 -0
- package/types/area8975-ui-rich-text-editor.d.ts +165 -0
- package/types/area8975-ui-search.d.ts +56 -0
- package/types/area8975-ui-segmented.d.ts +41 -0
- package/types/area8975-ui-select.d.ts +293 -0
- package/types/area8975-ui-sidebar-group.d.ts +15 -0
- package/types/area8975-ui-sidebar-item.d.ts +20 -0
- package/types/area8975-ui-sidebar.d.ts +16 -0
- package/types/area8975-ui-skeleton.d.ts +35 -0
- package/types/area8975-ui-stat.d.ts +13 -0
- package/types/area8975-ui-switch.d.ts +32 -0
- package/types/area8975-ui-tab.d.ts +45 -0
- package/types/area8975-ui-table-filters.d.ts +138 -0
- package/types/area8975-ui-table.d.ts +371 -0
- package/types/area8975-ui-textarea.d.ts +126 -0
- package/types/area8975-ui-theme.d.ts +61 -0
- package/types/area8975-ui-time-select.d.ts +35 -0
- package/types/area8975-ui-toast.d.ts +78 -0
- package/types/area8975-ui-toaster.d.ts +23 -0
- package/types/area8975-ui-tooltip.d.ts +47 -0
- package/types/area8975-ui-user-menu.d.ts +39 -0
- package/types/area8975-ui.d.ts +1 -4464
- package/fesm2022/area8975-ui.mjs.map +0 -1
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
import { NgTemplateOutlet } from "@angular/common";
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
import { Component, computed, inject, input } from "@angular/core";
|
|
4
|
+
import { UiAvatarComponent } from "@area8975/ui/avatar";
|
|
5
|
+
import { UiCardComponent } from "@area8975/ui/card";
|
|
6
|
+
import { UiDropdownComponent } from "@area8975/ui/dropdown";
|
|
7
|
+
import { NgIcon } from "@ng-icons/core";
|
|
8
|
+
var UiUserMenuComponent = class UiUserMenuComponent {
|
|
9
|
+
dropdown = inject(UiDropdownComponent, { optional: true });
|
|
10
|
+
name = input.required(...ngDevMode ? [{ debugName: "name" }] : /* istanbul ignore next */ []);
|
|
11
|
+
detail = input("", ...ngDevMode ? [{ debugName: "detail" }] : /* istanbul ignore next */ []);
|
|
12
|
+
src = input(null, ...ngDevMode ? [{ debugName: "src" }] : /* istanbul ignore next */ []);
|
|
13
|
+
items = input([], ...ngDevMode ? [{ debugName: "items" }] : /* istanbul ignore next */ []);
|
|
14
|
+
menuItems = computed(() => this.items().map((item) => {
|
|
15
|
+
if ("divider" in item) return item;
|
|
16
|
+
if ("children" in item) return {
|
|
17
|
+
...item,
|
|
18
|
+
children: item.children.map((child) => this.closing(child))
|
|
19
|
+
};
|
|
20
|
+
return this.closing(item);
|
|
21
|
+
}), ...ngDevMode ? [{ debugName: "menuItems" }] : /* istanbul ignore next */ []);
|
|
22
|
+
isDivider(item) {
|
|
23
|
+
return "divider" in item;
|
|
24
|
+
}
|
|
25
|
+
group(item) {
|
|
26
|
+
return "children" in item ? item : null;
|
|
27
|
+
}
|
|
28
|
+
button(item) {
|
|
29
|
+
return "onClick" in item ? item : null;
|
|
30
|
+
}
|
|
31
|
+
closing(item) {
|
|
32
|
+
return {
|
|
33
|
+
...item,
|
|
34
|
+
onClick: () => {
|
|
35
|
+
this.dropdown?.close();
|
|
36
|
+
item.onClick();
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
41
|
+
minVersion: "12.0.0",
|
|
42
|
+
version: "22.2.1",
|
|
43
|
+
ngImport: i0,
|
|
44
|
+
type: UiUserMenuComponent,
|
|
45
|
+
deps: [],
|
|
46
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
47
|
+
});
|
|
48
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
49
|
+
minVersion: "17.0.0",
|
|
50
|
+
version: "22.2.1",
|
|
51
|
+
type: UiUserMenuComponent,
|
|
52
|
+
isStandalone: true,
|
|
53
|
+
selector: "ui-user-menu",
|
|
54
|
+
inputs: {
|
|
55
|
+
name: {
|
|
56
|
+
classPropertyName: "name",
|
|
57
|
+
publicName: "name",
|
|
58
|
+
isSignal: true,
|
|
59
|
+
isRequired: true,
|
|
60
|
+
transformFunction: null
|
|
61
|
+
},
|
|
62
|
+
detail: {
|
|
63
|
+
classPropertyName: "detail",
|
|
64
|
+
publicName: "detail",
|
|
65
|
+
isSignal: true,
|
|
66
|
+
isRequired: false,
|
|
67
|
+
transformFunction: null
|
|
68
|
+
},
|
|
69
|
+
src: {
|
|
70
|
+
classPropertyName: "src",
|
|
71
|
+
publicName: "src",
|
|
72
|
+
isSignal: true,
|
|
73
|
+
isRequired: false,
|
|
74
|
+
transformFunction: null
|
|
75
|
+
},
|
|
76
|
+
items: {
|
|
77
|
+
classPropertyName: "items",
|
|
78
|
+
publicName: "items",
|
|
79
|
+
isSignal: true,
|
|
80
|
+
isRequired: false,
|
|
81
|
+
transformFunction: null
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
ngImport: i0,
|
|
85
|
+
template: "<ui-card radius=\"xl\" class=\"ui-user-menu\">\n <div class=\"ui-user-menu-person\">\n <ui-avatar [name]=\"name()\" [src]=\"src()\" size=\"lg\" />\n\n <div class=\"ui-user-menu-text\">\n <span class=\"ui-text-body ui-user-menu-name\">{{ name() }}</span>\n @if (detail()) {\n <span class=\"ui-text-body-alt ui-user-menu-detail\">{{\n detail()\n }}</span>\n }\n </div>\n </div>\n\n <ng-content />\n\n @if (menuItems().length) {\n <div class=\"ui-user-menu-items\">\n @for (item of menuItems(); track $index) {\n @if (isDivider(item)) {\n <div class=\"ui-user-menu-divider\" role=\"separator\"></div>\n } @else if (group(item); as category) {\n <span\n class=\"ui-user-menu-group ui-text-caption ui-user-menu-heading\"\n >{{ category.label }}</span>\n @for (child of category.children; track child.label) {\n <ng-container\n *ngTemplateOutlet=\"entryTemplate; context: { $implicit: child }\"\n />\n }\n } @else if (button(item); as entry) {\n <ng-container\n *ngTemplateOutlet=\"entryTemplate; context: { $implicit: entry }\"\n />\n }\n }\n </div>\n }\n</ui-card>\n\n<ng-template #entryTemplate let-entry>\n <button\n type=\"button\"\n class=\"ui-text-body-alt ui-user-menu-item\"\n (click)=\"entry.onClick()\"\n >\n @if (entry.icon) {\n <ng-icon\n [name]=\"entry.icon\"\n size=\"18\"\n strokeWidth=\"1.75\"\n class=\"shrink-0\"\n />\n }\n {{ entry.label }}\n </button>\n</ng-template>\n",
|
|
86
|
+
styles: ["@layer properties;.ui-user-menu{display:block;width:calc(var(--spacing, .25rem) * 72);overflow:hidden;--tw-shadow: 0 10px 15px -3px var(--tw-shadow-color, rgb(0 0 0 / .1)), 0 4px 6px -4px var(--tw-shadow-color, rgb(0 0 0 / .1));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ui-user-menu-person{display:flex;align-items:center;column-gap:calc(var(--spacing, .25rem) * 3);padding:calc(var(--spacing, .25rem) * 4)}.ui-user-menu-text{display:flex;min-width:0px;flex-direction:column;row-gap:calc(var(--spacing, .25rem) * .5)}.ui-user-menu-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;--tw-font-weight: var(--font-weight-medium, 500);font-weight:var(--font-weight-medium, 500);color:var(--foreground)}.ui-user-menu-detail{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--muted-foreground-1)}::ng-deep .ui-user-menu-section{display:flex;flex-direction:column;row-gap:calc(var(--spacing, .25rem) * 2);border-top-style:var(--tw-border-style);border-top-width:1px;border-color:var(--card-line);padding-inline:calc(var(--spacing, .25rem) * 4);padding-top:calc(var(--spacing, .25rem) * 3);padding-bottom:calc(var(--spacing, .25rem) * 4)}::ng-deep .ui-user-menu-heading{--tw-font-weight: var(--font-weight-medium, 500);font-weight:var(--font-weight-medium, 500);color:var(--muted-foreground-1)}.ui-user-menu-items{display:flex;flex-direction:column;row-gap:calc(var(--spacing, .25rem) * .5);border-top-style:var(--tw-border-style);border-top-width:1px;border-color:var(--card-line);padding:calc(var(--spacing, .25rem) * 2)}.ui-user-menu-group{padding-inline:calc(var(--spacing, .25rem) * 3);padding-top:calc(var(--spacing, .25rem) * 2);padding-bottom:var(--spacing, .25rem)}.ui-user-menu-item{display:flex;height:calc(var(--spacing, .25rem) * 10);cursor:pointer;align-items:center;column-gap:calc(var(--spacing, .25rem) * 3);border-radius:var(--radius-lg, .5rem);padding-inline:calc(var(--spacing, .25rem) * 3);text-align:start;color:var(--dropdown-item-foreground);transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease, var(--default-transition-timing-function, cubic-bezier(.4, 0, .2, 1)));transition-duration:var(--tw-duration, var(--default-transition-duration, .15s));--tw-duration: .15s;transition-duration:.15s}.ui-user-menu-item:hover{background-color:var(--dropdown-item-hover)}.ui-user-menu-item:focus-visible{background-color:var(--dropdown-item-focus)}.ui-user-menu-item:focus-visible{--tw-outline-style: none;outline-style:none}.ui-user-menu-divider{margin-inline:var(--spacing, .25rem);margin-block:calc(var(--spacing, .25rem) * 1.5);border-top-style:var(--tw-border-style);border-top-width:1px;border-color:var(--card-line)}@property --tw-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@property --tw-shadow-color{syntax: \"*\"; inherits: false;}@property --tw-shadow-alpha{syntax: \"<percentage>\"; inherits: false; initial-value: 100%;}@property --tw-inset-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@property --tw-inset-shadow-color{syntax: \"*\"; inherits: false;}@property --tw-inset-shadow-alpha{syntax: \"<percentage>\"; inherits: false; initial-value: 100%;}@property --tw-ring-color{syntax: \"*\"; inherits: false;}@property --tw-ring-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@property --tw-inset-ring-color{syntax: \"*\"; inherits: false;}@property --tw-inset-ring-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@property --tw-ring-inset{syntax: \"*\"; inherits: false;}@property --tw-ring-offset-width{syntax: \"<length>\"; inherits: false; initial-value: 0px;}@property --tw-ring-offset-color{syntax: \"*\"; inherits: false; initial-value: #fff;}@property --tw-ring-offset-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@property --tw-font-weight{syntax: \"*\"; inherits: false;}@property --tw-border-style{syntax: \"*\"; inherits: false; initial-value: solid;}@property --tw-duration{syntax: \"*\"; inherits: false;}@layer properties{@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-shadow: 0 0 #0000;--tw-shadow-color: initial;--tw-shadow-alpha: 100%;--tw-inset-shadow: 0 0 #0000;--tw-inset-shadow-color: initial;--tw-inset-shadow-alpha: 100%;--tw-ring-color: initial;--tw-ring-shadow: 0 0 #0000;--tw-inset-ring-color: initial;--tw-inset-ring-shadow: 0 0 #0000;--tw-ring-inset: initial;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-offset-shadow: 0 0 #0000;--tw-font-weight: initial;--tw-border-style: solid;--tw-duration: initial}}}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"],
|
|
87
|
+
dependencies: [
|
|
88
|
+
{
|
|
89
|
+
kind: "directive",
|
|
90
|
+
type: NgTemplateOutlet,
|
|
91
|
+
selector: "[ngTemplateOutlet]",
|
|
92
|
+
inputs: [
|
|
93
|
+
"ngTemplateOutletContext",
|
|
94
|
+
"ngTemplateOutlet",
|
|
95
|
+
"ngTemplateOutletInjector"
|
|
96
|
+
]
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
kind: "component",
|
|
100
|
+
type: UiCardComponent,
|
|
101
|
+
selector: "ui-card",
|
|
102
|
+
inputs: ["radius"]
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
kind: "component",
|
|
106
|
+
type: UiAvatarComponent,
|
|
107
|
+
selector: "ui-avatar",
|
|
108
|
+
inputs: [
|
|
109
|
+
"name",
|
|
110
|
+
"src",
|
|
111
|
+
"size",
|
|
112
|
+
"colour"
|
|
113
|
+
]
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
kind: "component",
|
|
117
|
+
type: NgIcon,
|
|
118
|
+
selector: "ng-icon",
|
|
119
|
+
inputs: [
|
|
120
|
+
"name",
|
|
121
|
+
"svg",
|
|
122
|
+
"size",
|
|
123
|
+
"strokeWidth",
|
|
124
|
+
"color"
|
|
125
|
+
]
|
|
126
|
+
}
|
|
127
|
+
]
|
|
128
|
+
});
|
|
129
|
+
};
|
|
130
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
131
|
+
minVersion: "12.0.0",
|
|
132
|
+
version: "22.2.1",
|
|
133
|
+
ngImport: i0,
|
|
134
|
+
type: UiUserMenuComponent,
|
|
135
|
+
decorators: [{
|
|
136
|
+
type: Component,
|
|
137
|
+
args: [{
|
|
138
|
+
selector: "ui-user-menu",
|
|
139
|
+
imports: [
|
|
140
|
+
NgTemplateOutlet,
|
|
141
|
+
UiCardComponent,
|
|
142
|
+
UiAvatarComponent,
|
|
143
|
+
NgIcon
|
|
144
|
+
],
|
|
145
|
+
template: "<ui-card radius=\"xl\" class=\"ui-user-menu\">\n <div class=\"ui-user-menu-person\">\n <ui-avatar [name]=\"name()\" [src]=\"src()\" size=\"lg\" />\n\n <div class=\"ui-user-menu-text\">\n <span class=\"ui-text-body ui-user-menu-name\">{{ name() }}</span>\n @if (detail()) {\n <span class=\"ui-text-body-alt ui-user-menu-detail\">{{\n detail()\n }}</span>\n }\n </div>\n </div>\n\n <ng-content />\n\n @if (menuItems().length) {\n <div class=\"ui-user-menu-items\">\n @for (item of menuItems(); track $index) {\n @if (isDivider(item)) {\n <div class=\"ui-user-menu-divider\" role=\"separator\"></div>\n } @else if (group(item); as category) {\n <span\n class=\"ui-user-menu-group ui-text-caption ui-user-menu-heading\"\n >{{ category.label }}</span>\n @for (child of category.children; track child.label) {\n <ng-container\n *ngTemplateOutlet=\"entryTemplate; context: { $implicit: child }\"\n />\n }\n } @else if (button(item); as entry) {\n <ng-container\n *ngTemplateOutlet=\"entryTemplate; context: { $implicit: entry }\"\n />\n }\n }\n </div>\n }\n</ui-card>\n\n<ng-template #entryTemplate let-entry>\n <button\n type=\"button\"\n class=\"ui-text-body-alt ui-user-menu-item\"\n (click)=\"entry.onClick()\"\n >\n @if (entry.icon) {\n <ng-icon\n [name]=\"entry.icon\"\n size=\"18\"\n strokeWidth=\"1.75\"\n class=\"shrink-0\"\n />\n }\n {{ entry.label }}\n </button>\n</ng-template>\n",
|
|
146
|
+
styles: ["@layer properties;.ui-user-menu{display:block;width:calc(var(--spacing, .25rem) * 72);overflow:hidden;--tw-shadow: 0 10px 15px -3px var(--tw-shadow-color, rgb(0 0 0 / .1)), 0 4px 6px -4px var(--tw-shadow-color, rgb(0 0 0 / .1));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ui-user-menu-person{display:flex;align-items:center;column-gap:calc(var(--spacing, .25rem) * 3);padding:calc(var(--spacing, .25rem) * 4)}.ui-user-menu-text{display:flex;min-width:0px;flex-direction:column;row-gap:calc(var(--spacing, .25rem) * .5)}.ui-user-menu-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;--tw-font-weight: var(--font-weight-medium, 500);font-weight:var(--font-weight-medium, 500);color:var(--foreground)}.ui-user-menu-detail{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--muted-foreground-1)}::ng-deep .ui-user-menu-section{display:flex;flex-direction:column;row-gap:calc(var(--spacing, .25rem) * 2);border-top-style:var(--tw-border-style);border-top-width:1px;border-color:var(--card-line);padding-inline:calc(var(--spacing, .25rem) * 4);padding-top:calc(var(--spacing, .25rem) * 3);padding-bottom:calc(var(--spacing, .25rem) * 4)}::ng-deep .ui-user-menu-heading{--tw-font-weight: var(--font-weight-medium, 500);font-weight:var(--font-weight-medium, 500);color:var(--muted-foreground-1)}.ui-user-menu-items{display:flex;flex-direction:column;row-gap:calc(var(--spacing, .25rem) * .5);border-top-style:var(--tw-border-style);border-top-width:1px;border-color:var(--card-line);padding:calc(var(--spacing, .25rem) * 2)}.ui-user-menu-group{padding-inline:calc(var(--spacing, .25rem) * 3);padding-top:calc(var(--spacing, .25rem) * 2);padding-bottom:var(--spacing, .25rem)}.ui-user-menu-item{display:flex;height:calc(var(--spacing, .25rem) * 10);cursor:pointer;align-items:center;column-gap:calc(var(--spacing, .25rem) * 3);border-radius:var(--radius-lg, .5rem);padding-inline:calc(var(--spacing, .25rem) * 3);text-align:start;color:var(--dropdown-item-foreground);transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease, var(--default-transition-timing-function, cubic-bezier(.4, 0, .2, 1)));transition-duration:var(--tw-duration, var(--default-transition-duration, .15s));--tw-duration: .15s;transition-duration:.15s}.ui-user-menu-item:hover{background-color:var(--dropdown-item-hover)}.ui-user-menu-item:focus-visible{background-color:var(--dropdown-item-focus)}.ui-user-menu-item:focus-visible{--tw-outline-style: none;outline-style:none}.ui-user-menu-divider{margin-inline:var(--spacing, .25rem);margin-block:calc(var(--spacing, .25rem) * 1.5);border-top-style:var(--tw-border-style);border-top-width:1px;border-color:var(--card-line)}@property --tw-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@property --tw-shadow-color{syntax: \"*\"; inherits: false;}@property --tw-shadow-alpha{syntax: \"<percentage>\"; inherits: false; initial-value: 100%;}@property --tw-inset-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@property --tw-inset-shadow-color{syntax: \"*\"; inherits: false;}@property --tw-inset-shadow-alpha{syntax: \"<percentage>\"; inherits: false; initial-value: 100%;}@property --tw-ring-color{syntax: \"*\"; inherits: false;}@property --tw-ring-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@property --tw-inset-ring-color{syntax: \"*\"; inherits: false;}@property --tw-inset-ring-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@property --tw-ring-inset{syntax: \"*\"; inherits: false;}@property --tw-ring-offset-width{syntax: \"<length>\"; inherits: false; initial-value: 0px;}@property --tw-ring-offset-color{syntax: \"*\"; inherits: false; initial-value: #fff;}@property --tw-ring-offset-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@property --tw-font-weight{syntax: \"*\"; inherits: false;}@property --tw-border-style{syntax: \"*\"; inherits: false; initial-value: solid;}@property --tw-duration{syntax: \"*\"; inherits: false;}@layer properties{@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-shadow: 0 0 #0000;--tw-shadow-color: initial;--tw-shadow-alpha: 100%;--tw-inset-shadow: 0 0 #0000;--tw-inset-shadow-color: initial;--tw-inset-shadow-alpha: 100%;--tw-ring-color: initial;--tw-ring-shadow: 0 0 #0000;--tw-inset-ring-color: initial;--tw-inset-ring-shadow: 0 0 #0000;--tw-ring-inset: initial;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-offset-shadow: 0 0 #0000;--tw-font-weight: initial;--tw-border-style: solid;--tw-duration: initial}}}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"]
|
|
147
|
+
}]
|
|
148
|
+
}],
|
|
149
|
+
propDecorators: {
|
|
150
|
+
name: [{
|
|
151
|
+
type: i0.Input,
|
|
152
|
+
args: [{
|
|
153
|
+
isSignal: true,
|
|
154
|
+
alias: "name",
|
|
155
|
+
required: true
|
|
156
|
+
}]
|
|
157
|
+
}],
|
|
158
|
+
detail: [{
|
|
159
|
+
type: i0.Input,
|
|
160
|
+
args: [{
|
|
161
|
+
isSignal: true,
|
|
162
|
+
alias: "detail",
|
|
163
|
+
required: false
|
|
164
|
+
}]
|
|
165
|
+
}],
|
|
166
|
+
src: [{
|
|
167
|
+
type: i0.Input,
|
|
168
|
+
args: [{
|
|
169
|
+
isSignal: true,
|
|
170
|
+
alias: "src",
|
|
171
|
+
required: false
|
|
172
|
+
}]
|
|
173
|
+
}],
|
|
174
|
+
items: [{
|
|
175
|
+
type: i0.Input,
|
|
176
|
+
args: [{
|
|
177
|
+
isSignal: true,
|
|
178
|
+
alias: "items",
|
|
179
|
+
required: false
|
|
180
|
+
}]
|
|
181
|
+
}]
|
|
182
|
+
}
|
|
183
|
+
});
|
|
184
|
+
export { UiUserMenuComponent };
|
|
185
|
+
|
|
186
|
+
//# sourceMappingURL=area8975-ui-user-menu.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"area8975-ui-user-menu.mjs","names":[],"sources":["../../../projects/ui/user-menu/user-menu.component.ts","../../../projects/ui/user-menu/user-menu.component.html"],"sourcesContent":["import { NgTemplateOutlet } from '@angular/common';\nimport { Component, computed, inject, input } from '@angular/core';\n\nimport { UiAvatarComponent } from '@area8975/ui/avatar';\nimport { UiCardComponent } from '@area8975/ui/card';\nimport { UiDropdownComponent } from '@area8975/ui/dropdown';\nimport type {\n DropdownMenuButton,\n DropdownMenuCategory,\n DropdownMenuItem\n} from '@area8975/ui/dropdown-menu';\nimport { NgIcon } from '@ng-icons/core';\n\n\n/** Give the dropdown it sits in `closeBehaviour=\"whenClickOutside\"`. */\n@Component({\n selector: 'ui-user-menu',\n templateUrl: './user-menu.component.html',\n styleUrl: './user-menu.component.css',\n imports: [\n NgTemplateOutlet,\n UiCardComponent,\n UiAvatarComponent,\n NgIcon\n ]\n})\nexport class UiUserMenuComponent {\n private readonly dropdown = inject(UiDropdownComponent, { optional: true });\n\n readonly name = input.required<string>();\n\n /** A second line under the name, e.g. an email address. */\n readonly detail = input<string>('');\n readonly src = input<string | null>(null);\n\n readonly items = input<DropdownMenuItem[]>([]);\n\n protected readonly menuItems = computed<DropdownMenuItem[]>(() =>\n this.items().map(item => {\n if ('divider' in item) {\n return item;\n }\n\n if ('children' in item) {\n return {\n ...item,\n children: item.children.map(child => this.closing(child))\n };\n }\n\n return this.closing(item);\n })\n );\n\n protected isDivider(item: DropdownMenuItem): boolean {\n return 'divider' in item;\n }\n\n protected group(item: DropdownMenuItem): DropdownMenuCategory | null {\n return 'children' in item ? item : null;\n }\n\n protected button(item: DropdownMenuItem): DropdownMenuButton | null {\n return 'onClick' in item ? item : null;\n }\n\n private closing(item: DropdownMenuButton): DropdownMenuButton {\n return {\n ...item,\n onClick: () => {\n this.dropdown?.close();\n item.onClick();\n }\n };\n }\n}\n","<ui-card radius=\"xl\" class=\"ui-user-menu\">\n <div class=\"ui-user-menu-person\">\n <ui-avatar [name]=\"name()\" [src]=\"src()\" size=\"lg\" />\n\n <div class=\"ui-user-menu-text\">\n <span class=\"ui-text-body ui-user-menu-name\">{{ name() }}</span>\n @if (detail()) {\n <span class=\"ui-text-body-alt ui-user-menu-detail\">{{\n detail()\n }}</span>\n }\n </div>\n </div>\n\n <ng-content />\n\n @if (menuItems().length) {\n <div class=\"ui-user-menu-items\">\n @for (item of menuItems(); track $index) {\n @if (isDivider(item)) {\n <div class=\"ui-user-menu-divider\" role=\"separator\"></div>\n } @else if (group(item); as category) {\n <span\n class=\"ui-user-menu-group ui-text-caption ui-user-menu-heading\"\n >{{ category.label }}</span>\n @for (child of category.children; track child.label) {\n <ng-container\n *ngTemplateOutlet=\"entryTemplate; context: { $implicit: child }\"\n />\n }\n } @else if (button(item); as entry) {\n <ng-container\n *ngTemplateOutlet=\"entryTemplate; context: { $implicit: entry }\"\n />\n }\n }\n </div>\n }\n</ui-card>\n\n<ng-template #entryTemplate let-entry>\n <button\n type=\"button\"\n class=\"ui-text-body-alt ui-user-menu-item\"\n (click)=\"entry.onClick()\"\n >\n @if (entry.icon) {\n <ng-icon\n [name]=\"entry.icon\"\n size=\"18\"\n strokeWidth=\"1.75\"\n class=\"shrink-0\"\n />\n }\n {{ entry.label }}\n </button>\n</ng-template>\n"],"mappings":";;;;;;;AA0BA,IAAa,sBAAb,MAAa,oBAAmB;CACX,WAAW,OAAO,qBAAqB,EAAE,UAAU,KAAI,CAAE;CAEjE,OAAO,MAAM,SAAkB,GAAA,YAAA,CAAA,EAAA,WAAA,OAAA,CAAA,+BAAA,CAAA,CAAA;CAG/B,SAAS,MAAc,IAAG,GAAA,YAAA,CAAA,EAAA,WAAA,SAAA,CAAA,+BAAA,CAAA,CAAA;CAC1B,MAAM,MAAqB,MAAK,GAAA,YAAA,CAAA,EAAA,WAAA,MAAA,CAAA,+BAAA,CAAA,CAAA;CAEhC,QAAQ,MAA0B,CAAA,GAAG,GAAA,YAAA,CAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;CAE3B,YAAY,eAC3B,KAAK,MAAK,CAAE,CAAC,KAAI,SAAO;EACpB,IAAI,aAAa,MACb,OAAO;EAGX,IAAI,cAAc,MACd,OAAO;GACH,GAAG;GACH,UAAU,KAAK,SAAS,KAAI,UAAS,KAAK,QAAQ,KAAK,CAAC;EAC3D;EAGL,OAAO,KAAK,QAAQ,IAAI;CAC5B,CAAC,GACJ,GAAA,YAAA,CAAA,EAAA,WAAA,YAAA,CAAA,+BAAA,CAAA,CAAA;CAES,UAAU,MAAsB;EACtC,OAAO,aAAa;CACxB;CAEU,MAAM,MAAsB;EAClC,OAAO,cAAc,OAAO,OAAO;CACvC;CAEU,OAAO,MAAsB;EACnC,OAAO,aAAa,OAAO,OAAO;CACtC;CAEQ,QAAQ,MAAwB;EACpC,OAAO;GACH,GAAG;GACH,eAAc;IACV,KAAK,UAAU,MAAK;IACpB,KAAK,QAAO;GAChB;EACH;CACL;CAhDS,OAAA,OAAA,GAAA,mBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,UAAA;EAAA,MAAA;EAAmB,MAAA,CAAA;EAAA,QAAA,GAAA,gBAAA;CAAA,CAAA;CAAnB,OAAA,OAAA,GAAA,qBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,MAAA;EAAmB,cAAA;EAAA,UAAA;EAAA,QAAA;GAAA,MAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;GAAA,QAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;GAAA,KAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;GAAA,OAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;EAAA;EAAA,UAAA;EAAA,UC1BhC;EAyDA,QAAA,CAAA,g0JAAA;EAAA,cAAA;GAAA;IAAA,MAAA;IAAA,MDrCQ;IAAgB,UAAA;IAAA,QAAA;KAAA;KAAA;KAAA;IAAA;GAAA;GAAA;IAAA,MAAA;IAAA,MAChB;IAAe,UAAA;IAAA,QAAA,CAAA,QAAA;GAAA;GAAA;IAAA,MAAA;IAAA,MACf;IAAiB,UAAA;IAAA,QAAA;KAAA;KAAA;KAAA;KAAA;IAAA;GAAA;GAAA;IAAA,MAAA;IAAA,MACjB;IAAM,UAAA;IAAA,QAAA;KAAA;KAAA;KAAA;KAAA;KAAA;IAAA;GAAA;EAAA;CAAA,CAAA;;AAGD,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAmB,YAAA,CAAA;EAX/B,MAAA;EACa,MAAA,CAAA;GAAA,UAAA;GAAc,SAGf;IACL;IACA;IACA;IACA;GACH;GAAA,UAAA;GAAA,QAAA,CAAA,g0JAAA;EAAA,CAAA"}
|