@sixbell-telco/sdk 3.3.1 → 4.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +137 -1
- package/README.md +47 -47
- package/THIRD_PARTY_NOTICES.md +33 -0
- package/_index.css +673 -76
- package/components/audio-player/README.md +1 -0
- package/components/audio-player/button-play/button-play.component.d.ts +3 -0
- package/components/audio-player/src/audio-player.component.d.ts +8 -0
- package/components/audio-player/volume-control/volume-control.component.d.ts +3 -0
- package/components/button/README.md +13 -0
- package/components/button/src/button.component.d.ts +30 -5
- package/components/data-table/README.md +53 -3
- package/components/data-table/expandable/expandable.component.d.ts +15 -2
- package/components/data-table/public-api.d.ts +2 -0
- package/components/data-table/sortable-header/sortable-header.component.d.ts +15 -1
- package/components/data-table/src/aria-sort.d.ts +22 -0
- package/components/data-table/src/data-table-context.service.d.ts +11 -3
- package/components/data-table/src/data-table.component.d.ts +39 -3
- package/components/data-table/src/sort-icon.component.d.ts +22 -0
- package/components/data-table/src/toggle-size.d.ts +7 -0
- package/components/data-table/sub-component-toggle/sub-component-toggle.component.d.ts +13 -0
- package/components/dialog/README.md +1 -0
- package/components/dialog/src/dialog.component.d.ts +9 -2
- package/components/divider/src/divider.component.d.ts +5 -0
- package/components/dropdown/README.md +21 -0
- package/components/dropdown/dropdown-content/dropdown-content.component.d.ts +4 -0
- package/components/dropdown/dropdown-trigger/dropdown-trigger.component.d.ts +36 -0
- package/components/dropdown/src/dropdown-item-focus.d.ts +6 -0
- package/components/dropdown/src/dropdown.component.d.ts +5 -2
- package/components/dual-list/src/dual-list.component.d.ts +6 -0
- package/components/file-upload/file-dropzone/file-dropzone.component.d.ts +6 -0
- package/components/forms/combobox/src/combobox.component.d.ts +7 -0
- package/components/forms/date-picker/README.md +2 -0
- package/components/forms/date-picker/src/date-picker.component.d.ts +6 -0
- package/components/forms/select/src/select.component.d.ts +3 -0
- package/components/icon/README.md +8 -1
- package/components/icon/src/icon.component.d.ts +9 -1
- package/components/notification/README.md +8 -0
- package/components/notification/src/notification.component.d.ts +8 -1
- package/components/paginator/README.md +1 -0
- package/components/paginator/components/pagination-item/pagination-item.component.d.ts +7 -1
- package/components/paginator/src/paginator.component.d.ts +10 -0
- package/components/sonner/toaster/src/toaster.component.d.ts +2 -1
- package/components/table/README.md +25 -0
- package/components/table/public-api.d.ts +1 -0
- package/components/table/src/table-loading.d.ts +18 -0
- package/components/table/src/table.component.d.ts +32 -4
- package/components/text/README.md +1 -0
- package/components/tooltip/src/tooltip.component.d.ts +2 -0
- package/directives/text/src/text.directive.d.ts +2 -2
- package/fesm2022/sixbell-telco-sdk-components-audio-player.mjs +48 -10
- package/fesm2022/sixbell-telco-sdk-components-audio-player.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-avatar.mjs +1 -1
- package/fesm2022/sixbell-telco-sdk-components-avatar.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-badge.mjs +2 -2
- package/fesm2022/sixbell-telco-sdk-components-badge.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-button.mjs +83 -4
- package/fesm2022/sixbell-telco-sdk-components-button.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-data-table-sub-component-toggle.mjs +34 -33
- package/fesm2022/sixbell-telco-sdk-components-data-table-sub-component-toggle.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-data-table.mjs +429 -361
- package/fesm2022/sixbell-telco-sdk-components-data-table.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-dialog.mjs +42 -22
- package/fesm2022/sixbell-telco-sdk-components-dialog.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-divider.mjs +8 -2
- package/fesm2022/sixbell-telco-sdk-components-divider.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-dropdown-menu-bar.mjs +7 -7
- package/fesm2022/sixbell-telco-sdk-components-dropdown-menu-bar.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-dropdown-menu.mjs +4 -4
- package/fesm2022/sixbell-telco-sdk-components-dropdown-menu.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-dropdown.mjs +247 -47
- package/fesm2022/sixbell-telco-sdk-components-dropdown.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-dual-list.mjs +10 -3
- package/fesm2022/sixbell-telco-sdk-components-dual-list.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-file-upload.mjs +16 -8
- package/fesm2022/sixbell-telco-sdk-components-file-upload.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-checkbox.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-combobox.mjs +13 -5
- package/fesm2022/sixbell-telco-sdk-components-forms-combobox.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-date-picker.mjs +9 -3
- package/fesm2022/sixbell-telco-sdk-components-forms-date-picker.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-input.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-radio.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-range.mjs +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-range.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-select.mjs +8 -4
- package/fesm2022/sixbell-telco-sdk-components-forms-select.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-switch.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-textarea.mjs +3 -15
- package/fesm2022/sixbell-telco-sdk-components-forms-textarea.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-toggle.mjs +2 -3
- package/fesm2022/sixbell-telco-sdk-components-forms-toggle.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-icon.mjs +12 -4
- package/fesm2022/sixbell-telco-sdk-components-icon.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-link.mjs +1 -1
- package/fesm2022/sixbell-telco-sdk-components-link.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-notification.mjs +17 -8
- package/fesm2022/sixbell-telco-sdk-components-notification.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-overlay.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-paginator.mjs +24 -5
- package/fesm2022/sixbell-telco-sdk-components-paginator.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-product-card.mjs +5 -5
- package/fesm2022/sixbell-telco-sdk-components-product-card.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-sonner-toaster.mjs +2 -1
- package/fesm2022/sixbell-telco-sdk-components-sonner-toaster.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-sonner.mjs +2 -1
- package/fesm2022/sixbell-telco-sdk-components-sonner.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-tab.mjs +1 -1
- package/fesm2022/sixbell-telco-sdk-components-tab.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-table.mjs +99 -22
- package/fesm2022/sixbell-telco-sdk-components-table.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-tooltip.mjs +21 -3
- package/fesm2022/sixbell-telco-sdk-components-tooltip.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-wizard.mjs +9 -9
- package/fesm2022/sixbell-telco-sdk-components-wizard.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-directives-text.mjs +3 -3
- package/fesm2022/sixbell-telco-sdk-directives-text.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-layouts.mjs +944 -0
- package/fesm2022/sixbell-telco-sdk-layouts.mjs.map +1 -0
- package/fesm2022/sixbell-telco-sdk-utils-cn.mjs +2 -3
- package/fesm2022/sixbell-telco-sdk-utils-cn.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-utils-http.mjs +39 -0
- package/fesm2022/sixbell-telco-sdk-utils-http.mjs.map +1 -0
- package/fesm2022/sixbell-telco-sdk-utils-mfe.mjs +150 -0
- package/fesm2022/sixbell-telco-sdk-utils-mfe.mjs.map +1 -0
- package/fesm2022/sixbell-telco-sdk-utils-theme.mjs +103 -4
- package/fesm2022/sixbell-telco-sdk-utils-theme.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-utils-translation.mjs +71 -2
- package/fesm2022/sixbell-telco-sdk-utils-translation.mjs.map +1 -1
- package/layouts/README.md +278 -0
- package/layouts/index.d.ts +5 -0
- package/layouts/public-api.d.ts +23 -0
- package/layouts/src/app-layout/app-layout.component.d.ts +83 -0
- package/layouts/src/layout-account.d.ts +16 -0
- package/layouts/src/layout-logo.d.ts +10 -0
- package/layouts/src/layout-switcher/layout-switcher.component.d.ts +13 -0
- package/layouts/src/layout.config.d.ts +22 -0
- package/layouts/src/layout.service.d.ts +17 -0
- package/layouts/src/menu/menu-active.d.ts +24 -0
- package/layouts/src/menu/menu-animation.d.ts +34 -0
- package/layouts/src/menu/menu-search.d.ts +13 -0
- package/layouts/src/menu/menu-sections.d.ts +23 -0
- package/layouts/src/menu/menu-url.d.ts +12 -0
- package/layouts/src/menu/menu.model.d.ts +15 -0
- package/layouts/src/navbar/navbar.component.d.ts +33 -0
- package/layouts/src/page-banner/page-banner.component.d.ts +40 -0
- package/layouts/src/side-menu/side-menu.component.d.ts +89 -0
- package/layouts/src/user-menu/user-menu.component.d.ts +91 -0
- package/package.json +26 -15
- package/utils/cn/src/cn.d.ts +1 -1
- package/utils/http/README.md +26 -0
- package/utils/http/index.d.ts +5 -0
- package/utils/http/public-api.d.ts +3 -0
- package/utils/http/src/bearer-token.interceptor.d.ts +19 -0
- package/utils/http/src/http-context.d.ts +3 -0
- package/utils/mfe/README.md +35 -0
- package/utils/mfe/index.d.ts +5 -0
- package/utils/mfe/public-api.d.ts +5 -0
- package/utils/mfe/src/mfe-shadow-root.d.ts +23 -0
- package/utils/mfe/src/mfe-shadow-shell.component.d.ts +20 -0
- package/utils/mfe/src/provide-mfe-shadow-shell.d.ts +20 -0
- package/utils/mfe/src/shadow-root-overlay-container.d.ts +13 -0
- package/utils/theme/README.md +14 -0
- package/utils/theme/public-api.d.ts +3 -1
- package/utils/theme/src/models/theme.d.ts +18 -0
- package/utils/theme/src/scheme-favicon/scheme-favicon.d.ts +26 -0
- package/utils/theme/src/theme-assets/theme-assets.service.d.ts +31 -1
- package/utils/theme/src/theme-assets/theme-assets.types.d.ts +6 -0
- package/utils/translation/README.md +12 -0
- package/utils/translation/public-api.d.ts +4 -0
- package/utils/translation/src/title-strategy/translated-title-strategy.d.ts +27 -0
- package/utils/translation/src/translated-label/translated-label.d.ts +21 -0
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
/**
|
|
3
|
+
* Top bar of the modern layout: the logo linking home, then any `[stNavbarEnd]` content and the
|
|
4
|
+
* account menu in a glass pill. The logo is the theme's `logo-modern` asset, else `logo`, for the
|
|
5
|
+
* resolved color scheme. It sits on the dark band of `bg-modern-gradient`: the logo and end regions
|
|
6
|
+
* (`data-st-navbar-band`) read `--color-primary-gradient-content` as their `--color-base-content`;
|
|
7
|
+
* the account menu panel opens in an overlay and keeps the page foreground.
|
|
8
|
+
*/
|
|
9
|
+
export declare class NavbarComponent {
|
|
10
|
+
private readonly logo;
|
|
11
|
+
/** Route the logo links to. */
|
|
12
|
+
readonly homeLink: import("@angular/core").InputSignal<string>;
|
|
13
|
+
/** Shows the account menu pill at the end. */
|
|
14
|
+
readonly showUserMenu: import("@angular/core").InputSignal<boolean>;
|
|
15
|
+
/** Alt text of the logo; defaults to the localized theme name. */
|
|
16
|
+
readonly logoAlt: import("@angular/core").InputSignal<string | null>;
|
|
17
|
+
/** `st-user-menu` `showLanguageSelector`. */
|
|
18
|
+
readonly showLanguageSelector: import("@angular/core").InputSignal<boolean>;
|
|
19
|
+
/** `st-user-menu` `showSchemeSelector`. */
|
|
20
|
+
readonly showSchemeSelector: import("@angular/core").InputSignal<boolean>;
|
|
21
|
+
/** `st-user-menu` `showThemeSelector`. */
|
|
22
|
+
readonly showThemeSelector: import("@angular/core").InputSignal<boolean>;
|
|
23
|
+
/** `st-user-menu` `showLayoutSelector`. */
|
|
24
|
+
readonly showLayoutSelector: import("@angular/core").InputSignal<boolean>;
|
|
25
|
+
readonly class: import("@angular/core").InputSignal<string>;
|
|
26
|
+
/** The account menu's layout option was picked; open `st-layout-switcher`. */
|
|
27
|
+
readonly openLayoutSwitcher: import("@angular/core").OutputEmitterRef<void>;
|
|
28
|
+
protected readonly hostClass: import("@angular/core").Signal<string>;
|
|
29
|
+
protected readonly logoUrl: import("@angular/core").Signal<string | null>;
|
|
30
|
+
protected readonly logoLabel: import("@angular/core").Signal<string>;
|
|
31
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NavbarComponent, never>;
|
|
32
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<NavbarComponent, "st-navbar", never, { "homeLink": { "alias": "homeLink"; "required": false; "isSignal": true; }; "showUserMenu": { "alias": "showUserMenu"; "required": false; "isSignal": true; }; "logoAlt": { "alias": "logoAlt"; "required": false; "isSignal": true; }; "showLanguageSelector": { "alias": "showLanguageSelector"; "required": false; "isSignal": true; }; "showSchemeSelector": { "alias": "showSchemeSelector"; "required": false; "isSignal": true; }; "showThemeSelector": { "alias": "showThemeSelector"; "required": false; "isSignal": true; }; "showLayoutSelector": { "alias": "showLayoutSelector"; "required": false; "isSignal": true; }; "class": { "alias": "class"; "required": false; "isSignal": true; }; }, { "openLayoutSwitcher": "openLayoutSwitcher"; }, never, ["[stNavbarEnd]"], true, never>;
|
|
33
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { ThemeAssetTone } from '@sixbell-telco/sdk/utils/theme';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
/**
|
|
4
|
+
* Page header for the SDK layouts. Classic shows the title over a theme banner image (or a plain
|
|
5
|
+
* surface when the theme has no such asset); modern shows it as light text on the brand gradient.
|
|
6
|
+
* Over an image, the title color follows the image tone the theme declares in its catalog
|
|
7
|
+
* (`tone`), and a surface scrim keeps it readable when no tone is known.
|
|
8
|
+
* Projected content (usually a `router-outlet`) fills the remaining height.
|
|
9
|
+
*/
|
|
10
|
+
export declare class PageBannerComponent {
|
|
11
|
+
private readonly layoutService;
|
|
12
|
+
private readonly themeAssetsService;
|
|
13
|
+
private readonly themeService;
|
|
14
|
+
private readonly router;
|
|
15
|
+
readonly title: import("@angular/core").InputSignal<string>;
|
|
16
|
+
readonly subtitle: import("@angular/core").InputSignal<string>;
|
|
17
|
+
/** URL the back button navigates to; no button when empty. */
|
|
18
|
+
readonly backLink: import("@angular/core").InputSignal<string | null>;
|
|
19
|
+
/** Theme asset key of the classic banner image; `null` for a plain surface. */
|
|
20
|
+
readonly bannerAsset: import("@angular/core").InputSignal<string | null>;
|
|
21
|
+
/** Luminance of the banner image; overrides the tone the theme declares for the asset. */
|
|
22
|
+
readonly bannerTone: import("@angular/core").InputSignal<ThemeAssetTone | null>;
|
|
23
|
+
readonly class: import("@angular/core").InputSignal<string>;
|
|
24
|
+
protected readonly backIcon = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\"><path d=\"M21 11H6.83l3.58-3.59L9 6l-6 6l6 6l1.41-1.41L6.83 13H21z\"></path></svg>";
|
|
25
|
+
/**
|
|
26
|
+
* Two-tone focus ring of the back button: a `base-content` outline over a `base-100` ring. One of the two
|
|
27
|
+
* contrasts with whatever is behind it (art, scrim, surface or the modern gradient), in both schemes.
|
|
28
|
+
*/
|
|
29
|
+
protected readonly backFocusClass = "[&_.btn:focus-visible]:outline-base-content [&_.btn:focus-visible]:ring-4 [&_.btn:focus-visible]:ring-base-100";
|
|
30
|
+
/** Frosted surface for the back button over toned art. */
|
|
31
|
+
protected readonly backClass: import("@angular/core").Signal<string>;
|
|
32
|
+
protected readonly hostClass: import("@angular/core").Signal<string>;
|
|
33
|
+
protected readonly isClassic: import("@angular/core").Signal<boolean>;
|
|
34
|
+
protected readonly bannerUrl: import("@angular/core").Signal<string | null>;
|
|
35
|
+
/** Tone of the image shown; `null` when neither the input nor the theme declares it. */
|
|
36
|
+
protected readonly imageTone: import("@angular/core").Signal<ThemeAssetTone | null>;
|
|
37
|
+
protected goBack(): void;
|
|
38
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<PageBannerComponent, never>;
|
|
39
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<PageBannerComponent, "st-page-banner", never, { "title": { "alias": "title"; "required": false; "isSignal": true; }; "subtitle": { "alias": "subtitle"; "required": false; "isSignal": true; }; "backLink": { "alias": "backLink"; "required": false; "isSignal": true; }; "bannerAsset": { "alias": "bannerAsset"; "required": false; "isSignal": true; }; "bannerTone": { "alias": "bannerTone"; "required": false; "isSignal": true; }; "class": { "alias": "class"; "required": false; "isSignal": true; }; }, {}, never, ["*"], true, never>;
|
|
40
|
+
}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { type LayoutMenuAnimationState } from '../menu/menu-animation';
|
|
2
|
+
import { menuItemHasChildren, type LayoutMenuActiveMatch, type LayoutMenuItem, type LayoutMenuTopLevelGroups } from '../menu/menu.model';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
interface RailEntry {
|
|
5
|
+
item: LayoutMenuItem;
|
|
6
|
+
target: LayoutMenuItem;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Sidebar navigation shared by the classic and modern layouts: a search box, the menu tree and, when
|
|
10
|
+
* the sidebar is collapsed, an icon rail. Active entries follow the router URL.
|
|
11
|
+
*/
|
|
12
|
+
export declare class SideMenuComponent {
|
|
13
|
+
private readonly router;
|
|
14
|
+
private readonly layoutService;
|
|
15
|
+
private readonly host;
|
|
16
|
+
private readonly injector;
|
|
17
|
+
private readonly idPrefix;
|
|
18
|
+
private readonly groupIds;
|
|
19
|
+
private readonly store;
|
|
20
|
+
/** Menu tree with labels already translated. */
|
|
21
|
+
readonly items: import("@angular/core").InputSignal<LayoutMenuItem[]>;
|
|
22
|
+
/** `divider`: level-1 groups render as section labels; `collapsible`: every group expands in place. */
|
|
23
|
+
readonly topLevelGroups: import("@angular/core").InputSignal<LayoutMenuTopLevelGroups>;
|
|
24
|
+
/** `route`: the longest matching route is active; `menu-id`: the entry named by the URL's `menu` param. */
|
|
25
|
+
readonly activeMatch: import("@angular/core").InputSignal<LayoutMenuActiveMatch>;
|
|
26
|
+
/**
|
|
27
|
+
* Overrides the visible state of `LayoutService.sidebarCollapsed()`, e.g. `[collapsed]="pinnedCollapsed && !hovered"`
|
|
28
|
+
* for a rail that expands while hovered. The pinned state itself is unchanged and still drives the collapse toggle.
|
|
29
|
+
*/
|
|
30
|
+
readonly collapsed: import("@angular/core").InputSignal<boolean | undefined>;
|
|
31
|
+
readonly searchable: import("@angular/core").InputSignal<boolean>;
|
|
32
|
+
/**
|
|
33
|
+
* Renders the footer button that pins the sidebar collapsed or open through `LayoutService.setSidebarCollapsed`.
|
|
34
|
+
* Its label, icon and action follow the pinned state, not the `collapsed` override, so a hover-expanded rail
|
|
35
|
+
* offers "expand" and pins the sidebar open; its placement follows the visible state.
|
|
36
|
+
*/
|
|
37
|
+
readonly showCollapseToggle: import("@angular/core").InputSignal<boolean>;
|
|
38
|
+
readonly class: import("@angular/core").InputSignal<string>;
|
|
39
|
+
/**
|
|
40
|
+
* Text of the search box; `searchChange` emits each edit, so `[(search)]` binds it two-way. It clears on
|
|
41
|
+
* navigation and when the collapse toggle pins the sidebar collapsed (a hover rail that only collapses
|
|
42
|
+
* visually keeps it).
|
|
43
|
+
*/
|
|
44
|
+
readonly search: import("@angular/core").ModelSignal<string>;
|
|
45
|
+
/**
|
|
46
|
+
* The current page sits on `bg-primary`, so its focus ring switches to `primary-content` and moves
|
|
47
|
+
* 2px inside the edge: both sides of the ring are then the primary fill, in every theme and scheme.
|
|
48
|
+
* It is raised with a small shadow; hover and press mix the primary toward `base-content`, away from
|
|
49
|
+
* `primary-content`, and the press drops the shadow.
|
|
50
|
+
*/
|
|
51
|
+
protected readonly activeLinkClass: string;
|
|
52
|
+
protected readonly inactiveLinkClass: string;
|
|
53
|
+
protected readonly groupStateClass: string;
|
|
54
|
+
protected readonly chevronIcon = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\"><path d=\"M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6l-6-6l1.41-1.41z\"></path></svg>";
|
|
55
|
+
protected readonly fallbackIcon = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\"><path d=\"M9.17 6l2 2H20v10H4V6h5.17M10 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2h-8l-2-2z\"></path></svg>";
|
|
56
|
+
protected readonly searchIcon = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\"><path d=\"M15.5 14h-.79l-.28-.27A6.471 6.471 0 0 0 16 9.5A6.5 6.5 0 1 0 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5S14 7.01 14 9.5S11.99 14 9.5 14z\"></path></svg>";
|
|
57
|
+
protected readonly collapseIcon = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\"><path d=\"M3 18h13v-2H3v2zm0-5h10v-2H3v2zm0-7v2h13V6H3zm18 9.59L17.42 12L21 8.41L19.59 7l-5 5l5 5L21 15.59z\"></path></svg>";
|
|
58
|
+
protected readonly expandIcon = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\"><path d=\"M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z\"></path></svg>";
|
|
59
|
+
private readonly url;
|
|
60
|
+
protected readonly isPinnedCollapsed: import("@angular/core").Signal<boolean>;
|
|
61
|
+
protected readonly isCollapsed: import("@angular/core").Signal<boolean>;
|
|
62
|
+
protected readonly hostClass: import("@angular/core").Signal<string>;
|
|
63
|
+
protected readonly active: import("@angular/core").Signal<import("@sixbell-telco/sdk/layouts").LayoutMenuActiveState>;
|
|
64
|
+
protected readonly searchResult: import("@angular/core").Signal<import("@sixbell-telco/sdk/layouts").LayoutMenuSearchResult>;
|
|
65
|
+
protected readonly sections: import("@angular/core").Signal<import("@sixbell-telco/sdk/layouts").LayoutMenuSection[]>;
|
|
66
|
+
protected readonly railEntries: import("@angular/core").Signal<RailEntry[]>;
|
|
67
|
+
constructor();
|
|
68
|
+
protected readonly hasChildren: typeof menuItemHasChildren;
|
|
69
|
+
protected linkQueryParams(item: LayoutMenuItem): Record<string, string>;
|
|
70
|
+
protected isActive(item: LayoutMenuItem): boolean;
|
|
71
|
+
protected isOnTrail(item: LayoutMenuItem): boolean;
|
|
72
|
+
/** `page` for the active link; `true` for a rail entry whose branch holds the active page. */
|
|
73
|
+
protected railCurrent(entry: RailEntry): 'page' | 'true' | null;
|
|
74
|
+
protected groupState(item: LayoutMenuItem): LayoutMenuAnimationState;
|
|
75
|
+
/** Expanded while opening or open; the content stays rendered while it closes. */
|
|
76
|
+
protected isGroupExpanded(item: LayoutMenuItem): boolean;
|
|
77
|
+
protected groupId(item: LayoutMenuItem): string;
|
|
78
|
+
protected labelId(item: LayoutMenuItem): string;
|
|
79
|
+
protected toggleGroup(item: LayoutMenuItem): void;
|
|
80
|
+
/** `animationend` bubbles from nested groups: settle only this group's own open or close keyframes. */
|
|
81
|
+
protected onGroupAnimationEnd(event: AnimationEvent, item: LayoutMenuItem): void;
|
|
82
|
+
protected toggleCollapsed(): void;
|
|
83
|
+
/** The rail's search button expands the sidebar and moves focus into the search box. */
|
|
84
|
+
protected openSearch(): void;
|
|
85
|
+
private prefersReducedMotion;
|
|
86
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SideMenuComponent, never>;
|
|
87
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<SideMenuComponent, "st-side-menu", never, { "items": { "alias": "items"; "required": true; "isSignal": true; }; "topLevelGroups": { "alias": "topLevelGroups"; "required": false; "isSignal": true; }; "activeMatch": { "alias": "activeMatch"; "required": false; "isSignal": true; }; "collapsed": { "alias": "collapsed"; "required": false; "isSignal": true; }; "searchable": { "alias": "searchable"; "required": false; "isSignal": true; }; "showCollapseToggle": { "alias": "showCollapseToggle"; "required": false; "isSignal": true; }; "class": { "alias": "class"; "required": false; "isSignal": true; }; "search": { "alias": "search"; "required": false; "isSignal": true; }; }, { "search": "searchChange"; }, never, never, true, never>;
|
|
88
|
+
}
|
|
89
|
+
export {};
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { ThemeScheme } from '@sixbell-telco/sdk/utils/theme';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
/** Where the menu sits: the modern navbar or the classic sidebar footer. */
|
|
4
|
+
export type UserMenuVariant = 'navbar' | 'sidebar';
|
|
5
|
+
type UserMenuView = 'options' | 'language' | 'scheme' | 'theme';
|
|
6
|
+
interface UserMenuChoice {
|
|
7
|
+
value: string;
|
|
8
|
+
label: string;
|
|
9
|
+
}
|
|
10
|
+
interface UserMenuSubmenu {
|
|
11
|
+
titleKey: string;
|
|
12
|
+
choices: UserMenuChoice[];
|
|
13
|
+
current: string;
|
|
14
|
+
select: (value: string) => void;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Account menu of the SDK layouts: the user's avatar opens account actions (change password, logout)
|
|
18
|
+
* and preferences (language, color scheme, theme, layout). The account comes from `provideLayoutAccount`.
|
|
19
|
+
*/
|
|
20
|
+
export declare class UserMenuComponent {
|
|
21
|
+
private readonly account;
|
|
22
|
+
private readonly layoutService;
|
|
23
|
+
private readonly themeService;
|
|
24
|
+
private readonly translationService;
|
|
25
|
+
private readonly translateService;
|
|
26
|
+
readonly variant: import("@angular/core").InputSignal<UserMenuVariant>;
|
|
27
|
+
/** Sidebar variant only: shows the avatar without name, role or chevron. */
|
|
28
|
+
readonly collapsed: import("@angular/core").InputSignal<boolean>;
|
|
29
|
+
/** Shows the language option (also needs more than one language). */
|
|
30
|
+
readonly showLanguageSelector: import("@angular/core").InputSignal<boolean>;
|
|
31
|
+
/** Shows the color scheme option (also needs more than one scheme). */
|
|
32
|
+
readonly showSchemeSelector: import("@angular/core").InputSignal<boolean>;
|
|
33
|
+
/** Shows the theme option (also needs more than one theme). */
|
|
34
|
+
readonly showThemeSelector: import("@angular/core").InputSignal<boolean>;
|
|
35
|
+
/** Shows the layout option (also needs more than one layout). */
|
|
36
|
+
readonly showLayoutSelector: import("@angular/core").InputSignal<boolean>;
|
|
37
|
+
readonly class: import("@angular/core").InputSignal<string>;
|
|
38
|
+
readonly openLayoutSwitcher: import("@angular/core").OutputEmitterRef<void>;
|
|
39
|
+
readonly openChange: import("@angular/core").OutputEmitterRef<boolean>;
|
|
40
|
+
/** Ticks on any translation change, including hosts that drive ngx-translate directly. */
|
|
41
|
+
private readonly translationEvents;
|
|
42
|
+
private readonly i18n;
|
|
43
|
+
protected readonly view: import("@angular/core").WritableSignal<UserMenuView>;
|
|
44
|
+
private readonly backButton;
|
|
45
|
+
private readonly optionsView;
|
|
46
|
+
/** The submenu just left, so focus can return to the option that opened it. */
|
|
47
|
+
private returnFocusTo;
|
|
48
|
+
protected readonly user: import("@angular/core").Signal<import("@sixbell-telco/sdk/components/avatar").AvatarUser | null>;
|
|
49
|
+
protected readonly canChangePassword: boolean;
|
|
50
|
+
protected readonly compact: import("@angular/core").Signal<boolean>;
|
|
51
|
+
protected readonly triggerLabel: import("@angular/core").Signal<string>;
|
|
52
|
+
protected readonly languages: import("@angular/core").Signal<UserMenuChoice[]>;
|
|
53
|
+
protected readonly schemes: import("@angular/core").Signal<UserMenuChoice[]>;
|
|
54
|
+
protected readonly themes: import("@angular/core").Signal<UserMenuChoice[]>;
|
|
55
|
+
protected readonly currentLanguage: import("@angular/core").WritableSignal<string>;
|
|
56
|
+
protected readonly currentScheme: import("@angular/core").WritableSignal<ThemeScheme>;
|
|
57
|
+
protected readonly currentTheme: import("@angular/core").WritableSignal<string>;
|
|
58
|
+
protected readonly hasLanguageSelector: import("@angular/core").Signal<boolean>;
|
|
59
|
+
protected readonly hasSchemeSelector: import("@angular/core").Signal<boolean>;
|
|
60
|
+
protected readonly hasThemeSelector: import("@angular/core").Signal<boolean>;
|
|
61
|
+
protected readonly hasLayoutSelector: import("@angular/core").Signal<boolean>;
|
|
62
|
+
protected readonly hasPreferences: import("@angular/core").Signal<boolean>;
|
|
63
|
+
protected readonly submenu: import("@angular/core").Signal<UserMenuSubmenu | null>;
|
|
64
|
+
protected readonly hostClass: import("@angular/core").Signal<string>;
|
|
65
|
+
protected readonly triggerClass: import("@angular/core").Signal<string>;
|
|
66
|
+
protected readonly icons: {
|
|
67
|
+
back: string;
|
|
68
|
+
layout: string;
|
|
69
|
+
language: string;
|
|
70
|
+
logout: string;
|
|
71
|
+
password: string;
|
|
72
|
+
person: string;
|
|
73
|
+
theme: string;
|
|
74
|
+
};
|
|
75
|
+
constructor();
|
|
76
|
+
/**
|
|
77
|
+
* Enter on a submenu entry swaps the view and focuses Back before the key sequence ends; without
|
|
78
|
+
* this, the browser's implicit Enter activation lands on Back and returns to the options at once.
|
|
79
|
+
* It listens on the document, which outlives the swap: the entry's own listeners are torn down
|
|
80
|
+
* with the options view while the event is still bubbling, and the overlay is outside the host.
|
|
81
|
+
*/
|
|
82
|
+
protected preventSubmenuEnter(event: Event): void;
|
|
83
|
+
protected schemeIcon(scheme: string): string;
|
|
84
|
+
protected show(view: UserMenuView): void;
|
|
85
|
+
protected handleOpenChange(open: boolean): void;
|
|
86
|
+
protected changePassword(): void;
|
|
87
|
+
protected logout(): void;
|
|
88
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<UserMenuComponent, never>;
|
|
89
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<UserMenuComponent, "st-user-menu", never, { "variant": { "alias": "variant"; "required": false; "isSignal": true; }; "collapsed": { "alias": "collapsed"; "required": false; "isSignal": true; }; "showLanguageSelector": { "alias": "showLanguageSelector"; "required": false; "isSignal": true; }; "showSchemeSelector": { "alias": "showSchemeSelector"; "required": false; "isSignal": true; }; "showThemeSelector": { "alias": "showThemeSelector"; "required": false; "isSignal": true; }; "showLayoutSelector": { "alias": "showLayoutSelector"; "required": false; "isSignal": true; }; "class": { "alias": "class"; "required": false; "isSignal": true; }; }, { "openLayoutSwitcher": "openLayoutSwitcher"; "openChange": "openChange"; }, never, never, true, never>;
|
|
90
|
+
}
|
|
91
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sixbell-telco/sdk",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.1.0",
|
|
4
4
|
"description": "A collection of reusable components designed for use in Sixbell Telco Angular projects",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"sixbell",
|
|
@@ -35,6 +35,10 @@
|
|
|
35
35
|
"./package.json": {
|
|
36
36
|
"default": "./package.json"
|
|
37
37
|
},
|
|
38
|
+
"./layouts": {
|
|
39
|
+
"types": "./layouts/index.d.ts",
|
|
40
|
+
"default": "./fesm2022/sixbell-telco-sdk-layouts.mjs"
|
|
41
|
+
},
|
|
38
42
|
"./components/accordion": {
|
|
39
43
|
"types": "./components/accordion/index.d.ts",
|
|
40
44
|
"default": "./fesm2022/sixbell-telco-sdk-components-accordion.mjs"
|
|
@@ -171,10 +175,18 @@
|
|
|
171
175
|
"types": "./utils/formatting/index.d.ts",
|
|
172
176
|
"default": "./fesm2022/sixbell-telco-sdk-utils-formatting.mjs"
|
|
173
177
|
},
|
|
178
|
+
"./utils/http": {
|
|
179
|
+
"types": "./utils/http/index.d.ts",
|
|
180
|
+
"default": "./fesm2022/sixbell-telco-sdk-utils-http.mjs"
|
|
181
|
+
},
|
|
174
182
|
"./utils/logger": {
|
|
175
183
|
"types": "./utils/logger/index.d.ts",
|
|
176
184
|
"default": "./fesm2022/sixbell-telco-sdk-utils-logger.mjs"
|
|
177
185
|
},
|
|
186
|
+
"./utils/mfe": {
|
|
187
|
+
"types": "./utils/mfe/index.d.ts",
|
|
188
|
+
"default": "./fesm2022/sixbell-telco-sdk-utils-mfe.mjs"
|
|
189
|
+
},
|
|
178
190
|
"./utils/runtime-config": {
|
|
179
191
|
"types": "./utils/runtime-config/index.d.ts",
|
|
180
192
|
"default": "./fesm2022/sixbell-telco-sdk-utils-runtime-config.mjs"
|
|
@@ -311,29 +323,28 @@
|
|
|
311
323
|
"peerDependencies": {
|
|
312
324
|
"@angular/core": "~19.2.25",
|
|
313
325
|
"@angular/cdk": "~19.2.19",
|
|
314
|
-
"
|
|
326
|
+
"tailwind-animations": "~1.0.2",
|
|
315
327
|
"@tailwindcss/typography": "~0.5.20",
|
|
316
328
|
"@tailwindcss/postcss": "~4.3.3",
|
|
317
329
|
"class-variance-authority": "~0.7.1",
|
|
318
|
-
"
|
|
319
|
-
"daisyui": "~5.7.
|
|
320
|
-
"postcss": "~8.5.
|
|
321
|
-
"tailwind-merge": "~3.3.1",
|
|
330
|
+
"cn": "~0.4.0",
|
|
331
|
+
"daisyui": "~5.7.47",
|
|
332
|
+
"postcss": "~8.5.29",
|
|
322
333
|
"tailwindcss": "~4.3.3",
|
|
323
|
-
"dayjs": "~1.11.
|
|
334
|
+
"dayjs": "~1.11.23",
|
|
324
335
|
"uuid": "~11.1.1",
|
|
325
|
-
"@ng-icons/core": "~
|
|
326
|
-
"@ng-icons/material-icons": "~
|
|
327
|
-
"@ng-icons/ionicons": "~
|
|
328
|
-
"@ng-icons/heroicons": "~
|
|
329
|
-
"tailwind-scrollbar": "~4.0.
|
|
336
|
+
"@ng-icons/core": "~31.4.0",
|
|
337
|
+
"@ng-icons/material-icons": "~31.4.0",
|
|
338
|
+
"@ng-icons/ionicons": "~31.4.0",
|
|
339
|
+
"@ng-icons/heroicons": "~31.4.0",
|
|
340
|
+
"tailwind-scrollbar": "~4.0.2",
|
|
330
341
|
"@ngx-translate/core": "17.0.0",
|
|
331
342
|
"@ngx-translate/http-loader": "17.0.0",
|
|
332
343
|
"ngx-translate-multi-http-loader": "20.0.0",
|
|
333
|
-
"cally": "~0.
|
|
334
|
-
"@tanstack/angular-table": "~8.21.
|
|
344
|
+
"cally": "~0.9.2",
|
|
345
|
+
"@tanstack/angular-table": "~8.21.4",
|
|
335
346
|
"ngx-sonner": "~3.1.0",
|
|
336
|
-
"dexie": "4.
|
|
347
|
+
"dexie": "4.4.6"
|
|
337
348
|
},
|
|
338
349
|
"sideEffects": false,
|
|
339
350
|
"module": "fesm2022/sixbell-telco-sdk.mjs",
|
package/utils/cn/src/cn.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { type ClassValue } from '
|
|
1
|
+
import { type ClassValue } from 'cn';
|
|
2
2
|
export declare function cn(...classes: ClassValue[]): string;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# @sixbell-telco/sdk/utils/http
|
|
2
|
+
|
|
3
|
+
HTTP building blocks shared by MFE hosts and children.
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
import { inject } from '@angular/core';
|
|
7
|
+
import { provideHttpClient, withInterceptors } from '@angular/common/http';
|
|
8
|
+
import { bearerTokenInterceptor, provideAuthToken } from '@sixbell-telco/sdk/utils/http';
|
|
9
|
+
|
|
10
|
+
export const appConfig = {
|
|
11
|
+
providers: [
|
|
12
|
+
provideHttpClient(withInterceptors([bearerTokenInterceptor, errorInterceptor])),
|
|
13
|
+
provideAuthToken(() => {
|
|
14
|
+
const session = inject(SessionService);
|
|
15
|
+
return () => session.token();
|
|
16
|
+
}),
|
|
17
|
+
],
|
|
18
|
+
};
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
- `bearerTokenInterceptor` adds `Authorization: Bearer <token>` when the getter returns a token.
|
|
22
|
+
- `BYPASS_INTERCEPTOR` opts a request out of `bearerTokenInterceptor`. App interceptors (error handling, etc.) should read this same token (re-export it instead of declaring a new `HttpContextToken`), so one flag skips them all:
|
|
23
|
+
|
|
24
|
+
```ts
|
|
25
|
+
http.get(url, { context: new HttpContext().set(BYPASS_INTERCEPTOR, true) });
|
|
26
|
+
```
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { HttpInterceptorFn } from '@angular/common/http';
|
|
2
|
+
import { InjectionToken, Provider } from '@angular/core';
|
|
3
|
+
/** Returns the current access token, or an empty value when there is no session. */
|
|
4
|
+
export type AuthTokenGetter = () => string | null | undefined;
|
|
5
|
+
/** Supplies the access token that `bearerTokenInterceptor` sends. */
|
|
6
|
+
export declare const AUTH_TOKEN: InjectionToken<AuthTokenGetter>;
|
|
7
|
+
/**
|
|
8
|
+
* Registers the token getter for `bearerTokenInterceptor`. The factory runs in an injection context,
|
|
9
|
+
* so it can `inject()` the app's session service.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* provideAuthToken(() => {
|
|
13
|
+
* const session = inject(SessionService);
|
|
14
|
+
* return () => session.token();
|
|
15
|
+
* })
|
|
16
|
+
*/
|
|
17
|
+
export declare function provideAuthToken(factory: () => AuthTokenGetter): Provider;
|
|
18
|
+
/** Adds `Authorization: Bearer <token>` when a token is available and the request does not set `BYPASS_INTERCEPTOR`. */
|
|
19
|
+
export declare const bearerTokenInterceptor: HttpInterceptorFn;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# MFE utilities
|
|
2
|
+
|
|
3
|
+
Helpers for child micro-frontends that a host mounts through Native Federation inside a shadow root.
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
import { MfeShadowShellComponent, provideMfeShadowShell } from '@sixbell-telco/sdk/utils/mfe';
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
## Shadow shell
|
|
10
|
+
|
|
11
|
+
Mount the child's routes under `MfeShadowShellComponent` and configure it with `provideMfeShadowShell` on the same route:
|
|
12
|
+
|
|
13
|
+
```ts
|
|
14
|
+
export const AUXILIARY_TABLES_ROUTES: Routes = [
|
|
15
|
+
{
|
|
16
|
+
path: '',
|
|
17
|
+
component: MfeShadowShellComponent,
|
|
18
|
+
providers: provideMfeShadowShell({
|
|
19
|
+
basePath: '/mfe-aux-tables/',
|
|
20
|
+
stylesheetHrefModule: 'assets/auxiliary-tables-stylesheet-href.js',
|
|
21
|
+
stylesheetHrefExport: 'auxiliaryTablesStylesheetHref',
|
|
22
|
+
}),
|
|
23
|
+
children: AUXILIARY_TABLES_FEATURE_ROUTES,
|
|
24
|
+
},
|
|
25
|
+
];
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
The shell:
|
|
29
|
+
|
|
30
|
+
- renders the child routes in its own shadow root (`<st-mfe-shadow-shell>`), so the child's compiled CSS cannot leak into the host;
|
|
31
|
+
- attaches the child's compiled stylesheet there and keeps the content hidden until it loads (or `revealTimeoutMs`, default 1500 ms);
|
|
32
|
+
- resolves the hashed stylesheet name from `<basePath><stylesheetHrefModule>` (default `assets/stylesheet-href.js`, export `stylesheetHref`), falling back to `<basePath>styles.css`, and preloads it once per page;
|
|
33
|
+
- scopes CDK `OverlayContainer`, `Overlay` and `Dialog` to the route, so dialogs, menus and popovers opened by the child render inside the shadow root and keep its styles. Without a shell (the standalone dev harness) overlays stay on the document body.
|
|
34
|
+
|
|
35
|
+
Theme tokens are not copied: they inherit from the host through the shadow boundary.
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { MFE_SHADOW_SHELL_CONFIG, MfeShadowRoot } from './src/mfe-shadow-root';
|
|
2
|
+
export type { MfeShadowShellConfig } from './src/mfe-shadow-root';
|
|
3
|
+
export { MfeShadowShellComponent } from './src/mfe-shadow-shell.component';
|
|
4
|
+
export { mfeStylesheetHref, provideMfeShadowShell, resolveMfeStylesheetHref } from './src/provide-mfe-shadow-shell';
|
|
5
|
+
export { ShadowRootOverlayContainer } from './src/shadow-root-overlay-container';
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { InjectionToken } from '@angular/core';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
/** Where a federated child MFE serves its compiled stylesheet. */
|
|
4
|
+
export interface MfeShadowShellConfig {
|
|
5
|
+
/** Public path the host mounts the child under, with a trailing slash (e.g. `/mfe-aux-tables/`). */
|
|
6
|
+
basePath: string;
|
|
7
|
+
/**
|
|
8
|
+
* Module (relative to `basePath`) whose export holds the hashed stylesheet href written after the build.
|
|
9
|
+
* Defaults to `assets/stylesheet-href.js`.
|
|
10
|
+
*/
|
|
11
|
+
stylesheetHrefModule?: string;
|
|
12
|
+
/** Export name read from `stylesheetHrefModule`. Defaults to `stylesheetHref`. */
|
|
13
|
+
stylesheetHrefExport?: string;
|
|
14
|
+
/** Reveal the content after this delay even if the stylesheet never answers. Defaults to 1500 ms. */
|
|
15
|
+
revealTimeoutMs?: number;
|
|
16
|
+
}
|
|
17
|
+
export declare const MFE_SHADOW_SHELL_CONFIG: InjectionToken<MfeShadowShellConfig>;
|
|
18
|
+
/** Route-scoped registry of the shell's shadow root, so overlays opened by the child render inside it. */
|
|
19
|
+
export declare class MfeShadowRoot {
|
|
20
|
+
readonly root: import("@angular/core").WritableSignal<ShadowRoot | null>;
|
|
21
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MfeShadowRoot, never>;
|
|
22
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<MfeShadowRoot>;
|
|
23
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
/**
|
|
3
|
+
* Route component that mounts a federated child inside its own shadow root: it attaches the child's
|
|
4
|
+
* compiled stylesheet there, hides the content until it loads (no unstyled flash), and registers the
|
|
5
|
+
* shadow root so CDK overlays opened by the child render inside it. Theme tokens inherit from the host.
|
|
6
|
+
* Configure it with `provideMfeShadowShell` on the same route.
|
|
7
|
+
*/
|
|
8
|
+
export declare class MfeShadowShellComponent {
|
|
9
|
+
private readonly config;
|
|
10
|
+
private readonly registry;
|
|
11
|
+
private readonly document;
|
|
12
|
+
private readonly host;
|
|
13
|
+
private readonly destroyRef;
|
|
14
|
+
private readonly stylesReady;
|
|
15
|
+
protected readonly visibility: import("@angular/core").Signal<"visible" | "hidden">;
|
|
16
|
+
constructor();
|
|
17
|
+
private attachStylesheet;
|
|
18
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MfeShadowShellComponent, never>;
|
|
19
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<MfeShadowShellComponent, "st-mfe-shadow-shell", never, {}, {}, never, never, true, never>;
|
|
20
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Provider } from '@angular/core';
|
|
2
|
+
import { MfeShadowShellConfig } from './mfe-shadow-root';
|
|
3
|
+
type StylesheetModuleImporter = (url: string) => Promise<Record<string, unknown>>;
|
|
4
|
+
/**
|
|
5
|
+
* Resolves the child's compiled stylesheet href: the hashed name written after the build, read from
|
|
6
|
+
* `stylesheetHrefModule`, or `<basePath>styles.css` when that module is missing.
|
|
7
|
+
*/
|
|
8
|
+
export declare function resolveMfeStylesheetHref(config: MfeShadowShellConfig, importer?: StylesheetModuleImporter): Promise<string>;
|
|
9
|
+
/** One resolution per child per page load; also preloads the stylesheet in the document head. */
|
|
10
|
+
export declare function mfeStylesheetHref(config: MfeShadowShellConfig): Promise<string>;
|
|
11
|
+
/**
|
|
12
|
+
* Route providers for a federated child mounted through `MfeShadowShellComponent`: the shell config,
|
|
13
|
+
* the shadow-root registry, and CDK Overlay/Dialog scoped to the route so overlays open inside it.
|
|
14
|
+
*
|
|
15
|
+
* ```ts
|
|
16
|
+
* { path: '', component: MfeShadowShellComponent, providers: provideMfeShadowShell({ basePath: '/mfe-aux-tables/' }), children }
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
export declare function provideMfeShadowShell(config: MfeShadowShellConfig): Provider[];
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { OverlayContainer } from '@angular/cdk/overlay';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
/**
|
|
4
|
+
* CDK overlay container that renders inside the federated child's shadow root, so the child's
|
|
5
|
+
* compiled stylesheet styles its dialogs, menus and popovers. Without a registered shell (the
|
|
6
|
+
* standalone dev harness) it stays on the document body, where the styles are global.
|
|
7
|
+
*/
|
|
8
|
+
export declare class ShadowRootOverlayContainer extends OverlayContainer {
|
|
9
|
+
private readonly shell;
|
|
10
|
+
getContainerElement(): HTMLElement;
|
|
11
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ShadowRootOverlayContainer, never>;
|
|
12
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<ShadowRootOverlayContainer>;
|
|
13
|
+
}
|
package/utils/theme/README.md
CHANGED
|
@@ -202,6 +202,16 @@ Theme file rules:
|
|
|
202
202
|
- `variables` are grouped by category and injected as CSS custom properties with a `data-theme` selector.
|
|
203
203
|
- `others` is required and intended for app-specific tokens not provided by the SDK.
|
|
204
204
|
- `assets` are optional but should have both light and dark variants for each asset.
|
|
205
|
+
- An asset may declare `tone: { "light": "light" | "dark", "dark": "light" | "dark" }`: the luminance of each variant's image, so content drawn over it (such as the `st-page-banner` title) can pick a readable color. Both variants are required when `tone` is present. Declare it for every banner:
|
|
206
|
+
|
|
207
|
+
```json
|
|
208
|
+
{
|
|
209
|
+
"name": "banner",
|
|
210
|
+
"light": "/assets/themes/assets/enghouse_networks/banners/banner-light.jpg",
|
|
211
|
+
"dark": "/assets/themes/assets/enghouse_networks/banners/banner-dark.jpg",
|
|
212
|
+
"tone": { "light": "light", "dark": "light" }
|
|
213
|
+
}
|
|
214
|
+
```
|
|
205
215
|
|
|
206
216
|
---
|
|
207
217
|
|
|
@@ -257,11 +267,15 @@ flowchart TD
|
|
|
257
267
|
- Assets are resolved by theme name + asset key + scheme.
|
|
258
268
|
- If an asset is missing in the current config, the last working config is used.
|
|
259
269
|
- Asset cache is in-memory by theme.
|
|
270
|
+
- The accessors are reactive: a `computed` that calls them re-runs after `setConfig()` or `setThemeConfig()`, including for cached assets and already registered themes.
|
|
260
271
|
|
|
261
272
|
```typescript
|
|
262
273
|
const url = assetsService.getAssetUrl(themeService.selectedTheme(), 'logo', themeService.resolvedScheme());
|
|
274
|
+
const tone = assetsService.getAssetTone(themeService.selectedTheme(), 'banner', themeService.resolvedScheme()); // 'light' | 'dark' | null
|
|
263
275
|
```
|
|
264
276
|
|
|
277
|
+
- `getAssetTone()` reads `tone` from the same config that serves the URL for that scheme, so it always describes the image shown. It returns `null` when the theme declares no valid tone; it never guesses one.
|
|
278
|
+
|
|
265
279
|
---
|
|
266
280
|
|
|
267
281
|
## Cache and Schema Versioning
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
export { DEFAULT_BASE_THEME, DEFAULT_SCHEME, FALLBACK_RUNTIME_THEME_CONFIG, THEME_SCHEMA_VERSION, VALID_SCHEMES } from './src/constants';
|
|
2
|
-
export type { FontDefinition, FontFaceDefinition, FontFaceFormat, FontWeightRange, ResolvedThemeScheme, RuntimeThemeConfig, RuntimeThemeConfigFile, ThemeAsset, ThemeAssets, ThemeScheme, ThemeStyleDefinition, ThemeVariants, } from './src/models/theme';
|
|
2
|
+
export type { FontDefinition, FontFaceDefinition, FontFaceFormat, FontWeightRange, ResolvedThemeScheme, RuntimeThemeConfig, RuntimeThemeConfigFile, ThemeAsset, ThemeAssetTone, ThemeAssetTones, ThemeAssets, ThemeScheme, ThemeStyleDefinition, ThemeVariants, } from './src/models/theme';
|
|
3
3
|
export { provideRuntimeTheme } from './src/providers/theme.provider';
|
|
4
|
+
export { SCHEME_FAVICON_CONFIG, SchemeFaviconService, provideSchemeFavicon } from './src/scheme-favicon/scheme-favicon';
|
|
5
|
+
export type { SchemeFaviconConfig } from './src/scheme-favicon/scheme-favicon';
|
|
4
6
|
export { ThemeAssetsService } from './src/theme-assets/theme-assets.service';
|
|
5
7
|
export { ThemeDomService } from './src/theme-dom/theme-dom.service';
|
|
6
8
|
export { ThemeSchemeService } from './src/theme-scheme/theme-scheme.service';
|
|
@@ -42,6 +42,19 @@ export interface ThemeAsset {
|
|
|
42
42
|
*/
|
|
43
43
|
dark?: string;
|
|
44
44
|
}
|
|
45
|
+
/**
|
|
46
|
+
* Luminance of an asset image: `light` art needs dark content on top of it, `dark` art light content.
|
|
47
|
+
*/
|
|
48
|
+
export type ThemeAssetTone = 'light' | 'dark';
|
|
49
|
+
/**
|
|
50
|
+
* Tone of each variant of an asset, declared by the theme because the light and dark images can differ.
|
|
51
|
+
* Optional; when present, both variants are required.
|
|
52
|
+
* @example { light: 'light', dark: 'dark' }
|
|
53
|
+
*/
|
|
54
|
+
export interface ThemeAssetTones {
|
|
55
|
+
light: ThemeAssetTone;
|
|
56
|
+
dark: ThemeAssetTone;
|
|
57
|
+
}
|
|
45
58
|
/**
|
|
46
59
|
* Asset definition for a theme
|
|
47
60
|
* Contains a single asset with light/dark variants
|
|
@@ -54,6 +67,11 @@ export interface AssetDefinition {
|
|
|
54
67
|
name: string;
|
|
55
68
|
light?: string;
|
|
56
69
|
dark?: string;
|
|
70
|
+
/**
|
|
71
|
+
* Luminance of each variant's image, for content drawn over it (for example a banner title).
|
|
72
|
+
* Read it with `ThemeAssetsService.getAssetTone()`.
|
|
73
|
+
*/
|
|
74
|
+
tone?: ThemeAssetTones;
|
|
57
75
|
}
|
|
58
76
|
/**
|
|
59
77
|
* Asset definitions for a theme
|