@sdcorejs/angular 22.2.7 → 22.2.9
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 +4 -2
- package/assets/STYLE-GUIDE.md +2 -0
- package/assets/scss/core/form.scss +6 -0
- package/fesm2022/sdcorejs-angular-components-data-state.mjs +2 -2
- package/fesm2022/sdcorejs-angular-components-data-state.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-form-generic.mjs +6 -6
- package/fesm2022/sdcorejs-angular-components-form-generic.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-modal.mjs +2 -2
- package/fesm2022/sdcorejs-angular-components-modal.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-query-builder.mjs +35 -2
- package/fesm2022/sdcorejs-angular-components-query-builder.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-side-drawer.mjs +2 -2
- package/fesm2022/sdcorejs-angular-components-side-drawer.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-tab.mjs +2 -2
- package/fesm2022/sdcorejs-angular-components-tab.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-table.mjs +219 -79
- package/fesm2022/sdcorejs-angular-components-table.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-upload-file.mjs +3 -5
- package/fesm2022/sdcorejs-angular-components-upload-file.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components.mjs +0 -1
- package/fesm2022/sdcorejs-angular-components.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-directives.mjs +49 -11
- package/fesm2022/sdcorejs-angular-directives.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-switch.mjs +6 -3
- package/fesm2022/sdcorejs-angular-forms-switch.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-i18n.mjs +5 -0
- package/fesm2022/sdcorejs-angular-i18n.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-modules-layout.mjs +63 -14
- package/fesm2022/sdcorejs-angular-modules-layout.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-services-loading.mjs +9 -4
- package/fesm2022/sdcorejs-angular-services-loading.mjs.map +1 -1
- package/package.json +1 -7
- package/types/sdcorejs-angular-components-form-generic.d.ts +1 -0
- package/types/sdcorejs-angular-components-query-builder.d.ts +3 -0
- package/types/sdcorejs-angular-components-table.d.ts +1 -1
- package/types/sdcorejs-angular-components-upload-file.d.ts +1 -2
- package/types/sdcorejs-angular-components.d.ts +0 -1
- package/types/sdcorejs-angular-forms-switch.d.ts +3 -2
- package/types/sdcorejs-angular-i18n.d.ts +1 -0
- package/types/sdcorejs-angular-modules-layout.d.ts +15 -1
- package/fesm2022/sdcorejs-angular-components-chart.mjs +0 -310
- package/fesm2022/sdcorejs-angular-components-chart.mjs.map +0 -1
- package/types/sdcorejs-angular-components-chart.d.ts +0 -65
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { inject, ElementRef, input, booleanAttribute, effect, ChangeDetectionStrategy, Component, InjectionToken, Injectable, signal, computed, Pipe, DestroyRef, viewChild, output, isSignal, untracked, NgModule } from '@angular/core';
|
|
2
|
+
import { inject, ElementRef, input, booleanAttribute, effect, ChangeDetectionStrategy, Component, InjectionToken, Injectable, signal, computed, Pipe, DestroyRef, viewChild, output, isSignal, untracked, model, NgModule } from '@angular/core';
|
|
3
3
|
import * as i2 from '@angular/common';
|
|
4
4
|
import { DOCUMENT, CommonModule, NgTemplateOutlet } from '@angular/common';
|
|
5
5
|
import * as i1$3 from '@angular/router';
|
|
@@ -2034,6 +2034,17 @@ class SdLayoutMenuTreeComponent {
|
|
|
2034
2034
|
...(ngDevMode ? [{ debugName: "showPin" }] : /* istanbul ignore next */ []));
|
|
2035
2035
|
pinVisibility = input('hover', /* @ts-ignore */
|
|
2036
2036
|
...(ngDevMode ? [{ debugName: "pinVisibility" }] : /* istanbul ignore next */ []));
|
|
2037
|
+
/** V3 hierarchy and flat shortcuts are opt-in; V2/mobile retain the default presentation. */
|
|
2038
|
+
presentation = input('default', /* @ts-ignore */
|
|
2039
|
+
...(ngDevMode ? [{ debugName: "presentation" }] : /* istanbul ignore next */ []));
|
|
2040
|
+
collapsible = input(false, /* @ts-ignore */
|
|
2041
|
+
...(ngDevMode ? [{ debugName: "collapsible" }] : /* istanbul ignore next */ []));
|
|
2042
|
+
collapsedGroupKeys = model([], /* @ts-ignore */
|
|
2043
|
+
...(ngDevMode ? [{ debugName: "collapsedGroupKeys" }] : /* istanbul ignore next */ []));
|
|
2044
|
+
structured = computed(() => this.presentation() !== 'default', /* @ts-ignore */
|
|
2045
|
+
...(ngDevMode ? [{ debugName: "structured" }] : /* istanbul ignore next */ []));
|
|
2046
|
+
iconFontSet = computed(() => (this.structured() ? 'material-icons-outlined' : undefined), /* @ts-ignore */
|
|
2047
|
+
...(ngDevMode ? [{ debugName: "iconFontSet" }] : /* istanbul ignore next */ []));
|
|
2037
2048
|
navigate = output();
|
|
2038
2049
|
togglePinned = output();
|
|
2039
2050
|
nodes = computed(() => {
|
|
@@ -2041,6 +2052,10 @@ class SdLayoutMenuTreeComponent {
|
|
|
2041
2052
|
const hoveredPinKey = this.#hoveredPinKey();
|
|
2042
2053
|
const alwaysShowPin = this.pinVisibility() === 'always';
|
|
2043
2054
|
const query = this.query().trim();
|
|
2055
|
+
const structured = this.structured();
|
|
2056
|
+
const hierarchy = this.presentation() === 'hierarchy' && !query;
|
|
2057
|
+
const collapsible = this.collapsible() && !query;
|
|
2058
|
+
const collapsedKeys = new Set(this.collapsedGroupKeys());
|
|
2044
2059
|
const menus = query ? searchMenuLeaves(this.menus(), query) : this.menus();
|
|
2045
2060
|
// Nhiều menu cùng khớp route thì chỉ path sát nhất sáng: ở '/appointment/cs' thì '/appointment' không sáng nữa
|
|
2046
2061
|
const activeMenuPath = resolveActiveMenuPath(menus, this.activePath());
|
|
@@ -2054,13 +2069,20 @@ class SdLayoutMenuTreeComponent {
|
|
|
2054
2069
|
const path = 'path' in menu ? menu.path : '';
|
|
2055
2070
|
const title = menu.title ?? menu.tooltipTitle ?? '';
|
|
2056
2071
|
const isPinned = pinnedKeys.has(key);
|
|
2072
|
+
const isExpanded = !collapsible || !collapsedKeys.has(key);
|
|
2057
2073
|
nodes.push({
|
|
2058
2074
|
menu,
|
|
2059
2075
|
key,
|
|
2060
2076
|
title,
|
|
2061
2077
|
depth,
|
|
2062
|
-
paddingLeft: 12 + depth * 16,
|
|
2078
|
+
paddingLeft: structured ? (depth ? 38 + (depth - 1) * 16 : 10) : 12 + depth * 16,
|
|
2079
|
+
inset: structured && depth ? 28 + (depth - 1) * 16 : 0,
|
|
2080
|
+
branchOffsets: hierarchy ? Array.from({ length: depth }, (_, index) => 19 + index * 16) : [],
|
|
2081
|
+
showIcon: !structured || (hierarchy && depth === 0),
|
|
2082
|
+
isRoot: depth === 0 && (!structured || hierarchy),
|
|
2063
2083
|
isGroup,
|
|
2084
|
+
isCollapsible: isGroup && collapsible,
|
|
2085
|
+
isExpanded,
|
|
2064
2086
|
isActive: !!path && path === activeMenuPath,
|
|
2065
2087
|
isPinned,
|
|
2066
2088
|
isPinVisible: alwaysShowPin || isPinned || hoveredPinKey === key,
|
|
@@ -2069,7 +2091,7 @@ class SdLayoutMenuTreeComponent {
|
|
|
2069
2091
|
// quyết định vị trí. Tính trong `nodes` computed nên tự cập nhật khi đổi ngôn ngữ.
|
|
2070
2092
|
pinLabel: this.#i18n.t(isPinned ? 'core.module.layout.menu.unpin' : 'core.module.layout.menu.pin', { title }),
|
|
2071
2093
|
});
|
|
2072
|
-
if (isGroup && 'children' in menu)
|
|
2094
|
+
if (isGroup && isExpanded && 'children' in menu)
|
|
2073
2095
|
append(menu.children ?? [], depth + 1, [...ancestors, menu.title ?? key]);
|
|
2074
2096
|
}
|
|
2075
2097
|
};
|
|
@@ -2084,6 +2106,9 @@ class SdLayoutMenuTreeComponent {
|
|
|
2084
2106
|
if ('path' in menu)
|
|
2085
2107
|
this.navigate.emit(menu);
|
|
2086
2108
|
}
|
|
2109
|
+
onToggleGroup(key) {
|
|
2110
|
+
this.collapsedGroupKeys.update(keys => (keys.includes(key) ? keys.filter(value => value !== key) : [...keys, key]));
|
|
2111
|
+
}
|
|
2087
2112
|
onTogglePinned(event, menu) {
|
|
2088
2113
|
event.stopPropagation();
|
|
2089
2114
|
this.togglePinned.emit(menu);
|
|
@@ -2109,12 +2134,12 @@ class SdLayoutMenuTreeComponent {
|
|
|
2109
2134
|
this.#pinHoverTimerId = undefined;
|
|
2110
2135
|
}
|
|
2111
2136
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: SdLayoutMenuTreeComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2112
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.5", type: SdLayoutMenuTreeComponent, isStandalone: true, selector: "sd-layout-menu-tree", inputs: { menus: { classPropertyName: "menus", publicName: "menus", isSignal: true, isRequired: false, transformFunction: null }, query: { classPropertyName: "query", publicName: "query", isSignal: true, isRequired: false, transformFunction: null }, activePath: { classPropertyName: "activePath", publicName: "activePath", isSignal: true, isRequired: false, transformFunction: null }, pinnedKeys: { classPropertyName: "pinnedKeys", publicName: "pinnedKeys", isSignal: true, isRequired: false, transformFunction: null }, showPin: { classPropertyName: "showPin", publicName: "showPin", isSignal: true, isRequired: false, transformFunction: null }, pinVisibility: { classPropertyName: "pinVisibility", publicName: "pinVisibility", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { navigate: "navigate", togglePinned: "togglePinned" }, ngImport: i0, template: "<nav class=\"d-flex flex-column gap-4\" aria-label=\"Navigation menu\">\n @for (node of nodes(); track node.key) {\n @if (node.isGroup) {\n <div class=\"sd-layout-menu-tree__group d-flex align-items-center gap-8 T12M text-black400\" [style.padding-left.px]=\"node.paddingLeft\">\n <sd-icon [name]=\"node.menu.icon || 'folder'\"></sd-icon>\n <span class=\"text-ellipsis\">{{ node.title }}</span>\n </div>\n } @else {\n <div\n class=\"sd-layout-menu-tree__route d-flex align-items-center gap-4\"\n (mouseenter)=\"onPinHoverStart(node.key)\"\n (mouseleave)=\"onPinHoverEnd(node.key)\">\n <button\n type=\"button\"\n class=\"sd-layout-menu-tree__route-button d-flex align-items-center gap-8 flex-1 text-left T14R\"\n data-menu-route\n [attr.data-menu-key]=\"node.key\"\n [attr.aria-current]=\"node.isActive ? 'page' : null\"\n [class.sd-layout-menu-tree__route-button--active]=\"node.isActive\"\n [style.padding-left.px]=\"node.paddingLeft\"\n (click)=\"onNavigate(node.menu)\">\n @if (node.menu.iconUrl) {\n <img class=\"sd-layout-menu-tree__icon-image\" [src]=\"node.menu.iconUrl\" alt=\"\" />\n } @else {\n <sd-icon [name]=\"node.menu.icon || 'chevron_right'\"></sd-icon>\n }\n <span class=\"text-ellipsis\">{{ node.title }}</span>\n </button>\n @if (showPin()) {\n <button\n type=\"button\"\n class=\"sd-layout-menu-tree__pin d-flex align-items-center justify-content-center\"\n [class.sd-layout-menu-tree__pin--visible]=\"node.isPinVisible\"\n [attr.data-pin-key]=\"node.key\"\n [attr.aria-label]=\"node.pinLabel\"\n [attr.aria-pressed]=\"node.isPinned\"\n (click)=\"onTogglePinned($event, node.menu)\">\n <sd-icon name=\"push_pin\"></sd-icon>\n </button>\n }\n </div>\n }\n } @empty {\n <div class=\"d-flex flex-column align-items-center justify-content-center gap-12 p-24 text-black400 T14R\">\n Kh\u00F4ng t\u00ECm th\u1EA5y menu ph\u00F9 h\u1EE3p\n </div>\n }\n</nav>\n", styles: [".sd-layout-menu-tree__route-button,.sd-layout-menu-tree__pin{min-height:40px;border:0;background:transparent;color:var(--sd-black500, var(--sd-text, #1a1b1f));cursor:pointer;border-radius:8px;transition:background-color .12s ease,color .12s ease}.sd-layout-menu-tree__route-button--active{color:var(--sd-primary);background:var(--sd-primary-light);font-weight:500}.sd-layout-menu-tree__route-button:hover,.sd-layout-menu-tree__pin:hover{background:var(--sd-black100, var(--sd-surface-muted, #f3f3f3));color:var(--sd-primary, #005cbb)}.sd-layout-menu-tree__route-button--active:hover{background:var(--sd-primary-light, #d7e3ff)}.sd-layout-menu-tree__route-button:focus-visible,.sd-layout-menu-tree__pin:focus-visible{outline:2px solid var(--sd-primary);outline-offset:2px}.sd-layout-menu-tree__pin{width:36px;flex:0 0 36px;opacity:0;pointer-events:none;transition:opacity .12s ease,background-color .12s ease,color .12s ease}.sd-layout-menu-tree__pin--visible,.sd-layout-menu-tree__pin:focus-visible{opacity:1;pointer-events:auto}.sd-layout-menu-tree__group{min-height:32px}.sd-layout-menu-tree__icon-image{width:20px;height:20px;object-fit:contain}@media(prefers-reduced-motion:reduce){.sd-layout-menu-tree__route-button,.sd-layout-menu-tree__pin{transition:none}}\n"], dependencies: [{ kind: "component", type: SdIcon, selector: "sd-icon", inputs: ["name", "fontIcon", "color", "set", "fontSet", "size", "strokeWidth", "absoluteStrokeWidth", "ariaLabel"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2137
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.5", type: SdLayoutMenuTreeComponent, isStandalone: true, selector: "sd-layout-menu-tree", inputs: { menus: { classPropertyName: "menus", publicName: "menus", isSignal: true, isRequired: false, transformFunction: null }, query: { classPropertyName: "query", publicName: "query", isSignal: true, isRequired: false, transformFunction: null }, activePath: { classPropertyName: "activePath", publicName: "activePath", isSignal: true, isRequired: false, transformFunction: null }, pinnedKeys: { classPropertyName: "pinnedKeys", publicName: "pinnedKeys", isSignal: true, isRequired: false, transformFunction: null }, showPin: { classPropertyName: "showPin", publicName: "showPin", isSignal: true, isRequired: false, transformFunction: null }, pinVisibility: { classPropertyName: "pinVisibility", publicName: "pinVisibility", isSignal: true, isRequired: false, transformFunction: null }, presentation: { classPropertyName: "presentation", publicName: "presentation", isSignal: true, isRequired: false, transformFunction: null }, collapsible: { classPropertyName: "collapsible", publicName: "collapsible", isSignal: true, isRequired: false, transformFunction: null }, collapsedGroupKeys: { classPropertyName: "collapsedGroupKeys", publicName: "collapsedGroupKeys", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { collapsedGroupKeys: "collapsedGroupKeysChange", navigate: "navigate", togglePinned: "togglePinned" }, ngImport: i0, template: "@let _structured = structured();\n@let _showPin = showPin();\n@let _iconFontSet = iconFontSet();\n<nav\n class=\"sd-layout-menu-tree d-flex flex-column gap-4\"\n [class.sd-layout-menu-tree--structured]=\"_structured\"\n [class.sd-layout-menu-tree--pinnable]=\"_showPin\"\n aria-label=\"Navigation menu\">\n @for (node of nodes(); track node.key) {\n @if (node.isGroup) {\n @if (node.isCollapsible) {\n <button\n type=\"button\"\n class=\"sd-layout-menu-tree__group sd-layout-menu-tree__group-toggle d-flex align-items-center gap-8 T12M text-black400\"\n [attr.data-menu-group]=\"node.key\"\n [attr.aria-label]=\"node.title\"\n [attr.aria-expanded]=\"node.isExpanded\"\n [class.sd-layout-menu-tree__root]=\"node.isRoot\"\n [style.padding-left.px]=\"node.paddingLeft\"\n (click)=\"onToggleGroup(node.key)\">\n <ng-container [ngTemplateOutlet]=\"groupContent\" [ngTemplateOutletContext]=\"{ $implicit: node }\"></ng-container>\n <sd-icon\n class=\"sd-layout-menu-tree__disclosure\"\n [name]=\"node.isExpanded ? 'expand_more' : 'chevron_right'\"\n size=\"18px\"\n aria-hidden=\"true\"></sd-icon>\n </button>\n } @else {\n <div\n class=\"sd-layout-menu-tree__group d-flex align-items-center gap-8 T12M text-black400\"\n [class.sd-layout-menu-tree__root]=\"node.isRoot\"\n [style.padding-left.px]=\"node.paddingLeft\">\n <ng-container [ngTemplateOutlet]=\"groupContent\" [ngTemplateOutletContext]=\"{ $implicit: node }\"></ng-container>\n </div>\n }\n } @else {\n <div\n class=\"sd-layout-menu-tree__route d-flex align-items-center gap-4\"\n [class.sd-layout-menu-tree__root]=\"node.isRoot\"\n (mouseenter)=\"onPinHoverStart(node.key)\"\n (mouseleave)=\"onPinHoverEnd(node.key)\">\n @for (offset of node.branchOffsets; track offset) {\n <span data-menu-branch class=\"sd-layout-menu-tree__branch\" [style.left.px]=\"offset\" aria-hidden=\"true\"></span>\n }\n <button\n type=\"button\"\n class=\"sd-layout-menu-tree__route-button d-flex align-items-center gap-8 flex-1 text-left T14R\"\n data-menu-route\n [attr.data-menu-key]=\"node.key\"\n [attr.aria-current]=\"node.isActive ? 'page' : null\"\n [class.sd-layout-menu-tree__route-button--active]=\"node.isActive\"\n [style.margin-left.px]=\"node.inset\"\n [style.padding-left.px]=\"node.paddingLeft - node.inset\"\n [class.sd-layout-menu-tree__route-button--nested]=\"node.depth > 0\"\n (click)=\"onNavigate(node.menu)\">\n @if (node.showIcon) {\n @if (node.menu.iconUrl) {\n <img data-menu-icon class=\"sd-layout-menu-tree__icon-image\" [src]=\"node.menu.iconUrl\" alt=\"\" />\n } @else {\n <sd-icon\n data-menu-icon\n [name]=\"node.menu.icon || 'chevron_right'\"\n [fontSet]=\"_iconFontSet\"\n [size]=\"_structured ? '20px' : undefined\"></sd-icon>\n }\n }\n <span class=\"sd-layout-menu-tree__label\" [class.text-ellipsis]=\"!_structured\">{{ node.title }}</span>\n </button>\n @if (_showPin) {\n <button\n type=\"button\"\n class=\"sd-layout-menu-tree__pin d-flex align-items-center justify-content-center\"\n [class.sd-layout-menu-tree__pin--visible]=\"node.isPinVisible\"\n [attr.data-pin-key]=\"node.key\"\n [attr.aria-label]=\"node.pinLabel\"\n [attr.aria-pressed]=\"node.isPinned\"\n (click)=\"onTogglePinned($event, node.menu)\">\n <sd-icon name=\"push_pin\"></sd-icon>\n </button>\n }\n </div>\n }\n } @empty {\n <div class=\"d-flex flex-column align-items-center justify-content-center gap-12 p-24 text-black400 T14R\">\n Kh\u00F4ng t\u00ECm th\u1EA5y menu ph\u00F9 h\u1EE3p\n </div>\n }\n</nav>\n\n<ng-template #groupContent let-node>\n @for (offset of node.branchOffsets; track offset) {\n <span data-menu-branch class=\"sd-layout-menu-tree__branch\" [style.left.px]=\"offset\" aria-hidden=\"true\"></span>\n }\n @if (node.showIcon) {\n @if (_structured && node.menu.iconUrl) {\n <img data-menu-icon class=\"sd-layout-menu-tree__icon-image\" [src]=\"node.menu.iconUrl\" alt=\"\" />\n } @else {\n <sd-icon data-menu-icon [name]=\"node.menu.icon || 'folder'\" [fontSet]=\"_iconFontSet\" [size]=\"_structured ? '20px' : undefined\"></sd-icon>\n }\n }\n <span class=\"sd-layout-menu-tree__label\" [class.text-ellipsis]=\"!_structured\">{{ node.title }}</span>\n</ng-template>\n", styles: [".sd-layout-menu-tree__route-button,.sd-layout-menu-tree__group-toggle,.sd-layout-menu-tree__pin{min-height:40px;border:0;background:transparent;color:var(--sd-black500, var(--sd-text, #1a1b1f));cursor:pointer;border-radius:8px;transition:background-color .12s ease,color .12s ease}.sd-layout-menu-tree__route-button--active{color:var(--sd-primary);background:var(--sd-primary-light);font-weight:500}.sd-layout-menu-tree__route-button:hover,.sd-layout-menu-tree__group-toggle:hover,.sd-layout-menu-tree__pin:hover{background:var(--sd-black100, var(--sd-surface-muted, #f3f3f3));color:var(--sd-primary, #005cbb)}.sd-layout-menu-tree__route-button--active:hover{background:var(--sd-primary-light, #d7e3ff)}.sd-layout-menu-tree__route-button:focus-visible,.sd-layout-menu-tree__group-toggle:focus-visible,.sd-layout-menu-tree__pin:focus-visible{outline:2px solid var(--sd-primary);outline-offset:2px}.sd-layout-menu-tree__pin{width:36px;flex:0 0 36px;opacity:0;pointer-events:none;transition:opacity .12s ease,background-color .12s ease,color .12s ease}.sd-layout-menu-tree__pin--visible,.sd-layout-menu-tree__pin:focus-visible{opacity:1;pointer-events:auto}.sd-layout-menu-tree__group{min-height:32px}.sd-layout-menu-tree__group-toggle{text-align:left;padding-top:7px;padding-bottom:7px}.sd-layout-menu-tree__disclosure{flex:0 0 18px;margin-left:auto}.sd-layout-menu-tree__icon-image{width:20px;height:20px;object-fit:contain}.sd-layout-menu-tree--structured{--menu-surface: var(--sd-white, #fff);--menu-line: color-mix(in srgb, var(--sd-border, #c4c6d0) 45%, var(--menu-surface));--menu-ink: var(--sd-text, #252c38);--menu-muted: var(--sd-text-secondary, #6b7280);gap:0!important}.sd-layout-menu-tree--structured .sd-layout-menu-tree__group,.sd-layout-menu-tree--structured .sd-layout-menu-tree__route{position:relative;min-width:0;margin:2px 0}.sd-layout-menu-tree--structured .sd-layout-menu-tree__group{min-height:34px;padding-right:10px;color:var(--menu-muted);font-weight:500;font-family:inherit;font-size:13px;line-height:1.4}.sd-layout-menu-tree--structured .sd-layout-menu-tree__root{min-height:40px;color:var(--menu-ink)}.sd-layout-menu-tree--structured .sd-layout-menu-tree__group.sd-layout-menu-tree__root:not(:first-child){margin-top:10px}.sd-layout-menu-tree--structured .sd-layout-menu-tree__branch{position:absolute;top:-2px;bottom:-2px;width:1px;background:var(--menu-line);pointer-events:none}.sd-layout-menu-tree--structured .sd-layout-menu-tree__route-button{position:relative;min-width:0;min-height:34px;padding-top:7px;padding-right:10px;padding-bottom:7px;border-radius:6px;color:var(--menu-ink);font-family:inherit;font-size:13px;font-weight:400;line-height:1.4}.sd-layout-menu-tree--structured .sd-layout-menu-tree__root .sd-layout-menu-tree__route-button{min-height:40px;border-radius:7px;font-weight:500}.sd-layout-menu-tree--structured .sd-layout-menu-tree__label{white-space:normal;overflow-wrap:anywhere;text-overflow:clip;min-width:0}.sd-layout-menu-tree--structured [data-menu-icon]{flex:0 0 20px;color:var(--menu-muted)}.sd-layout-menu-tree--structured .sd-layout-menu-tree__route-button:hover,.sd-layout-menu-tree--structured .sd-layout-menu-tree__group-toggle:hover{background:color-mix(in srgb,var(--sd-surface-muted, #e7e8ed) 35%,var(--menu-surface))}.sd-layout-menu-tree--structured .sd-layout-menu-tree__route-button--active,.sd-layout-menu-tree--structured .sd-layout-menu-tree__route-button--active:hover{color:var(--sd-primary, #005cbb);background:var(--sd-primary-light, #eaf1fa);font-weight:500}.sd-layout-menu-tree--structured .sd-layout-menu-tree__route-button--active:before,.sd-layout-menu-tree--structured .sd-layout-menu-tree__route-button--active:hover:before{content:\"\";position:absolute;left:0;top:9px;bottom:9px;width:3px;border-radius:2px;background:var(--sd-primary, #005cbb)}.sd-layout-menu-tree--structured .sd-layout-menu-tree__route-button--active [data-menu-icon],.sd-layout-menu-tree--structured .sd-layout-menu-tree__route-button--active:hover [data-menu-icon]{color:inherit}.sd-layout-menu-tree--structured .sd-layout-menu-tree__route-button--active.sd-layout-menu-tree__route-button--nested:before{left:-10px}.sd-layout-menu-tree--structured .sd-layout-menu-tree__pin{position:absolute;right:2px;top:50%;transform:translateY(-50%);width:32px;min-height:32px;border-radius:6px;color:var(--menu-muted)}.sd-layout-menu-tree--structured.sd-layout-menu-tree--pinnable .sd-layout-menu-tree__route-button{padding-right:38px}.sd-layout-menu-tree--structured .sd-layout-menu-tree__route-button:focus-visible,.sd-layout-menu-tree--structured .sd-layout-menu-tree__group-toggle:focus-visible,.sd-layout-menu-tree--structured .sd-layout-menu-tree__pin:focus-visible{outline-offset:-2px}@media(pointer:coarse){.sd-layout-menu-tree--structured .sd-layout-menu-tree__route .sd-layout-menu-tree__route-button,.sd-layout-menu-tree--structured .sd-layout-menu-tree__group-toggle,.sd-layout-menu-tree--structured .sd-layout-menu-tree__pin{min-height:44px}.sd-layout-menu-tree--structured .sd-layout-menu-tree__pin{width:44px;opacity:1;pointer-events:auto}.sd-layout-menu-tree--structured.sd-layout-menu-tree--pinnable .sd-layout-menu-tree__route-button{padding-right:50px}}@media(prefers-reduced-motion:reduce){.sd-layout-menu-tree__route-button,.sd-layout-menu-tree__group-toggle,.sd-layout-menu-tree__pin{transition:none}}\n"], dependencies: [{ kind: "component", type: SdIcon, selector: "sd-icon", inputs: ["name", "fontIcon", "color", "set", "fontSet", "size", "strokeWidth", "absoluteStrokeWidth", "ariaLabel"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2113
2138
|
}
|
|
2114
2139
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: SdLayoutMenuTreeComponent, decorators: [{
|
|
2115
2140
|
type: Component,
|
|
2116
|
-
args: [{ selector: 'sd-layout-menu-tree', standalone: true, imports: [SdIcon], changeDetection: ChangeDetectionStrategy.OnPush, template: "<nav class=\"d-flex flex-column gap-4\" aria-label=\"Navigation menu\">\n @for (node of nodes(); track node.key) {\n @if (node.isGroup) {\n <div class=\"sd-layout-menu-tree__group d-flex align-items-center gap-8 T12M text-black400\" [style.padding-left.px]=\"node.paddingLeft\">\n <sd-icon [name]=\"node.menu.icon || 'folder'\"></sd-icon>\n <span class=\"text-ellipsis\">{{ node.title }}</span>\n </div>\n } @else {\n <div\n class=\"sd-layout-menu-tree__route d-flex align-items-center gap-4\"\n (mouseenter)=\"onPinHoverStart(node.key)\"\n (mouseleave)=\"onPinHoverEnd(node.key)\">\n <button\n type=\"button\"\n class=\"sd-layout-menu-tree__route-button d-flex align-items-center gap-8 flex-1 text-left T14R\"\n data-menu-route\n [attr.data-menu-key]=\"node.key\"\n [attr.aria-current]=\"node.isActive ? 'page' : null\"\n [class.sd-layout-menu-tree__route-button--active]=\"node.isActive\"\n [style.padding-left.px]=\"node.paddingLeft\"\n (click)=\"onNavigate(node.menu)\">\n @if (node.menu.iconUrl) {\n <img class=\"sd-layout-menu-tree__icon-image\" [src]=\"node.menu.iconUrl\" alt=\"\" />\n } @else {\n <sd-icon [name]=\"node.menu.icon || 'chevron_right'\"></sd-icon>\n }\n <span class=\"text-ellipsis\">{{ node.title }}</span>\n </button>\n @if (showPin()) {\n <button\n type=\"button\"\n class=\"sd-layout-menu-tree__pin d-flex align-items-center justify-content-center\"\n [class.sd-layout-menu-tree__pin--visible]=\"node.isPinVisible\"\n [attr.data-pin-key]=\"node.key\"\n [attr.aria-label]=\"node.pinLabel\"\n [attr.aria-pressed]=\"node.isPinned\"\n (click)=\"onTogglePinned($event, node.menu)\">\n <sd-icon name=\"push_pin\"></sd-icon>\n </button>\n }\n </div>\n }\n } @empty {\n <div class=\"d-flex flex-column align-items-center justify-content-center gap-12 p-24 text-black400 T14R\">\n Kh\u00F4ng t\u00ECm th\u1EA5y menu ph\u00F9 h\u1EE3p\n </div>\n }\n</nav>\n", styles: [".sd-layout-menu-tree__route-button,.sd-layout-menu-tree__pin{min-height:40px;border:0;background:transparent;color:var(--sd-black500, var(--sd-text, #1a1b1f));cursor:pointer;border-radius:8px;transition:background-color .12s ease,color .12s ease}.sd-layout-menu-tree__route-button--active{color:var(--sd-primary);background:var(--sd-primary-light);font-weight:500}.sd-layout-menu-tree__route-button:hover,.sd-layout-menu-tree__pin:hover{background:var(--sd-black100, var(--sd-surface-muted, #f3f3f3));color:var(--sd-primary, #005cbb)}.sd-layout-menu-tree__route-button--active:hover{background:var(--sd-primary-light, #d7e3ff)}.sd-layout-menu-tree__route-button:focus-visible,.sd-layout-menu-tree__pin:focus-visible{outline:2px solid var(--sd-primary);outline-offset:2px}.sd-layout-menu-tree__pin{width:36px;flex:0 0 36px;opacity:0;pointer-events:none;transition:opacity .12s ease,background-color .12s ease,color .12s ease}.sd-layout-menu-tree__pin--visible,.sd-layout-menu-tree__pin:focus-visible{opacity:1;pointer-events:auto}.sd-layout-menu-tree__group{min-height:32px}.sd-layout-menu-tree__icon-image{width:20px;height:20px;object-fit:contain}@media(prefers-reduced-motion:reduce){.sd-layout-menu-tree__route-button,.sd-layout-menu-tree__pin{transition:none}}\n"] }]
|
|
2117
|
-
}], ctorParameters: () => [], propDecorators: { menus: [{ type: i0.Input, args: [{ isSignal: true, alias: "menus", required: false }] }], query: [{ type: i0.Input, args: [{ isSignal: true, alias: "query", required: false }] }], activePath: [{ type: i0.Input, args: [{ isSignal: true, alias: "activePath", required: false }] }], pinnedKeys: [{ type: i0.Input, args: [{ isSignal: true, alias: "pinnedKeys", required: false }] }], showPin: [{ type: i0.Input, args: [{ isSignal: true, alias: "showPin", required: false }] }], pinVisibility: [{ type: i0.Input, args: [{ isSignal: true, alias: "pinVisibility", required: false }] }], navigate: [{ type: i0.Output, args: ["navigate"] }], togglePinned: [{ type: i0.Output, args: ["togglePinned"] }] } });
|
|
2141
|
+
args: [{ selector: 'sd-layout-menu-tree', standalone: true, imports: [SdIcon, NgTemplateOutlet], changeDetection: ChangeDetectionStrategy.OnPush, template: "@let _structured = structured();\n@let _showPin = showPin();\n@let _iconFontSet = iconFontSet();\n<nav\n class=\"sd-layout-menu-tree d-flex flex-column gap-4\"\n [class.sd-layout-menu-tree--structured]=\"_structured\"\n [class.sd-layout-menu-tree--pinnable]=\"_showPin\"\n aria-label=\"Navigation menu\">\n @for (node of nodes(); track node.key) {\n @if (node.isGroup) {\n @if (node.isCollapsible) {\n <button\n type=\"button\"\n class=\"sd-layout-menu-tree__group sd-layout-menu-tree__group-toggle d-flex align-items-center gap-8 T12M text-black400\"\n [attr.data-menu-group]=\"node.key\"\n [attr.aria-label]=\"node.title\"\n [attr.aria-expanded]=\"node.isExpanded\"\n [class.sd-layout-menu-tree__root]=\"node.isRoot\"\n [style.padding-left.px]=\"node.paddingLeft\"\n (click)=\"onToggleGroup(node.key)\">\n <ng-container [ngTemplateOutlet]=\"groupContent\" [ngTemplateOutletContext]=\"{ $implicit: node }\"></ng-container>\n <sd-icon\n class=\"sd-layout-menu-tree__disclosure\"\n [name]=\"node.isExpanded ? 'expand_more' : 'chevron_right'\"\n size=\"18px\"\n aria-hidden=\"true\"></sd-icon>\n </button>\n } @else {\n <div\n class=\"sd-layout-menu-tree__group d-flex align-items-center gap-8 T12M text-black400\"\n [class.sd-layout-menu-tree__root]=\"node.isRoot\"\n [style.padding-left.px]=\"node.paddingLeft\">\n <ng-container [ngTemplateOutlet]=\"groupContent\" [ngTemplateOutletContext]=\"{ $implicit: node }\"></ng-container>\n </div>\n }\n } @else {\n <div\n class=\"sd-layout-menu-tree__route d-flex align-items-center gap-4\"\n [class.sd-layout-menu-tree__root]=\"node.isRoot\"\n (mouseenter)=\"onPinHoverStart(node.key)\"\n (mouseleave)=\"onPinHoverEnd(node.key)\">\n @for (offset of node.branchOffsets; track offset) {\n <span data-menu-branch class=\"sd-layout-menu-tree__branch\" [style.left.px]=\"offset\" aria-hidden=\"true\"></span>\n }\n <button\n type=\"button\"\n class=\"sd-layout-menu-tree__route-button d-flex align-items-center gap-8 flex-1 text-left T14R\"\n data-menu-route\n [attr.data-menu-key]=\"node.key\"\n [attr.aria-current]=\"node.isActive ? 'page' : null\"\n [class.sd-layout-menu-tree__route-button--active]=\"node.isActive\"\n [style.margin-left.px]=\"node.inset\"\n [style.padding-left.px]=\"node.paddingLeft - node.inset\"\n [class.sd-layout-menu-tree__route-button--nested]=\"node.depth > 0\"\n (click)=\"onNavigate(node.menu)\">\n @if (node.showIcon) {\n @if (node.menu.iconUrl) {\n <img data-menu-icon class=\"sd-layout-menu-tree__icon-image\" [src]=\"node.menu.iconUrl\" alt=\"\" />\n } @else {\n <sd-icon\n data-menu-icon\n [name]=\"node.menu.icon || 'chevron_right'\"\n [fontSet]=\"_iconFontSet\"\n [size]=\"_structured ? '20px' : undefined\"></sd-icon>\n }\n }\n <span class=\"sd-layout-menu-tree__label\" [class.text-ellipsis]=\"!_structured\">{{ node.title }}</span>\n </button>\n @if (_showPin) {\n <button\n type=\"button\"\n class=\"sd-layout-menu-tree__pin d-flex align-items-center justify-content-center\"\n [class.sd-layout-menu-tree__pin--visible]=\"node.isPinVisible\"\n [attr.data-pin-key]=\"node.key\"\n [attr.aria-label]=\"node.pinLabel\"\n [attr.aria-pressed]=\"node.isPinned\"\n (click)=\"onTogglePinned($event, node.menu)\">\n <sd-icon name=\"push_pin\"></sd-icon>\n </button>\n }\n </div>\n }\n } @empty {\n <div class=\"d-flex flex-column align-items-center justify-content-center gap-12 p-24 text-black400 T14R\">\n Kh\u00F4ng t\u00ECm th\u1EA5y menu ph\u00F9 h\u1EE3p\n </div>\n }\n</nav>\n\n<ng-template #groupContent let-node>\n @for (offset of node.branchOffsets; track offset) {\n <span data-menu-branch class=\"sd-layout-menu-tree__branch\" [style.left.px]=\"offset\" aria-hidden=\"true\"></span>\n }\n @if (node.showIcon) {\n @if (_structured && node.menu.iconUrl) {\n <img data-menu-icon class=\"sd-layout-menu-tree__icon-image\" [src]=\"node.menu.iconUrl\" alt=\"\" />\n } @else {\n <sd-icon data-menu-icon [name]=\"node.menu.icon || 'folder'\" [fontSet]=\"_iconFontSet\" [size]=\"_structured ? '20px' : undefined\"></sd-icon>\n }\n }\n <span class=\"sd-layout-menu-tree__label\" [class.text-ellipsis]=\"!_structured\">{{ node.title }}</span>\n</ng-template>\n", styles: [".sd-layout-menu-tree__route-button,.sd-layout-menu-tree__group-toggle,.sd-layout-menu-tree__pin{min-height:40px;border:0;background:transparent;color:var(--sd-black500, var(--sd-text, #1a1b1f));cursor:pointer;border-radius:8px;transition:background-color .12s ease,color .12s ease}.sd-layout-menu-tree__route-button--active{color:var(--sd-primary);background:var(--sd-primary-light);font-weight:500}.sd-layout-menu-tree__route-button:hover,.sd-layout-menu-tree__group-toggle:hover,.sd-layout-menu-tree__pin:hover{background:var(--sd-black100, var(--sd-surface-muted, #f3f3f3));color:var(--sd-primary, #005cbb)}.sd-layout-menu-tree__route-button--active:hover{background:var(--sd-primary-light, #d7e3ff)}.sd-layout-menu-tree__route-button:focus-visible,.sd-layout-menu-tree__group-toggle:focus-visible,.sd-layout-menu-tree__pin:focus-visible{outline:2px solid var(--sd-primary);outline-offset:2px}.sd-layout-menu-tree__pin{width:36px;flex:0 0 36px;opacity:0;pointer-events:none;transition:opacity .12s ease,background-color .12s ease,color .12s ease}.sd-layout-menu-tree__pin--visible,.sd-layout-menu-tree__pin:focus-visible{opacity:1;pointer-events:auto}.sd-layout-menu-tree__group{min-height:32px}.sd-layout-menu-tree__group-toggle{text-align:left;padding-top:7px;padding-bottom:7px}.sd-layout-menu-tree__disclosure{flex:0 0 18px;margin-left:auto}.sd-layout-menu-tree__icon-image{width:20px;height:20px;object-fit:contain}.sd-layout-menu-tree--structured{--menu-surface: var(--sd-white, #fff);--menu-line: color-mix(in srgb, var(--sd-border, #c4c6d0) 45%, var(--menu-surface));--menu-ink: var(--sd-text, #252c38);--menu-muted: var(--sd-text-secondary, #6b7280);gap:0!important}.sd-layout-menu-tree--structured .sd-layout-menu-tree__group,.sd-layout-menu-tree--structured .sd-layout-menu-tree__route{position:relative;min-width:0;margin:2px 0}.sd-layout-menu-tree--structured .sd-layout-menu-tree__group{min-height:34px;padding-right:10px;color:var(--menu-muted);font-weight:500;font-family:inherit;font-size:13px;line-height:1.4}.sd-layout-menu-tree--structured .sd-layout-menu-tree__root{min-height:40px;color:var(--menu-ink)}.sd-layout-menu-tree--structured .sd-layout-menu-tree__group.sd-layout-menu-tree__root:not(:first-child){margin-top:10px}.sd-layout-menu-tree--structured .sd-layout-menu-tree__branch{position:absolute;top:-2px;bottom:-2px;width:1px;background:var(--menu-line);pointer-events:none}.sd-layout-menu-tree--structured .sd-layout-menu-tree__route-button{position:relative;min-width:0;min-height:34px;padding-top:7px;padding-right:10px;padding-bottom:7px;border-radius:6px;color:var(--menu-ink);font-family:inherit;font-size:13px;font-weight:400;line-height:1.4}.sd-layout-menu-tree--structured .sd-layout-menu-tree__root .sd-layout-menu-tree__route-button{min-height:40px;border-radius:7px;font-weight:500}.sd-layout-menu-tree--structured .sd-layout-menu-tree__label{white-space:normal;overflow-wrap:anywhere;text-overflow:clip;min-width:0}.sd-layout-menu-tree--structured [data-menu-icon]{flex:0 0 20px;color:var(--menu-muted)}.sd-layout-menu-tree--structured .sd-layout-menu-tree__route-button:hover,.sd-layout-menu-tree--structured .sd-layout-menu-tree__group-toggle:hover{background:color-mix(in srgb,var(--sd-surface-muted, #e7e8ed) 35%,var(--menu-surface))}.sd-layout-menu-tree--structured .sd-layout-menu-tree__route-button--active,.sd-layout-menu-tree--structured .sd-layout-menu-tree__route-button--active:hover{color:var(--sd-primary, #005cbb);background:var(--sd-primary-light, #eaf1fa);font-weight:500}.sd-layout-menu-tree--structured .sd-layout-menu-tree__route-button--active:before,.sd-layout-menu-tree--structured .sd-layout-menu-tree__route-button--active:hover:before{content:\"\";position:absolute;left:0;top:9px;bottom:9px;width:3px;border-radius:2px;background:var(--sd-primary, #005cbb)}.sd-layout-menu-tree--structured .sd-layout-menu-tree__route-button--active [data-menu-icon],.sd-layout-menu-tree--structured .sd-layout-menu-tree__route-button--active:hover [data-menu-icon]{color:inherit}.sd-layout-menu-tree--structured .sd-layout-menu-tree__route-button--active.sd-layout-menu-tree__route-button--nested:before{left:-10px}.sd-layout-menu-tree--structured .sd-layout-menu-tree__pin{position:absolute;right:2px;top:50%;transform:translateY(-50%);width:32px;min-height:32px;border-radius:6px;color:var(--menu-muted)}.sd-layout-menu-tree--structured.sd-layout-menu-tree--pinnable .sd-layout-menu-tree__route-button{padding-right:38px}.sd-layout-menu-tree--structured .sd-layout-menu-tree__route-button:focus-visible,.sd-layout-menu-tree--structured .sd-layout-menu-tree__group-toggle:focus-visible,.sd-layout-menu-tree--structured .sd-layout-menu-tree__pin:focus-visible{outline-offset:-2px}@media(pointer:coarse){.sd-layout-menu-tree--structured .sd-layout-menu-tree__route .sd-layout-menu-tree__route-button,.sd-layout-menu-tree--structured .sd-layout-menu-tree__group-toggle,.sd-layout-menu-tree--structured .sd-layout-menu-tree__pin{min-height:44px}.sd-layout-menu-tree--structured .sd-layout-menu-tree__pin{width:44px;opacity:1;pointer-events:auto}.sd-layout-menu-tree--structured.sd-layout-menu-tree--pinnable .sd-layout-menu-tree__route-button{padding-right:50px}}@media(prefers-reduced-motion:reduce){.sd-layout-menu-tree__route-button,.sd-layout-menu-tree__group-toggle,.sd-layout-menu-tree__pin{transition:none}}\n"] }]
|
|
2142
|
+
}], ctorParameters: () => [], propDecorators: { menus: [{ type: i0.Input, args: [{ isSignal: true, alias: "menus", required: false }] }], query: [{ type: i0.Input, args: [{ isSignal: true, alias: "query", required: false }] }], activePath: [{ type: i0.Input, args: [{ isSignal: true, alias: "activePath", required: false }] }], pinnedKeys: [{ type: i0.Input, args: [{ isSignal: true, alias: "pinnedKeys", required: false }] }], showPin: [{ type: i0.Input, args: [{ isSignal: true, alias: "showPin", required: false }] }], pinVisibility: [{ type: i0.Input, args: [{ isSignal: true, alias: "pinVisibility", required: false }] }], presentation: [{ type: i0.Input, args: [{ isSignal: true, alias: "presentation", required: false }] }], collapsible: [{ type: i0.Input, args: [{ isSignal: true, alias: "collapsible", required: false }] }], collapsedGroupKeys: [{ type: i0.Input, args: [{ isSignal: true, alias: "collapsedGroupKeys", required: false }] }, { type: i0.Output, args: ["collapsedGroupKeysChange"] }], navigate: [{ type: i0.Output, args: ["navigate"] }], togglePinned: [{ type: i0.Output, args: ["togglePinned"] }] } });
|
|
2118
2143
|
|
|
2119
2144
|
class SdLayoutSearchFieldComponent {
|
|
2120
2145
|
model = input('', /* @ts-ignore */
|
|
@@ -2123,14 +2148,16 @@ class SdLayoutSearchFieldComponent {
|
|
|
2123
2148
|
...(ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []));
|
|
2124
2149
|
autoId = input.required(/* @ts-ignore */
|
|
2125
2150
|
...(ngDevMode ? [{ debugName: "autoId" }] : /* istanbul ignore next */ []));
|
|
2151
|
+
appearance = input('pill', /* @ts-ignore */
|
|
2152
|
+
...(ngDevMode ? [{ debugName: "appearance" }] : /* istanbul ignore next */ []));
|
|
2126
2153
|
sdChange = output();
|
|
2127
2154
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: SdLayoutSearchFieldComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2128
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.1.5", type: SdLayoutSearchFieldComponent, isStandalone: true, selector: "sd-layout-search-field", inputs: { model: { classPropertyName: "model", publicName: "model", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: true, transformFunction: null }, autoId: { classPropertyName: "autoId", publicName: "autoId", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { sdChange: "sdChange" }, ngImport: i0, template: "<div\n data-layout-search\n class=\"sd-layout-search-field sd-layout-search-field--soft-pill
|
|
2155
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.1.5", type: SdLayoutSearchFieldComponent, isStandalone: true, selector: "sd-layout-search-field", inputs: { model: { classPropertyName: "model", publicName: "model", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: true, transformFunction: null }, autoId: { classPropertyName: "autoId", publicName: "autoId", isSignal: true, isRequired: true, transformFunction: null }, appearance: { classPropertyName: "appearance", publicName: "appearance", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { sdChange: "sdChange" }, ngImport: i0, template: "<div\n data-layout-search\n class=\"sd-layout-search-field d-flex align-items-center gap-8\"\n [class.sd-layout-search-field--soft-pill]=\"appearance() === 'pill'\"\n [class.sd-layout-search-field--compact]=\"appearance() === 'compact'\">\n <sd-icon class=\"sd-layout-search-field__icon\" name=\"search\"></sd-icon>\n <sd-input\n class=\"sd-layout-search-field__control\"\n size=\"sm\"\n hideInlineError\n [placeholder]=\"placeholder()\"\n [autoId]=\"autoId()\"\n [model]=\"model()\"\n (sdChange)=\"sdChange.emit($event)\">\n </sd-input>\n</div>\n", styles: [":host{display:block;min-width:0}.sd-layout-search-field{min-height:38px;padding:0 12px;border:0;border-radius:9999px;outline:1px solid transparent;outline-offset:1px;background:var(--sd-black100, var(--sd-surface-muted));color:var(--sd-black400, var(--sd-text-muted))}.sd-layout-search-field:focus-within{outline-color:var(--sd-primary)}.sd-layout-search-field__icon{flex:0 0 auto;color:var(--sd-black400, var(--sd-text-muted))}.sd-layout-search-field__control{flex:1;min-width:0;--sd-border: transparent;--mdc-outlined-text-field-outline-color: transparent;--mdc-outlined-text-field-hover-outline-color: transparent;--mdc-outlined-text-field-focus-outline-color: transparent;--mdc-outlined-text-field-input-text-placeholder-color: var(--sd-black400, var(--sd-text-muted));--mdc-outlined-text-field-container-shape: 0px}:host ::ng-deep .sd-layout-search-field__control input:focus-visible{outline:0}.sd-layout-search-field--compact{min-height:36px;padding:0 9px;border:1px solid color-mix(in srgb,var(--sd-border, #c4c6d0) 45%,var(--sd-white, #fff));border-radius:7px;background:color-mix(in srgb,var(--sd-surface-muted, #e7e8ed) 35%,var(--sd-white, #fff));color:var(--sd-text-secondary, #6b7280);outline:0;--mat-form-field-container-height: 34px;--mat-form-field-container-vertical-padding: 6px;--mat-form-field-container-text-size: 13px}.sd-layout-search-field--compact:focus-within{border-color:color-mix(in srgb,var(--sd-primary, #005cbb) 75%,var(--sd-white, #fff))}\n"], dependencies: [{ kind: "component", type: SdIcon, selector: "sd-icon", inputs: ["name", "fontIcon", "color", "set", "fontSet", "size", "strokeWidth", "absoluteStrokeWidth", "ariaLabel"] }, { kind: "component", type: SdInput, selector: "sd-input", inputs: ["autoId", "name", "appearance", "floatLabel", "size", "form", "label", "helperText", "placeholder", "type", "mask", "hideInlineError", "blurOnEnter", "clearable", "required", "readonly", "disabled", "viewed", "minlength", "maxlength", "pattern", "patternErrorMessage", "validator", "inlineError", "hyperlink", "model"], outputs: ["modelChange", "sdChange", "sdFocus", "sdBlur", "keyupEnter", "cleared", "sdFocusForceBlur"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2129
2156
|
}
|
|
2130
2157
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: SdLayoutSearchFieldComponent, decorators: [{
|
|
2131
2158
|
type: Component,
|
|
2132
|
-
args: [{ selector: 'sd-layout-search-field', standalone: true, imports: [SdIcon, SdInput], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\n data-layout-search\n class=\"sd-layout-search-field sd-layout-search-field--soft-pill
|
|
2133
|
-
}], propDecorators: { model: [{ type: i0.Input, args: [{ isSignal: true, alias: "model", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: true }] }], autoId: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoId", required: true }] }], sdChange: [{ type: i0.Output, args: ["sdChange"] }] } });
|
|
2159
|
+
args: [{ selector: 'sd-layout-search-field', standalone: true, imports: [SdIcon, SdInput], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\n data-layout-search\n class=\"sd-layout-search-field d-flex align-items-center gap-8\"\n [class.sd-layout-search-field--soft-pill]=\"appearance() === 'pill'\"\n [class.sd-layout-search-field--compact]=\"appearance() === 'compact'\">\n <sd-icon class=\"sd-layout-search-field__icon\" name=\"search\"></sd-icon>\n <sd-input\n class=\"sd-layout-search-field__control\"\n size=\"sm\"\n hideInlineError\n [placeholder]=\"placeholder()\"\n [autoId]=\"autoId()\"\n [model]=\"model()\"\n (sdChange)=\"sdChange.emit($event)\">\n </sd-input>\n</div>\n", styles: [":host{display:block;min-width:0}.sd-layout-search-field{min-height:38px;padding:0 12px;border:0;border-radius:9999px;outline:1px solid transparent;outline-offset:1px;background:var(--sd-black100, var(--sd-surface-muted));color:var(--sd-black400, var(--sd-text-muted))}.sd-layout-search-field:focus-within{outline-color:var(--sd-primary)}.sd-layout-search-field__icon{flex:0 0 auto;color:var(--sd-black400, var(--sd-text-muted))}.sd-layout-search-field__control{flex:1;min-width:0;--sd-border: transparent;--mdc-outlined-text-field-outline-color: transparent;--mdc-outlined-text-field-hover-outline-color: transparent;--mdc-outlined-text-field-focus-outline-color: transparent;--mdc-outlined-text-field-input-text-placeholder-color: var(--sd-black400, var(--sd-text-muted));--mdc-outlined-text-field-container-shape: 0px}:host ::ng-deep .sd-layout-search-field__control input:focus-visible{outline:0}.sd-layout-search-field--compact{min-height:36px;padding:0 9px;border:1px solid color-mix(in srgb,var(--sd-border, #c4c6d0) 45%,var(--sd-white, #fff));border-radius:7px;background:color-mix(in srgb,var(--sd-surface-muted, #e7e8ed) 35%,var(--sd-white, #fff));color:var(--sd-text-secondary, #6b7280);outline:0;--mat-form-field-container-height: 34px;--mat-form-field-container-vertical-padding: 6px;--mat-form-field-container-text-size: 13px}.sd-layout-search-field--compact:focus-within{border-color:color-mix(in srgb,var(--sd-primary, #005cbb) 75%,var(--sd-white, #fff))}\n"] }]
|
|
2160
|
+
}], propDecorators: { model: [{ type: i0.Input, args: [{ isSignal: true, alias: "model", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: true }] }], autoId: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoId", required: true }] }], appearance: [{ type: i0.Input, args: [{ isSignal: true, alias: "appearance", required: false }] }], sdChange: [{ type: i0.Output, args: ["sdChange"] }] } });
|
|
2134
2161
|
|
|
2135
2162
|
class SdSidebarV2 {
|
|
2136
2163
|
#router = inject(Router);
|
|
@@ -2258,7 +2285,7 @@ class SdSidebarV2 {
|
|
|
2258
2285
|
this.#navigationState.patchVersionState(2, { locked: false });
|
|
2259
2286
|
}
|
|
2260
2287
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: SdSidebarV2, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2261
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.5", type: SdSidebarV2, isStandalone: true, selector: "sd-sidebar-v2", inputs: { menus: { classPropertyName: "menus", publicName: "menus", isSignal: true, isRequired: false, transformFunction: null }, userInfo: { classPropertyName: "userInfo", publicName: "userInfo", isSignal: true, isRequired: true, transformFunction: null }, sidebar: { classPropertyName: "sidebar", publicName: "sidebar", isSignal: true, isRequired: true, transformFunction: null } }, host: { listeners: { "keydown.escape": "closeFromEscape()" } }, ngImport: i0, template: "<!-- why: `(keydown.escape)` \u0111\u01B0\u1EE3c gom l\u00EAn HOST c\u1EE7a component (xem `host` trong main.component.ts).\n Tr\u01B0\u1EDBc \u0111\u00E2y n\u00F3 n\u1EB1m tr\u00EAn div b\u1ECDc v\u00E0 tr\u00EAn <section> flyout \u2014 c\u1EA3 hai \u0111\u1EC1u KH\u00D4NG focusable n\u00EAn ch\u1EC9\n \"ch\u1EA1y nh\u1EDD\" event n\u1ED5i b\u1ECDt t\u1EEB con, \u0111\u1ED3ng th\u1EDDi khi\u1EBFn markup khai b\u00E1o interaction handler tr\u00EAn\n ph\u1EA7n t\u1EED kh\u00F4ng nh\u1EADn \u0111\u01B0\u1EE3c focus. Host l\u00E0 t\u1ED5 ti\u00EAn c\u1EE7a t\u1EA5t c\u1EA3 n\u00EAn h\u00E0nh vi gi\u1EEF nguy\u00EAn. -->\n<div class=\"sd-sidebar-v2\">\n <aside class=\"sd-sidebar-v2__rail d-flex flex-column align-items-center gap-8 py-12 bg-white border-right border-black200\">\n <button type=\"button\" class=\"sd-sidebar-v2__brand d-flex align-items-center justify-content-center\" [attr.aria-label]=\"'core.module.layout.home.tab-name' | sdTranslate\">\n @if (sidebar().logoUrl) {\n <img class=\"sd-sidebar-v2__logo\" [src]=\"sidebar().logoUrl\" alt=\"\" />\n } @else {\n <sd-icon name=\"apps\"></sd-icon>\n }\n </button>\n\n <nav class=\"d-flex flex-column align-items-center gap-4 flex-1\" [attr.aria-label]=\"'core.module.layout.sidebar.menu-groups' | sdTranslate\">\n @for (item of railItems(); track item.key) {\n <button\n type=\"button\"\n class=\"sd-sidebar-v2__rail-action d-flex flex-column align-items-center justify-content-center gap-4\"\n [attr.data-v2-group-key]=\"item.key\"\n [attr.aria-label]=\"item.title\"\n [attr.aria-expanded]=\"activeGroupKey() === item.key && isFlyoutOpen()\"\n [class.sd-sidebar-v2__rail-action--active]=\"activeGroupKey() === item.key\"\n (click)=\"selectGroup(item.menu)\"\n (mouseenter)=\"previewGroup(item.menu)\"\n (focus)=\"previewGroup(item.menu)\">\n @if (item.menu.iconUrl) {\n <img class=\"sd-sidebar-v2__rail-icon\" [src]=\"item.menu.iconUrl\" alt=\"\" />\n } @else {\n <sd-icon [name]=\"item.menu.icon || 'widgets'\"></sd-icon>\n }\n <span class=\"sd-sidebar-v2__rail-label text-ellipsis\">{{ item.title }}</span>\n </button>\n }\n </nav>\n\n <sd-layout-user-menu [userInfo]=\"userInfo()\" [compact]=\"true\"></sd-layout-user-menu>\n </aside>\n\n @if (isFlyoutOpen()) {\n <button\n type=\"button\"\n class=\"sd-sidebar-v2__backdrop\"\n [attr.aria-label]=\"'core.module.layout.sidebar.close-menu' | sdTranslate\"\n (click)=\"closeFromBackdrop()\"\n (keydown.escape)=\"closeFromEscape()\"></button>\n <section\n class=\"sd-sidebar-v2__flyout d-flex flex-column bg-white border-right border-black200 mat-elevation-z4\"\n role=\"region\"\n [attr.aria-label]=\"activeGroup()?.title || 'Menu'\"\n (mouseleave)=\"leaveFlyout()\">\n <header class=\"d-flex align-items-center justify-content-between gap-8 px-16 py-12 border-bottom border-black200\">\n <span class=\"T16M text-ellipsis\">{{ activeGroup()?.title || sidebar().defaultTitle || 'Menu' }}</span>\n @if (isFlyoutLocked()) {\n <sd-icon name=\"lock\"></sd-icon>\n }\n </header>\n <div class=\"p-12\">\n <sd-layout-search-field\n [placeholder]=\"'core.module.layout.sidebar.search-in-group' | sdTranslate\"\n [autoId]=\"'layout-v2-context-search'\"\n [model]=\"searchText()\"\n (sdChange)=\"searchText.set($event)\">\n </sd-layout-search-field>\n </div>\n <div class=\"flex-1 overflow-auto px-8 pb-12\">\n <sd-layout-menu-tree\n [menus]=\"contextMenus()\"\n [query]=\"searchText()\"\n [activePath]=\"activePath()\"\n [pinnedKeys]=\"pinnedKeys()\"\n (navigate)=\"onNavigate($event)\"\n (togglePinned)=\"onTogglePinned($event)\">\n </sd-layout-menu-tree>\n </div>\n </section>\n }\n\n <main class=\"sd-sidebar-v2__content\" data-v2-content data-content-offset=\"rail\">\n <ng-content></ng-content>\n </main>\n</div>\n", styles: [".sd-sidebar-v2{min-height:100vh;background:var(--sd-light)}.sd-sidebar-v2__rail{position:fixed;z-index:30;inset:0 auto 0 0;width:72px}.sd-sidebar-v2__brand,.sd-sidebar-v2__rail-action{width:56px;min-height:52px;border:0;border-radius:10px;background:transparent;color:var(--sd-black400);cursor:pointer}.sd-sidebar-v2__rail-action:hover,.sd-sidebar-v2__rail-action--active{color:var(--sd-primary);background:var(--sd-primary-light)}.sd-sidebar-v2__brand:focus-visible,.sd-sidebar-v2__rail-action:focus-visible{outline:2px solid var(--sd-primary);outline-offset:2px}.sd-sidebar-v2__rail-label{width:52px;font-size:10px;line-height:12px;text-align:center}.sd-sidebar-v2__logo,.sd-sidebar-v2__rail-icon{width:24px;height:24px;object-fit:contain}.sd-sidebar-v2__backdrop{position:fixed;z-index:10;inset:0;border:0;background:transparent}.sd-sidebar-v2__flyout{position:fixed;z-index:20;inset:0 auto 0 72px;width:320px}.sd-sidebar-v2__content{min-height:100vh;margin-left:72px}@media(prefers-reduced-motion:reduce){.sd-sidebar-v2__flyout{transition:none}}\n"], dependencies: [{ kind: "component", type: SdIcon, selector: "sd-icon", inputs: ["name", "fontIcon", "color", "set", "fontSet", "size", "strokeWidth", "absoluteStrokeWidth", "ariaLabel"] }, { kind: "component", type: SdLayoutSearchFieldComponent, selector: "sd-layout-search-field", inputs: ["model", "placeholder", "autoId"], outputs: ["sdChange"] }, { kind: "component", type: SdLayoutMenuTreeComponent, selector: "sd-layout-menu-tree", inputs: ["menus", "query", "activePath", "pinnedKeys", "showPin", "pinVisibility"], outputs: ["navigate", "togglePinned"] }, { kind: "component", type: SdLayoutUserMenuComponent, selector: "sd-layout-user-menu", inputs: ["userInfo", "signout", "changePassword", "updateProfile", "setting", "notification", "compact", "presentation"], outputs: ["opened", "closed"] }, { kind: "pipe", type: SdTranslatePipe, name: "sdTranslate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2288
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.5", type: SdSidebarV2, isStandalone: true, selector: "sd-sidebar-v2", inputs: { menus: { classPropertyName: "menus", publicName: "menus", isSignal: true, isRequired: false, transformFunction: null }, userInfo: { classPropertyName: "userInfo", publicName: "userInfo", isSignal: true, isRequired: true, transformFunction: null }, sidebar: { classPropertyName: "sidebar", publicName: "sidebar", isSignal: true, isRequired: true, transformFunction: null } }, host: { listeners: { "keydown.escape": "closeFromEscape()" } }, ngImport: i0, template: "<!-- why: `(keydown.escape)` \u0111\u01B0\u1EE3c gom l\u00EAn HOST c\u1EE7a component (xem `host` trong main.component.ts).\n Tr\u01B0\u1EDBc \u0111\u00E2y n\u00F3 n\u1EB1m tr\u00EAn div b\u1ECDc v\u00E0 tr\u00EAn <section> flyout \u2014 c\u1EA3 hai \u0111\u1EC1u KH\u00D4NG focusable n\u00EAn ch\u1EC9\n \"ch\u1EA1y nh\u1EDD\" event n\u1ED5i b\u1ECDt t\u1EEB con, \u0111\u1ED3ng th\u1EDDi khi\u1EBFn markup khai b\u00E1o interaction handler tr\u00EAn\n ph\u1EA7n t\u1EED kh\u00F4ng nh\u1EADn \u0111\u01B0\u1EE3c focus. Host l\u00E0 t\u1ED5 ti\u00EAn c\u1EE7a t\u1EA5t c\u1EA3 n\u00EAn h\u00E0nh vi gi\u1EEF nguy\u00EAn. -->\n<div class=\"sd-sidebar-v2\">\n <aside class=\"sd-sidebar-v2__rail d-flex flex-column align-items-center gap-8 py-12 bg-white border-right border-black200\">\n <button type=\"button\" class=\"sd-sidebar-v2__brand d-flex align-items-center justify-content-center\" [attr.aria-label]=\"'core.module.layout.home.tab-name' | sdTranslate\">\n @if (sidebar().logoUrl) {\n <img class=\"sd-sidebar-v2__logo\" [src]=\"sidebar().logoUrl\" alt=\"\" />\n } @else {\n <sd-icon name=\"apps\"></sd-icon>\n }\n </button>\n\n <nav class=\"d-flex flex-column align-items-center gap-4 flex-1\" [attr.aria-label]=\"'core.module.layout.sidebar.menu-groups' | sdTranslate\">\n @for (item of railItems(); track item.key) {\n <button\n type=\"button\"\n class=\"sd-sidebar-v2__rail-action d-flex flex-column align-items-center justify-content-center gap-4\"\n [attr.data-v2-group-key]=\"item.key\"\n [attr.aria-label]=\"item.title\"\n [attr.aria-expanded]=\"activeGroupKey() === item.key && isFlyoutOpen()\"\n [class.sd-sidebar-v2__rail-action--active]=\"activeGroupKey() === item.key\"\n (click)=\"selectGroup(item.menu)\"\n (mouseenter)=\"previewGroup(item.menu)\"\n (focus)=\"previewGroup(item.menu)\">\n @if (item.menu.iconUrl) {\n <img class=\"sd-sidebar-v2__rail-icon\" [src]=\"item.menu.iconUrl\" alt=\"\" />\n } @else {\n <sd-icon [name]=\"item.menu.icon || 'widgets'\"></sd-icon>\n }\n <span class=\"sd-sidebar-v2__rail-label text-ellipsis\">{{ item.title }}</span>\n </button>\n }\n </nav>\n\n <sd-layout-user-menu [userInfo]=\"userInfo()\" [compact]=\"true\"></sd-layout-user-menu>\n </aside>\n\n @if (isFlyoutOpen()) {\n <button\n type=\"button\"\n class=\"sd-sidebar-v2__backdrop\"\n [attr.aria-label]=\"'core.module.layout.sidebar.close-menu' | sdTranslate\"\n (click)=\"closeFromBackdrop()\"\n (keydown.escape)=\"closeFromEscape()\"></button>\n <section\n class=\"sd-sidebar-v2__flyout d-flex flex-column bg-white border-right border-black200 mat-elevation-z4\"\n role=\"region\"\n [attr.aria-label]=\"activeGroup()?.title || 'Menu'\"\n (mouseleave)=\"leaveFlyout()\">\n <header class=\"d-flex align-items-center justify-content-between gap-8 px-16 py-12 border-bottom border-black200\">\n <span class=\"T16M text-ellipsis\">{{ activeGroup()?.title || sidebar().defaultTitle || 'Menu' }}</span>\n @if (isFlyoutLocked()) {\n <sd-icon name=\"lock\"></sd-icon>\n }\n </header>\n <div class=\"p-12\">\n <sd-layout-search-field\n [placeholder]=\"'core.module.layout.sidebar.search-in-group' | sdTranslate\"\n [autoId]=\"'layout-v2-context-search'\"\n [model]=\"searchText()\"\n (sdChange)=\"searchText.set($event)\">\n </sd-layout-search-field>\n </div>\n <div class=\"flex-1 overflow-auto px-8 pb-12\">\n <sd-layout-menu-tree\n [menus]=\"contextMenus()\"\n [query]=\"searchText()\"\n [activePath]=\"activePath()\"\n [pinnedKeys]=\"pinnedKeys()\"\n (navigate)=\"onNavigate($event)\"\n (togglePinned)=\"onTogglePinned($event)\">\n </sd-layout-menu-tree>\n </div>\n </section>\n }\n\n <main class=\"sd-sidebar-v2__content\" data-v2-content data-content-offset=\"rail\">\n <ng-content></ng-content>\n </main>\n</div>\n", styles: [".sd-sidebar-v2{min-height:100vh;background:var(--sd-light)}.sd-sidebar-v2__rail{position:fixed;z-index:30;inset:0 auto 0 0;width:72px}.sd-sidebar-v2__brand,.sd-sidebar-v2__rail-action{width:56px;min-height:52px;border:0;border-radius:10px;background:transparent;color:var(--sd-black400);cursor:pointer}.sd-sidebar-v2__rail-action:hover,.sd-sidebar-v2__rail-action--active{color:var(--sd-primary);background:var(--sd-primary-light)}.sd-sidebar-v2__brand:focus-visible,.sd-sidebar-v2__rail-action:focus-visible{outline:2px solid var(--sd-primary);outline-offset:2px}.sd-sidebar-v2__rail-label{width:52px;font-size:10px;line-height:12px;text-align:center}.sd-sidebar-v2__logo,.sd-sidebar-v2__rail-icon{width:24px;height:24px;object-fit:contain}.sd-sidebar-v2__backdrop{position:fixed;z-index:10;inset:0;border:0;background:transparent}.sd-sidebar-v2__flyout{position:fixed;z-index:20;inset:0 auto 0 72px;width:320px}.sd-sidebar-v2__content{min-height:100vh;margin-left:72px}@media(prefers-reduced-motion:reduce){.sd-sidebar-v2__flyout{transition:none}}\n"], dependencies: [{ kind: "component", type: SdIcon, selector: "sd-icon", inputs: ["name", "fontIcon", "color", "set", "fontSet", "size", "strokeWidth", "absoluteStrokeWidth", "ariaLabel"] }, { kind: "component", type: SdLayoutSearchFieldComponent, selector: "sd-layout-search-field", inputs: ["model", "placeholder", "autoId", "appearance"], outputs: ["sdChange"] }, { kind: "component", type: SdLayoutMenuTreeComponent, selector: "sd-layout-menu-tree", inputs: ["menus", "query", "activePath", "pinnedKeys", "showPin", "pinVisibility", "presentation", "collapsible", "collapsedGroupKeys"], outputs: ["collapsedGroupKeysChange", "navigate", "togglePinned"] }, { kind: "component", type: SdLayoutUserMenuComponent, selector: "sd-layout-user-menu", inputs: ["userInfo", "signout", "changePassword", "updateProfile", "setting", "notification", "compact", "presentation"], outputs: ["opened", "closed"] }, { kind: "pipe", type: SdTranslatePipe, name: "sdTranslate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2262
2289
|
}
|
|
2263
2290
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: SdSidebarV2, decorators: [{
|
|
2264
2291
|
type: Component,
|
|
@@ -2380,7 +2407,7 @@ class SdSidebarMobileV2 {
|
|
|
2380
2407
|
this.#document.body.style.overflow = this.#previousBodyOverflow;
|
|
2381
2408
|
}
|
|
2382
2409
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: SdSidebarMobileV2, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2383
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.5", type: SdSidebarMobileV2, isStandalone: true, selector: "sd-sidebar-mobile-v2", inputs: { menus: { classPropertyName: "menus", publicName: "menus", isSignal: true, isRequired: false, transformFunction: null }, userInfo: { classPropertyName: "userInfo", publicName: "userInfo", isSignal: true, isRequired: true, transformFunction: null }, sidebar: { classPropertyName: "sidebar", publicName: "sidebar", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: "<div class=\"sd-sidebar-mobile-v2 d-flex flex-column\">\n <main class=\"sd-sidebar-mobile-v2__content flex-1 overflow-auto\">\n <ng-content></ng-content>\n </main>\n\n <nav class=\"sd-sidebar-mobile-v2__bar d-flex align-items-stretch bg-white border-top border-black200\" [attr.aria-label]=\"'core.module.layout.sidebar.primary-nav' | sdTranslate\">\n @for (menu of primaryMenus(); track menu.id || menu.title) {\n <button\n type=\"button\"\n class=\"sd-sidebar-mobile-v2__bar-action d-flex flex-column align-items-center justify-content-center gap-4 flex-1\"\n [attr.data-mobile-menu-key]=\"menu.id ? 'id:' + menu.id : null\"\n [attr.aria-label]=\"menu.tooltipTitle || menu.title || 'Menu'\"\n [attr.aria-expanded]=\"sheetGroupKey() === (menu.id ? 'id:' + menu.id : '') && isSheetOpen()\"\n (click)=\"activateMenu(menu, $event.currentTarget)\">\n @if (menu.iconUrl) {\n <img class=\"sd-sidebar-mobile-v2__icon\" [src]=\"menu.iconUrl\" alt=\"\" />\n } @else {\n <sd-icon [name]=\"menu.icon || 'widgets'\"></sd-icon>\n }\n <span class=\"sd-sidebar-mobile-v2__label text-ellipsis\">{{ menu.tooltipTitle || menu.title }}</span>\n </button>\n }\n @if (overflowMenus().length) {\n <button\n type=\"button\"\n class=\"sd-sidebar-mobile-v2__bar-action d-flex flex-column align-items-center justify-content-center gap-4 flex-1\"\n [attr.aria-label]=\"'core.module.layout.sidebar.more-menu' | sdTranslate\"\n [attr.aria-expanded]=\"sheetGroupKey() === 'more' && isSheetOpen()\"\n (click)=\"openMore($event.currentTarget)\">\n <sd-icon name=\"more_horiz\"></sd-icon>\n <span class=\"sd-sidebar-mobile-v2__label\">{{ 'core.module.layout.sidebar.more' | sdTranslate }}</span>\n </button>\n }\n </nav>\n\n @if (isSheetOpen()) {\n <button type=\"button\" class=\"sd-sidebar-mobile-v2__backdrop\" [attr.aria-label]=\"'core.module.layout.sidebar.close-menu' | sdTranslate\" (click)=\"closeSheet()\"></button>\n <section\n data-v2-sheet\n class=\"sd-sidebar-mobile-v2__sheet d-flex flex-column bg-white rounded-top-16 mat-elevation-z8\"\n role=\"dialog\"\n aria-modal=\"true\"\n [attr.aria-label]=\"sheetTitle()\"\n cdkTrapFocus\n [cdkTrapFocusAutoCapture]=\"true\"\n (keydown)=\"onSheetKeydown($event)\">\n <header class=\"d-flex align-items-center justify-content-between gap-8 px-16 py-12 border-bottom border-black200\">\n <span class=\"T16M text-ellipsis\">{{ sheetTitle() }}</span>\n <button\n type=\"button\"\n class=\"sd-sidebar-mobile-v2__close d-flex align-items-center justify-content-center\"\n [attr.aria-label]=\"'core.common.close' | sdTranslate\"\n (click)=\"closeSheet()\">\n <sd-icon name=\"close\"></sd-icon>\n </button>\n </header>\n <div class=\"d-flex flex-column gap-12 p-12 overflow-auto\">\n <sd-layout-user-menu presentation=\"mobile-inline\" [userInfo]=\"userInfo()\"></sd-layout-user-menu>\n <sd-layout-search-field\n [placeholder]=\"'core.module.layout.sidebar.search-in-menu' | sdTranslate\"\n [autoId]=\"'layout-v2-mobile-search'\"\n [model]=\"searchText()\"\n (sdChange)=\"searchText.set($event)\">\n </sd-layout-search-field>\n <sd-layout-menu-tree\n [menus]=\"sheetMenus()\"\n [query]=\"searchText()\"\n [activePath]=\"activePath()\"\n [pinnedKeys]=\"pinnedKeys()\"\n pinVisibility=\"always\"\n (navigate)=\"onNavigate($event)\"\n (togglePinned)=\"onTogglePinned($event)\">\n </sd-layout-menu-tree>\n </div>\n </section>\n }\n</div>\n", styles: [":host{display:block}.sd-sidebar-mobile-v2{min-height:100dvh;padding-bottom:calc(64px + env(safe-area-inset-bottom));background:var(--sd-light)}.sd-sidebar-mobile-v2__bar{position:fixed;z-index:30;inset:auto 0 0;min-height:64px;padding-bottom:env(safe-area-inset-bottom)}.sd-sidebar-mobile-v2__bar-action,.sd-sidebar-mobile-v2__close{min-width:0;min-height:48px;border:0;background:transparent;color:var(--sd-black400);cursor:pointer}.sd-sidebar-mobile-v2__bar-action:hover,.sd-sidebar-mobile-v2__close:hover{color:var(--sd-primary);background:var(--sd-primary-light)}.sd-sidebar-mobile-v2__bar-action:focus-visible,.sd-sidebar-mobile-v2__close:focus-visible{outline:2px solid var(--sd-primary);outline-offset:-2px}.sd-sidebar-mobile-v2__label{max-width:72px;font-size:11px;line-height:14px}.sd-sidebar-mobile-v2__icon{width:22px;height:22px;object-fit:contain}.sd-sidebar-mobile-v2__backdrop{position:fixed;z-index:40;inset:0;border:0;background:color-mix(in srgb,var(--sd-black) 40%,transparent)}.sd-sidebar-mobile-v2__sheet{position:fixed;z-index:50;inset:auto 0 0;max-height:min(78dvh,720px);padding-bottom:env(safe-area-inset-bottom);overflow:hidden}@media(prefers-reduced-motion:reduce){.sd-sidebar-mobile-v2__sheet{transition:none}}\n"], dependencies: [{ kind: "ngmodule", type: A11yModule }, { kind: "directive", type: i1$2.CdkTrapFocus, selector: "[cdkTrapFocus]", inputs: ["cdkTrapFocus", "cdkTrapFocusAutoCapture"], exportAs: ["cdkTrapFocus"] }, { kind: "component", type: SdIcon, selector: "sd-icon", inputs: ["name", "fontIcon", "color", "set", "fontSet", "size", "strokeWidth", "absoluteStrokeWidth", "ariaLabel"] }, { kind: "component", type: SdLayoutSearchFieldComponent, selector: "sd-layout-search-field", inputs: ["model", "placeholder", "autoId"], outputs: ["sdChange"] }, { kind: "component", type: SdLayoutMenuTreeComponent, selector: "sd-layout-menu-tree", inputs: ["menus", "query", "activePath", "pinnedKeys", "showPin", "pinVisibility"], outputs: ["navigate", "togglePinned"] }, { kind: "component", type: SdLayoutUserMenuComponent, selector: "sd-layout-user-menu", inputs: ["userInfo", "signout", "changePassword", "updateProfile", "setting", "notification", "compact", "presentation"], outputs: ["opened", "closed"] }, { kind: "pipe", type: SdTranslatePipe, name: "sdTranslate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2410
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.5", type: SdSidebarMobileV2, isStandalone: true, selector: "sd-sidebar-mobile-v2", inputs: { menus: { classPropertyName: "menus", publicName: "menus", isSignal: true, isRequired: false, transformFunction: null }, userInfo: { classPropertyName: "userInfo", publicName: "userInfo", isSignal: true, isRequired: true, transformFunction: null }, sidebar: { classPropertyName: "sidebar", publicName: "sidebar", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: "<div class=\"sd-sidebar-mobile-v2 d-flex flex-column\">\n <main class=\"sd-sidebar-mobile-v2__content flex-1 overflow-auto\">\n <ng-content></ng-content>\n </main>\n\n <nav class=\"sd-sidebar-mobile-v2__bar d-flex align-items-stretch bg-white border-top border-black200\" [attr.aria-label]=\"'core.module.layout.sidebar.primary-nav' | sdTranslate\">\n @for (menu of primaryMenus(); track menu.id || menu.title) {\n <button\n type=\"button\"\n class=\"sd-sidebar-mobile-v2__bar-action d-flex flex-column align-items-center justify-content-center gap-4 flex-1\"\n [attr.data-mobile-menu-key]=\"menu.id ? 'id:' + menu.id : null\"\n [attr.aria-label]=\"menu.tooltipTitle || menu.title || 'Menu'\"\n [attr.aria-expanded]=\"sheetGroupKey() === (menu.id ? 'id:' + menu.id : '') && isSheetOpen()\"\n (click)=\"activateMenu(menu, $event.currentTarget)\">\n @if (menu.iconUrl) {\n <img class=\"sd-sidebar-mobile-v2__icon\" [src]=\"menu.iconUrl\" alt=\"\" />\n } @else {\n <sd-icon [name]=\"menu.icon || 'widgets'\"></sd-icon>\n }\n <span class=\"sd-sidebar-mobile-v2__label text-ellipsis\">{{ menu.tooltipTitle || menu.title }}</span>\n </button>\n }\n @if (overflowMenus().length) {\n <button\n type=\"button\"\n class=\"sd-sidebar-mobile-v2__bar-action d-flex flex-column align-items-center justify-content-center gap-4 flex-1\"\n [attr.aria-label]=\"'core.module.layout.sidebar.more-menu' | sdTranslate\"\n [attr.aria-expanded]=\"sheetGroupKey() === 'more' && isSheetOpen()\"\n (click)=\"openMore($event.currentTarget)\">\n <sd-icon name=\"more_horiz\"></sd-icon>\n <span class=\"sd-sidebar-mobile-v2__label\">{{ 'core.module.layout.sidebar.more' | sdTranslate }}</span>\n </button>\n }\n </nav>\n\n @if (isSheetOpen()) {\n <button type=\"button\" class=\"sd-sidebar-mobile-v2__backdrop\" [attr.aria-label]=\"'core.module.layout.sidebar.close-menu' | sdTranslate\" (click)=\"closeSheet()\"></button>\n <section\n data-v2-sheet\n class=\"sd-sidebar-mobile-v2__sheet d-flex flex-column bg-white rounded-top-16 mat-elevation-z8\"\n role=\"dialog\"\n aria-modal=\"true\"\n [attr.aria-label]=\"sheetTitle()\"\n cdkTrapFocus\n [cdkTrapFocusAutoCapture]=\"true\"\n (keydown)=\"onSheetKeydown($event)\">\n <header class=\"d-flex align-items-center justify-content-between gap-8 px-16 py-12 border-bottom border-black200\">\n <span class=\"T16M text-ellipsis\">{{ sheetTitle() }}</span>\n <button\n type=\"button\"\n class=\"sd-sidebar-mobile-v2__close d-flex align-items-center justify-content-center\"\n [attr.aria-label]=\"'core.common.close' | sdTranslate\"\n (click)=\"closeSheet()\">\n <sd-icon name=\"close\"></sd-icon>\n </button>\n </header>\n <div class=\"d-flex flex-column gap-12 p-12 overflow-auto\">\n <sd-layout-user-menu presentation=\"mobile-inline\" [userInfo]=\"userInfo()\"></sd-layout-user-menu>\n <sd-layout-search-field\n [placeholder]=\"'core.module.layout.sidebar.search-in-menu' | sdTranslate\"\n [autoId]=\"'layout-v2-mobile-search'\"\n [model]=\"searchText()\"\n (sdChange)=\"searchText.set($event)\">\n </sd-layout-search-field>\n <sd-layout-menu-tree\n [menus]=\"sheetMenus()\"\n [query]=\"searchText()\"\n [activePath]=\"activePath()\"\n [pinnedKeys]=\"pinnedKeys()\"\n pinVisibility=\"always\"\n (navigate)=\"onNavigate($event)\"\n (togglePinned)=\"onTogglePinned($event)\">\n </sd-layout-menu-tree>\n </div>\n </section>\n }\n</div>\n", styles: [":host{display:block}.sd-sidebar-mobile-v2{min-height:100dvh;padding-bottom:calc(64px + env(safe-area-inset-bottom));background:var(--sd-light)}.sd-sidebar-mobile-v2__bar{position:fixed;z-index:30;inset:auto 0 0;min-height:64px;padding-bottom:env(safe-area-inset-bottom)}.sd-sidebar-mobile-v2__bar-action,.sd-sidebar-mobile-v2__close{min-width:0;min-height:48px;border:0;background:transparent;color:var(--sd-black400);cursor:pointer}.sd-sidebar-mobile-v2__bar-action:hover,.sd-sidebar-mobile-v2__close:hover{color:var(--sd-primary);background:var(--sd-primary-light)}.sd-sidebar-mobile-v2__bar-action:focus-visible,.sd-sidebar-mobile-v2__close:focus-visible{outline:2px solid var(--sd-primary);outline-offset:-2px}.sd-sidebar-mobile-v2__label{max-width:72px;font-size:11px;line-height:14px}.sd-sidebar-mobile-v2__icon{width:22px;height:22px;object-fit:contain}.sd-sidebar-mobile-v2__backdrop{position:fixed;z-index:40;inset:0;border:0;background:color-mix(in srgb,var(--sd-black) 40%,transparent)}.sd-sidebar-mobile-v2__sheet{position:fixed;z-index:50;inset:auto 0 0;max-height:min(78dvh,720px);padding-bottom:env(safe-area-inset-bottom);overflow:hidden}@media(prefers-reduced-motion:reduce){.sd-sidebar-mobile-v2__sheet{transition:none}}\n"], dependencies: [{ kind: "ngmodule", type: A11yModule }, { kind: "directive", type: i1$2.CdkTrapFocus, selector: "[cdkTrapFocus]", inputs: ["cdkTrapFocus", "cdkTrapFocusAutoCapture"], exportAs: ["cdkTrapFocus"] }, { kind: "component", type: SdIcon, selector: "sd-icon", inputs: ["name", "fontIcon", "color", "set", "fontSet", "size", "strokeWidth", "absoluteStrokeWidth", "ariaLabel"] }, { kind: "component", type: SdLayoutSearchFieldComponent, selector: "sd-layout-search-field", inputs: ["model", "placeholder", "autoId", "appearance"], outputs: ["sdChange"] }, { kind: "component", type: SdLayoutMenuTreeComponent, selector: "sd-layout-menu-tree", inputs: ["menus", "query", "activePath", "pinnedKeys", "showPin", "pinVisibility", "presentation", "collapsible", "collapsedGroupKeys"], outputs: ["collapsedGroupKeysChange", "navigate", "togglePinned"] }, { kind: "component", type: SdLayoutUserMenuComponent, selector: "sd-layout-user-menu", inputs: ["userInfo", "signout", "changePassword", "updateProfile", "setting", "notification", "compact", "presentation"], outputs: ["opened", "closed"] }, { kind: "pipe", type: SdTranslatePipe, name: "sdTranslate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2384
2411
|
}
|
|
2385
2412
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: SdSidebarMobileV2, decorators: [{
|
|
2386
2413
|
type: Component,
|
|
@@ -2400,6 +2427,8 @@ class SdSidebarV3 {
|
|
|
2400
2427
|
...(ngDevMode ? [{ debugName: "sidebar" }] : /* istanbul ignore next */ []));
|
|
2401
2428
|
isCollapsed = signal(false, /* @ts-ignore */
|
|
2402
2429
|
...(ngDevMode ? [{ debugName: "isCollapsed" }] : /* istanbul ignore next */ []));
|
|
2430
|
+
collapsedGroupKeys = signal([], /* @ts-ignore */
|
|
2431
|
+
...(ngDevMode ? [{ debugName: "collapsedGroupKeys" }] : /* istanbul ignore next */ []));
|
|
2403
2432
|
searchText = signal('', /* @ts-ignore */
|
|
2404
2433
|
...(ngDevMode ? [{ debugName: "searchText" }] : /* istanbul ignore next */ []));
|
|
2405
2434
|
activePath = signal(this.#router.url.split(/[?#]/, 1)[0] ?? '', /* @ts-ignore */
|
|
@@ -2431,6 +2460,25 @@ class SdSidebarV3 {
|
|
|
2431
2460
|
if (event instanceof NavigationEnd)
|
|
2432
2461
|
this.activePath.set(event.urlAfterRedirects.split(/[?#]/, 1)[0] ?? '');
|
|
2433
2462
|
});
|
|
2463
|
+
effect(() => {
|
|
2464
|
+
const menus = this.menus();
|
|
2465
|
+
const activeMenuPath = resolveActiveMenuPath(menus, this.activePath());
|
|
2466
|
+
if (!activeMenuPath)
|
|
2467
|
+
return;
|
|
2468
|
+
const activeGroupKeys = new Set();
|
|
2469
|
+
const visit = (items, ancestors) => {
|
|
2470
|
+
for (const menu of items) {
|
|
2471
|
+
if (!('children' in menu) || !containsMenuPath(menu, activeMenuPath))
|
|
2472
|
+
continue;
|
|
2473
|
+
const key = getMenuStableKey(menu, ancestors);
|
|
2474
|
+
activeGroupKeys.add(key);
|
|
2475
|
+
visit(menu.children ?? [], [...ancestors, menu.title ?? key]);
|
|
2476
|
+
}
|
|
2477
|
+
};
|
|
2478
|
+
visit(menus, []);
|
|
2479
|
+
// why: Chỉ mở nhánh khi route/menu đổi; người dùng vẫn được đóng nhánh đang active.
|
|
2480
|
+
untracked(() => this.collapsedGroupKeys.update(keys => keys.filter(key => !activeGroupKeys.has(key))));
|
|
2481
|
+
});
|
|
2434
2482
|
}
|
|
2435
2483
|
toggleCollapsed() {
|
|
2436
2484
|
this.isCollapsed.update(collapsed => !collapsed);
|
|
@@ -2441,6 +2489,7 @@ class SdSidebarV3 {
|
|
|
2441
2489
|
this.navigateMenu(menu);
|
|
2442
2490
|
else {
|
|
2443
2491
|
this.isCollapsed.set(false);
|
|
2492
|
+
this.collapsedGroupKeys.update(keys => keys.filter(key => key !== getMenuStableKey(menu)));
|
|
2444
2493
|
this.#navigationState.patchVersionState(3, { collapsed: false });
|
|
2445
2494
|
}
|
|
2446
2495
|
}
|
|
@@ -2463,11 +2512,11 @@ class SdSidebarV3 {
|
|
|
2463
2512
|
this.#navigationState.togglePinned(menu);
|
|
2464
2513
|
}
|
|
2465
2514
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: SdSidebarV3, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2466
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.5", type: SdSidebarV3, isStandalone: true, selector: "sd-sidebar-v3", inputs: { menus: { classPropertyName: "menus", publicName: "menus", isSignal: true, isRequired: false, transformFunction: null }, userInfo: { classPropertyName: "userInfo", publicName: "userInfo", isSignal: true, isRequired: true, transformFunction: null }, sidebar: { classPropertyName: "sidebar", publicName: "sidebar", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: "<div class=\"sd-sidebar-v3\" [class.sd-sidebar-v3--collapsed]=\"
|
|
2515
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.5", type: SdSidebarV3, isStandalone: true, selector: "sd-sidebar-v3", inputs: { menus: { classPropertyName: "menus", publicName: "menus", isSignal: true, isRequired: false, transformFunction: null }, userInfo: { classPropertyName: "userInfo", publicName: "userInfo", isSignal: true, isRequired: true, transformFunction: null }, sidebar: { classPropertyName: "sidebar", publicName: "sidebar", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: "@let collapsed = isCollapsed();\n@let configuration = sidebar();\n@let pinned = pinnedMenus();\n@let recent = recentMenus();\n<div class=\"sd-sidebar-v3\" [class.sd-sidebar-v3--collapsed]=\"collapsed\">\n <aside class=\"sd-sidebar-v3__drawer d-flex flex-column\" data-v3-sidebar [attr.data-collapsed]=\"collapsed\">\n <header\n data-v3-header\n class=\"sd-sidebar-v3__header d-flex align-items-center gap-8 p-12\"\n [class.sd-sidebar-v3__header--collapsed]=\"collapsed\"\n [class.justify-content-between]=\"!collapsed\"\n [class.justify-content-center]=\"collapsed\">\n @if (!collapsed) {\n <div data-v3-brand class=\"d-flex align-items-center gap-8 overflow-hidden\">\n @if (configuration.logoUrl) {\n <img class=\"sd-sidebar-v3__logo\" [src]=\"configuration.logoUrl\" alt=\"\" />\n } @else {\n <sd-icon name=\"apps\" fontSet=\"material-icons-outlined\" size=\"20px\"></sd-icon>\n }\n <span class=\"sd-sidebar-v3__title text-ellipsis\">{{ configuration.defaultTitle || 'Back Office' }}</span>\n </div>\n }\n <button\n type=\"button\"\n class=\"sd-sidebar-v3__icon-action d-flex align-items-center justify-content-center\"\n [attr.aria-label]=\"collapsed ? 'M\u1EDF r\u1ED9ng sidebar' : 'Thu g\u1ECDn sidebar'\"\n [attr.aria-expanded]=\"!collapsed\"\n (click)=\"toggleCollapsed()\">\n <sd-icon [name]=\"collapsed ? 'chevron_right' : 'chevron_left'\" size=\"20px\"></sd-icon>\n </button>\n </header>\n\n @if (collapsed) {\n <nav class=\"sd-sidebar-v3__navigation d-flex flex-column align-items-center gap-4 p-8 flex-1 overflow-auto\" aria-label=\"Menu thu g\u1ECDn\">\n @for (item of collapsedItems(); track item.key) {\n <button\n type=\"button\"\n class=\"sd-sidebar-v3__collapsed-action d-flex align-items-center justify-content-center\"\n [attr.aria-label]=\"item.title\"\n [attr.title]=\"item.title\"\n (click)=\"activateCollapsedMenu(item.menu)\">\n @if (item.menu.iconUrl) {\n <img class=\"sd-sidebar-v3__logo\" [src]=\"item.menu.iconUrl\" alt=\"\" />\n } @else {\n <sd-icon [name]=\"item.menu.icon || 'widgets'\" fontSet=\"material-icons-outlined\" size=\"20px\"></sd-icon>\n }\n </button>\n }\n </nav>\n } @else {\n <div class=\"sd-sidebar-v3__search px-12 pb-12\">\n <sd-layout-search-field\n appearance=\"compact\"\n placeholder=\"T\u00ECm trong t\u1EA5t c\u1EA3 menu\"\n [autoId]=\"'layout-v3-global-search'\"\n [model]=\"searchText()\"\n (sdChange)=\"searchText.set($event)\">\n </sd-layout-search-field>\n </div>\n <div class=\"sd-sidebar-v3__navigation d-flex flex-column gap-16 flex-1 overflow-auto px-8 pb-12\">\n @if (pinned.length) {\n <section data-v3-pinned class=\"d-flex flex-column gap-4\">\n <h2 class=\"sd-sidebar-v3__section-title m-0\">{{ 'core.module.layout.sidebar.pinned' | sdTranslate }}</h2>\n <sd-layout-menu-tree\n presentation=\"shortcuts\"\n [menus]=\"pinned\"\n [activePath]=\"activePath()\"\n [pinnedKeys]=\"pinnedKeys()\"\n (navigate)=\"navigateMenu($event)\"\n (togglePinned)=\"onTogglePinned($event)\">\n </sd-layout-menu-tree>\n </section>\n }\n @if (recentConfiguration().enabled && recent.length) {\n <section data-v3-recent class=\"d-flex flex-column gap-4\">\n <h2 class=\"sd-sidebar-v3__section-title m-0\">{{ 'core.module.layout.sidebar.recent' | sdTranslate }}</h2>\n <sd-layout-menu-tree\n presentation=\"shortcuts\"\n [menus]=\"recent\"\n [activePath]=\"activePath()\"\n [showPin]=\"false\"\n (navigate)=\"navigateMenu($event)\">\n </sd-layout-menu-tree>\n </section>\n }\n <section data-v3-all class=\"d-flex flex-column gap-4\">\n <h2 class=\"sd-sidebar-v3__section-title m-0\">{{ 'core.module.layout.sidebar.all-menu' | sdTranslate }}</h2>\n <sd-layout-menu-tree\n presentation=\"hierarchy\"\n [collapsible]=\"true\"\n [(collapsedGroupKeys)]=\"collapsedGroupKeys\"\n [menus]=\"menus()\"\n [query]=\"searchText()\"\n [activePath]=\"activePath()\"\n [pinnedKeys]=\"pinnedKeys()\"\n (navigate)=\"navigateMenu($event)\"\n (togglePinned)=\"onTogglePinned($event)\">\n </sd-layout-menu-tree>\n </section>\n </div>\n }\n\n <div data-v3-footer class=\"sd-sidebar-v3__footer p-8\">\n <sd-layout-user-menu [userInfo]=\"userInfo()\" [compact]=\"collapsed\"></sd-layout-user-menu>\n </div>\n </aside>\n\n <main class=\"sd-sidebar-v3__content\">\n <ng-content></ng-content>\n </main>\n</div>\n", styles: [".sd-sidebar-v3{--sidebar-surface: var(--sd-white, #fff);--sidebar-line: color-mix(in srgb, var(--sd-border, #c4c6d0) 45%, var(--sidebar-surface));--sidebar-ink: var(--sd-text, #252c38);--sidebar-muted: var(--sd-text-secondary, #6b7280);min-height:100vh;background:var(--sd-light)}.sd-sidebar-v3__drawer{position:fixed;z-index:20;inset:0 auto 0 0;width:304px;box-sizing:border-box;background:var(--sidebar-surface);border-right:1px solid var(--sidebar-line);color:var(--sidebar-ink);transition:width .16s ease}.sd-sidebar-v3__header{flex-shrink:0;min-height:64px;box-sizing:border-box}.sd-sidebar-v3__title{font-size:16px;font-weight:600;line-height:22px;letter-spacing:-.2px}.sd-sidebar-v3__search{flex-shrink:0}.sd-sidebar-v3__navigation{min-height:0;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:var(--sidebar-line) transparent}.sd-sidebar-v3__navigation section{flex-shrink:0}.sd-sidebar-v3__section-title{padding:4px 10px;font-size:11px;font-weight:500;line-height:16px;letter-spacing:.3px;color:var(--sidebar-muted)}.sd-sidebar-v3__footer{flex-shrink:0;border-top:1px solid var(--sidebar-line);background:var(--sidebar-surface)}.sd-sidebar-v3--collapsed .sd-sidebar-v3__drawer{width:72px}.sd-sidebar-v3__content{min-height:100vh;margin-left:304px;transition:margin-left .16s ease}.sd-sidebar-v3--collapsed .sd-sidebar-v3__content{margin-left:72px}.sd-sidebar-v3__icon-action,.sd-sidebar-v3__collapsed-action{width:40px;flex-shrink:0;height:40px;border:0;border-radius:7px;background:transparent;color:var(--sidebar-muted);cursor:pointer}@media(pointer:coarse){.sd-sidebar-v3__icon-action,.sd-sidebar-v3__collapsed-action{width:44px;height:44px}}.sd-sidebar-v3__icon-action:hover,.sd-sidebar-v3__collapsed-action:hover{color:var(--sd-primary);background:var(--sd-primary-light)}.sd-sidebar-v3__icon-action:focus-visible,.sd-sidebar-v3__collapsed-action:focus-visible{outline:2px solid var(--sd-primary);outline-offset:2px}.sd-sidebar-v3__logo{width:28px;height:28px;object-fit:contain}@media(prefers-reduced-motion:reduce){.sd-sidebar-v3__drawer,.sd-sidebar-v3__content{transition:none}}\n"], dependencies: [{ kind: "component", type: SdIcon, selector: "sd-icon", inputs: ["name", "fontIcon", "color", "set", "fontSet", "size", "strokeWidth", "absoluteStrokeWidth", "ariaLabel"] }, { kind: "component", type: SdLayoutSearchFieldComponent, selector: "sd-layout-search-field", inputs: ["model", "placeholder", "autoId", "appearance"], outputs: ["sdChange"] }, { kind: "component", type: SdLayoutMenuTreeComponent, selector: "sd-layout-menu-tree", inputs: ["menus", "query", "activePath", "pinnedKeys", "showPin", "pinVisibility", "presentation", "collapsible", "collapsedGroupKeys"], outputs: ["collapsedGroupKeysChange", "navigate", "togglePinned"] }, { kind: "component", type: SdLayoutUserMenuComponent, selector: "sd-layout-user-menu", inputs: ["userInfo", "signout", "changePassword", "updateProfile", "setting", "notification", "compact", "presentation"], outputs: ["opened", "closed"] }, { kind: "pipe", type: SdTranslatePipe, name: "sdTranslate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2467
2516
|
}
|
|
2468
2517
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: SdSidebarV3, decorators: [{
|
|
2469
2518
|
type: Component,
|
|
2470
|
-
args: [{ selector: 'sd-sidebar-v3', standalone: true, imports: [SdIcon, SdLayoutSearchFieldComponent, SdLayoutMenuTreeComponent, SdLayoutUserMenuComponent, SdTranslatePipe], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"sd-sidebar-v3\" [class.sd-sidebar-v3--collapsed]=\"
|
|
2519
|
+
args: [{ selector: 'sd-sidebar-v3', standalone: true, imports: [SdIcon, SdLayoutSearchFieldComponent, SdLayoutMenuTreeComponent, SdLayoutUserMenuComponent, SdTranslatePipe], changeDetection: ChangeDetectionStrategy.OnPush, template: "@let collapsed = isCollapsed();\n@let configuration = sidebar();\n@let pinned = pinnedMenus();\n@let recent = recentMenus();\n<div class=\"sd-sidebar-v3\" [class.sd-sidebar-v3--collapsed]=\"collapsed\">\n <aside class=\"sd-sidebar-v3__drawer d-flex flex-column\" data-v3-sidebar [attr.data-collapsed]=\"collapsed\">\n <header\n data-v3-header\n class=\"sd-sidebar-v3__header d-flex align-items-center gap-8 p-12\"\n [class.sd-sidebar-v3__header--collapsed]=\"collapsed\"\n [class.justify-content-between]=\"!collapsed\"\n [class.justify-content-center]=\"collapsed\">\n @if (!collapsed) {\n <div data-v3-brand class=\"d-flex align-items-center gap-8 overflow-hidden\">\n @if (configuration.logoUrl) {\n <img class=\"sd-sidebar-v3__logo\" [src]=\"configuration.logoUrl\" alt=\"\" />\n } @else {\n <sd-icon name=\"apps\" fontSet=\"material-icons-outlined\" size=\"20px\"></sd-icon>\n }\n <span class=\"sd-sidebar-v3__title text-ellipsis\">{{ configuration.defaultTitle || 'Back Office' }}</span>\n </div>\n }\n <button\n type=\"button\"\n class=\"sd-sidebar-v3__icon-action d-flex align-items-center justify-content-center\"\n [attr.aria-label]=\"collapsed ? 'M\u1EDF r\u1ED9ng sidebar' : 'Thu g\u1ECDn sidebar'\"\n [attr.aria-expanded]=\"!collapsed\"\n (click)=\"toggleCollapsed()\">\n <sd-icon [name]=\"collapsed ? 'chevron_right' : 'chevron_left'\" size=\"20px\"></sd-icon>\n </button>\n </header>\n\n @if (collapsed) {\n <nav class=\"sd-sidebar-v3__navigation d-flex flex-column align-items-center gap-4 p-8 flex-1 overflow-auto\" aria-label=\"Menu thu g\u1ECDn\">\n @for (item of collapsedItems(); track item.key) {\n <button\n type=\"button\"\n class=\"sd-sidebar-v3__collapsed-action d-flex align-items-center justify-content-center\"\n [attr.aria-label]=\"item.title\"\n [attr.title]=\"item.title\"\n (click)=\"activateCollapsedMenu(item.menu)\">\n @if (item.menu.iconUrl) {\n <img class=\"sd-sidebar-v3__logo\" [src]=\"item.menu.iconUrl\" alt=\"\" />\n } @else {\n <sd-icon [name]=\"item.menu.icon || 'widgets'\" fontSet=\"material-icons-outlined\" size=\"20px\"></sd-icon>\n }\n </button>\n }\n </nav>\n } @else {\n <div class=\"sd-sidebar-v3__search px-12 pb-12\">\n <sd-layout-search-field\n appearance=\"compact\"\n placeholder=\"T\u00ECm trong t\u1EA5t c\u1EA3 menu\"\n [autoId]=\"'layout-v3-global-search'\"\n [model]=\"searchText()\"\n (sdChange)=\"searchText.set($event)\">\n </sd-layout-search-field>\n </div>\n <div class=\"sd-sidebar-v3__navigation d-flex flex-column gap-16 flex-1 overflow-auto px-8 pb-12\">\n @if (pinned.length) {\n <section data-v3-pinned class=\"d-flex flex-column gap-4\">\n <h2 class=\"sd-sidebar-v3__section-title m-0\">{{ 'core.module.layout.sidebar.pinned' | sdTranslate }}</h2>\n <sd-layout-menu-tree\n presentation=\"shortcuts\"\n [menus]=\"pinned\"\n [activePath]=\"activePath()\"\n [pinnedKeys]=\"pinnedKeys()\"\n (navigate)=\"navigateMenu($event)\"\n (togglePinned)=\"onTogglePinned($event)\">\n </sd-layout-menu-tree>\n </section>\n }\n @if (recentConfiguration().enabled && recent.length) {\n <section data-v3-recent class=\"d-flex flex-column gap-4\">\n <h2 class=\"sd-sidebar-v3__section-title m-0\">{{ 'core.module.layout.sidebar.recent' | sdTranslate }}</h2>\n <sd-layout-menu-tree\n presentation=\"shortcuts\"\n [menus]=\"recent\"\n [activePath]=\"activePath()\"\n [showPin]=\"false\"\n (navigate)=\"navigateMenu($event)\">\n </sd-layout-menu-tree>\n </section>\n }\n <section data-v3-all class=\"d-flex flex-column gap-4\">\n <h2 class=\"sd-sidebar-v3__section-title m-0\">{{ 'core.module.layout.sidebar.all-menu' | sdTranslate }}</h2>\n <sd-layout-menu-tree\n presentation=\"hierarchy\"\n [collapsible]=\"true\"\n [(collapsedGroupKeys)]=\"collapsedGroupKeys\"\n [menus]=\"menus()\"\n [query]=\"searchText()\"\n [activePath]=\"activePath()\"\n [pinnedKeys]=\"pinnedKeys()\"\n (navigate)=\"navigateMenu($event)\"\n (togglePinned)=\"onTogglePinned($event)\">\n </sd-layout-menu-tree>\n </section>\n </div>\n }\n\n <div data-v3-footer class=\"sd-sidebar-v3__footer p-8\">\n <sd-layout-user-menu [userInfo]=\"userInfo()\" [compact]=\"collapsed\"></sd-layout-user-menu>\n </div>\n </aside>\n\n <main class=\"sd-sidebar-v3__content\">\n <ng-content></ng-content>\n </main>\n</div>\n", styles: [".sd-sidebar-v3{--sidebar-surface: var(--sd-white, #fff);--sidebar-line: color-mix(in srgb, var(--sd-border, #c4c6d0) 45%, var(--sidebar-surface));--sidebar-ink: var(--sd-text, #252c38);--sidebar-muted: var(--sd-text-secondary, #6b7280);min-height:100vh;background:var(--sd-light)}.sd-sidebar-v3__drawer{position:fixed;z-index:20;inset:0 auto 0 0;width:304px;box-sizing:border-box;background:var(--sidebar-surface);border-right:1px solid var(--sidebar-line);color:var(--sidebar-ink);transition:width .16s ease}.sd-sidebar-v3__header{flex-shrink:0;min-height:64px;box-sizing:border-box}.sd-sidebar-v3__title{font-size:16px;font-weight:600;line-height:22px;letter-spacing:-.2px}.sd-sidebar-v3__search{flex-shrink:0}.sd-sidebar-v3__navigation{min-height:0;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:var(--sidebar-line) transparent}.sd-sidebar-v3__navigation section{flex-shrink:0}.sd-sidebar-v3__section-title{padding:4px 10px;font-size:11px;font-weight:500;line-height:16px;letter-spacing:.3px;color:var(--sidebar-muted)}.sd-sidebar-v3__footer{flex-shrink:0;border-top:1px solid var(--sidebar-line);background:var(--sidebar-surface)}.sd-sidebar-v3--collapsed .sd-sidebar-v3__drawer{width:72px}.sd-sidebar-v3__content{min-height:100vh;margin-left:304px;transition:margin-left .16s ease}.sd-sidebar-v3--collapsed .sd-sidebar-v3__content{margin-left:72px}.sd-sidebar-v3__icon-action,.sd-sidebar-v3__collapsed-action{width:40px;flex-shrink:0;height:40px;border:0;border-radius:7px;background:transparent;color:var(--sidebar-muted);cursor:pointer}@media(pointer:coarse){.sd-sidebar-v3__icon-action,.sd-sidebar-v3__collapsed-action{width:44px;height:44px}}.sd-sidebar-v3__icon-action:hover,.sd-sidebar-v3__collapsed-action:hover{color:var(--sd-primary);background:var(--sd-primary-light)}.sd-sidebar-v3__icon-action:focus-visible,.sd-sidebar-v3__collapsed-action:focus-visible{outline:2px solid var(--sd-primary);outline-offset:2px}.sd-sidebar-v3__logo{width:28px;height:28px;object-fit:contain}@media(prefers-reduced-motion:reduce){.sd-sidebar-v3__drawer,.sd-sidebar-v3__content{transition:none}}\n"] }]
|
|
2471
2520
|
}], ctorParameters: () => [], propDecorators: { menus: [{ type: i0.Input, args: [{ isSignal: true, alias: "menus", required: false }] }], userInfo: [{ type: i0.Input, args: [{ isSignal: true, alias: "userInfo", required: true }] }], sidebar: [{ type: i0.Input, args: [{ isSignal: true, alias: "sidebar", required: true }] }] } });
|
|
2472
2521
|
|
|
2473
2522
|
class SdSidebarMobileV3 {
|
|
@@ -2574,7 +2623,7 @@ class SdSidebarMobileV3 {
|
|
|
2574
2623
|
this.#document.body.style.overflow = this.#previousBodyOverflow;
|
|
2575
2624
|
}
|
|
2576
2625
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: SdSidebarMobileV3, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2577
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.5", type: SdSidebarMobileV3, isStandalone: true, selector: "sd-sidebar-mobile-v3", inputs: { menus: { classPropertyName: "menus", publicName: "menus", isSignal: true, isRequired: false, transformFunction: null }, userInfo: { classPropertyName: "userInfo", publicName: "userInfo", isSignal: true, isRequired: true, transformFunction: null }, sidebar: { classPropertyName: "sidebar", publicName: "sidebar", isSignal: true, isRequired: true, transformFunction: null } }, viewQueries: [{ propertyName: "trigger", first: true, predicate: ["trigger"], descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"sd-sidebar-mobile-v3 d-flex flex-column\">\n <header\n class=\"sd-sidebar-mobile-v3__topbar d-flex align-items-center justify-content-between gap-8 px-16 bg-white border-bottom border-black200\">\n <div class=\"d-flex align-items-center gap-8 overflow-hidden\">\n @if (sidebar().logoUrl) {\n <img class=\"sd-sidebar-mobile-v3__logo\" [src]=\"sidebar().logoUrl\" alt=\"\" />\n }\n <span class=\"T16M text-ellipsis\">{{ sidebar().defaultTitle || 'Back Office' }}</span>\n </div>\n <button\n #trigger\n type=\"button\"\n data-v3-mobile-trigger\n class=\"sd-sidebar-mobile-v3__icon-action d-flex align-items-center justify-content-center\"\n aria-label=\"M\u1EDF menu\"\n [attr.aria-expanded]=\"isDrawerOpen()\"\n (click)=\"openDrawer($event.currentTarget)\">\n <sd-icon name=\"menu\"></sd-icon>\n </button>\n </header>\n\n <main class=\"flex-1 overflow-auto\">\n <ng-content></ng-content>\n </main>\n\n @if (isDrawerOpen()) {\n <button type=\"button\" class=\"sd-sidebar-mobile-v3__backdrop\" aria-label=\"\u0110\u00F3ng menu\" (click)=\"closeFromBackdrop()\"></button>\n <aside\n class=\"sd-sidebar-mobile-v3__drawer d-flex flex-column bg-white mat-elevation-z8\"\n role=\"dialog\"\n aria-modal=\"true\"\n aria-label=\"Menu ch\u00EDnh\"\n cdkTrapFocus\n [cdkTrapFocusAutoCapture]=\"true\"\n (keydown)=\"onDrawerKeydown($event)\">\n <header class=\"d-flex align-items-center justify-content-between gap-8 px-16 py-12 border-bottom border-black200\">\n <span class=\"T18M text-ellipsis\">{{ sidebar().defaultTitle || 'Back Office' }}</span>\n <button\n type=\"button\"\n class=\"sd-sidebar-mobile-v3__icon-action d-flex align-items-center justify-content-center\"\n aria-label=\"\u0110\u00F3ng menu\"\n (click)=\"closeFromBackdrop()\">\n <sd-icon name=\"close\"></sd-icon>\n </button>\n </header>\n <div class=\"sd-sidebar-mobile-v3__navigation d-flex flex-column gap-16 flex-1 overflow-auto p-12\">\n <sd-layout-user-menu presentation=\"mobile-inline\" [userInfo]=\"userInfo()\"></sd-layout-user-menu>\n <div class=\"sd-sidebar-mobile-v3__search bg-white\">\n <sd-layout-search-field\n placeholder=\"T\u00ECm trong t\u1EA5t c\u1EA3 menu\"\n [autoId]=\"'layout-v3-mobile-global-search'\"\n [model]=\"searchText()\"\n (sdChange)=\"searchText.set($event)\">\n </sd-layout-search-field>\n </div>\n @if (pinnedMenus().length) {\n <section data-v3-mobile-pinned class=\"d-flex flex-column gap-4\">\n <h2 class=\"T12M text-black400 px-12 m-0\">{{ 'core.module.layout.sidebar.pinned' | sdTranslate }}</h2>\n <sd-layout-menu-tree\n [menus]=\"pinnedMenus()\"\n [activePath]=\"activePath()\"\n [pinnedKeys]=\"pinnedKeys()\"\n pinVisibility=\"always\"\n (navigate)=\"navigateMenu($event)\"\n (togglePinned)=\"onTogglePinned($event)\">\n </sd-layout-menu-tree>\n </section>\n }\n @if (recentConfiguration().enabled && recentMenus().length) {\n <section data-v3-mobile-recent class=\"d-flex flex-column gap-4\">\n <h2 class=\"T12M text-black400 px-12 m-0\">{{ 'core.module.layout.sidebar.recent' | sdTranslate }}</h2>\n <sd-layout-menu-tree [menus]=\"recentMenus()\" [activePath]=\"activePath()\" [showPin]=\"false\" (navigate)=\"navigateMenu($event)\">\n </sd-layout-menu-tree>\n </section>\n }\n <section class=\"d-flex flex-column gap-4\">\n <h2 class=\"T12M text-black400 px-12 m-0\">{{ 'core.module.layout.sidebar.all-menu' | sdTranslate }}</h2>\n <sd-layout-menu-tree\n [menus]=\"menus()\"\n [query]=\"searchText()\"\n [activePath]=\"activePath()\"\n [pinnedKeys]=\"pinnedKeys()\"\n pinVisibility=\"always\"\n (navigate)=\"navigateMenu($event)\"\n (togglePinned)=\"onTogglePinned($event)\">\n </sd-layout-menu-tree>\n </section>\n </div>\n </aside>\n }\n</div>\n", styles: [":host{display:block}.sd-sidebar-mobile-v3{min-height:100dvh;background:var(--sd-light)}.sd-sidebar-mobile-v3__topbar{min-height:56px}.sd-sidebar-mobile-v3__icon-action{width:40px;height:40px;border:0;border-radius:8px;background:transparent;color:var(--sd-black500);cursor:pointer}.sd-sidebar-mobile-v3__icon-action:hover{color:var(--sd-primary);background:var(--sd-primary-light)}.sd-sidebar-mobile-v3__icon-action:focus-visible{outline:2px solid var(--sd-primary);outline-offset:2px}.sd-sidebar-mobile-v3__logo{width:28px;height:28px;object-fit:contain}.sd-sidebar-mobile-v3__backdrop{position:fixed;z-index:40;inset:0;border:0;background:color-mix(in srgb,var(--sd-black) 40%,transparent)}.sd-sidebar-mobile-v3__drawer{position:fixed;z-index:50;inset:0 auto 0 0;width:min(88vw,360px);max-width:100%;padding-bottom:env(safe-area-inset-bottom)}.sd-sidebar-mobile-v3__search{position:sticky;z-index:2;top:-12px;margin:-12px;padding:12px;background:var(--sd-white, #fff)}@media(prefers-reduced-motion:reduce){.sd-sidebar-mobile-v3__drawer{transition:none}}\n"], dependencies: [{ kind: "ngmodule", type: A11yModule }, { kind: "directive", type: i1$2.CdkTrapFocus, selector: "[cdkTrapFocus]", inputs: ["cdkTrapFocus", "cdkTrapFocusAutoCapture"], exportAs: ["cdkTrapFocus"] }, { kind: "component", type: SdIcon, selector: "sd-icon", inputs: ["name", "fontIcon", "color", "set", "fontSet", "size", "strokeWidth", "absoluteStrokeWidth", "ariaLabel"] }, { kind: "component", type: SdLayoutSearchFieldComponent, selector: "sd-layout-search-field", inputs: ["model", "placeholder", "autoId"], outputs: ["sdChange"] }, { kind: "component", type: SdLayoutMenuTreeComponent, selector: "sd-layout-menu-tree", inputs: ["menus", "query", "activePath", "pinnedKeys", "showPin", "pinVisibility"], outputs: ["navigate", "togglePinned"] }, { kind: "component", type: SdLayoutUserMenuComponent, selector: "sd-layout-user-menu", inputs: ["userInfo", "signout", "changePassword", "updateProfile", "setting", "notification", "compact", "presentation"], outputs: ["opened", "closed"] }, { kind: "pipe", type: SdTranslatePipe, name: "sdTranslate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2626
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.5", type: SdSidebarMobileV3, isStandalone: true, selector: "sd-sidebar-mobile-v3", inputs: { menus: { classPropertyName: "menus", publicName: "menus", isSignal: true, isRequired: false, transformFunction: null }, userInfo: { classPropertyName: "userInfo", publicName: "userInfo", isSignal: true, isRequired: true, transformFunction: null }, sidebar: { classPropertyName: "sidebar", publicName: "sidebar", isSignal: true, isRequired: true, transformFunction: null } }, viewQueries: [{ propertyName: "trigger", first: true, predicate: ["trigger"], descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"sd-sidebar-mobile-v3 d-flex flex-column\">\n <header\n class=\"sd-sidebar-mobile-v3__topbar d-flex align-items-center justify-content-between gap-8 px-16 bg-white border-bottom border-black200\">\n <div class=\"d-flex align-items-center gap-8 overflow-hidden\">\n @if (sidebar().logoUrl) {\n <img class=\"sd-sidebar-mobile-v3__logo\" [src]=\"sidebar().logoUrl\" alt=\"\" />\n }\n <span class=\"T16M text-ellipsis\">{{ sidebar().defaultTitle || 'Back Office' }}</span>\n </div>\n <button\n #trigger\n type=\"button\"\n data-v3-mobile-trigger\n class=\"sd-sidebar-mobile-v3__icon-action d-flex align-items-center justify-content-center\"\n aria-label=\"M\u1EDF menu\"\n [attr.aria-expanded]=\"isDrawerOpen()\"\n (click)=\"openDrawer($event.currentTarget)\">\n <sd-icon name=\"menu\"></sd-icon>\n </button>\n </header>\n\n <main class=\"flex-1 overflow-auto\">\n <ng-content></ng-content>\n </main>\n\n @if (isDrawerOpen()) {\n <button type=\"button\" class=\"sd-sidebar-mobile-v3__backdrop\" aria-label=\"\u0110\u00F3ng menu\" (click)=\"closeFromBackdrop()\"></button>\n <aside\n class=\"sd-sidebar-mobile-v3__drawer d-flex flex-column bg-white mat-elevation-z8\"\n role=\"dialog\"\n aria-modal=\"true\"\n aria-label=\"Menu ch\u00EDnh\"\n cdkTrapFocus\n [cdkTrapFocusAutoCapture]=\"true\"\n (keydown)=\"onDrawerKeydown($event)\">\n <header class=\"d-flex align-items-center justify-content-between gap-8 px-16 py-12 border-bottom border-black200\">\n <span class=\"T18M text-ellipsis\">{{ sidebar().defaultTitle || 'Back Office' }}</span>\n <button\n type=\"button\"\n class=\"sd-sidebar-mobile-v3__icon-action d-flex align-items-center justify-content-center\"\n aria-label=\"\u0110\u00F3ng menu\"\n (click)=\"closeFromBackdrop()\">\n <sd-icon name=\"close\"></sd-icon>\n </button>\n </header>\n <div class=\"sd-sidebar-mobile-v3__navigation d-flex flex-column gap-16 flex-1 overflow-auto p-12\">\n <sd-layout-user-menu presentation=\"mobile-inline\" [userInfo]=\"userInfo()\"></sd-layout-user-menu>\n <div class=\"sd-sidebar-mobile-v3__search bg-white\">\n <sd-layout-search-field\n placeholder=\"T\u00ECm trong t\u1EA5t c\u1EA3 menu\"\n [autoId]=\"'layout-v3-mobile-global-search'\"\n [model]=\"searchText()\"\n (sdChange)=\"searchText.set($event)\">\n </sd-layout-search-field>\n </div>\n @if (pinnedMenus().length) {\n <section data-v3-mobile-pinned class=\"d-flex flex-column gap-4\">\n <h2 class=\"T12M text-black400 px-12 m-0\">{{ 'core.module.layout.sidebar.pinned' | sdTranslate }}</h2>\n <sd-layout-menu-tree\n [menus]=\"pinnedMenus()\"\n [activePath]=\"activePath()\"\n [pinnedKeys]=\"pinnedKeys()\"\n pinVisibility=\"always\"\n (navigate)=\"navigateMenu($event)\"\n (togglePinned)=\"onTogglePinned($event)\">\n </sd-layout-menu-tree>\n </section>\n }\n @if (recentConfiguration().enabled && recentMenus().length) {\n <section data-v3-mobile-recent class=\"d-flex flex-column gap-4\">\n <h2 class=\"T12M text-black400 px-12 m-0\">{{ 'core.module.layout.sidebar.recent' | sdTranslate }}</h2>\n <sd-layout-menu-tree [menus]=\"recentMenus()\" [activePath]=\"activePath()\" [showPin]=\"false\" (navigate)=\"navigateMenu($event)\">\n </sd-layout-menu-tree>\n </section>\n }\n <section class=\"d-flex flex-column gap-4\">\n <h2 class=\"T12M text-black400 px-12 m-0\">{{ 'core.module.layout.sidebar.all-menu' | sdTranslate }}</h2>\n <sd-layout-menu-tree\n [menus]=\"menus()\"\n [query]=\"searchText()\"\n [activePath]=\"activePath()\"\n [pinnedKeys]=\"pinnedKeys()\"\n pinVisibility=\"always\"\n (navigate)=\"navigateMenu($event)\"\n (togglePinned)=\"onTogglePinned($event)\">\n </sd-layout-menu-tree>\n </section>\n </div>\n </aside>\n }\n</div>\n", styles: [":host{display:block}.sd-sidebar-mobile-v3{min-height:100dvh;background:var(--sd-light)}.sd-sidebar-mobile-v3__topbar{min-height:56px}.sd-sidebar-mobile-v3__icon-action{width:40px;height:40px;border:0;border-radius:8px;background:transparent;color:var(--sd-black500);cursor:pointer}.sd-sidebar-mobile-v3__icon-action:hover{color:var(--sd-primary);background:var(--sd-primary-light)}.sd-sidebar-mobile-v3__icon-action:focus-visible{outline:2px solid var(--sd-primary);outline-offset:2px}.sd-sidebar-mobile-v3__logo{width:28px;height:28px;object-fit:contain}.sd-sidebar-mobile-v3__backdrop{position:fixed;z-index:40;inset:0;border:0;background:color-mix(in srgb,var(--sd-black) 40%,transparent)}.sd-sidebar-mobile-v3__drawer{position:fixed;z-index:50;inset:0 auto 0 0;width:min(88vw,360px);max-width:100%;padding-bottom:env(safe-area-inset-bottom)}.sd-sidebar-mobile-v3__search{position:sticky;z-index:2;top:-12px;margin:-12px;padding:12px;background:var(--sd-white, #fff)}@media(prefers-reduced-motion:reduce){.sd-sidebar-mobile-v3__drawer{transition:none}}\n"], dependencies: [{ kind: "ngmodule", type: A11yModule }, { kind: "directive", type: i1$2.CdkTrapFocus, selector: "[cdkTrapFocus]", inputs: ["cdkTrapFocus", "cdkTrapFocusAutoCapture"], exportAs: ["cdkTrapFocus"] }, { kind: "component", type: SdIcon, selector: "sd-icon", inputs: ["name", "fontIcon", "color", "set", "fontSet", "size", "strokeWidth", "absoluteStrokeWidth", "ariaLabel"] }, { kind: "component", type: SdLayoutSearchFieldComponent, selector: "sd-layout-search-field", inputs: ["model", "placeholder", "autoId", "appearance"], outputs: ["sdChange"] }, { kind: "component", type: SdLayoutMenuTreeComponent, selector: "sd-layout-menu-tree", inputs: ["menus", "query", "activePath", "pinnedKeys", "showPin", "pinVisibility", "presentation", "collapsible", "collapsedGroupKeys"], outputs: ["collapsedGroupKeysChange", "navigate", "togglePinned"] }, { kind: "component", type: SdLayoutUserMenuComponent, selector: "sd-layout-user-menu", inputs: ["userInfo", "signout", "changePassword", "updateProfile", "setting", "notification", "compact", "presentation"], outputs: ["opened", "closed"] }, { kind: "pipe", type: SdTranslatePipe, name: "sdTranslate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2578
2627
|
}
|
|
2579
2628
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: SdSidebarMobileV3, decorators: [{
|
|
2580
2629
|
type: Component,
|