@smartsoft001/claude-plugins 2.200.0 → 2.202.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/package.json +1 -1
- package/plugins/smart-angular/.claude-plugin/plugin.json +1 -1
- package/plugins/smart-angular/skills/angular-components-accordion/SKILL.md +84 -80
- package/plugins/smart-angular/skills/angular-components-action-panel/SKILL.md +35 -60
- package/plugins/smart-angular/skills/angular-components-alert/SKILL.md +24 -29
- package/plugins/smart-angular/skills/angular-components-avatar/SKILL.md +30 -30
- package/plugins/smart-angular/skills/angular-components-badge/SKILL.md +18 -12
- package/plugins/smart-angular/skills/angular-components-breadcrumbs/SKILL.md +27 -10
- package/plugins/smart-angular/skills/angular-components-button/SKILL.md +43 -17
- package/plugins/smart-angular/skills/angular-components-button-group/SKILL.md +26 -14
- package/plugins/smart-angular/skills/angular-components-calendar/SKILL.md +47 -28
- package/plugins/smart-angular/skills/angular-components-card/SKILL.md +29 -22
- package/plugins/smart-angular/skills/angular-components-card-heading/SKILL.md +24 -18
- package/plugins/smart-angular/skills/angular-components-command-palette/SKILL.md +41 -32
- package/plugins/smart-angular/skills/angular-components-container/SKILL.md +21 -20
- package/plugins/smart-angular/skills/angular-components-date-edit/SKILL.md +48 -45
- package/plugins/smart-angular/skills/angular-components-date-range/SKILL.md +72 -82
- package/plugins/smart-angular/skills/angular-components-description-list/SKILL.md +23 -10
- package/plugins/smart-angular/skills/angular-components-detail/SKILL.md +20 -8
- package/plugins/smart-angular/skills/angular-components-details/SKILL.md +35 -12
- package/plugins/smart-angular/skills/angular-components-divider/SKILL.md +36 -18
- package/plugins/smart-angular/skills/angular-components-drawer/SKILL.md +28 -23
- package/plugins/smart-angular/skills/angular-components-dropdown/SKILL.md +35 -16
- package/plugins/smart-angular/skills/angular-components-empty-state/SKILL.md +49 -11
- package/plugins/smart-angular/skills/angular-components-feed/SKILL.md +45 -12
- package/plugins/smart-angular/skills/angular-components-form/SKILL.md +53 -25
- package/plugins/smart-angular/skills/angular-components-grid-list/SKILL.md +37 -13
- package/plugins/smart-angular/skills/angular-components-icon/SKILL.md +8 -8
- package/plugins/smart-angular/skills/angular-components-info/SKILL.md +19 -15
- package/plugins/smart-angular/skills/angular-components-input/SKILL.md +78 -49
- package/plugins/smart-angular/skills/angular-components-list/SKILL.md +85 -78
- package/plugins/smart-angular/skills/angular-components-list-container/SKILL.md +24 -32
- package/plugins/smart-angular/skills/angular-components-media-object/SKILL.md +19 -17
- package/plugins/smart-angular/skills/angular-components-modal/SKILL.md +23 -16
- package/plugins/smart-angular/skills/angular-components-multi-column-layout/SKILL.md +19 -16
- package/plugins/smart-angular/skills/angular-components-navbar/SKILL.md +38 -21
- package/plugins/smart-angular/skills/angular-components-notification/SKILL.md +32 -33
- package/plugins/smart-angular/skills/angular-components-page/SKILL.md +46 -52
- package/plugins/smart-angular/skills/angular-components-page-heading/SKILL.md +42 -25
- package/plugins/smart-angular/skills/angular-components-paging/SKILL.md +17 -15
- package/plugins/smart-angular/skills/angular-components-password-strength/SKILL.md +21 -19
- package/plugins/smart-angular/skills/angular-components-progress-bars/SKILL.md +61 -24
- package/plugins/smart-angular/skills/angular-components-searchbar/SKILL.md +30 -37
- package/plugins/smart-angular/skills/angular-components-section-heading/SKILL.md +38 -27
- package/plugins/smart-angular/skills/angular-components-select-menu/SKILL.md +33 -17
- package/plugins/smart-angular/skills/angular-components-sidebar-layout/SKILL.md +30 -26
- package/plugins/smart-angular/skills/angular-components-sidebar-navigation/SKILL.md +79 -16
- package/plugins/smart-angular/skills/angular-components-sign-in-form/SKILL.md +64 -24
- package/plugins/smart-angular/skills/angular-components-stacked-layout/SKILL.md +24 -23
- package/plugins/smart-angular/skills/angular-components-stacked-list/SKILL.md +40 -21
- package/plugins/smart-angular/skills/angular-components-stats/SKILL.md +28 -15
- package/plugins/smart-angular/skills/angular-components-table/SKILL.md +42 -22
- package/plugins/smart-angular/skills/angular-components-tabs/SKILL.md +37 -13
- package/plugins/smart-angular/skills/angular-components-textarea/SKILL.md +48 -46
- package/plugins/smart-angular/skills/angular-components-toggle/SKILL.md +21 -28
- package/plugins/smart-angular/skills/angular-components-vertical-navigation/SKILL.md +66 -24
- package/plugins/smart-core/.claude-plugin/plugin.json +1 -1
- package/plugins/smart-react/.claude-plugin/plugin.json +1 -1
- package/plugins/smart-react/skills/react-components-action-panel/SKILL.md +13 -13
- package/plugins/smart-react/skills/react-components-alert/SKILL.md +2 -2
- package/plugins/smart-react/skills/react-components-avatar/SKILL.md +11 -11
- package/plugins/smart-react/skills/react-components-badge/SKILL.md +2 -2
- package/plugins/smart-react/skills/react-components-breadcrumbs/SKILL.md +7 -7
- package/plugins/smart-react/skills/react-components-button/SKILL.md +20 -20
- package/plugins/smart-react/skills/react-components-button-group/SKILL.md +2 -2
- package/plugins/smart-react/skills/react-components-calendar/SKILL.md +13 -13
- package/plugins/smart-react/skills/react-components-card/SKILL.md +1 -1
- package/plugins/smart-react/skills/react-components-card-heading/SKILL.md +2 -2
- package/plugins/smart-react/skills/react-components-command-palette/SKILL.md +3 -3
- package/plugins/smart-react/skills/react-components-container/SKILL.md +6 -6
- package/plugins/smart-react/skills/react-components-date-edit/SKILL.md +1 -1
- package/plugins/smart-react/skills/react-components-date-range/SKILL.md +4 -4
- package/plugins/smart-react/skills/react-components-description-list/SKILL.md +1 -1
- package/plugins/smart-react/skills/react-components-detail/SKILL.md +25 -16
- package/plugins/smart-react/skills/react-components-details/SKILL.md +10 -10
- package/plugins/smart-react/skills/react-components-divider/SKILL.md +6 -6
- package/plugins/smart-react/skills/react-components-drawer/SKILL.md +1 -1
- package/plugins/smart-react/skills/react-components-dropdown/SKILL.md +1 -1
- package/plugins/smart-react/skills/react-components-empty-state/SKILL.md +1 -1
- package/plugins/smart-react/skills/react-components-feed/SKILL.md +1 -1
- package/plugins/smart-react/skills/react-components-grid-list/SKILL.md +1 -1
- package/plugins/smart-react/skills/react-components-info/SKILL.md +3 -1
- package/plugins/smart-react/skills/react-components-input/SKILL.md +41 -17
- package/plugins/smart-react/skills/react-components-list/SKILL.md +34 -31
- package/plugins/smart-react/skills/react-components-list-container/SKILL.md +6 -6
- package/plugins/smart-react/skills/react-components-loader/SKILL.md +1 -1
- package/plugins/smart-react/skills/react-components-media-object/SKILL.md +1 -1
- package/plugins/smart-react/skills/react-components-modal/SKILL.md +8 -8
- package/plugins/smart-react/skills/react-components-multi-column-layout/SKILL.md +1 -1
- package/plugins/smart-react/skills/react-components-navbar/SKILL.md +1 -1
- package/plugins/smart-react/skills/react-components-notification/SKILL.md +9 -9
- package/plugins/smart-react/skills/react-components-page-heading/SKILL.md +6 -6
- package/plugins/smart-react/skills/react-components-paging/SKILL.md +28 -28
- package/plugins/smart-react/skills/react-components-password-strength/SKILL.md +4 -4
- package/plugins/smart-react/skills/react-components-progress-bars/SKILL.md +19 -19
- package/plugins/smart-react/skills/react-components-searchbar/SKILL.md +10 -10
- package/plugins/smart-react/skills/react-components-section-heading/SKILL.md +13 -13
- package/plugins/smart-react/skills/react-components-select-menu/SKILL.md +19 -19
- package/plugins/smart-react/skills/react-components-sidebar-layout/SKILL.md +9 -9
- package/plugins/smart-react/skills/react-components-sidebar-navigation/SKILL.md +29 -29
- package/plugins/smart-react/skills/react-components-sign-in-form/SKILL.md +3 -3
- package/plugins/smart-react/skills/react-components-stacked-layout/SKILL.md +1 -1
- package/plugins/smart-react/skills/react-components-stacked-list/SKILL.md +2 -2
- package/plugins/smart-react/skills/react-components-stats/SKILL.md +2 -2
- package/plugins/smart-react/skills/react-components-table/SKILL.md +1 -1
- package/plugins/smart-react/skills/react-components-tabs/SKILL.md +2 -2
- package/plugins/smart-react/skills/react-components-textarea/SKILL.md +8 -8
- package/plugins/smart-react/skills/react-components-toggle/SKILL.md +3 -2
- package/plugins/smart-react/skills/react-components-vertical-navigation/SKILL.md +7 -7
|
@@ -17,7 +17,7 @@ The `<smart-sidebar-layout>` component provides a two-column application shell w
|
|
|
17
17
|
|
|
18
18
|
### SidebarLayoutComponent (`<smart-sidebar-layout>`)
|
|
19
19
|
|
|
20
|
-
Main wrapper component. Renders `SidebarLayoutStandardComponent` by default. When `SIDEBAR_LAYOUT_STANDARD_COMPONENT_TOKEN` is provided, renders the injected component via `NgComponentOutlet
|
|
20
|
+
Main wrapper component. Renders `SidebarLayoutStandardComponent` by default. When `SIDEBAR_LAYOUT_STANDARD_COMPONENT_TOKEN` is provided, renders the injected component via `NgComponentOutlet` and hands it the `options` and `class` inputs. Accepts main content via projected `<ng-content>`, which reaches the `<ng-content />` of whichever implementation renders (the standard, the preset or a custom one).
|
|
21
21
|
|
|
22
22
|
### SidebarLayoutStandardComponent (`<smart-sidebar-layout-standard>`)
|
|
23
23
|
|
|
@@ -38,31 +38,37 @@ Abstract base directive for extending custom sidebar-layout implementations. Exp
|
|
|
38
38
|
|
|
39
39
|
### ISidebarLayoutOptions
|
|
40
40
|
|
|
41
|
+
| Field | Type | Default | Description |
|
|
42
|
+
| ------------------ | ------------------------------------ | -------- | --------------------------------------------------------------------------------------------------------------------- |
|
|
43
|
+
| `sidebarTpl` | `TemplateRef<unknown>` | - | The sidebar content, rendered in the `<aside>`. |
|
|
44
|
+
| `headerTpl` | `TemplateRef<unknown>` | - | A header above the sidebar and the content. |
|
|
45
|
+
| `sidebarPosition` | `'left' \| 'right'` | `'left'` | `'right'` renders the sidebar after the content. |
|
|
46
|
+
| `title` | `string` | - | Preset only: an `<h1>` in the header zone when `headerTpl` is not set. The standard ignores it. |
|
|
47
|
+
| `condensed` | `boolean` | `false` | Preset only: narrows the sidebar from `w-64` to `w-16` (the sidebar content is not changed). The standard ignores it. |
|
|
48
|
+
| `mobileBreakpoint` | `SmartSidebarLayoutMobileBreakpoint` | - | Not read by the built-in implementations; available to a custom implementation. |
|
|
49
|
+
|
|
50
|
+
`SmartSidebarLayoutMobileBreakpoint` is `'sm' | 'md' | 'lg'`.
|
|
51
|
+
|
|
41
52
|
```typescript
|
|
42
53
|
type SmartSidebarLayoutMobileBreakpoint = 'sm' | 'md' | 'lg';
|
|
43
54
|
|
|
44
55
|
interface ISidebarLayoutOptions {
|
|
45
|
-
title?: string;
|
|
56
|
+
title?: string; // preset only
|
|
46
57
|
sidebarTpl?: TemplateRef<unknown>;
|
|
47
58
|
headerTpl?: TemplateRef<unknown>;
|
|
48
59
|
sidebarPosition?: 'left' | 'right';
|
|
49
|
-
mobileBreakpoint?: SmartSidebarLayoutMobileBreakpoint;
|
|
50
|
-
condensed?: boolean;
|
|
60
|
+
mobileBreakpoint?: SmartSidebarLayoutMobileBreakpoint; // not read by the built-in implementations
|
|
61
|
+
condensed?: boolean; // preset only
|
|
51
62
|
}
|
|
52
63
|
```
|
|
53
64
|
|
|
54
|
-
The default `SidebarLayoutStandardComponent` consumes `sidebarTpl`, `headerTpl`, and `sidebarPosition`. `title`, `mobileBreakpoint`, and `condensed` are reserved for custom implementations registered via `SIDEBAR_LAYOUT_STANDARD_COMPONENT_TOKEN` and are ignored by `SidebarLayoutStandardComponent`.
|
|
55
|
-
|
|
56
65
|
## SIDEBAR_LAYOUT_STANDARD_COMPONENT_TOKEN
|
|
57
66
|
|
|
67
|
+
InjectionToken that allows replacing the default `SidebarLayoutStandardComponent` with a custom implementation. Provide a component class extending `SidebarLayoutBaseComponent` under `SIDEBAR_LAYOUT_STANDARD_COMPONENT_TOKEN`; every `<smart-sidebar-layout>` below that injector renders it.
|
|
68
|
+
|
|
58
69
|
```typescript
|
|
59
70
|
import { SIDEBAR_LAYOUT_STANDARD_COMPONENT_TOKEN } from '@smartsoft001/angular';
|
|
60
|
-
```
|
|
61
|
-
|
|
62
|
-
InjectionToken that allows replacing the default `SidebarLayoutStandardComponent` with a custom implementation. Provide a `Type<SidebarLayoutBaseComponent>` to override.
|
|
63
71
|
|
|
64
|
-
```typescript
|
|
65
|
-
// In your app module or component providers:
|
|
66
72
|
providers: [
|
|
67
73
|
{
|
|
68
74
|
provide: SIDEBAR_LAYOUT_STANDARD_COMPONENT_TOKEN,
|
|
@@ -78,7 +84,6 @@ import {
|
|
|
78
84
|
ChangeDetectionStrategy,
|
|
79
85
|
Component,
|
|
80
86
|
computed,
|
|
81
|
-
input,
|
|
82
87
|
ViewEncapsulation,
|
|
83
88
|
} from '@angular/core';
|
|
84
89
|
import { NgTemplateOutlet } from '@angular/common';
|
|
@@ -109,9 +114,6 @@ import { SidebarLayoutBaseComponent } from '@smartsoft001/angular';
|
|
|
109
114
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
110
115
|
})
|
|
111
116
|
export class MyCustomSidebarLayoutComponent extends SidebarLayoutBaseComponent {
|
|
112
|
-
// NgComponentOutlet passes 'cssClass' by canonical name, not the 'class' alias.
|
|
113
|
-
override cssClass = input<string>('');
|
|
114
|
-
|
|
115
117
|
containerClasses = computed(() => {
|
|
116
118
|
const classes = ['my-sidebar-layout'];
|
|
117
119
|
const extra = this.cssClass();
|
|
@@ -123,8 +125,7 @@ export class MyCustomSidebarLayoutComponent extends SidebarLayoutBaseComponent {
|
|
|
123
125
|
|
|
124
126
|
When extending the base directly, remember to:
|
|
125
127
|
|
|
126
|
-
-
|
|
127
|
-
- accept main content via `<ng-content>`,
|
|
128
|
+
- accept main content via `<ng-content>` (the wrapper projects its content into it),
|
|
128
129
|
- read `options().sidebarPosition` to swap aside/main DOM order if needed.
|
|
129
130
|
|
|
130
131
|
## Usage Examples
|
|
@@ -171,6 +172,7 @@ When extending the base directly, remember to:
|
|
|
171
172
|
|
|
172
173
|
- Wrapper: `packages/shared/angular/src/lib/components/sidebar-layout/sidebar-layout.component.ts`
|
|
173
174
|
- Standard: `packages/shared/angular/src/lib/components/sidebar-layout/standard/standard.component.ts`
|
|
175
|
+
- Preset: `packages/shared/angular/src/lib/components/sidebar-layout/preset/preset.component.ts`
|
|
174
176
|
- Base class: `packages/shared/angular/src/lib/components/sidebar-layout/base/base.component.ts`
|
|
175
177
|
- Token: `packages/shared/angular/src/lib/shared.inectors.ts` (`SIDEBAR_LAYOUT_STANDARD_COMPONENT_TOKEN`)
|
|
176
178
|
- Interface: `packages/shared/angular/src/lib/models/interfaces.ts` (`ISidebarLayoutOptions`)
|
|
@@ -182,7 +184,7 @@ drop-in replacement for `SidebarLayoutStandardComponent`. It extends the
|
|
|
182
184
|
standard component (reusing `isRightSidebar`) and applies a Tailwind shell where
|
|
183
185
|
every utility is `smart:`-prefixed with explicit `smart:dark:*` variants.
|
|
184
186
|
|
|
185
|
-
|
|
187
|
+
The structure is listed below.
|
|
186
188
|
|
|
187
189
|
- Root: full-height gray page (`smart:min-h-full smart:bg-gray-50
|
|
188
190
|
smart:dark:bg-gray-900`); `cssClass` is merged onto it.
|
|
@@ -201,14 +203,16 @@ smart:dark:bg-gray-900`); `cssClass` is merged onto it.
|
|
|
201
203
|
No new `ISidebarLayoutOptions` fields — the preset consumes the existing
|
|
202
204
|
`title`, `headerTpl`, `sidebarTpl`, `sidebarPosition`, and `condensed`.
|
|
203
205
|
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
206
|
+
The preset declares `cssClass` without the `class` alias: bind `[cssClass]`
|
|
207
|
+
when you use `<smart-sidebar-layout-preset>` directly. On
|
|
208
|
+
`<smart-sidebar-layout>` pass `class` as usual.
|
|
207
209
|
|
|
208
|
-
|
|
209
|
-
(`getSidebarLayout*Classes`); it is intentionally NOT barrel-exported.
|
|
210
|
+
The class recipes are internal to the preset and not exported.
|
|
210
211
|
|
|
211
|
-
|
|
212
|
+
Provide `SidebarLayoutPresetComponent` under
|
|
213
|
+
`SIDEBAR_LAYOUT_STANDARD_COMPONENT_TOKEN` to restyle every
|
|
214
|
+
`<smart-sidebar-layout>`, or register every preset of the library at once with
|
|
215
|
+
`provideSmartPresets()`.
|
|
212
216
|
|
|
213
217
|
```typescript
|
|
214
218
|
{
|
|
@@ -217,5 +221,5 @@ Register it to restyle every `<smart-sidebar-layout>`:
|
|
|
217
221
|
}
|
|
218
222
|
```
|
|
219
223
|
|
|
220
|
-
Documented gap: `options.mobileBreakpoint` is not
|
|
221
|
-
component
|
|
224
|
+
Documented gap: `options.mobileBreakpoint` is not read by the preset nor by the
|
|
225
|
+
standard component it extends.
|
|
@@ -17,21 +17,21 @@ The `<smart-sidebar-navigation>` component renders a full-height application sid
|
|
|
17
17
|
|
|
18
18
|
### SidebarNavigationComponent (`<smart-sidebar-navigation>`)
|
|
19
19
|
|
|
20
|
-
Main wrapper. Delegates to `SidebarNavigationStandardComponent` by default. When `SIDEBAR_NAVIGATION_STANDARD_COMPONENT_TOKEN` is provided, renders the injected component via `NgComponentOutlet
|
|
20
|
+
Main wrapper. Delegates to `SidebarNavigationStandardComponent` by default. When `SIDEBAR_NAVIGATION_STANDARD_COMPONENT_TOKEN` is provided, renders the injected component via `NgComponentOutlet` and hands it the `options` and `class` inputs. Re-emits `itemClick` and `itemToggle` of whichever implementation renders. There is no preset for this component.
|
|
21
21
|
|
|
22
22
|
### SidebarNavigationStandardComponent (`<smart-sidebar-navigation-standard>`)
|
|
23
23
|
|
|
24
|
-
Barebones placeholder using native HTML. Renders an outer wrapper with `cssClass`, an optional `<div class="sidebar-logo">` (
|
|
24
|
+
Barebones placeholder using native HTML. Renders an outer wrapper with `cssClass`, an optional `<div class="sidebar-logo">` (`logo.tpl` when set; otherwise `<img class="sidebar-logo-img">` from `logo.url` plus a second `.sidebar-logo-img-dark` image from `logo.urlDark`, both with `logo.alt`, wrapped in a plain `<a href>` when `logo.href` is set), a `<nav class="sidebar-navigation">` (with `aria-label` from `options.ariaLabel` or default `"Sidebar"`), and a `<ul>` of groups (`options.items` as a first, untitled group, then `options.groups`). Each group renders an optional `<div class="group-title">` and a `<ul>` of items.
|
|
25
25
|
|
|
26
|
-
Items render in three forms
|
|
26
|
+
Items render in three forms.
|
|
27
27
|
|
|
28
|
-
- `<a class="item-link">` (when `href` provided)
|
|
29
|
-
- `<button class="item-button">` (when no `href
|
|
30
|
-
- `<button class="item-toggle">` followed by `<ul class="children">` (when `expandable === true
|
|
28
|
+
- `<a class="item-link">` (when `href` is provided; a plain `<a href>`)
|
|
29
|
+
- `<button class="item-button">` (when there is no `href`; a click emits `itemClick`)
|
|
30
|
+
- `<button class="item-toggle">` followed by `<ul class="children">` (when `expandable === true`; a click emits `itemToggle`)
|
|
31
31
|
|
|
32
|
-
|
|
32
|
+
Links and buttons get the `current` class and `aria-current="page"` when `item.current === true`, and show `iconTpl` (or, without it, `initial`, e.g. a team letter), `label` and `badge`. An expandable toggle shows only `iconTpl`, `label` and a chevron: its `initial`, `badge` and `current` are not rendered. The toggle keeps a local expanded state per item id, starting from `item.expanded`. Children render as `.child-link` / `.child-button` with their `label`, `href` and `current` only: their `iconTpl`, `initial`, `badge`, `expandable` and `children` are not rendered (one nesting level).
|
|
33
33
|
|
|
34
|
-
When `options.profile` is present, renders a `<li class="profile">` at the bottom containing `<a class="profile-link">` with `<img class="profile-avatar"
|
|
34
|
+
When `options.profile` is present, renders a `<li class="profile">` at the bottom containing `<a class="profile-link">` (to `profile.href`, `'#'` by default) with `<img class="profile-avatar">` (`avatarUrl`, `avatarAlt`), an optional `.sr-only` text (`srOnlyText`) and the `.profile-name` (`name`).
|
|
35
35
|
|
|
36
36
|
### SidebarNavigationBaseComponent (abstract)
|
|
37
37
|
|
|
@@ -66,6 +66,70 @@ Abstract base directive. Exposes:
|
|
|
66
66
|
|
|
67
67
|
### ISidebarNavOptions
|
|
68
68
|
|
|
69
|
+
When both `items` and `groups` are provided, `items` is rendered first as a leading, untitled group.
|
|
70
|
+
|
|
71
|
+
| Field | Type | Default | Description |
|
|
72
|
+
| ----------- | ----------------------- | ----------- | ------------------------------------------------------------------------------- |
|
|
73
|
+
| `ariaLabel` | `string` | `'Sidebar'` | Accessible name of the `<nav>`. |
|
|
74
|
+
| `logo` | `ISidebarNavLogo` | - | The brand at the top. |
|
|
75
|
+
| `items` | `ISidebarNavItem[]` | - | The first, untitled group of items. |
|
|
76
|
+
| `groups` | `ISidebarNavGroup[]` | - | Further groups, each with an optional title. |
|
|
77
|
+
| `profile` | `ISidebarNavProfile` | - | A profile link at the bottom. |
|
|
78
|
+
| `layout` | `SmartSidebarNavLayout` | - | Not read by the built-in implementations; available to a custom implementation. |
|
|
79
|
+
|
|
80
|
+
`SmartSidebarNavLayout` is `'light' | 'dark' | 'with-expandable-sections' | 'with-secondary-navigation' | 'brand'`.
|
|
81
|
+
|
|
82
|
+
### ISidebarNavItem
|
|
83
|
+
|
|
84
|
+
| Field | Type | Default | Description |
|
|
85
|
+
| ------------ | ---------------------- | -------- | ---------------------------------------------------------------------------------------- |
|
|
86
|
+
| `id` | `string` | required | Reported as `itemId`. |
|
|
87
|
+
| `label` | `string` | - | Item text. |
|
|
88
|
+
| `href` | `string` | - | Renders a plain `<a href>` (no `itemClick`). |
|
|
89
|
+
| `current` | `boolean` | - | Marks the current page (`current` class, `aria-current="page"`); not on toggles. |
|
|
90
|
+
| `badge` | `string \| number` | - | A count or text badge; not on toggles and children. |
|
|
91
|
+
| `iconTpl` | `TemplateRef<unknown>` | - | Item icon; not on children. |
|
|
92
|
+
| `initial` | `string` | - | A letter shown instead of an icon (e.g. for teams); not on toggles and children. |
|
|
93
|
+
| `expandable` | `boolean` | - | Makes the item a toggle for its `children` (top-level items only). |
|
|
94
|
+
| `expanded` | `boolean` | `false` | Initial expanded state of an expandable item. |
|
|
95
|
+
| `children` | `ISidebarNavItem[]` | - | Nested items of an expandable item; one level, rendered with `label`, `href`, `current`. |
|
|
96
|
+
|
|
97
|
+
### ISidebarNavGroup
|
|
98
|
+
|
|
99
|
+
| Field | Type | Default | Description |
|
|
100
|
+
| ------- | ------------------- | -------- | ------------------------------- |
|
|
101
|
+
| `id` | `string` | - | Tracking key of the group. |
|
|
102
|
+
| `title` | `string` | - | Group heading (`.group-title`). |
|
|
103
|
+
| `items` | `ISidebarNavItem[]` | required | The group's items. |
|
|
104
|
+
|
|
105
|
+
### ISidebarNavLogo
|
|
106
|
+
|
|
107
|
+
| Field | Type | Default | Description |
|
|
108
|
+
| --------- | ---------------------- | ------- | ----------------------------------------------------------- |
|
|
109
|
+
| `url` | `string` | - | Logo image. |
|
|
110
|
+
| `urlDark` | `string` | - | A second image with the `sidebar-logo-img-dark` class hook. |
|
|
111
|
+
| `alt` | `string` | `''` | Alt text of both images. |
|
|
112
|
+
| `href` | `string` | - | Wraps the images in a plain `<a href>`. |
|
|
113
|
+
| `tpl` | `TemplateRef<unknown>` | - | The logo as a template; wins over the images. |
|
|
114
|
+
|
|
115
|
+
### ISidebarNavProfile
|
|
116
|
+
|
|
117
|
+
| Field | Type | Default | Description |
|
|
118
|
+
| ------------ | -------- | ------- | ---------------------------------------------- |
|
|
119
|
+
| `name` | `string` | - | User name. |
|
|
120
|
+
| `avatarUrl` | `string` | - | Avatar image. |
|
|
121
|
+
| `avatarAlt` | `string` | `''` | Alt text of the avatar. |
|
|
122
|
+
| `href` | `string` | `'#'` | Profile link. |
|
|
123
|
+
| `srOnlyText` | `string` | - | Text for screen readers (e.g. "Your profile"). |
|
|
124
|
+
|
|
125
|
+
### ISidebarNavItemClick and ISidebarNavItemToggle
|
|
126
|
+
|
|
127
|
+
| Type | Field | Type | Description |
|
|
128
|
+
| ----------------------- | ---------- | --------- | ----------------------------- |
|
|
129
|
+
| `ISidebarNavItemClick` | `itemId` | `string` | The `id` of the clicked item. |
|
|
130
|
+
| `ISidebarNavItemToggle` | `itemId` | `string` | The `id` of the toggled item. |
|
|
131
|
+
| `ISidebarNavItemToggle` | `expanded` | `boolean` | The new expanded state. |
|
|
132
|
+
|
|
69
133
|
```typescript
|
|
70
134
|
type SmartSidebarNavLayout =
|
|
71
135
|
| 'light'
|
|
@@ -75,7 +139,7 @@ type SmartSidebarNavLayout =
|
|
|
75
139
|
| 'brand';
|
|
76
140
|
|
|
77
141
|
interface ISidebarNavOptions {
|
|
78
|
-
layout?: SmartSidebarNavLayout;
|
|
142
|
+
layout?: SmartSidebarNavLayout; // not read by the built-in implementations
|
|
79
143
|
ariaLabel?: string;
|
|
80
144
|
logo?: ISidebarNavLogo;
|
|
81
145
|
items?: ISidebarNavItem[];
|
|
@@ -119,10 +183,10 @@ interface ISidebarNavProfile {
|
|
|
119
183
|
}
|
|
120
184
|
```
|
|
121
185
|
|
|
122
|
-
When both `items` and `groups` are provided, `items` is rendered first as a leading single-group section.
|
|
123
|
-
|
|
124
186
|
## SIDEBAR_NAVIGATION_STANDARD_COMPONENT_TOKEN
|
|
125
187
|
|
|
188
|
+
Provide a component class extending `SidebarNavigationBaseComponent` under `SIDEBAR_NAVIGATION_STANDARD_COMPONENT_TOKEN`; every `<smart-sidebar-navigation>` below that injector renders it.
|
|
189
|
+
|
|
126
190
|
```typescript
|
|
127
191
|
import { SIDEBAR_NAVIGATION_STANDARD_COMPONENT_TOKEN } from '@smartsoft001/angular';
|
|
128
192
|
|
|
@@ -140,7 +204,6 @@ providers: [
|
|
|
140
204
|
import {
|
|
141
205
|
ChangeDetectionStrategy,
|
|
142
206
|
Component,
|
|
143
|
-
input,
|
|
144
207
|
ViewEncapsulation,
|
|
145
208
|
} from '@angular/core';
|
|
146
209
|
|
|
@@ -153,8 +216,8 @@ import { SidebarNavigationBaseComponent } from '@smartsoft001/angular';
|
|
|
153
216
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
154
217
|
})
|
|
155
218
|
export class MyCustomSidebarNavigationComponent extends SidebarNavigationBaseComponent {
|
|
156
|
-
//
|
|
157
|
-
|
|
219
|
+
// `options()`, `cssClass()`, `itemClick`, `itemToggle` and the protected
|
|
220
|
+
// `resolvedGroups()`, `isExpanded()` and `toggleExpanded()` are inherited.
|
|
158
221
|
}
|
|
159
222
|
```
|
|
160
223
|
|
|
@@ -164,7 +227,7 @@ export class MyCustomSidebarNavigationComponent extends SidebarNavigationBaseCom
|
|
|
164
227
|
<!-- Flat list with logo and profile -->
|
|
165
228
|
<smart-sidebar-navigation
|
|
166
229
|
[options]="{
|
|
167
|
-
logo: { url: '/
|
|
230
|
+
logo: { url: 'https://tailwindcss.com/plus-assets/img/logos/mark.svg?color=indigo&shade=600', alt: 'Acme' },
|
|
168
231
|
items: [
|
|
169
232
|
{ id: 'dashboard', label: 'Dashboard', href: '/', current: true, badge: 5 },
|
|
170
233
|
{ id: 'team', label: 'Team', href: '/team' },
|
|
@@ -172,7 +235,7 @@ export class MyCustomSidebarNavigationComponent extends SidebarNavigationBaseCom
|
|
|
172
235
|
],
|
|
173
236
|
profile: {
|
|
174
237
|
name: 'Tom Cook',
|
|
175
|
-
avatarUrl: '/
|
|
238
|
+
avatarUrl: 'https://i.pravatar.cc/80?img=12',
|
|
176
239
|
href: '/me',
|
|
177
240
|
srOnlyText: 'Your profile',
|
|
178
241
|
},
|
|
@@ -17,11 +17,11 @@ The `<smart-sign-in-form>` component renders a single form that supports both **
|
|
|
17
17
|
|
|
18
18
|
### SignInFormComponent (`<smart-sign-in-form>`)
|
|
19
19
|
|
|
20
|
-
Main wrapper component. Renders `SignInFormStandardComponent` by default. When `SIGN_IN_FORM_STANDARD_COMPONENT_TOKEN` is provided, renders the injected component via `NgComponentOutlet`. The wrapper re-emits `submit` and `socialClick` from the standard child, or from the custom implementation registered through the token.
|
|
20
|
+
Main wrapper component. Renders `SignInFormStandardComponent` by default. When `SIGN_IN_FORM_STANDARD_COMPONENT_TOKEN` is provided, renders the injected component via `NgComponentOutlet` and hands it `mode`, `disabled`, `options` and `class`. The wrapper re-emits `submit` and `socialClick` from the standard child, or from the preset or custom implementation registered through the token.
|
|
21
21
|
|
|
22
22
|
### SignInFormStandardComponent (`<smart-sign-in-form-standard>`)
|
|
23
23
|
|
|
24
|
-
Barebones placeholder concrete implementation using a native `<form
|
|
24
|
+
Barebones placeholder concrete implementation using a native `<form>` (with `aria-label` from `options.ariaLabel`). Renders an outer wrapper, the form with `Email` / `Password` `<label>`s (hidden when `options.showLabels` is `false`), `<input type="email" id="smart-sign-in-form-email">`, `<input type="password" id="smart-sign-in-form-password">` (with `autocomplete="new-password"` in `sign-up` mode, `current-password` otherwise), an optional `Forgot password?` link (sign-in mode only), the submit button (`options.submitLabel`, or `Sign in` / `Sign up` after the mode), optional social provider buttons (`iconTpl` or `iconUrl`, then `label`), an optional alt-link (`Create an account` to `signUpHref` in sign-in mode, `Already have an account?` to `signInHref` in sign-up mode), and an optional `extraTpl` slot. It does not read `layout` or `heroImageUrl` (preset only). The submit handler emits `{ email, password, mode }` via the inherited `submit` output unless `disabled` is `true`. It stops the native `submit` event from bubbling, because the output shares its name with the DOM event: without that, a `(submit)` listener on the host would also receive the raw `SubmitEvent`. A custom implementation must do the same. Each social provider button emits `{ providerId, mode }` via `socialClick`, also ignored while `disabled` (the inputs and buttons are disabled too).
|
|
25
25
|
|
|
26
26
|
### SignInFormBaseComponent (abstract)
|
|
27
27
|
|
|
@@ -47,13 +47,49 @@ Abstract base directive. Exposes:
|
|
|
47
47
|
|
|
48
48
|
### Outputs
|
|
49
49
|
|
|
50
|
-
| Output | Type | Description
|
|
51
|
-
| ------------- | ------------------------------------------ |
|
|
52
|
-
| `submit` | `OutputEmitterRef<ISignInFormSubmit>` | Emitted on form submit (when not disabled): `{ email, password, mode }`
|
|
53
|
-
| `socialClick` | `OutputEmitterRef<ISignInFormSocialClick>` | Emitted on social provider button click: `{ providerId, mode }`
|
|
50
|
+
| Output | Type | Description |
|
|
51
|
+
| ------------- | ------------------------------------------ | ------------------------------------------------------------------------------------- |
|
|
52
|
+
| `submit` | `OutputEmitterRef<ISignInFormSubmit>` | Emitted on form submit (when not disabled): `{ email, password, mode }` |
|
|
53
|
+
| `socialClick` | `OutputEmitterRef<ISignInFormSocialClick>` | Emitted on a social provider button click (when not disabled): `{ providerId, mode }` |
|
|
54
54
|
|
|
55
55
|
### ISignInFormOptions
|
|
56
56
|
|
|
57
|
+
| Field | Type | Default | Description |
|
|
58
|
+
| --------------------- | ----------------------- | -------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- |
|
|
59
|
+
| `socialProviders` | `ISocialProvider[]` | `[]` | Social sign-in buttons. |
|
|
60
|
+
| `showLabels` | `boolean` | - | `false` hides the field labels; the preset's `simple-no-labels` layout hides them unless this is `true`. |
|
|
61
|
+
| `forgotPasswordHref` | `string` | - | "Forgot password?" link (sign-in mode). |
|
|
62
|
+
| `signUpHref` | `string` | - | "Create an account" link (sign-in mode). |
|
|
63
|
+
| `signInHref` | `string` | - | "Already have an account?" link (sign-up mode). |
|
|
64
|
+
| `submitLabel` | `string` | `mode === 'sign-up' ? 'Sign up' : 'Sign in'` | Text of the submit button (not translated). |
|
|
65
|
+
| `emailPlaceholder` | `string` | - | Placeholder of the email field. |
|
|
66
|
+
| `passwordPlaceholder` | `string` | - | Placeholder of the password field. |
|
|
67
|
+
| `extraTpl` | `TemplateRef<unknown>` | - | Extra content at the end of the form (e.g. a "remember me" checkbox or terms). |
|
|
68
|
+
| `ariaLabel` | `string` | - | Accessible name of the `<form>`. |
|
|
69
|
+
| `layout` | `SmartSignInFormLayout` | `'simple'` | Preset only: `simple`, `simple-no-labels`, `card` or `split-screen` (see the preset section). The standard ignores it. |
|
|
70
|
+
| `heroImageUrl` | `string` | - | Preset only: the cover image of the `split-screen` layout. The standard ignores it. |
|
|
71
|
+
|
|
72
|
+
`SmartSignInFormMode` is `'sign-in' | 'sign-up'`; `SmartSignInFormLayout` is `'simple' | 'simple-no-labels' | 'split-screen' | 'card'`.
|
|
73
|
+
|
|
74
|
+
### ISocialProvider
|
|
75
|
+
|
|
76
|
+
| Field | Type | Default | Description |
|
|
77
|
+
| --------- | ---------------------- | -------- | ------------------------------------------ |
|
|
78
|
+
| `id` | `string` | required | Reported as `providerId`. |
|
|
79
|
+
| `label` | `string` | required | Button text. |
|
|
80
|
+
| `iconTpl` | `TemplateRef<unknown>` | - | Icon template; wins over `iconUrl`. |
|
|
81
|
+
| `iconUrl` | `string` | - | Icon image (rendered with an empty `alt`). |
|
|
82
|
+
|
|
83
|
+
### ISignInFormSubmit and ISignInFormSocialClick
|
|
84
|
+
|
|
85
|
+
| Type | Field | Type | Description |
|
|
86
|
+
| ------------------------ | ------------ | --------------------- | --------------------------------- |
|
|
87
|
+
| `ISignInFormSubmit` | `email` | `string` | The typed email. |
|
|
88
|
+
| `ISignInFormSubmit` | `password` | `string` | The typed password. |
|
|
89
|
+
| `ISignInFormSubmit` | `mode` | `SmartSignInFormMode` | The form mode. |
|
|
90
|
+
| `ISignInFormSocialClick` | `providerId` | `string` | The `id` of the clicked provider. |
|
|
91
|
+
| `ISignInFormSocialClick` | `mode` | `SmartSignInFormMode` | The form mode. |
|
|
92
|
+
|
|
57
93
|
```typescript
|
|
58
94
|
type SmartSignInFormMode = 'sign-in' | 'sign-up';
|
|
59
95
|
type SmartSignInFormLayout =
|
|
@@ -61,9 +97,9 @@ type SmartSignInFormLayout =
|
|
|
61
97
|
|
|
62
98
|
interface ISignInFormOptions {
|
|
63
99
|
socialProviders?: ISocialProvider[];
|
|
64
|
-
layout?: SmartSignInFormLayout;
|
|
100
|
+
layout?: SmartSignInFormLayout; // preset only
|
|
65
101
|
showLabels?: boolean;
|
|
66
|
-
heroImageUrl?: string;
|
|
102
|
+
heroImageUrl?: string; // preset only
|
|
67
103
|
forgotPasswordHref?: string;
|
|
68
104
|
signUpHref?: string;
|
|
69
105
|
signInHref?: string;
|
|
@@ -93,10 +129,10 @@ interface ISignInFormSocialClick {
|
|
|
93
129
|
}
|
|
94
130
|
```
|
|
95
131
|
|
|
96
|
-
The default `SignInFormStandardComponent` consumes `socialProviders`, `showLabels`, `forgotPasswordHref`, `signUpHref`, `signInHref`, `submitLabel`, `emailPlaceholder`, `passwordPlaceholder`, `extraTpl`, and `ariaLabel`. `layout` and `heroImageUrl` are hints for custom implementations registered via the token.
|
|
97
|
-
|
|
98
132
|
## SIGN_IN_FORM_STANDARD_COMPONENT_TOKEN
|
|
99
133
|
|
|
134
|
+
Provide a component class extending `SignInFormBaseComponent` under `SIGN_IN_FORM_STANDARD_COMPONENT_TOKEN`; every `<smart-sign-in-form>` below that injector renders it.
|
|
135
|
+
|
|
100
136
|
```typescript
|
|
101
137
|
import { SIGN_IN_FORM_STANDARD_COMPONENT_TOKEN } from '@smartsoft001/angular';
|
|
102
138
|
|
|
@@ -114,8 +150,6 @@ providers: [
|
|
|
114
150
|
import {
|
|
115
151
|
ChangeDetectionStrategy,
|
|
116
152
|
Component,
|
|
117
|
-
computed,
|
|
118
|
-
input,
|
|
119
153
|
signal,
|
|
120
154
|
ViewEncapsulation,
|
|
121
155
|
} from '@angular/core';
|
|
@@ -145,9 +179,6 @@ import { SignInFormBaseComponent } from '@smartsoft001/angular';
|
|
|
145
179
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
146
180
|
})
|
|
147
181
|
export class MyCustomSignInFormComponent extends SignInFormBaseComponent {
|
|
148
|
-
// NgComponentOutlet passes 'cssClass' by canonical name, not the 'class' alias.
|
|
149
|
-
override cssClass = input<string>('');
|
|
150
|
-
|
|
151
182
|
email = signal('');
|
|
152
183
|
password = signal('');
|
|
153
184
|
|
|
@@ -181,8 +212,8 @@ export class MyCustomSignInFormComponent extends SignInFormBaseComponent {
|
|
|
181
212
|
forgotPasswordHref: '/forgot',
|
|
182
213
|
signUpHref: '/signup',
|
|
183
214
|
socialProviders: [
|
|
184
|
-
{ id: 'google', label: '
|
|
185
|
-
{ id: 'github', label: '
|
|
215
|
+
{ id: 'google', label: 'Continue with Google' },
|
|
216
|
+
{ id: 'github', label: 'Continue with GitHub' },
|
|
186
217
|
],
|
|
187
218
|
}"
|
|
188
219
|
(submit)="onSignIn($event)"
|
|
@@ -213,11 +244,18 @@ blue focus ring; solid blue submit; outline social buttons; blue text links).
|
|
|
213
244
|
`data-role` hooks for testing/styling: `container`, `form`, `email`, `password`,
|
|
214
245
|
`submit`, `social`, `forgot`, `alt-link`, `hero`, `extra`, `card`.
|
|
215
246
|
|
|
216
|
-
|
|
247
|
+
Provide `SignInFormPresetComponent` under `SIGN_IN_FORM_STANDARD_COMPONENT_TOKEN`
|
|
248
|
+
so `<smart-sign-in-form>` renders the preset, or register every preset of the
|
|
249
|
+
library at once with `provideSmartPresets()`. The preset declares `cssClass`
|
|
250
|
+
without the `class` alias: bind `[cssClass]` when you use
|
|
251
|
+
`<smart-sign-in-form-preset>` directly; on `<smart-sign-in-form>` pass `class`
|
|
252
|
+
as usual.
|
|
217
253
|
|
|
218
254
|
```typescript
|
|
219
|
-
import {
|
|
220
|
-
|
|
255
|
+
import {
|
|
256
|
+
SIGN_IN_FORM_STANDARD_COMPONENT_TOKEN,
|
|
257
|
+
SignInFormPresetComponent,
|
|
258
|
+
} from '@smartsoft001/angular';
|
|
221
259
|
|
|
222
260
|
providers: [
|
|
223
261
|
{
|
|
@@ -227,9 +265,11 @@ providers: [
|
|
|
227
265
|
];
|
|
228
266
|
```
|
|
229
267
|
|
|
230
|
-
|
|
231
|
-
`lg` breakpoint); `submitLabel`, `emailPlaceholder`, `passwordPlaceholder`,
|
|
232
|
-
the `extraTpl` slot are all honored.
|
|
268
|
+
Notes: `heroImageUrl` renders as a `smart:lg:block` cover image (hidden below
|
|
269
|
+
the `lg` breakpoint); `submitLabel`, `emailPlaceholder`, `passwordPlaceholder`,
|
|
270
|
+
and the `extraTpl` slot are all honored. The preset styles the submit button
|
|
271
|
+
through its `data-role="submit"` hook and does not carry the standard's
|
|
272
|
+
`submit` class.
|
|
233
273
|
|
|
234
274
|
## Reference implementation
|
|
235
275
|
|
|
@@ -244,7 +284,7 @@ The example application under `docs/examples/app` signs in through this componen
|
|
|
244
284
|
|
|
245
285
|
- Wrapper: `packages/shared/angular/src/lib/components/sign-in-form/sign-in-form.component.ts`
|
|
246
286
|
- Standard: `packages/shared/angular/src/lib/components/sign-in-form/standard/standard.component.ts`
|
|
247
|
-
- Preset: `packages/shared/angular/src/lib/components/sign-in-form/preset/preset.component.ts`
|
|
287
|
+
- Preset: `packages/shared/angular/src/lib/components/sign-in-form/preset/preset.component.ts`
|
|
248
288
|
- Base class: `packages/shared/angular/src/lib/components/sign-in-form/base/base.component.ts`
|
|
249
289
|
- Token: `packages/shared/angular/src/lib/shared.inectors.ts` (`SIGN_IN_FORM_STANDARD_COMPONENT_TOKEN`)
|
|
250
290
|
- Interfaces: `packages/shared/angular/src/lib/models/interfaces.ts` (`ISignInFormOptions`, `ISocialProvider`, `ISignInFormSubmit`, `ISignInFormSocialClick`, `SmartSignInFormMode`, `SmartSignInFormLayout`)
|
|
@@ -17,7 +17,7 @@ The `<smart-stacked-layout>` component provides a top-to-bottom application shel
|
|
|
17
17
|
|
|
18
18
|
### StackedLayoutComponent (`<smart-stacked-layout>`)
|
|
19
19
|
|
|
20
|
-
Main wrapper component. Renders `StackedLayoutStandardComponent` by default. When `STACKED_LAYOUT_STANDARD_COMPONENT_TOKEN` is provided, renders the injected component via `NgComponentOutlet
|
|
20
|
+
Main wrapper component. Renders `StackedLayoutStandardComponent` by default. When `STACKED_LAYOUT_STANDARD_COMPONENT_TOKEN` is provided, renders the injected component via `NgComponentOutlet` and hands it the `options` and `class` inputs. Accepts main content via projected `<ng-content>`, which reaches the `<ng-content />` of whichever implementation renders (the standard, the preset or a custom one).
|
|
21
21
|
|
|
22
22
|
### StackedLayoutStandardComponent (`<smart-stacked-layout-standard>`)
|
|
23
23
|
|
|
@@ -38,6 +38,15 @@ Abstract base directive for extending custom stacked-layout implementations. Exp
|
|
|
38
38
|
|
|
39
39
|
### IStackedLayoutOptions
|
|
40
40
|
|
|
41
|
+
| Field | Type | Default | Description |
|
|
42
|
+
| ---------------- | ---------------------------------- | ------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
|
|
43
|
+
| `title` | `string` | - | Page title, rendered as `<h1 data-role="title">` when `headerTpl` is not set. |
|
|
44
|
+
| `navTpl` | `TemplateRef<unknown>` | - | Navigation at the top (inside the `<nav>`). |
|
|
45
|
+
| `headerTpl` | `TemplateRef<unknown>` | - | The page header beneath the navigation; wins over `title`. |
|
|
46
|
+
| `containerWidth` | `SmartStackedLayoutContainerWidth` | `'xl'` | Width of the header and content containers in the preset (see the mapping below); the standard only exposes it as `data-container-width`. |
|
|
47
|
+
|
|
48
|
+
`SmartStackedLayoutContainerWidth` is `'sm' | 'md' | 'lg' | 'xl' | 'full'`.
|
|
49
|
+
|
|
41
50
|
```typescript
|
|
42
51
|
type SmartStackedLayoutContainerWidth = 'sm' | 'md' | 'lg' | 'xl' | 'full';
|
|
43
52
|
|
|
@@ -45,22 +54,17 @@ interface IStackedLayoutOptions {
|
|
|
45
54
|
title?: string;
|
|
46
55
|
navTpl?: TemplateRef<unknown>;
|
|
47
56
|
headerTpl?: TemplateRef<unknown>;
|
|
48
|
-
containerWidth?: SmartStackedLayoutContainerWidth;
|
|
57
|
+
containerWidth?: SmartStackedLayoutContainerWidth; // styled by the preset
|
|
49
58
|
}
|
|
50
59
|
```
|
|
51
60
|
|
|
52
|
-
The default `StackedLayoutStandardComponent` consumes `navTpl` (rendered inside the top `<nav>`), `headerTpl` (rendered as a secondary `<header>` block beneath the navigation) and `title` (rendered as `<header><h1 data-role="title">` when there is no `headerTpl`, the same precedence as the preset). `containerWidth` is purely visual: the standard only exposes it as `data-container-width` on the root (default `'xl'`), and the max-width is styled by `StackedLayoutPresetComponent`.
|
|
53
|
-
|
|
54
61
|
## STACKED_LAYOUT_STANDARD_COMPONENT_TOKEN
|
|
55
62
|
|
|
63
|
+
InjectionToken that allows replacing the default `StackedLayoutStandardComponent` with a custom implementation. Provide a component class extending `StackedLayoutBaseComponent` under `STACKED_LAYOUT_STANDARD_COMPONENT_TOKEN`; every `<smart-stacked-layout>` below that injector renders it.
|
|
64
|
+
|
|
56
65
|
```typescript
|
|
57
66
|
import { STACKED_LAYOUT_STANDARD_COMPONENT_TOKEN } from '@smartsoft001/angular';
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
InjectionToken that allows replacing the default `StackedLayoutStandardComponent` with a custom implementation. Provide a `Type<StackedLayoutBaseComponent>` to override.
|
|
61
67
|
|
|
62
|
-
```typescript
|
|
63
|
-
// In your app module or component providers:
|
|
64
68
|
providers: [
|
|
65
69
|
{
|
|
66
70
|
provide: STACKED_LAYOUT_STANDARD_COMPONENT_TOKEN,
|
|
@@ -76,7 +80,6 @@ import {
|
|
|
76
80
|
ChangeDetectionStrategy,
|
|
77
81
|
Component,
|
|
78
82
|
computed,
|
|
79
|
-
input,
|
|
80
83
|
ViewEncapsulation,
|
|
81
84
|
} from '@angular/core';
|
|
82
85
|
import { NgTemplateOutlet } from '@angular/common';
|
|
@@ -109,9 +112,6 @@ import { StackedLayoutBaseComponent } from '@smartsoft001/angular';
|
|
|
109
112
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
110
113
|
})
|
|
111
114
|
export class MyCustomStackedLayoutComponent extends StackedLayoutBaseComponent {
|
|
112
|
-
// NgComponentOutlet passes 'cssClass' by canonical name, not the 'class' alias.
|
|
113
|
-
override cssClass = input<string>('');
|
|
114
|
-
|
|
115
115
|
containerClasses = computed(() => {
|
|
116
116
|
const classes = ['my-stacked-layout'];
|
|
117
117
|
const extra = this.cssClass();
|
|
@@ -123,8 +123,7 @@ export class MyCustomStackedLayoutComponent extends StackedLayoutBaseComponent {
|
|
|
123
123
|
|
|
124
124
|
When extending the base directly, remember to:
|
|
125
125
|
|
|
126
|
-
-
|
|
127
|
-
- accept main content via `<ng-content>` so consumers can project arbitrary page content,
|
|
126
|
+
- accept main content via `<ng-content>` so consumers can project arbitrary page content (the wrapper projects its content into it),
|
|
128
127
|
- use `[ngTemplateOutlet]` to render `options().navTpl` and `options().headerTpl`.
|
|
129
128
|
|
|
130
129
|
## Usage Examples
|
|
@@ -164,13 +163,14 @@ When extending the base directly, remember to:
|
|
|
164
163
|
|
|
165
164
|
- Wrapper: `packages/shared/angular/src/lib/components/stacked-layout/stacked-layout.component.ts`
|
|
166
165
|
- Standard: `packages/shared/angular/src/lib/components/stacked-layout/standard/standard.component.ts`
|
|
166
|
+
- Preset: `packages/shared/angular/src/lib/components/stacked-layout/preset/preset.component.ts`
|
|
167
167
|
- Base class: `packages/shared/angular/src/lib/components/stacked-layout/base/base.component.ts`
|
|
168
168
|
- Token: `packages/shared/angular/src/lib/shared.inectors.ts` (`STACKED_LAYOUT_STANDARD_COMPONENT_TOKEN`)
|
|
169
169
|
- Interface: `packages/shared/angular/src/lib/models/interfaces.ts` (`IStackedLayoutOptions`)
|
|
170
170
|
|
|
171
171
|
## HyperUI preset
|
|
172
172
|
|
|
173
|
-
`StackedLayoutPresetComponent` (`<smart-stacked-layout-preset>`) is the HyperUI-styled drop-in for `StackedLayoutStandardComponent`. It uses the same `IStackedLayoutOptions` API — no interface changes, no new options fields — and delivers the page scaffold in the HyperUI container rhythm
|
|
173
|
+
`StackedLayoutPresetComponent` (`<smart-stacked-layout-preset>`) is the HyperUI-styled drop-in for `StackedLayoutStandardComponent`. It uses the same `IStackedLayoutOptions` API — no interface changes, no new options fields — and delivers the page scaffold in the HyperUI container rhythm.
|
|
174
174
|
|
|
175
175
|
- **Page root** (`data-role="root"`): full-height gray surface — `smart:min-h-full smart:bg-gray-50 smart:dark:bg-gray-900`. The external `cssClass` is merged here.
|
|
176
176
|
- **Header zone**: white bar (`smart:bg-white smart:shadow-sm smart:dark:bg-gray-800 smart:dark:border-b smart:dark:border-gray-700`) whose inner container (`data-role="header"`, `smart:py-4`) renders `navTpl` (`data-role="nav"`), then `headerTpl` if present, else `title` as an `<h1 data-role="title">` fallback.
|
|
@@ -178,7 +178,7 @@ When extending the base directly, remember to:
|
|
|
178
178
|
|
|
179
179
|
### containerWidth mapping
|
|
180
180
|
|
|
181
|
-
Both the header and content containers share the base `smart:mx-auto smart:px-4 smart:sm:px-6 smart:lg:px-8` plus a max-width from `options.containerWidth
|
|
181
|
+
Both the header and content containers share the base `smart:mx-auto smart:px-4 smart:sm:px-6 smart:lg:px-8` plus a max-width from `options.containerWidth`, as listed below.
|
|
182
182
|
|
|
183
183
|
| containerWidth | max-width class |
|
|
184
184
|
| -------------------- | ------------------ |
|
|
@@ -190,9 +190,13 @@ Both the header and content containers share the base `smart:mx-auto smart:px-4
|
|
|
190
190
|
|
|
191
191
|
### Token registration
|
|
192
192
|
|
|
193
|
+
Provide `StackedLayoutPresetComponent` under `STACKED_LAYOUT_STANDARD_COMPONENT_TOKEN` to restyle every `<smart-stacked-layout>`, or register every preset of the library at once with `provideSmartPresets()`. The preset declares `cssClass` without the `class` alias: bind `[cssClass]` when you use `<smart-stacked-layout-preset>` directly; on `<smart-stacked-layout>` pass `class` as usual.
|
|
194
|
+
|
|
193
195
|
```typescript
|
|
194
|
-
import {
|
|
195
|
-
|
|
196
|
+
import {
|
|
197
|
+
STACKED_LAYOUT_STANDARD_COMPONENT_TOKEN,
|
|
198
|
+
StackedLayoutPresetComponent,
|
|
199
|
+
} from '@smartsoft001/angular';
|
|
196
200
|
|
|
197
201
|
providers: [
|
|
198
202
|
{
|
|
@@ -204,7 +208,4 @@ providers: [
|
|
|
204
208
|
|
|
205
209
|
### Documented gaps
|
|
206
210
|
|
|
207
|
-
The preset delivers the
|
|
208
|
-
|
|
209
|
-
- Preset: `packages/shared/angular/src/lib/components/stacked-layout/preset/preset.component.ts`
|
|
210
|
-
- Class recipes: `packages/shared/angular/src/lib/components/stacked-layout/preset/preset-classes.util.ts`
|
|
211
|
+
The preset delivers the page scaffold only. For "content + image" sections, project `<smart-section-heading>` blocks (with the section-heading preset) into the stacked-layout content region.
|