@smartsoft001/claude-plugins 2.201.0 → 2.203.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 +64 -13
- 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 +86 -49
- package/plugins/smart-angular/skills/angular-components-list/SKILL.md +131 -81
- 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 +78 -17
- 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 +48 -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-angular/skills/smart-crud/SKILL.md +5 -2
- 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 +16 -16
- 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 +51 -17
- package/plugins/smart-react/skills/react-components-list/SKILL.md +81 -45
- 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 +10 -10
- 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-overlays/SKILL.md +3 -3
- package/plugins/smart-react/skills/react-components-page/SKILL.md +5 -5
- 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 +9 -9
- package/plugins/smart-react/skills/react-provider/SKILL.md +1 -1
- package/plugins/smart-react/skills/smart-crud-react/SKILL.md +2 -2
|
@@ -17,11 +17,11 @@ The `<smart-select-menu>` component renders a single-select menu with a placehol
|
|
|
17
17
|
|
|
18
18
|
### SelectMenuComponent (`<smart-select-menu>`)
|
|
19
19
|
|
|
20
|
-
Main wrapper component. Renders `SelectMenuStandardComponent` by default. When `SELECT_MENU_STANDARD_COMPONENT_TOKEN` is provided, renders the injected component via `NgComponentOutlet
|
|
20
|
+
Main wrapper component. Renders `SelectMenuStandardComponent` by default. When `SELECT_MENU_STANDARD_COMPONENT_TOKEN` is provided, renders the injected component via `NgComponentOutlet`, hands it `value`, `disabled`, `options` and `class`, and forwards its `value` changes back, so `[(value)]` on `<smart-select-menu>` works with any implementation. There is no preset for this component.
|
|
21
21
|
|
|
22
22
|
### SelectMenuStandardComponent (`<smart-select-menu-standard>`)
|
|
23
23
|
|
|
24
|
-
Barebones placeholder concrete implementation using a native `<select>`. Renders an outer wrapper `<div>`, a `<div class="select-menu">`, and a `<select>` with one `<option>` per item; an optional placeholder is rendered as a disabled first option
|
|
24
|
+
Barebones placeholder concrete implementation using a native `<select>`. Renders an outer wrapper `<div>`, a `<div class="select-menu">`, and a `<select>` (with `aria-label` from `options.ariaLabel`) with one `<option>` per item (with the item's `ariaLabel`); an optional placeholder is rendered as a disabled first option, selected while `value` is `null`. Disabled items get the `disabled` attribute on their `<option>`. The `<select>` is disabled when `disabled()` is `true`. On `change`, the standard reads the raw string value, looks up the matching item by `String(value) === String(item.value)` (preserving numeric types), and calls `select()`. When `items` is empty and `emptyTpl` is provided, the empty template is rendered inside `<div class="empty">`. The external `cssClass` is applied to the root wrapper. It does not include any Tailwind UI styling — it exists solely as the default structural placeholder until a custom implementation is registered through the token.
|
|
25
25
|
|
|
26
26
|
### SelectMenuBaseComponent (abstract)
|
|
27
27
|
|
|
@@ -48,6 +48,29 @@ Abstract base directive for extending custom select menu implementations. Expose
|
|
|
48
48
|
|
|
49
49
|
### ISelectMenuOptions
|
|
50
50
|
|
|
51
|
+
| Field | Type | Default | Description |
|
|
52
|
+
| ------------- | ------------------------ | ------- | ----------------------------------------------------------------------------------------------------- |
|
|
53
|
+
| `items` | `ISelectMenuItem[]` | `[]` | The choices. |
|
|
54
|
+
| `placeholder` | `string` | - | A disabled first option, selected while `value` is `null`. |
|
|
55
|
+
| `ariaLabel` | `string` | - | Accessible name of the `<select>`. |
|
|
56
|
+
| `emptyTpl` | `TemplateRef<unknown>` | - | Rendered under the select when `items` is empty. |
|
|
57
|
+
| `variant` | `SmartSelectMenuVariant` | - | Not read by the built-in implementations; available to a custom implementation (e.g. a listbox look). |
|
|
58
|
+
|
|
59
|
+
`SmartSelectMenuVariant` is `'native' | 'custom' | 'with-check' | 'with-status' | 'with-avatar' | 'with-secondary' | 'branded'`.
|
|
60
|
+
|
|
61
|
+
### ISelectMenuItem
|
|
62
|
+
|
|
63
|
+
| Field | Type | Default | Description |
|
|
64
|
+
| ----------- | ------------------------------------------- | -------- | ------------------------------------------------------------------------------- |
|
|
65
|
+
| `value` | `string \| number` | required | The value written to `value`; a numeric value stays a number. |
|
|
66
|
+
| `label` | `string` | required | The option text. |
|
|
67
|
+
| `disabled` | `boolean` | - | Disables the option. |
|
|
68
|
+
| `ariaLabel` | `string` | - | Accessible name of the option. |
|
|
69
|
+
| `avatarUrl` | `string` | - | Not read by the built-in implementations; available to a custom implementation. |
|
|
70
|
+
| `iconTpl` | `TemplateRef<unknown>` | - | Not read by the built-in implementations; available to a custom implementation. |
|
|
71
|
+
| `secondary` | `string` | - | Not read by the built-in implementations; available to a custom implementation. |
|
|
72
|
+
| `status` | `'online' \| 'offline' \| 'busy' \| string` | - | Not read by the built-in implementations; available to a custom implementation. |
|
|
73
|
+
|
|
51
74
|
```typescript
|
|
52
75
|
type SmartSelectMenuVariant =
|
|
53
76
|
| 'native'
|
|
@@ -61,7 +84,7 @@ type SmartSelectMenuVariant =
|
|
|
61
84
|
interface ISelectMenuOptions {
|
|
62
85
|
items?: ISelectMenuItem[];
|
|
63
86
|
placeholder?: string;
|
|
64
|
-
variant?: SmartSelectMenuVariant;
|
|
87
|
+
variant?: SmartSelectMenuVariant; // not read by the standard implementation
|
|
65
88
|
emptyTpl?: TemplateRef<unknown>;
|
|
66
89
|
ariaLabel?: string;
|
|
67
90
|
}
|
|
@@ -69,26 +92,22 @@ interface ISelectMenuOptions {
|
|
|
69
92
|
interface ISelectMenuItem {
|
|
70
93
|
value: string | number;
|
|
71
94
|
label: string;
|
|
72
|
-
avatarUrl?: string;
|
|
73
|
-
iconTpl?: TemplateRef<unknown>;
|
|
74
|
-
secondary?: string;
|
|
75
|
-
status?: 'online' | 'offline' | 'busy' | string;
|
|
95
|
+
avatarUrl?: string; // not read by the standard implementation
|
|
96
|
+
iconTpl?: TemplateRef<unknown>; // not read by the standard implementation
|
|
97
|
+
secondary?: string; // not read by the standard implementation
|
|
98
|
+
status?: 'online' | 'offline' | 'busy' | string; // not read by the standard implementation
|
|
76
99
|
disabled?: boolean;
|
|
77
100
|
ariaLabel?: string;
|
|
78
101
|
}
|
|
79
102
|
```
|
|
80
103
|
|
|
81
|
-
The default `SelectMenuStandardComponent` renders `value`, `disabled`, `placeholder`, `items` and `emptyTpl`. `variant`, `avatarUrl`, `iconTpl`, `secondary`, and `status` are hints/data for custom implementations registered via the token.
|
|
82
|
-
|
|
83
104
|
## SELECT_MENU_STANDARD_COMPONENT_TOKEN
|
|
84
105
|
|
|
106
|
+
InjectionToken that allows replacing the default `SelectMenuStandardComponent` with a custom implementation. Provide a component class extending `SelectMenuBaseComponent` under `SELECT_MENU_STANDARD_COMPONENT_TOKEN`; every `<smart-select-menu>` below that injector renders it.
|
|
107
|
+
|
|
85
108
|
```typescript
|
|
86
109
|
import { SELECT_MENU_STANDARD_COMPONENT_TOKEN } from '@smartsoft001/angular';
|
|
87
|
-
```
|
|
88
110
|
|
|
89
|
-
InjectionToken that allows replacing the default `SelectMenuStandardComponent` with a custom implementation. Provide a `Type<SelectMenuBaseComponent>` to override.
|
|
90
|
-
|
|
91
|
-
```typescript
|
|
92
111
|
providers: [
|
|
93
112
|
{
|
|
94
113
|
provide: SELECT_MENU_STANDARD_COMPONENT_TOKEN,
|
|
@@ -104,7 +123,7 @@ import {
|
|
|
104
123
|
ChangeDetectionStrategy,
|
|
105
124
|
Component,
|
|
106
125
|
computed,
|
|
107
|
-
|
|
126
|
+
signal,
|
|
108
127
|
ViewEncapsulation,
|
|
109
128
|
} from '@angular/core';
|
|
110
129
|
|
|
@@ -134,9 +153,6 @@ import { SelectMenuBaseComponent } from '@smartsoft001/angular';
|
|
|
134
153
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
135
154
|
})
|
|
136
155
|
export class MyCustomSelectMenuComponent extends SelectMenuBaseComponent {
|
|
137
|
-
// NgComponentOutlet passes 'cssClass' by canonical name, not the 'class' alias.
|
|
138
|
-
override cssClass = input<string>('');
|
|
139
|
-
|
|
140
156
|
open = signal(false);
|
|
141
157
|
|
|
142
158
|
currentLabel = computed(() => {
|
|
@@ -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`)
|