@sixbell-telco/sdk 4.3.0 → 4.5.0
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/CHANGELOG.md +35 -1
- package/components/dropdown/README.md +1 -1
- package/components/dropdown/dropdown-chevron/dropdown-chevron.component.d.ts +1 -1
- package/components/dropdown/dropdown-trigger/dropdown-trigger.component.d.ts +10 -13
- package/components/dropdown-menu/README.md +1 -1
- package/components/dropdown-menu/bar/dropdown-menu-bar-content/dropdown-menu-bar-content.component.d.ts +5 -1
- package/components/dropdown-menu/bar/dropdown-menu-bar-sub-trigger/dropdown-menu-bar-sub-trigger.component.d.ts +2 -0
- package/components/dropdown-menu/bar/dropdown-menu-bar-trigger/dropdown-menu-bar-trigger.component.d.ts +2 -0
- package/components/dropdown-menu/context/dropdown-context-menu-trigger/dropdown-context-menu-trigger.component.d.ts +1 -0
- package/components/dropdown-menu/src/dropdown-menu-content/dropdown-menu-content.component.d.ts +2 -0
- package/components/dropdown-menu/src/dropdown-menu-sub-content/dropdown-menu-sub-content.component.d.ts +2 -0
- package/components/dropdown-menu/src/dropdown-menu-sub-trigger/dropdown-menu-sub-trigger.component.d.ts +1 -0
- package/components/dropdown-menu/src/dropdown-menu-trigger/dropdown-menu-trigger.component.d.ts +1 -0
- package/components/forms/combobox/README.md +1 -1
- package/components/forms/combobox/src/combobox.component.d.ts +10 -11
- package/components/forms/select/README.md +1 -1
- package/components/forms/select/src/select.component.d.ts +10 -11
- package/components/overlay/README.md +6 -1
- package/components/overlay/src/overlay.component.d.ts +9 -8
- package/components/tooltip/README.md +3 -2
- package/components/tooltip/src/tooltip.component.d.ts +8 -8
- package/fesm2022/sixbell-telco-sdk-components-dropdown-menu-bar.mjs +18 -9
- package/fesm2022/sixbell-telco-sdk-components-dropdown-menu-bar.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-dropdown-menu-context.mjs +5 -1
- package/fesm2022/sixbell-telco-sdk-components-dropdown-menu-context.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-dropdown-menu.mjs +20 -9
- package/fesm2022/sixbell-telco-sdk-components-dropdown-menu.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-dropdown.mjs +26 -55
- package/fesm2022/sixbell-telco-sdk-components-dropdown.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-combobox.mjs +35 -49
- package/fesm2022/sixbell-telco-sdk-components-forms-combobox.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-select.mjs +35 -43
- package/fesm2022/sixbell-telco-sdk-components-forms-select.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-overlay.mjs +39 -77
- package/fesm2022/sixbell-telco-sdk-components-overlay.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-tooltip.mjs +33 -52
- package/fesm2022/sixbell-telco-sdk-components-tooltip.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-layouts.mjs +35 -13
- package/fesm2022/sixbell-telco-sdk-layouts.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-utils-popover-motion.mjs +186 -0
- package/fesm2022/sixbell-telco-sdk-utils-popover-motion.mjs.map +1 -0
- package/fesm2022/sixbell-telco-sdk-utils-translation.mjs +129 -14
- package/fesm2022/sixbell-telco-sdk-utils-translation.mjs.map +1 -1
- package/layouts/README.md +15 -1
- package/layouts/public-api.d.ts +2 -2
- package/layouts/src/layout-account.d.ts +16 -0
- package/layouts/src/menu/menu-active.d.ts +2 -1
- package/layouts/src/menu/menu-url.d.ts +2 -0
- package/layouts/src/page-banner/page-banner.component.d.ts +13 -1
- package/layouts/src/user-menu/user-menu.component.d.ts +4 -2
- package/package.json +41 -37
- package/src/_index.css +85 -0
- package/utils/popover-motion/README.md +38 -0
- package/utils/popover-motion/index.d.ts +5 -0
- package/utils/popover-motion/public-api.d.ts +2 -0
- package/utils/popover-motion/src/popover-menu-motion.d.ts +37 -0
- package/utils/popover-motion/src/popover-motion.d.ts +31 -0
- package/utils/translation/README.md +2 -0
- package/utils/translation/src/translation.service.d.ts +24 -0
|
@@ -109,11 +109,11 @@ class LayoutSwitcherComponent {
|
|
|
109
109
|
this.opened.set(false);
|
|
110
110
|
}
|
|
111
111
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: LayoutSwitcherComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
112
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.25", type: LayoutSwitcherComponent, isStandalone: true, selector: "st-layout-switcher", inputs: { opened: { classPropertyName: "opened", publicName: "opened", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { opened: "openedChange" }, ngImport: i0, template: "<st-dialog [(opened)]=\"opened\" width=\"lg\" [fullscreenOnMobile]=\"false\">\n\t<st-dialog-title>{{ 'sdk.layout.title' | translate }}</st-dialog-title>\n\t<st-dialog-content>\n\t\t<div class=\"grid grid-cols-2 gap-6 py-4\">\n\t\t\t@for (option of options; track option.value) {\n\t\t\t\t<!-- Preview Card -->\n\t\t\t\t<button\n\t\t\t\t\tclass=\"group rounded-box relative flex cursor-pointer flex-col items-center gap-3 border-2 p-4 transition-
|
|
112
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.25", type: LayoutSwitcherComponent, isStandalone: true, selector: "st-layout-switcher", inputs: { opened: { classPropertyName: "opened", publicName: "opened", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { opened: "openedChange" }, ngImport: i0, template: "<st-dialog [(opened)]=\"opened\" width=\"lg\" [fullscreenOnMobile]=\"false\">\n\t<st-dialog-title>{{ 'sdk.layout.title' | translate }}</st-dialog-title>\n\t<st-dialog-content>\n\t\t<div class=\"grid grid-cols-2 gap-6 py-4\">\n\t\t\t@for (option of options; track option.value) {\n\t\t\t\t<!-- Preview Card -->\n\t\t\t\t<button\n\t\t\t\t\tclass=\"group rounded-box relative flex cursor-pointer flex-col items-center gap-3 border-2 p-4 transition-[border-color,box-shadow,scale] duration-300 active:scale-[0.98]\"\n\t\t\t\t\t[class]=\"\n\t\t\t\t\t\tselectedLayout() === option.value\n\t\t\t\t\t\t\t? 'border-primary ring-primary/30 ring-4'\n\t\t\t\t\t\t\t: 'border-base-300 hover:border-primary/50 hover:ring-primary/15 hover:ring-2'\n\t\t\t\t\t\"\n\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t[attr.aria-pressed]=\"selectedLayout() === option.value\"\n\t\t\t\t\t[attr.data-st-layout-option]=\"option.value\"\n\t\t\t\t\t[attr.aria-describedby]=\"'st-layout-option-' + option.value + '-description'\"\n\t\t\t\t\t(click)=\"select(option.value)\"\n\t\t\t\t>\n\t\t\t\t\t<!-- Selected Checkmark Badge -->\n\t\t\t\t\t@if (selectedLayout() === option.value) {\n\t\t\t\t\t\t<div class=\"bg-primary text-primary-content absolute -top-2.5 -right-2.5 z-10 grid h-6 w-6 place-items-center rounded-full shadow-md\">\n\t\t\t\t\t\t\t<st-icon [icon]=\"checkIcon\" size=\"xs\" />\n\t\t\t\t\t\t</div>\n\t\t\t\t\t}\n\n\t\t\t\t\t<!-- Minimap Container -->\n\t\t\t\t\t<div class=\"bg-base-200 rounded-box relative h-40 w-full overflow-hidden\">\n\t\t\t\t\t\t@switch (option.value) {\n\t\t\t\t\t\t\t<!-- ============================== -->\n\t\t\t\t\t\t\t<!-- CLASSIC MINIMAP -->\n\t\t\t\t\t\t\t<!-- ============================== -->\n\t\t\t\t\t\t\t@case ('classic') {\n\t\t\t\t\t\t\t\t<div class=\"absolute inset-0 flex\">\n\t\t\t\t\t\t\t\t\t<!-- Sidebar -->\n\t\t\t\t\t\t\t\t\t<div class=\"bg-base-300 border-base-content/10 flex flex-col justify-between border-r px-2 py-3\">\n\t\t\t\t\t\t\t\t\t\t<!-- Logo placeholder -->\n\t\t\t\t\t\t\t\t\t\t<div class=\"flex flex-col gap-2\">\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"bg-base-content/15 h-2 w-10 rounded-full\"></div>\n\t\t\t\t\t\t\t\t\t\t\t<!-- Menu items -->\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"mt-2 flex flex-col gap-1.5\">\n\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"bg-primary/60 h-1.5 w-12 rounded-full\"></div>\n\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"bg-base-content/10 h-1.5 w-10 rounded-full\"></div>\n\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"bg-base-content/10 h-1.5 w-8 rounded-full\"></div>\n\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"bg-base-content/10 h-1.5 w-11 rounded-full\"></div>\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t<!-- Avatar placeholder at bottom -->\n\t\t\t\t\t\t\t\t\t\t<div class=\"flex items-center gap-1\">\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"bg-primary/30 h-3 w-3 rounded-full\"></div>\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"bg-base-content/10 h-1.5 w-6 rounded-full\"></div>\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t<!-- Main content area -->\n\t\t\t\t\t\t\t\t\t<div class=\"flex flex-1 flex-col items-center justify-center gap-2 p-4\">\n\t\t\t\t\t\t\t\t\t\t<div class=\"bg-base-content/8 h-2 w-3/4 rounded-full\"></div>\n\t\t\t\t\t\t\t\t\t\t<div class=\"bg-base-content/5 rounded-field h-12 w-5/6\"></div>\n\t\t\t\t\t\t\t\t\t\t<div class=\"bg-base-content/5 rounded-field h-6 w-2/3\"></div>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t<!-- ============================== -->\n\t\t\t\t\t\t\t<!-- MODERN MINIMAP -->\n\t\t\t\t\t\t\t<!-- ============================== -->\n\t\t\t\t\t\t\t@case ('modern') {\n\t\t\t\t\t\t\t\t<div class=\"absolute inset-0 flex flex-col gap-1 p-1.5\">\n\t\t\t\t\t\t\t\t\t<!-- Top navbar -->\n\t\t\t\t\t\t\t\t\t<div class=\"bg-primary/70 rounded-field flex h-6 shrink-0 items-center justify-between px-2\">\n\t\t\t\t\t\t\t\t\t\t<div class=\"bg-primary-content/30 h-1.5 w-8 rounded-full\"></div>\n\t\t\t\t\t\t\t\t\t\t<div class=\"flex items-center gap-1\">\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"bg-primary-content/20 h-2 w-2 rounded-full\"></div>\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"bg-primary-content/20 h-2 w-2 rounded-full\"></div>\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"bg-primary-content/30 h-2.5 w-2.5 rounded-full\"></div>\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t<!-- Body: sidebar + main -->\n\t\t\t\t\t\t\t\t\t<div class=\"flex min-h-0 flex-1 gap-1\">\n\t\t\t\t\t\t\t\t\t\t<!-- Sidebar (rounded) -->\n\t\t\t\t\t\t\t\t\t\t<div class=\"bg-base-300 border-base-content/10 rounded-field flex flex-col gap-1.5 border px-2 py-2\">\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"bg-primary/60 h-1.5 w-12 rounded-full\"></div>\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"bg-base-content/10 h-1.5 w-10 rounded-full\"></div>\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"bg-base-content/10 h-1.5 w-8 rounded-full\"></div>\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"bg-base-content/10 h-1.5 w-11 rounded-full\"></div>\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t<!-- Main content -->\n\t\t\t\t\t\t\t\t\t\t<div class=\"flex flex-1 flex-col justify-center gap-1.5 px-3\">\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"bg-base-content/8 h-1.5 w-3/4 rounded-full\"></div>\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"bg-base-content/5 rounded-field h-10 w-full\"></div>\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"bg-base-content/5 rounded-field h-5 w-2/3\"></div>\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t</div>\n\n\t\t\t\t\t<!-- Label -->\n\t\t\t\t\t<span stText=\"8\" stTextWeight=\"medium\" class=\"text-base-content\">{{ option.labelKey | translate }}</span>\n\t\t\t\t\t<span class=\"sr-only\" [id]=\"'st-layout-option-' + option.value + '-description'\">{{ option.descriptionKey | translate }}</span>\n\t\t\t\t</button>\n\t\t\t}\n\t\t</div>\n\t</st-dialog-content>\n</st-dialog>\n", dependencies: [{ kind: "component", type: DialogComponent, selector: "st-dialog", inputs: ["width", "fullscreenOnMobile", "xPosition", "yPosition", "opened", "stopPropagation"], outputs: ["openedChange", "closed", "clickOutside", "clicked", "pointerDown", "keyDownEnter", "keyDownSpace", "triggered"] }, { kind: "component", type: DialogTitleComponent, selector: "st-dialog-title" }, { kind: "component", type: DialogContentComponent, selector: "st-dialog-content" }, { kind: "component", type: IconComponent, selector: "st-icon", inputs: ["color", "size", "icon", "ariaLabel"] }, { kind: "directive", type: TextDirective, selector: "[stText]", inputs: ["stText", "stTextWeight", "stTextColor", "stTextOverflow", "stTextLineClamp", "stTextClass"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
113
113
|
}
|
|
114
114
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: LayoutSwitcherComponent, decorators: [{
|
|
115
115
|
type: Component,
|
|
116
|
-
args: [{ selector: 'st-layout-switcher', changeDetection: ChangeDetectionStrategy.OnPush, imports: [DialogComponent, DialogTitleComponent, DialogContentComponent, IconComponent, TextDirective, TranslatePipe], template: "<st-dialog [(opened)]=\"opened\" width=\"lg\" [fullscreenOnMobile]=\"false\">\n\t<st-dialog-title>{{ 'sdk.layout.title' | translate }}</st-dialog-title>\n\t<st-dialog-content>\n\t\t<div class=\"grid grid-cols-2 gap-6 py-4\">\n\t\t\t@for (option of options; track option.value) {\n\t\t\t\t<!-- Preview Card -->\n\t\t\t\t<button\n\t\t\t\t\tclass=\"group rounded-box relative flex cursor-pointer flex-col items-center gap-3 border-2 p-4 transition-
|
|
116
|
+
args: [{ selector: 'st-layout-switcher', changeDetection: ChangeDetectionStrategy.OnPush, imports: [DialogComponent, DialogTitleComponent, DialogContentComponent, IconComponent, TextDirective, TranslatePipe], template: "<st-dialog [(opened)]=\"opened\" width=\"lg\" [fullscreenOnMobile]=\"false\">\n\t<st-dialog-title>{{ 'sdk.layout.title' | translate }}</st-dialog-title>\n\t<st-dialog-content>\n\t\t<div class=\"grid grid-cols-2 gap-6 py-4\">\n\t\t\t@for (option of options; track option.value) {\n\t\t\t\t<!-- Preview Card -->\n\t\t\t\t<button\n\t\t\t\t\tclass=\"group rounded-box relative flex cursor-pointer flex-col items-center gap-3 border-2 p-4 transition-[border-color,box-shadow,scale] duration-300 active:scale-[0.98]\"\n\t\t\t\t\t[class]=\"\n\t\t\t\t\t\tselectedLayout() === option.value\n\t\t\t\t\t\t\t? 'border-primary ring-primary/30 ring-4'\n\t\t\t\t\t\t\t: 'border-base-300 hover:border-primary/50 hover:ring-primary/15 hover:ring-2'\n\t\t\t\t\t\"\n\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t[attr.aria-pressed]=\"selectedLayout() === option.value\"\n\t\t\t\t\t[attr.data-st-layout-option]=\"option.value\"\n\t\t\t\t\t[attr.aria-describedby]=\"'st-layout-option-' + option.value + '-description'\"\n\t\t\t\t\t(click)=\"select(option.value)\"\n\t\t\t\t>\n\t\t\t\t\t<!-- Selected Checkmark Badge -->\n\t\t\t\t\t@if (selectedLayout() === option.value) {\n\t\t\t\t\t\t<div class=\"bg-primary text-primary-content absolute -top-2.5 -right-2.5 z-10 grid h-6 w-6 place-items-center rounded-full shadow-md\">\n\t\t\t\t\t\t\t<st-icon [icon]=\"checkIcon\" size=\"xs\" />\n\t\t\t\t\t\t</div>\n\t\t\t\t\t}\n\n\t\t\t\t\t<!-- Minimap Container -->\n\t\t\t\t\t<div class=\"bg-base-200 rounded-box relative h-40 w-full overflow-hidden\">\n\t\t\t\t\t\t@switch (option.value) {\n\t\t\t\t\t\t\t<!-- ============================== -->\n\t\t\t\t\t\t\t<!-- CLASSIC MINIMAP -->\n\t\t\t\t\t\t\t<!-- ============================== -->\n\t\t\t\t\t\t\t@case ('classic') {\n\t\t\t\t\t\t\t\t<div class=\"absolute inset-0 flex\">\n\t\t\t\t\t\t\t\t\t<!-- Sidebar -->\n\t\t\t\t\t\t\t\t\t<div class=\"bg-base-300 border-base-content/10 flex flex-col justify-between border-r px-2 py-3\">\n\t\t\t\t\t\t\t\t\t\t<!-- Logo placeholder -->\n\t\t\t\t\t\t\t\t\t\t<div class=\"flex flex-col gap-2\">\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"bg-base-content/15 h-2 w-10 rounded-full\"></div>\n\t\t\t\t\t\t\t\t\t\t\t<!-- Menu items -->\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"mt-2 flex flex-col gap-1.5\">\n\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"bg-primary/60 h-1.5 w-12 rounded-full\"></div>\n\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"bg-base-content/10 h-1.5 w-10 rounded-full\"></div>\n\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"bg-base-content/10 h-1.5 w-8 rounded-full\"></div>\n\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"bg-base-content/10 h-1.5 w-11 rounded-full\"></div>\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t<!-- Avatar placeholder at bottom -->\n\t\t\t\t\t\t\t\t\t\t<div class=\"flex items-center gap-1\">\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"bg-primary/30 h-3 w-3 rounded-full\"></div>\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"bg-base-content/10 h-1.5 w-6 rounded-full\"></div>\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t<!-- Main content area -->\n\t\t\t\t\t\t\t\t\t<div class=\"flex flex-1 flex-col items-center justify-center gap-2 p-4\">\n\t\t\t\t\t\t\t\t\t\t<div class=\"bg-base-content/8 h-2 w-3/4 rounded-full\"></div>\n\t\t\t\t\t\t\t\t\t\t<div class=\"bg-base-content/5 rounded-field h-12 w-5/6\"></div>\n\t\t\t\t\t\t\t\t\t\t<div class=\"bg-base-content/5 rounded-field h-6 w-2/3\"></div>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t<!-- ============================== -->\n\t\t\t\t\t\t\t<!-- MODERN MINIMAP -->\n\t\t\t\t\t\t\t<!-- ============================== -->\n\t\t\t\t\t\t\t@case ('modern') {\n\t\t\t\t\t\t\t\t<div class=\"absolute inset-0 flex flex-col gap-1 p-1.5\">\n\t\t\t\t\t\t\t\t\t<!-- Top navbar -->\n\t\t\t\t\t\t\t\t\t<div class=\"bg-primary/70 rounded-field flex h-6 shrink-0 items-center justify-between px-2\">\n\t\t\t\t\t\t\t\t\t\t<div class=\"bg-primary-content/30 h-1.5 w-8 rounded-full\"></div>\n\t\t\t\t\t\t\t\t\t\t<div class=\"flex items-center gap-1\">\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"bg-primary-content/20 h-2 w-2 rounded-full\"></div>\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"bg-primary-content/20 h-2 w-2 rounded-full\"></div>\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"bg-primary-content/30 h-2.5 w-2.5 rounded-full\"></div>\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t<!-- Body: sidebar + main -->\n\t\t\t\t\t\t\t\t\t<div class=\"flex min-h-0 flex-1 gap-1\">\n\t\t\t\t\t\t\t\t\t\t<!-- Sidebar (rounded) -->\n\t\t\t\t\t\t\t\t\t\t<div class=\"bg-base-300 border-base-content/10 rounded-field flex flex-col gap-1.5 border px-2 py-2\">\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"bg-primary/60 h-1.5 w-12 rounded-full\"></div>\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"bg-base-content/10 h-1.5 w-10 rounded-full\"></div>\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"bg-base-content/10 h-1.5 w-8 rounded-full\"></div>\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"bg-base-content/10 h-1.5 w-11 rounded-full\"></div>\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t<!-- Main content -->\n\t\t\t\t\t\t\t\t\t\t<div class=\"flex flex-1 flex-col justify-center gap-1.5 px-3\">\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"bg-base-content/8 h-1.5 w-3/4 rounded-full\"></div>\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"bg-base-content/5 rounded-field h-10 w-full\"></div>\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"bg-base-content/5 rounded-field h-5 w-2/3\"></div>\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t</div>\n\n\t\t\t\t\t<!-- Label -->\n\t\t\t\t\t<span stText=\"8\" stTextWeight=\"medium\" class=\"text-base-content\">{{ option.labelKey | translate }}</span>\n\t\t\t\t\t<span class=\"sr-only\" [id]=\"'st-layout-option-' + option.value + '-description'\">{{ option.descriptionKey | translate }}</span>\n\t\t\t\t</button>\n\t\t\t}\n\t\t</div>\n\t</st-dialog-content>\n</st-dialog>\n" }]
|
|
117
117
|
}] });
|
|
118
118
|
|
|
119
119
|
const DEFAULT_MENU_TOP_LEVEL_GROUPS = 'collapsible';
|
|
@@ -146,8 +146,8 @@ const SCHEME_ICONS = {
|
|
|
146
146
|
dark: matDarkModeOutline,
|
|
147
147
|
};
|
|
148
148
|
/**
|
|
149
|
-
* Account menu of the SDK layouts: the user's avatar opens account actions (change password,
|
|
150
|
-
* and preferences (language, color scheme, theme, layout). The account comes from `provideLayoutAccount`.
|
|
149
|
+
* Account menu of the SDK layouts: the user's avatar opens account actions (change password, app-defined
|
|
150
|
+
* `actions`, logout) and preferences (language, color scheme, theme, layout). The account comes from `provideLayoutAccount`.
|
|
151
151
|
*/
|
|
152
152
|
class UserMenuComponent {
|
|
153
153
|
account = inject(LAYOUT_ACCOUNT);
|
|
@@ -179,6 +179,8 @@ class UserMenuComponent {
|
|
|
179
179
|
returnFocusTo = null;
|
|
180
180
|
user = this.account.user;
|
|
181
181
|
canChangePassword = !!this.account.changePassword;
|
|
182
|
+
accountActions = computed(() => this.account.actions?.() ?? []);
|
|
183
|
+
hasAccountOptions = computed(() => this.canChangePassword || this.accountActions().length > 0);
|
|
182
184
|
compact = computed(() => this.variant() === 'sidebar' && this.collapsed());
|
|
183
185
|
triggerLabel = computed(() => {
|
|
184
186
|
this.i18n();
|
|
@@ -236,7 +238,7 @@ class UserMenuComponent {
|
|
|
236
238
|
}
|
|
237
239
|
});
|
|
238
240
|
hostClass = computed(() => cn(this.variant() === 'sidebar' ? 'block w-full' : 'inline-block', this.class()));
|
|
239
|
-
triggerClass = computed(() => cn('*:h-auto *:min-h-0 *:transition-
|
|
241
|
+
triggerClass = computed(() => cn('*:h-auto *:min-h-0 *:transition-[color,background-color,border-color,box-shadow,transform,width,min-width,padding,gap] *:duration-300', {
|
|
240
242
|
'w-full *:w-full *:justify-between *:px-3 *:py-1.5': this.variant() === 'sidebar' && !this.compact(),
|
|
241
243
|
'*:w-10 *:min-w-10 *:justify-center *:p-0': this.compact(),
|
|
242
244
|
'*:gap-2 *:px-2 *:py-1': this.variant() === 'navbar',
|
|
@@ -297,7 +299,7 @@ class UserMenuComponent {
|
|
|
297
299
|
this.account.logout();
|
|
298
300
|
}
|
|
299
301
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: UserMenuComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
300
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.25", type: UserMenuComponent, isStandalone: true, selector: "st-user-menu", inputs: { variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, collapsed: { classPropertyName: "collapsed", publicName: "collapsed", isSignal: true, isRequired: false, transformFunction: null }, showLanguageSelector: { classPropertyName: "showLanguageSelector", publicName: "showLanguageSelector", isSignal: true, isRequired: false, transformFunction: null }, showSchemeSelector: { classPropertyName: "showSchemeSelector", publicName: "showSchemeSelector", isSignal: true, isRequired: false, transformFunction: null }, showThemeSelector: { classPropertyName: "showThemeSelector", publicName: "showThemeSelector", isSignal: true, isRequired: false, transformFunction: null }, showLayoutSelector: { classPropertyName: "showLayoutSelector", publicName: "showLayoutSelector", isSignal: true, isRequired: false, transformFunction: null }, class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { openLayoutSwitcher: "openLayoutSwitcher", openChange: "openChange" }, host: { listeners: { "document:keydown.enter": "preventSubmenuEnter($event)" }, properties: { "class": "hostClass()" } }, viewQueries: [{ propertyName: "backButton", first: true, predicate: ["backButton"], descendants: true, read: ElementRef, isSignal: true }, { propertyName: "optionsView", first: true, predicate: ["optionsView"], descendants: true, read: ElementRef, isSignal: true }], ngImport: i0, template: "@let sidebar = variant() === 'sidebar';\n<st-dropdown [class]=\"sidebar ? 'block w-full' : 'inline-block'\" (openChange)=\"handleOpenChange($event)\">\n\t<st-dropdown-trigger\n\t\t[class]=\"sidebar ? 'block w-full *:w-full' : ''\"\n\t\toriginX=\"end\"\n\t\toriginY=\"bottom\"\n\t\t[overlayX]=\"sidebar ? 'start' : 'end'\"\n\t\t[overlayY]=\"sidebar ? 'bottom' : 'top'\"\n\t>\n\t\t<st-button variant=\"base\" [ghost]=\"true\" [block]=\"sidebar && !compact()\" [class]=\"triggerClass()\" data-st-user-menu-trigger>\n\t\t\t<span class=\"sr-only\">{{ triggerLabel() }}</span>\n\t\t\t@if (user(); as currentUser) {\n\t\t\t\t<st-avatar\n\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t\tclass=\"[&_span]:text-nowrap\"\n\t\t\t\t\t[class.p-1]=\"sidebar\"\n\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\t[shape]=\"sidebar ? 'square' : 'rounded'\"\n\t\t\t\t\t[ring]=\"sidebar\"\n\t\t\t\t\t[user]=\"currentUser\"\n\t\t\t\t\t[showNameAndRole]=\"!compact()\"\n\t\t\t\t/>\n\t\t\t} @else {\n\t\t\t\t<st-icon [icon]=\"icons.person\" />\n\t\t\t}\n\t\t\t@if (sidebar && !compact()) {\n\t\t\t\t<st-dropdown-chevron aria-hidden=\"true\" position=\"right\" size=\"auto\" />\n\t\t\t}\n\t\t</st-button>\n\t</st-dropdown-trigger>\n\t<st-dropdown-content class=\"min-w-64\">\n\t\t@if (submenu(); as menu) {\n\t\t\t<div class=\"animate-morph-in\" [attr.data-st-user-menu-view]=\"view()\">\n\t\t\t\t<div class=\"inline-flex items-center gap-2 py-1.5 ps-2\">\n\t\t\t\t\t<st-button\n\t\t\t\t\t\t#backButton\n\t\t\t\t\t\tclass=\"*:text-sm\"\n\t\t\t\t\t\tvariant=\"base\"\n\t\t\t\t\t\tsize=\"xs\"\n\t\t\t\t\t\t[ghost]=\"true\"\n\t\t\t\t\t\t[circle]=\"true\"\n\t\t\t\t\t\t[icon]=\"icons.back\"\n\t\t\t\t\t\t(triggered)=\"show('options')\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<span class=\"sr-only\">{{ 'sdk.layout.back' | translate }}</span>\n\t\t\t\t\t</st-button>\n\t\t\t\t\t<span stText=\"7\" stTextWeight=\"medium\">{{ menu.titleKey | translate }}</span>\n\t\t\t\t</div>\n\t\t\t\t<st-dropdown-separator />\n\t\t\t\t@for (choice of menu.choices; track choice.value) {\n\t\t\t\t\t<st-dropdown-item-radio\n\t\t\t\t\t\t[value]=\"choice.value\"\n\t\t\t\t\t\t[checked]=\"menu.current === choice.value\"\n\t\t\t\t\t\t[closeOnSelect]=\"false\"\n\t\t\t\t\t\t[attr.data-st-user-menu-choice]=\"choice.value\"\n\t\t\t\t\t\t(checkedChanged)=\"menu.select($event)\"\n\t\t\t\t\t>\n\t\t\t\t\t\t@if (view() === 'scheme') {\n\t\t\t\t\t\t\t<div class=\"inline-flex items-center gap-2\">\n\t\t\t\t\t\t\t\t<st-icon [icon]=\"schemeIcon(choice.value)\" />\n\t\t\t\t\t\t\t\t<span>{{ choice.label }}</span>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t} @else {\n\t\t\t\t\t\t\t<span>{{ choice.label }}</span>\n\t\t\t\t\t\t}\n\t\t\t\t\t</st-dropdown-item-radio>\n\t\t\t\t}\n\t\t\t</div>\n\t\t} @else {\n\t\t\t<div #optionsView class=\"animate-morph-in\" data-st-user-menu-view=\"options\">\n\t\t\t\t@if (canChangePassword) {\n\t\t\t\t\t<st-dropdown-label>{{ 'sdk.layout.account' | translate }}</st-dropdown-label>\n\t\t\t\t\t<st-dropdown-item data-st-user-menu-option=\"change-password\" (selected)=\"changePassword()\">\n\t\t\t\t\t\t<div class=\"inline-flex items-center gap-2\">\n\t\t\t\t\t\t\t<st-icon [icon]=\"icons.password\" />\n\t\t\t\t\t\t\t<span>{{ 'sdk.layout.change_password' | translate }}</span>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</st-dropdown-item>\n\t\t\t\t\t<st-dropdown-separator />\n\t\t\t\t}\n\t\t\t\t@if (hasPreferences()) {\n\t\t\t\t\t<st-dropdown-label>{{ 'sdk.layout.preferences' | translate }}</st-dropdown-label>\n\t\t\t\t\t@if (hasLanguageSelector()) {\n\t\t\t\t\t\t<st-dropdown-item data-st-user-menu-option=\"language\" [closeOnSelect]=\"false\" (selected)=\"show('language')\">\n\t\t\t\t\t\t\t<div class=\"inline-flex items-center gap-2\">\n\t\t\t\t\t\t\t\t<st-icon [icon]=\"icons.language\" />\n\t\t\t\t\t\t\t\t<span>{{ 'sdk.layout.language' | translate }}</span>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</st-dropdown-item>\n\t\t\t\t\t}\n\t\t\t\t\t@if (hasSchemeSelector()) {\n\t\t\t\t\t\t<st-dropdown-item data-st-user-menu-option=\"scheme\" [closeOnSelect]=\"false\" (selected)=\"show('scheme')\">\n\t\t\t\t\t\t\t<div class=\"inline-flex items-center gap-2\">\n\t\t\t\t\t\t\t\t<st-icon [icon]=\"schemeIcon(currentScheme())\" />\n\t\t\t\t\t\t\t\t<span>{{ 'sdk.layout.scheme' | translate }}</span>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</st-dropdown-item>\n\t\t\t\t\t}\n\t\t\t\t\t@if (hasThemeSelector()) {\n\t\t\t\t\t\t<st-dropdown-item data-st-user-menu-option=\"theme\" [closeOnSelect]=\"false\" (selected)=\"show('theme')\">\n\t\t\t\t\t\t\t<div class=\"inline-flex items-center gap-2\">\n\t\t\t\t\t\t\t\t<st-icon [icon]=\"icons.theme\" />\n\t\t\t\t\t\t\t\t<span>{{ 'sdk.layout.theme' | translate }}</span>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</st-dropdown-item>\n\t\t\t\t\t}\n\t\t\t\t\t@if (hasLayoutSelector()) {\n\t\t\t\t\t\t<st-dropdown-item data-st-user-menu-option=\"layout\" (selected)=\"openLayoutSwitcher.emit()\">\n\t\t\t\t\t\t\t<div class=\"inline-flex items-center gap-2\">\n\t\t\t\t\t\t\t\t<st-icon [icon]=\"icons.layout\" />\n\t\t\t\t\t\t\t\t<span>{{ 'sdk.layout.layout' | translate }}</span>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</st-dropdown-item>\n\t\t\t\t\t}\n\t\t\t\t\t<st-dropdown-separator />\n\t\t\t\t}\n\t\t\t\t<st-dropdown-item class=\"text-error\" data-st-user-menu-option=\"logout\" (selected)=\"logout()\">\n\t\t\t\t\t<div class=\"inline-flex items-center gap-2\">\n\t\t\t\t\t\t<st-icon [icon]=\"icons.logout\" />\n\t\t\t\t\t\t<span>{{ 'sdk.layout.logout' | translate }}</span>\n\t\t\t\t\t</div>\n\t\t\t\t</st-dropdown-item>\n\t\t\t</div>\n\t\t}\n\t</st-dropdown-content>\n</st-dropdown>\n", dependencies: [{ kind: "component", type: AvatarComponent, selector: "st-avatar", inputs: ["variant", "shape", "size", "ring", "presence", "user", "image", "showNameAndRole"] }, { kind: "component", type: ButtonComponent, selector: "st-button", inputs: ["variant", "ghost", "outline", "link", "soft", "dash", "wide", "circle", "square", "glass", "block", "loader", "size", "shadow", "focusable", "icon", "iconPosition", "type", "disabled", "stopPropagation", "ariaLabel", "ariaExpanded", "ariaPressed", "ariaDescribedBy", "ariaControls"], outputs: ["clicked", "pointerDown", "keyDownEnter", "keyDownSpace", "triggered"] }, { kind: "component", type: DropdownComponent, selector: "st-dropdown", inputs: ["open"], outputs: ["openChange", "opened", "closed"], exportAs: ["stDropdown"] }, { kind: "component", type: DropdownTriggerComponent, selector: "st-dropdown-trigger", inputs: ["offsetX", "offsetY", "originX", "originY", "overlayX", "overlayY", "fallbacks", "stopPropagation", "triggerTabIndex"], outputs: ["opened", "closed", "clicked", "pointerDown", "keyDownEnter", "keyDownSpace", "triggered"] }, { kind: "component", type: DropdownContentComponent, selector: "st-dropdown-content", inputs: ["class", "size", "shadow"], outputs: ["closeRequested"], exportAs: ["dropdownContent"] }, { kind: "component", type: DropdownItemComponent, selector: "st-dropdown-item", inputs: ["active", "class", "disabled", "closeOnSelect", "stopPropagation"], outputs: ["selected", "clicked", "keyDownEnter", "keyDownSpace", "triggered"] }, { kind: "component", type: DropdownItemRadioComponent, selector: "st-dropdown-item-radio", inputs: ["checked", "value", "disabled", "indicator", "showIndicator", "class", "closeOnSelect", "stopPropagation"], outputs: ["checkedChanged", "triggered", "clicked", "keyDownEnter", "keyDownSpace"] }, { kind: "component", type: DropdownLabelComponent, selector: "st-dropdown-label", inputs: ["class"] }, { kind: "component", type: DropdownSeparatorComponent, selector: "st-dropdown-separator" }, { kind: "component", type: DropdownChevronComponent, selector: "st-dropdown-chevron", inputs: ["icon", "class", "size", "color", "position"] }, { kind: "component", type: IconComponent, selector: "st-icon", inputs: ["color", "size", "icon", "ariaLabel"] }, { kind: "directive", type: TextDirective, selector: "[stText]", inputs: ["stText", "stTextWeight", "stTextColor", "stTextOverflow", "stTextLineClamp", "stTextClass"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
302
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.25", type: UserMenuComponent, isStandalone: true, selector: "st-user-menu", inputs: { variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, collapsed: { classPropertyName: "collapsed", publicName: "collapsed", isSignal: true, isRequired: false, transformFunction: null }, showLanguageSelector: { classPropertyName: "showLanguageSelector", publicName: "showLanguageSelector", isSignal: true, isRequired: false, transformFunction: null }, showSchemeSelector: { classPropertyName: "showSchemeSelector", publicName: "showSchemeSelector", isSignal: true, isRequired: false, transformFunction: null }, showThemeSelector: { classPropertyName: "showThemeSelector", publicName: "showThemeSelector", isSignal: true, isRequired: false, transformFunction: null }, showLayoutSelector: { classPropertyName: "showLayoutSelector", publicName: "showLayoutSelector", isSignal: true, isRequired: false, transformFunction: null }, class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { openLayoutSwitcher: "openLayoutSwitcher", openChange: "openChange" }, host: { listeners: { "document:keydown.enter": "preventSubmenuEnter($event)" }, properties: { "class": "hostClass()" } }, viewQueries: [{ propertyName: "backButton", first: true, predicate: ["backButton"], descendants: true, read: ElementRef, isSignal: true }, { propertyName: "optionsView", first: true, predicate: ["optionsView"], descendants: true, read: ElementRef, isSignal: true }], ngImport: i0, template: "@let sidebar = variant() === 'sidebar';\n<st-dropdown [class]=\"sidebar ? 'block w-full' : 'inline-block'\" (openChange)=\"handleOpenChange($event)\">\n\t<st-dropdown-trigger\n\t\t[class]=\"sidebar ? 'block w-full *:w-full' : ''\"\n\t\toriginX=\"end\"\n\t\toriginY=\"bottom\"\n\t\t[overlayX]=\"sidebar ? 'start' : 'end'\"\n\t\t[overlayY]=\"sidebar ? 'bottom' : 'top'\"\n\t>\n\t\t<st-button variant=\"base\" [ghost]=\"true\" [block]=\"sidebar && !compact()\" [class]=\"triggerClass()\" data-st-user-menu-trigger>\n\t\t\t<span class=\"sr-only\">{{ triggerLabel() }}</span>\n\t\t\t@if (user(); as currentUser) {\n\t\t\t\t<st-avatar\n\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t\tclass=\"[&_span]:text-nowrap\"\n\t\t\t\t\t[class.p-1]=\"sidebar\"\n\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\t[shape]=\"sidebar ? 'square' : 'rounded'\"\n\t\t\t\t\t[ring]=\"sidebar\"\n\t\t\t\t\t[user]=\"currentUser\"\n\t\t\t\t\t[showNameAndRole]=\"!compact()\"\n\t\t\t\t/>\n\t\t\t} @else {\n\t\t\t\t<st-icon [icon]=\"icons.person\" />\n\t\t\t}\n\t\t\t@if (sidebar && !compact()) {\n\t\t\t\t<st-dropdown-chevron aria-hidden=\"true\" position=\"right\" size=\"auto\" />\n\t\t\t}\n\t\t</st-button>\n\t</st-dropdown-trigger>\n\t<st-dropdown-content class=\"min-w-64\">\n\t\t@if (submenu(); as menu) {\n\t\t\t<div class=\"animate-morph-in\" [attr.data-st-user-menu-view]=\"view()\">\n\t\t\t\t<div class=\"inline-flex items-center gap-2 py-1.5 ps-2\">\n\t\t\t\t\t<st-button\n\t\t\t\t\t\t#backButton\n\t\t\t\t\t\tclass=\"*:text-sm\"\n\t\t\t\t\t\tvariant=\"base\"\n\t\t\t\t\t\tsize=\"xs\"\n\t\t\t\t\t\t[ghost]=\"true\"\n\t\t\t\t\t\t[circle]=\"true\"\n\t\t\t\t\t\t[icon]=\"icons.back\"\n\t\t\t\t\t\t(triggered)=\"show('options')\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<span class=\"sr-only\">{{ 'sdk.layout.back' | translate }}</span>\n\t\t\t\t\t</st-button>\n\t\t\t\t\t<span stText=\"7\" stTextWeight=\"medium\">{{ menu.titleKey | translate }}</span>\n\t\t\t\t</div>\n\t\t\t\t<st-dropdown-separator />\n\t\t\t\t@for (choice of menu.choices; track choice.value) {\n\t\t\t\t\t<st-dropdown-item-radio\n\t\t\t\t\t\t[value]=\"choice.value\"\n\t\t\t\t\t\t[checked]=\"menu.current === choice.value\"\n\t\t\t\t\t\t[closeOnSelect]=\"false\"\n\t\t\t\t\t\t[attr.data-st-user-menu-choice]=\"choice.value\"\n\t\t\t\t\t\t(checkedChanged)=\"menu.select($event)\"\n\t\t\t\t\t>\n\t\t\t\t\t\t@if (view() === 'scheme') {\n\t\t\t\t\t\t\t<div class=\"inline-flex items-center gap-2\">\n\t\t\t\t\t\t\t\t<st-icon [icon]=\"schemeIcon(choice.value)\" />\n\t\t\t\t\t\t\t\t<span>{{ choice.label }}</span>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t} @else {\n\t\t\t\t\t\t\t<span>{{ choice.label }}</span>\n\t\t\t\t\t\t}\n\t\t\t\t\t</st-dropdown-item-radio>\n\t\t\t\t}\n\t\t\t</div>\n\t\t} @else {\n\t\t\t<div #optionsView class=\"animate-morph-in\" data-st-user-menu-view=\"options\">\n\t\t\t\t@if (hasAccountOptions()) {\n\t\t\t\t\t<st-dropdown-label>{{ 'sdk.layout.account' | translate }}</st-dropdown-label>\n\t\t\t\t\t@if (canChangePassword) {\n\t\t\t\t\t\t<st-dropdown-item data-st-user-menu-option=\"change-password\" (selected)=\"changePassword()\">\n\t\t\t\t\t\t\t<div class=\"inline-flex items-center gap-2\">\n\t\t\t\t\t\t\t\t<st-icon [icon]=\"icons.password\" />\n\t\t\t\t\t\t\t\t<span>{{ 'sdk.layout.change_password' | translate }}</span>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</st-dropdown-item>\n\t\t\t\t\t}\n\t\t\t\t\t@for (action of accountActions(); track action.id) {\n\t\t\t\t\t\t<st-dropdown-item [attr.data-st-user-menu-option]=\"action.id\" (selected)=\"action.run()\">\n\t\t\t\t\t\t\t<div class=\"inline-flex items-center gap-2\">\n\t\t\t\t\t\t\t\t@if (action.icon) {\n\t\t\t\t\t\t\t\t\t<st-icon [icon]=\"action.icon\" />\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t<span>{{ action.labelKey | translate }}</span>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</st-dropdown-item>\n\t\t\t\t\t}\n\t\t\t\t\t<st-dropdown-separator />\n\t\t\t\t}\n\t\t\t\t@if (hasPreferences()) {\n\t\t\t\t\t<st-dropdown-label>{{ 'sdk.layout.preferences' | translate }}</st-dropdown-label>\n\t\t\t\t\t@if (hasLanguageSelector()) {\n\t\t\t\t\t\t<st-dropdown-item data-st-user-menu-option=\"language\" [closeOnSelect]=\"false\" (selected)=\"show('language')\">\n\t\t\t\t\t\t\t<div class=\"inline-flex items-center gap-2\">\n\t\t\t\t\t\t\t\t<st-icon [icon]=\"icons.language\" />\n\t\t\t\t\t\t\t\t<span>{{ 'sdk.layout.language' | translate }}</span>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</st-dropdown-item>\n\t\t\t\t\t}\n\t\t\t\t\t@if (hasSchemeSelector()) {\n\t\t\t\t\t\t<st-dropdown-item data-st-user-menu-option=\"scheme\" [closeOnSelect]=\"false\" (selected)=\"show('scheme')\">\n\t\t\t\t\t\t\t<div class=\"inline-flex items-center gap-2\">\n\t\t\t\t\t\t\t\t<st-icon [icon]=\"schemeIcon(currentScheme())\" />\n\t\t\t\t\t\t\t\t<span>{{ 'sdk.layout.scheme' | translate }}</span>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</st-dropdown-item>\n\t\t\t\t\t}\n\t\t\t\t\t@if (hasThemeSelector()) {\n\t\t\t\t\t\t<st-dropdown-item data-st-user-menu-option=\"theme\" [closeOnSelect]=\"false\" (selected)=\"show('theme')\">\n\t\t\t\t\t\t\t<div class=\"inline-flex items-center gap-2\">\n\t\t\t\t\t\t\t\t<st-icon [icon]=\"icons.theme\" />\n\t\t\t\t\t\t\t\t<span>{{ 'sdk.layout.theme' | translate }}</span>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</st-dropdown-item>\n\t\t\t\t\t}\n\t\t\t\t\t@if (hasLayoutSelector()) {\n\t\t\t\t\t\t<st-dropdown-item data-st-user-menu-option=\"layout\" (selected)=\"openLayoutSwitcher.emit()\">\n\t\t\t\t\t\t\t<div class=\"inline-flex items-center gap-2\">\n\t\t\t\t\t\t\t\t<st-icon [icon]=\"icons.layout\" />\n\t\t\t\t\t\t\t\t<span>{{ 'sdk.layout.layout' | translate }}</span>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</st-dropdown-item>\n\t\t\t\t\t}\n\t\t\t\t\t<st-dropdown-separator />\n\t\t\t\t}\n\t\t\t\t<st-dropdown-item class=\"text-error\" data-st-user-menu-option=\"logout\" (selected)=\"logout()\">\n\t\t\t\t\t<div class=\"inline-flex items-center gap-2\">\n\t\t\t\t\t\t<st-icon [icon]=\"icons.logout\" />\n\t\t\t\t\t\t<span>{{ 'sdk.layout.logout' | translate }}</span>\n\t\t\t\t\t</div>\n\t\t\t\t</st-dropdown-item>\n\t\t\t</div>\n\t\t}\n\t</st-dropdown-content>\n</st-dropdown>\n", dependencies: [{ kind: "component", type: AvatarComponent, selector: "st-avatar", inputs: ["variant", "shape", "size", "ring", "presence", "user", "image", "showNameAndRole"] }, { kind: "component", type: ButtonComponent, selector: "st-button", inputs: ["variant", "ghost", "outline", "link", "soft", "dash", "wide", "circle", "square", "glass", "block", "loader", "size", "shadow", "focusable", "icon", "iconPosition", "type", "disabled", "stopPropagation", "ariaLabel", "ariaExpanded", "ariaPressed", "ariaDescribedBy", "ariaControls"], outputs: ["clicked", "pointerDown", "keyDownEnter", "keyDownSpace", "triggered"] }, { kind: "component", type: DropdownComponent, selector: "st-dropdown", inputs: ["open"], outputs: ["openChange", "opened", "closed"], exportAs: ["stDropdown"] }, { kind: "component", type: DropdownTriggerComponent, selector: "st-dropdown-trigger", inputs: ["offsetX", "offsetY", "originX", "originY", "overlayX", "overlayY", "fallbacks", "stopPropagation", "triggerTabIndex"], outputs: ["opened", "closed", "clicked", "pointerDown", "keyDownEnter", "keyDownSpace", "triggered"] }, { kind: "component", type: DropdownContentComponent, selector: "st-dropdown-content", inputs: ["class", "size", "shadow"], outputs: ["closeRequested"], exportAs: ["dropdownContent"] }, { kind: "component", type: DropdownItemComponent, selector: "st-dropdown-item", inputs: ["active", "class", "disabled", "closeOnSelect", "stopPropagation"], outputs: ["selected", "clicked", "keyDownEnter", "keyDownSpace", "triggered"] }, { kind: "component", type: DropdownItemRadioComponent, selector: "st-dropdown-item-radio", inputs: ["checked", "value", "disabled", "indicator", "showIndicator", "class", "closeOnSelect", "stopPropagation"], outputs: ["checkedChanged", "triggered", "clicked", "keyDownEnter", "keyDownSpace"] }, { kind: "component", type: DropdownLabelComponent, selector: "st-dropdown-label", inputs: ["class"] }, { kind: "component", type: DropdownSeparatorComponent, selector: "st-dropdown-separator" }, { kind: "component", type: DropdownChevronComponent, selector: "st-dropdown-chevron", inputs: ["icon", "class", "size", "color", "position"] }, { kind: "component", type: IconComponent, selector: "st-icon", inputs: ["color", "size", "icon", "ariaLabel"] }, { kind: "directive", type: TextDirective, selector: "[stText]", inputs: ["stText", "stTextWeight", "stTextColor", "stTextOverflow", "stTextLineClamp", "stTextClass"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
301
303
|
}
|
|
302
304
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: UserMenuComponent, decorators: [{
|
|
303
305
|
type: Component,
|
|
@@ -318,7 +320,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImpo
|
|
|
318
320
|
], host: {
|
|
319
321
|
'[class]': 'hostClass()',
|
|
320
322
|
'(document:keydown.enter)': 'preventSubmenuEnter($event)',
|
|
321
|
-
}, template: "@let sidebar = variant() === 'sidebar';\n<st-dropdown [class]=\"sidebar ? 'block w-full' : 'inline-block'\" (openChange)=\"handleOpenChange($event)\">\n\t<st-dropdown-trigger\n\t\t[class]=\"sidebar ? 'block w-full *:w-full' : ''\"\n\t\toriginX=\"end\"\n\t\toriginY=\"bottom\"\n\t\t[overlayX]=\"sidebar ? 'start' : 'end'\"\n\t\t[overlayY]=\"sidebar ? 'bottom' : 'top'\"\n\t>\n\t\t<st-button variant=\"base\" [ghost]=\"true\" [block]=\"sidebar && !compact()\" [class]=\"triggerClass()\" data-st-user-menu-trigger>\n\t\t\t<span class=\"sr-only\">{{ triggerLabel() }}</span>\n\t\t\t@if (user(); as currentUser) {\n\t\t\t\t<st-avatar\n\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t\tclass=\"[&_span]:text-nowrap\"\n\t\t\t\t\t[class.p-1]=\"sidebar\"\n\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\t[shape]=\"sidebar ? 'square' : 'rounded'\"\n\t\t\t\t\t[ring]=\"sidebar\"\n\t\t\t\t\t[user]=\"currentUser\"\n\t\t\t\t\t[showNameAndRole]=\"!compact()\"\n\t\t\t\t/>\n\t\t\t} @else {\n\t\t\t\t<st-icon [icon]=\"icons.person\" />\n\t\t\t}\n\t\t\t@if (sidebar && !compact()) {\n\t\t\t\t<st-dropdown-chevron aria-hidden=\"true\" position=\"right\" size=\"auto\" />\n\t\t\t}\n\t\t</st-button>\n\t</st-dropdown-trigger>\n\t<st-dropdown-content class=\"min-w-64\">\n\t\t@if (submenu(); as menu) {\n\t\t\t<div class=\"animate-morph-in\" [attr.data-st-user-menu-view]=\"view()\">\n\t\t\t\t<div class=\"inline-flex items-center gap-2 py-1.5 ps-2\">\n\t\t\t\t\t<st-button\n\t\t\t\t\t\t#backButton\n\t\t\t\t\t\tclass=\"*:text-sm\"\n\t\t\t\t\t\tvariant=\"base\"\n\t\t\t\t\t\tsize=\"xs\"\n\t\t\t\t\t\t[ghost]=\"true\"\n\t\t\t\t\t\t[circle]=\"true\"\n\t\t\t\t\t\t[icon]=\"icons.back\"\n\t\t\t\t\t\t(triggered)=\"show('options')\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<span class=\"sr-only\">{{ 'sdk.layout.back' | translate }}</span>\n\t\t\t\t\t</st-button>\n\t\t\t\t\t<span stText=\"7\" stTextWeight=\"medium\">{{ menu.titleKey | translate }}</span>\n\t\t\t\t</div>\n\t\t\t\t<st-dropdown-separator />\n\t\t\t\t@for (choice of menu.choices; track choice.value) {\n\t\t\t\t\t<st-dropdown-item-radio\n\t\t\t\t\t\t[value]=\"choice.value\"\n\t\t\t\t\t\t[checked]=\"menu.current === choice.value\"\n\t\t\t\t\t\t[closeOnSelect]=\"false\"\n\t\t\t\t\t\t[attr.data-st-user-menu-choice]=\"choice.value\"\n\t\t\t\t\t\t(checkedChanged)=\"menu.select($event)\"\n\t\t\t\t\t>\n\t\t\t\t\t\t@if (view() === 'scheme') {\n\t\t\t\t\t\t\t<div class=\"inline-flex items-center gap-2\">\n\t\t\t\t\t\t\t\t<st-icon [icon]=\"schemeIcon(choice.value)\" />\n\t\t\t\t\t\t\t\t<span>{{ choice.label }}</span>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t} @else {\n\t\t\t\t\t\t\t<span>{{ choice.label }}</span>\n\t\t\t\t\t\t}\n\t\t\t\t\t</st-dropdown-item-radio>\n\t\t\t\t}\n\t\t\t</div>\n\t\t} @else {\n\t\t\t<div #optionsView class=\"animate-morph-in\" data-st-user-menu-view=\"options\">\n\t\t\t\t@if (
|
|
323
|
+
}, template: "@let sidebar = variant() === 'sidebar';\n<st-dropdown [class]=\"sidebar ? 'block w-full' : 'inline-block'\" (openChange)=\"handleOpenChange($event)\">\n\t<st-dropdown-trigger\n\t\t[class]=\"sidebar ? 'block w-full *:w-full' : ''\"\n\t\toriginX=\"end\"\n\t\toriginY=\"bottom\"\n\t\t[overlayX]=\"sidebar ? 'start' : 'end'\"\n\t\t[overlayY]=\"sidebar ? 'bottom' : 'top'\"\n\t>\n\t\t<st-button variant=\"base\" [ghost]=\"true\" [block]=\"sidebar && !compact()\" [class]=\"triggerClass()\" data-st-user-menu-trigger>\n\t\t\t<span class=\"sr-only\">{{ triggerLabel() }}</span>\n\t\t\t@if (user(); as currentUser) {\n\t\t\t\t<st-avatar\n\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t\tclass=\"[&_span]:text-nowrap\"\n\t\t\t\t\t[class.p-1]=\"sidebar\"\n\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\t[shape]=\"sidebar ? 'square' : 'rounded'\"\n\t\t\t\t\t[ring]=\"sidebar\"\n\t\t\t\t\t[user]=\"currentUser\"\n\t\t\t\t\t[showNameAndRole]=\"!compact()\"\n\t\t\t\t/>\n\t\t\t} @else {\n\t\t\t\t<st-icon [icon]=\"icons.person\" />\n\t\t\t}\n\t\t\t@if (sidebar && !compact()) {\n\t\t\t\t<st-dropdown-chevron aria-hidden=\"true\" position=\"right\" size=\"auto\" />\n\t\t\t}\n\t\t</st-button>\n\t</st-dropdown-trigger>\n\t<st-dropdown-content class=\"min-w-64\">\n\t\t@if (submenu(); as menu) {\n\t\t\t<div class=\"animate-morph-in\" [attr.data-st-user-menu-view]=\"view()\">\n\t\t\t\t<div class=\"inline-flex items-center gap-2 py-1.5 ps-2\">\n\t\t\t\t\t<st-button\n\t\t\t\t\t\t#backButton\n\t\t\t\t\t\tclass=\"*:text-sm\"\n\t\t\t\t\t\tvariant=\"base\"\n\t\t\t\t\t\tsize=\"xs\"\n\t\t\t\t\t\t[ghost]=\"true\"\n\t\t\t\t\t\t[circle]=\"true\"\n\t\t\t\t\t\t[icon]=\"icons.back\"\n\t\t\t\t\t\t(triggered)=\"show('options')\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<span class=\"sr-only\">{{ 'sdk.layout.back' | translate }}</span>\n\t\t\t\t\t</st-button>\n\t\t\t\t\t<span stText=\"7\" stTextWeight=\"medium\">{{ menu.titleKey | translate }}</span>\n\t\t\t\t</div>\n\t\t\t\t<st-dropdown-separator />\n\t\t\t\t@for (choice of menu.choices; track choice.value) {\n\t\t\t\t\t<st-dropdown-item-radio\n\t\t\t\t\t\t[value]=\"choice.value\"\n\t\t\t\t\t\t[checked]=\"menu.current === choice.value\"\n\t\t\t\t\t\t[closeOnSelect]=\"false\"\n\t\t\t\t\t\t[attr.data-st-user-menu-choice]=\"choice.value\"\n\t\t\t\t\t\t(checkedChanged)=\"menu.select($event)\"\n\t\t\t\t\t>\n\t\t\t\t\t\t@if (view() === 'scheme') {\n\t\t\t\t\t\t\t<div class=\"inline-flex items-center gap-2\">\n\t\t\t\t\t\t\t\t<st-icon [icon]=\"schemeIcon(choice.value)\" />\n\t\t\t\t\t\t\t\t<span>{{ choice.label }}</span>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t} @else {\n\t\t\t\t\t\t\t<span>{{ choice.label }}</span>\n\t\t\t\t\t\t}\n\t\t\t\t\t</st-dropdown-item-radio>\n\t\t\t\t}\n\t\t\t</div>\n\t\t} @else {\n\t\t\t<div #optionsView class=\"animate-morph-in\" data-st-user-menu-view=\"options\">\n\t\t\t\t@if (hasAccountOptions()) {\n\t\t\t\t\t<st-dropdown-label>{{ 'sdk.layout.account' | translate }}</st-dropdown-label>\n\t\t\t\t\t@if (canChangePassword) {\n\t\t\t\t\t\t<st-dropdown-item data-st-user-menu-option=\"change-password\" (selected)=\"changePassword()\">\n\t\t\t\t\t\t\t<div class=\"inline-flex items-center gap-2\">\n\t\t\t\t\t\t\t\t<st-icon [icon]=\"icons.password\" />\n\t\t\t\t\t\t\t\t<span>{{ 'sdk.layout.change_password' | translate }}</span>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</st-dropdown-item>\n\t\t\t\t\t}\n\t\t\t\t\t@for (action of accountActions(); track action.id) {\n\t\t\t\t\t\t<st-dropdown-item [attr.data-st-user-menu-option]=\"action.id\" (selected)=\"action.run()\">\n\t\t\t\t\t\t\t<div class=\"inline-flex items-center gap-2\">\n\t\t\t\t\t\t\t\t@if (action.icon) {\n\t\t\t\t\t\t\t\t\t<st-icon [icon]=\"action.icon\" />\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t<span>{{ action.labelKey | translate }}</span>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</st-dropdown-item>\n\t\t\t\t\t}\n\t\t\t\t\t<st-dropdown-separator />\n\t\t\t\t}\n\t\t\t\t@if (hasPreferences()) {\n\t\t\t\t\t<st-dropdown-label>{{ 'sdk.layout.preferences' | translate }}</st-dropdown-label>\n\t\t\t\t\t@if (hasLanguageSelector()) {\n\t\t\t\t\t\t<st-dropdown-item data-st-user-menu-option=\"language\" [closeOnSelect]=\"false\" (selected)=\"show('language')\">\n\t\t\t\t\t\t\t<div class=\"inline-flex items-center gap-2\">\n\t\t\t\t\t\t\t\t<st-icon [icon]=\"icons.language\" />\n\t\t\t\t\t\t\t\t<span>{{ 'sdk.layout.language' | translate }}</span>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</st-dropdown-item>\n\t\t\t\t\t}\n\t\t\t\t\t@if (hasSchemeSelector()) {\n\t\t\t\t\t\t<st-dropdown-item data-st-user-menu-option=\"scheme\" [closeOnSelect]=\"false\" (selected)=\"show('scheme')\">\n\t\t\t\t\t\t\t<div class=\"inline-flex items-center gap-2\">\n\t\t\t\t\t\t\t\t<st-icon [icon]=\"schemeIcon(currentScheme())\" />\n\t\t\t\t\t\t\t\t<span>{{ 'sdk.layout.scheme' | translate }}</span>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</st-dropdown-item>\n\t\t\t\t\t}\n\t\t\t\t\t@if (hasThemeSelector()) {\n\t\t\t\t\t\t<st-dropdown-item data-st-user-menu-option=\"theme\" [closeOnSelect]=\"false\" (selected)=\"show('theme')\">\n\t\t\t\t\t\t\t<div class=\"inline-flex items-center gap-2\">\n\t\t\t\t\t\t\t\t<st-icon [icon]=\"icons.theme\" />\n\t\t\t\t\t\t\t\t<span>{{ 'sdk.layout.theme' | translate }}</span>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</st-dropdown-item>\n\t\t\t\t\t}\n\t\t\t\t\t@if (hasLayoutSelector()) {\n\t\t\t\t\t\t<st-dropdown-item data-st-user-menu-option=\"layout\" (selected)=\"openLayoutSwitcher.emit()\">\n\t\t\t\t\t\t\t<div class=\"inline-flex items-center gap-2\">\n\t\t\t\t\t\t\t\t<st-icon [icon]=\"icons.layout\" />\n\t\t\t\t\t\t\t\t<span>{{ 'sdk.layout.layout' | translate }}</span>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</st-dropdown-item>\n\t\t\t\t\t}\n\t\t\t\t\t<st-dropdown-separator />\n\t\t\t\t}\n\t\t\t\t<st-dropdown-item class=\"text-error\" data-st-user-menu-option=\"logout\" (selected)=\"logout()\">\n\t\t\t\t\t<div class=\"inline-flex items-center gap-2\">\n\t\t\t\t\t\t<st-icon [icon]=\"icons.logout\" />\n\t\t\t\t\t\t<span>{{ 'sdk.layout.logout' | translate }}</span>\n\t\t\t\t\t</div>\n\t\t\t\t</st-dropdown-item>\n\t\t\t</div>\n\t\t}\n\t</st-dropdown-content>\n</st-dropdown>\n" }]
|
|
322
324
|
}], ctorParameters: () => [] });
|
|
323
325
|
|
|
324
326
|
/**
|
|
@@ -376,6 +378,10 @@ function normalizeMenuRoute(route) {
|
|
|
376
378
|
const withSlash = clean.startsWith('/') ? clean : `/${clean}`;
|
|
377
379
|
return trimTrailingSlashes(withSlash);
|
|
378
380
|
}
|
|
381
|
+
/** True for the root route `/`, the shortest route prefix of every URL. */
|
|
382
|
+
function isRootMenuRoute(route) {
|
|
383
|
+
return normalizeMenuRoute(route) === '/';
|
|
384
|
+
}
|
|
379
385
|
/** True when `url` is the known route or sits beneath it, ignoring query and fragment. */
|
|
380
386
|
function menuRoutesMatch(knownRoute, url) {
|
|
381
387
|
const known = normalizeMenuRoute(knownRoute);
|
|
@@ -424,13 +430,14 @@ function trailScore(trail) {
|
|
|
424
430
|
}
|
|
425
431
|
/**
|
|
426
432
|
* Depth-first trail to the best matching item for `url`; the longest route prefix wins, the later item on a tie.
|
|
427
|
-
* A matching child beats its own parent on an equally long route.
|
|
433
|
+
* A matching child beats its own parent on an equally long route. A root entry (`/`) matches every URL as the
|
|
434
|
+
* shortest prefix, so it is active only when no longer route matches.
|
|
428
435
|
*/
|
|
429
436
|
function findRouteTrail(items, url, ancestors = []) {
|
|
430
437
|
let best = [];
|
|
431
438
|
for (const item of items) {
|
|
432
439
|
const trail = [...ancestors, item];
|
|
433
|
-
const ownTrail = menuRoutesMatch(item.route, url) ? trail : [];
|
|
440
|
+
const ownTrail = isRootMenuRoute(item.route) || menuRoutesMatch(item.route, url) ? trail : [];
|
|
434
441
|
const childTrail = menuItemHasChildren(item) ? findRouteTrail(item.children ?? [], url, trail) : [];
|
|
435
442
|
const candidate = childTrail.length > 0 && trailScore(childTrail) >= trailScore(ownTrail) ? childTrail : ownTrail;
|
|
436
443
|
if (candidate.length > 0 && trailScore(candidate) >= trailScore(best)) {
|
|
@@ -896,6 +903,12 @@ class PageBannerComponent {
|
|
|
896
903
|
subtitle = input('');
|
|
897
904
|
/** URL the back button navigates to; no button when empty. */
|
|
898
905
|
backLink = input(null);
|
|
906
|
+
/**
|
|
907
|
+
* Query params of the current URL the back button keeps, so shell state such as the host's `?menu=` survives the
|
|
908
|
+
* navigation. Defaults to `['menu']`; page-specific params (filters, tabs) are dropped unless listed. `'all'` keeps
|
|
909
|
+
* every param, `[]` keeps none. A param written in `backLink` itself always wins.
|
|
910
|
+
*/
|
|
911
|
+
backQueryParams = input([MENU_QUERY_PARAM]);
|
|
899
912
|
/** Theme asset key of the classic banner image; `null` for a plain surface. */
|
|
900
913
|
bannerAsset = input('banner');
|
|
901
914
|
/** Luminance of the banner image; overrides the tone the theme declares for the asset. */
|
|
@@ -932,12 +945,21 @@ class PageBannerComponent {
|
|
|
932
945
|
});
|
|
933
946
|
goBack() {
|
|
934
947
|
const url = this.backLink();
|
|
935
|
-
if (url)
|
|
936
|
-
|
|
937
|
-
|
|
948
|
+
if (!url)
|
|
949
|
+
return;
|
|
950
|
+
const target = this.router.parseUrl(url);
|
|
951
|
+
target.queryParams = { ...this.carriedQueryParams(), ...target.queryParams };
|
|
952
|
+
void this.router.navigateByUrl(target);
|
|
953
|
+
}
|
|
954
|
+
carriedQueryParams() {
|
|
955
|
+
const keep = this.backQueryParams();
|
|
956
|
+
const current = this.router.parseUrl(this.router.url).queryParams;
|
|
957
|
+
if (keep === 'all')
|
|
958
|
+
return current;
|
|
959
|
+
return Object.fromEntries(keep.filter((name) => Object.hasOwn(current, name)).map((name) => [name, current[name]]));
|
|
938
960
|
}
|
|
939
961
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: PageBannerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
940
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.25", type: PageBannerComponent, isStandalone: true, selector: "st-page-banner", inputs: { title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, subtitle: { classPropertyName: "subtitle", publicName: "subtitle", isSignal: true, isRequired: false, transformFunction: null }, backLink: { classPropertyName: "backLink", publicName: "backLink", isSignal: true, isRequired: false, transformFunction: null }, bannerAsset: { classPropertyName: "bannerAsset", publicName: "bannerAsset", isSignal: true, isRequired: false, transformFunction: null }, bannerTone: { classPropertyName: "bannerTone", publicName: "bannerTone", isSignal: true, isRequired: false, transformFunction: null }, class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "hostClass()" } }, ngImport: i0, template: "@if (isClassic()) {\n\t@if (bannerUrl(); as url) {\n\t\t<div\n\t\t\tdata-st-banner=\"image\"\n\t\t\t[style.background-image]=\"'url(' + url + ')'\"\n\t\t\tclass=\"rounded-box bg-neutral relative mb-6 flex h-30 items-end justify-between bg-cover bg-center px-6 py-5\"\n\t\t>\n\t\t\t@if (!imageTone()) {\n\t\t\t\t<!-- Unknown image tone: a caption gradient darkens only the corner behind the title, so white text reads over any photo and the rest of the art stays untouched -->\n\t\t\t\t<div\n\t\t\t\t\tdata-st-banner-scrim\n\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t\tclass=\"rounded-box pointer-events-none absolute inset-0 z-0 bg-linear-to-r from-black/70 via-black/40 via-60% to-transparent\"\n\t\t\t\t></div>\n\t\t\t}\n\n\t\t\t@if (backLink()) {\n\t\t\t\t<!-- Over art the button sits on a frosted base-100 surface with base-content text, so the label keeps 4.5:1 over any pixel in either scheme -->\n\t\t\t\t<div data-st-banner-back [class]=\"backClass()\">\n\t\t\t\t\t<st-button variant=\"base\" size=\"sm\" [ghost]=\"true\" [icon]=\"backIcon\" (clicked)=\"goBack()\">\n\t\t\t\t\t\t{{ 'sdk.layout.back' | translate }}\n\t\t\t\t\t</st-button>\n\t\t\t\t</div>\n\t\t\t}\n\n\t\t\t<!-- Fixed white/black opposite to the image luminance (unknown tone = white over the caption gradient), with a soft halo of the opposite color for busy art -->\n\t\t\t<div [class]=\"textClass()\">\n\t\t\t\t<h1 stText=\"1\" stTextWeight=\"medium\">{{ title() }}</h1>\n\t\t\t\t@if (subtitle()) {\n\t\t\t\t\t<p class=\"opacity-80\" stText=\"7\" stTextWeight=\"medium\" stTextLineClamp=\"2\">{{ subtitle() }}</p>\n\t\t\t\t}\n\t\t\t</div>\n\t\t</div>\n\t} @else {\n\t\t<div data-st-banner=\"plain\" class=\"rounded-box bg-base-200 relative mb-6 flex h-30 items-end justify-between px-6 py-5\">\n\t\t\t@if (backLink()) {\n\t\t\t\t<div data-st-banner-back class=\"absolute top-5 right-6 flex gap-3\" [class]=\"backFocusClass\">\n\t\t\t\t\t<st-button variant=\"tertiary\" size=\"sm\" [icon]=\"backIcon\" (clicked)=\"goBack()\">\n\t\t\t\t\t\t{{ 'sdk.layout.back' | translate }}\n\t\t\t\t\t</st-button>\n\t\t\t\t</div>\n\t\t\t}\n\n\t\t\t<div class=\"text-base-content flex min-w-0 flex-col wrap-break-word\">\n\t\t\t\t<h1 stText=\"1\" stTextWeight=\"medium\">{{ title() }}</h1>\n\t\t\t\t@if (subtitle()) {\n\t\t\t\t\t<p class=\"text-base-content/80\" stText=\"7\" stTextWeight=\"medium\" stTextLineClamp=\"2\">{{ subtitle() }}</p>\n\t\t\t\t}\n\t\t\t</div>\n\t\t</div>\n\t}\n} @else if (title()) {\n\t<!-- Modern: on the brand gradient, primary-gradient-content stays light in both schemes -->\n\t<div data-st-banner=\"modern\" class=\"mb-4 flex items-end justify-between\">\n\t\t<div class=\"text-primary-gradient-content flex min-w-0 flex-col wrap-break-word\">\n\t\t\t<h1 stText=\"1\" stTextWeight=\"medium\">{{ title() }}</h1>\n\t\t\t@if (subtitle()) {\n\t\t\t\t<p class=\"text-primary-gradient-content/70\" stText=\"7\" stTextWeight=\"medium\" stTextLineClamp=\"2\">{{ subtitle() }}</p>\n\t\t\t}\n\t\t</div>\n\n\t\t@if (backLink()) {\n\t\t\t<div data-st-banner-back [class]=\"frostedBackClass\">\n\t\t\t\t<st-button variant=\"base\" size=\"sm\" [ghost]=\"true\" [icon]=\"backIcon\" (clicked)=\"goBack()\">\n\t\t\t\t\t{{ 'sdk.layout.back' | translate }}\n\t\t\t\t</st-button>\n\t\t\t</div>\n\t\t}\n\t</div>\n}\n\n<!-- Stretch the routed page (a sibling of router-outlet) so feature cards can fill the shell -->\n<div\n\tclass=\"flex min-h-0 flex-1 flex-col [&>*:not(router-outlet)]:flex [&>*:not(router-outlet)]:min-h-full [&>*:not(router-outlet)]:flex-1 [&>*:not(router-outlet)]:flex-col\"\n>\n\t<ng-content />\n</div>\n", dependencies: [{ kind: "component", type: ButtonComponent, selector: "st-button", inputs: ["variant", "ghost", "outline", "link", "soft", "dash", "wide", "circle", "square", "glass", "block", "loader", "size", "shadow", "focusable", "icon", "iconPosition", "type", "disabled", "stopPropagation", "ariaLabel", "ariaExpanded", "ariaPressed", "ariaDescribedBy", "ariaControls"], outputs: ["clicked", "pointerDown", "keyDownEnter", "keyDownSpace", "triggered"] }, { kind: "directive", type: TextDirective, selector: "[stText]", inputs: ["stText", "stTextWeight", "stTextColor", "stTextOverflow", "stTextLineClamp", "stTextClass"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
962
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.25", type: PageBannerComponent, isStandalone: true, selector: "st-page-banner", inputs: { title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, subtitle: { classPropertyName: "subtitle", publicName: "subtitle", isSignal: true, isRequired: false, transformFunction: null }, backLink: { classPropertyName: "backLink", publicName: "backLink", isSignal: true, isRequired: false, transformFunction: null }, backQueryParams: { classPropertyName: "backQueryParams", publicName: "backQueryParams", isSignal: true, isRequired: false, transformFunction: null }, bannerAsset: { classPropertyName: "bannerAsset", publicName: "bannerAsset", isSignal: true, isRequired: false, transformFunction: null }, bannerTone: { classPropertyName: "bannerTone", publicName: "bannerTone", isSignal: true, isRequired: false, transformFunction: null }, class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "hostClass()" } }, ngImport: i0, template: "@if (isClassic()) {\n\t@if (bannerUrl(); as url) {\n\t\t<div\n\t\t\tdata-st-banner=\"image\"\n\t\t\t[style.background-image]=\"'url(' + url + ')'\"\n\t\t\tclass=\"rounded-box bg-neutral relative mb-6 flex h-30 items-end justify-between bg-cover bg-center px-6 py-5\"\n\t\t>\n\t\t\t@if (!imageTone()) {\n\t\t\t\t<!-- Unknown image tone: a caption gradient darkens only the corner behind the title, so white text reads over any photo and the rest of the art stays untouched -->\n\t\t\t\t<div\n\t\t\t\t\tdata-st-banner-scrim\n\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t\tclass=\"rounded-box pointer-events-none absolute inset-0 z-0 bg-linear-to-r from-black/70 via-black/40 via-60% to-transparent\"\n\t\t\t\t></div>\n\t\t\t}\n\n\t\t\t@if (backLink()) {\n\t\t\t\t<!-- Over art the button sits on a frosted base-100 surface with base-content text, so the label keeps 4.5:1 over any pixel in either scheme -->\n\t\t\t\t<div data-st-banner-back [class]=\"backClass()\">\n\t\t\t\t\t<st-button variant=\"base\" size=\"sm\" [ghost]=\"true\" [icon]=\"backIcon\" (clicked)=\"goBack()\">\n\t\t\t\t\t\t{{ 'sdk.layout.back' | translate }}\n\t\t\t\t\t</st-button>\n\t\t\t\t</div>\n\t\t\t}\n\n\t\t\t<!-- Fixed white/black opposite to the image luminance (unknown tone = white over the caption gradient), with a soft halo of the opposite color for busy art -->\n\t\t\t<div [class]=\"textClass()\">\n\t\t\t\t<h1 stText=\"1\" stTextWeight=\"medium\">{{ title() }}</h1>\n\t\t\t\t@if (subtitle()) {\n\t\t\t\t\t<p class=\"opacity-80\" stText=\"7\" stTextWeight=\"medium\" stTextLineClamp=\"2\">{{ subtitle() }}</p>\n\t\t\t\t}\n\t\t\t</div>\n\t\t</div>\n\t} @else {\n\t\t<div data-st-banner=\"plain\" class=\"rounded-box bg-base-200 relative mb-6 flex h-30 items-end justify-between px-6 py-5\">\n\t\t\t@if (backLink()) {\n\t\t\t\t<div data-st-banner-back class=\"absolute top-5 right-6 flex gap-3\" [class]=\"backFocusClass\">\n\t\t\t\t\t<st-button variant=\"tertiary\" size=\"sm\" [icon]=\"backIcon\" (clicked)=\"goBack()\">\n\t\t\t\t\t\t{{ 'sdk.layout.back' | translate }}\n\t\t\t\t\t</st-button>\n\t\t\t\t</div>\n\t\t\t}\n\n\t\t\t<div class=\"text-base-content flex min-w-0 flex-col wrap-break-word\">\n\t\t\t\t<h1 stText=\"1\" stTextWeight=\"medium\">{{ title() }}</h1>\n\t\t\t\t@if (subtitle()) {\n\t\t\t\t\t<p class=\"text-base-content/80\" stText=\"7\" stTextWeight=\"medium\" stTextLineClamp=\"2\">{{ subtitle() }}</p>\n\t\t\t\t}\n\t\t\t</div>\n\t\t</div>\n\t}\n} @else if (title()) {\n\t<!-- Modern: on the brand gradient, primary-gradient-content stays light in both schemes -->\n\t<div data-st-banner=\"modern\" class=\"mb-4 flex items-end justify-between\">\n\t\t<div class=\"text-primary-gradient-content flex min-w-0 flex-col wrap-break-word\">\n\t\t\t<h1 stText=\"1\" stTextWeight=\"medium\">{{ title() }}</h1>\n\t\t\t@if (subtitle()) {\n\t\t\t\t<p class=\"text-primary-gradient-content/70\" stText=\"7\" stTextWeight=\"medium\" stTextLineClamp=\"2\">{{ subtitle() }}</p>\n\t\t\t}\n\t\t</div>\n\n\t\t@if (backLink()) {\n\t\t\t<div data-st-banner-back [class]=\"frostedBackClass\">\n\t\t\t\t<st-button variant=\"base\" size=\"sm\" [ghost]=\"true\" [icon]=\"backIcon\" (clicked)=\"goBack()\">\n\t\t\t\t\t{{ 'sdk.layout.back' | translate }}\n\t\t\t\t</st-button>\n\t\t\t</div>\n\t\t}\n\t</div>\n}\n\n<!-- Stretch the routed page (a sibling of router-outlet) so feature cards can fill the shell -->\n<div\n\tclass=\"flex min-h-0 flex-1 flex-col [&>*:not(router-outlet)]:flex [&>*:not(router-outlet)]:min-h-full [&>*:not(router-outlet)]:flex-1 [&>*:not(router-outlet)]:flex-col\"\n>\n\t<ng-content />\n</div>\n", dependencies: [{ kind: "component", type: ButtonComponent, selector: "st-button", inputs: ["variant", "ghost", "outline", "link", "soft", "dash", "wide", "circle", "square", "glass", "block", "loader", "size", "shadow", "focusable", "icon", "iconPosition", "type", "disabled", "stopPropagation", "ariaLabel", "ariaExpanded", "ariaPressed", "ariaDescribedBy", "ariaControls"], outputs: ["clicked", "pointerDown", "keyDownEnter", "keyDownSpace", "triggered"] }, { kind: "directive", type: TextDirective, selector: "[stText]", inputs: ["stText", "stTextWeight", "stTextColor", "stTextOverflow", "stTextLineClamp", "stTextClass"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
941
963
|
}
|
|
942
964
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: PageBannerComponent, decorators: [{
|
|
943
965
|
type: Component,
|