@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,24 +17,24 @@ The `<smart-notification>` component displays a transient or persistent message
|
|
|
17
17
|
|
|
18
18
|
### NotificationComponent (`<smart-notification>`)
|
|
19
19
|
|
|
20
|
-
Main wrapper component. Renders `NotificationStandardComponent` by default. When `NOTIFICATION_STANDARD_COMPONENT_TOKEN` is provided, renders the injected component via `NgComponentOutlet`.
|
|
20
|
+
Main wrapper component. Renders `NotificationStandardComponent` by default. When `NOTIFICATION_STANDARD_COMPONENT_TOKEN` is provided (or `provideSmartPresets()` registers the preset), renders the injected component via `NgComponentOutlet`, forwarding its inputs and re-emitting its `dismissed` and `actionClick` outputs. It has no open state: render it while the notification should be visible and remove it on `(dismissed)`.
|
|
21
21
|
|
|
22
22
|
### NotificationStandardComponent (`<smart-notification-standard>`)
|
|
23
23
|
|
|
24
|
-
Barebones placeholder concrete implementation. Renders a `<div role="status">` with `aria-live` (defaulting to `polite`, overridable via `options.ariaLive`), an `<h3>` for the title, an optional `<p>` for the description, an optional close button when `dismissible` is `true`, and one `<button>` per action with a `data-variant` attribute. It does not include Tailwind UI styling — it exists solely as the default structural placeholder until a custom implementation is registered through the token.
|
|
24
|
+
Barebones placeholder concrete implementation. Renders a `<div role="status">` with `aria-live` (defaulting to `polite`, overridable via `options.ariaLive`), an `<h3>` for the title, an optional `<p>` for the description, an optional close button when `dismissible` is `true`, and one `<button>` per action with a `data-variant` attribute. It does not render `iconName` or `avatarUrl`. It does not include Tailwind UI styling — it exists solely as the default structural placeholder until a custom implementation is registered through the token.
|
|
25
25
|
|
|
26
26
|
### NotificationPresetComponent (`<smart-notification-preset>`)
|
|
27
27
|
|
|
28
|
-
Styled toast variation that extends `NotificationBaseComponent` and is a drop-in replacement for `NotificationStandardComponent`. Register it via `NOTIFICATION_STANDARD_COMPONENT_TOKEN` to restyle every `<smart-notification>`, or use the `<smart-notification-preset>` selector directly. It renders the translated Preline toast looks as a card (`bg-white`/`dark:bg-gray-800`, border, `rounded-xl`, `shadow-lg`), with the layout selected through `options.variant` (default `'simple'`):
|
|
28
|
+
Styled toast variation that extends `NotificationBaseComponent` and is a drop-in replacement for `NotificationStandardComponent`. Register it via `NOTIFICATION_STANDARD_COMPONENT_TOKEN` (or with `provideSmartPresets()`) to restyle every `<smart-notification>`, or use the `<smart-notification-preset>` selector directly. It renders the translated Preline toast looks as a card (`bg-white`/`dark:bg-gray-800`, border, `rounded-xl`, `shadow-lg`), with the layout selected through `options.variant` (default `'simple'`):
|
|
29
29
|
|
|
30
|
-
- `simple` — leading icon glyph (when `iconName` is set) plus the `title` message and optional `description`.
|
|
31
|
-
- `condensed` — inline single-row
|
|
30
|
+
- `simple` — leading icon glyph (when `iconName` is set) plus the `title` message and optional `description`; it does **not** render `actions`.
|
|
31
|
+
- `condensed` — inline single-row `title` with the action links and close button pushed to the end (`ms-auto`); no description or icon.
|
|
32
32
|
- `with-actions-below` / `with-avatar` — icon (or avatar image for `with-avatar`) + heading + description, with text-link styled actions below; the close button is absolutely positioned.
|
|
33
33
|
- `with-buttons-below` / `with-split-buttons` — same layout but actions render as solid/bordered buttons (per `action.variant`); `with-split-buttons` makes each button `grow` to fill the row.
|
|
34
34
|
|
|
35
|
-
`dismissible` renders a close button that calls `dismiss()`; each action calls `invokeAction(action.id)`. Open/close visibility is Angular-driven via the `dismissed` output — no Preline JS runtime is used. All classes are `smart:`-prefixed Tailwind with explicit `dark:` variants
|
|
35
|
+
`dismissible` renders a close button that calls `dismiss()`; each action calls `invokeAction(action.id)`. Open/close visibility is Angular-driven via the `dismissed` output — no Preline JS runtime is used. All classes are `smart:`-prefixed Tailwind with explicit `dark:` variants; the class recipes are internal to the preset (not exported).
|
|
36
36
|
|
|
37
|
-
>
|
|
37
|
+
> `NotificationPresetComponent` declares `cssClass` without the `class` alias: bind it as `[cssClass]` on the `<smart-notification-preset>` selector, or pass `class` on `<smart-notification>` (the wrapper forwards it).
|
|
38
38
|
|
|
39
39
|
### NotificationBaseComponent (abstract)
|
|
40
40
|
|
|
@@ -44,16 +44,16 @@ Abstract base directive for extending custom notification implementations. Expos
|
|
|
44
44
|
|
|
45
45
|
### Inputs
|
|
46
46
|
|
|
47
|
-
| Input | Type | Default | Description
|
|
48
|
-
| ------------- | ------------------------------------------------ | ------- |
|
|
49
|
-
| `title` | `InputSignal<string>` (required) | - | Headline text
|
|
50
|
-
| `description` | `InputSignal<string \| undefined>` | - | Optional supporting text
|
|
51
|
-
| `iconName` | `InputSignal<string \| undefined>` | - |
|
|
52
|
-
| `avatarUrl` | `InputSignal<string \| undefined>` | - |
|
|
53
|
-
| `actions` | `InputSignal<INotificationAction[]>` | `[]` | Action buttons
|
|
54
|
-
| `dismissible` | `InputSignal<boolean>` | `false` | When `true`, renders a close button
|
|
55
|
-
| `options` | `InputSignal<INotificationOptions \| undefined>` | - | Optional configuration (variant, ariaLive)
|
|
56
|
-
| `class` | `InputSignal<string>` | `''` | External CSS classes (alias for `cssClass`)
|
|
47
|
+
| Input | Type | Default | Description |
|
|
48
|
+
| ------------- | ------------------------------------------------ | ------- | ----------------------------------------------------------------------------------------------------------- |
|
|
49
|
+
| `title` | `InputSignal<string>` (required) | - | Headline text |
|
|
50
|
+
| `description` | `InputSignal<string \| undefined>` | - | Optional supporting text |
|
|
51
|
+
| `iconName` | `InputSignal<string \| undefined>` | - | Preset only: a glyph (text, e.g. an emoji) before the text (not in the `condensed` and `with-avatar` looks) |
|
|
52
|
+
| `avatarUrl` | `InputSignal<string \| undefined>` | - | Preset only: the image of the `with-avatar` look |
|
|
53
|
+
| `actions` | `InputSignal<INotificationAction[]>` | `[]` | Action buttons (not rendered by the preset's `simple` look) |
|
|
54
|
+
| `dismissible` | `InputSignal<boolean>` | `false` | When `true`, renders a close button |
|
|
55
|
+
| `options` | `InputSignal<INotificationOptions \| undefined>` | - | Optional configuration (variant, ariaLive) |
|
|
56
|
+
| `class` | `InputSignal<string>` | `''` | External CSS classes (alias for `cssClass`) |
|
|
57
57
|
|
|
58
58
|
### Outputs
|
|
59
59
|
|
|
@@ -64,6 +64,12 @@ Abstract base directive for extending custom notification implementations. Expos
|
|
|
64
64
|
|
|
65
65
|
### INotificationAction
|
|
66
66
|
|
|
67
|
+
| Field | Type | Default | Description |
|
|
68
|
+
| --------- | -------------------------- | ----------- | ------------------------------------------------------------------------------ |
|
|
69
|
+
| `id` | `string` | required | Echoed back as `actionId` in the `actionClick` payload. |
|
|
70
|
+
| `label` | `string` | required | Button text. |
|
|
71
|
+
| `variant` | `'primary' \| 'secondary'` | `'primary'` | The standard exposes it as `data-variant`; the preset styles the action by it. |
|
|
72
|
+
|
|
67
73
|
```typescript
|
|
68
74
|
interface INotificationAction {
|
|
69
75
|
id: string;
|
|
@@ -72,10 +78,13 @@ interface INotificationAction {
|
|
|
72
78
|
}
|
|
73
79
|
```
|
|
74
80
|
|
|
75
|
-
`id` is echoed back in the `actionClick` payload so the host can route handling. `variant` controls the placeholder's `data-variant` attribute and is intended as a styling hook for custom implementations.
|
|
76
|
-
|
|
77
81
|
### INotificationOptions
|
|
78
82
|
|
|
83
|
+
| Field | Type | Default | Description |
|
|
84
|
+
| ---------- | -------------------------- | ---------- | ------------------------------------------------------------------------------------------------------------------------------------- |
|
|
85
|
+
| `variant` | `SmartNotificationVariant` | `'simple'` | Preset only: the toast look (`simple`, `condensed`, `with-actions-below`, `with-avatar`, `with-split-buttons`, `with-buttons-below`). |
|
|
86
|
+
| `ariaLive` | `'polite' \| 'assertive'` | `'polite'` | The `aria-live` of the `role="status"` container; `assertive` for errors. |
|
|
87
|
+
|
|
79
88
|
```typescript
|
|
80
89
|
type SmartNotificationVariant =
|
|
81
90
|
| 'simple'
|
|
@@ -91,18 +100,13 @@ interface INotificationOptions {
|
|
|
91
100
|
}
|
|
92
101
|
```
|
|
93
102
|
|
|
94
|
-
The standard component only consumes `ariaLive` (placeholder behavior — applied directly as the `aria-live` attribute on the `role="status"` container; defaults to `'polite'`). The `variant` property is ignored by `NotificationStandardComponent` but **fully consumed by `NotificationPresetComponent`** (default `'simple'`) to pick the toast layout.
|
|
95
|
-
|
|
96
103
|
## NOTIFICATION_STANDARD_COMPONENT_TOKEN
|
|
97
104
|
|
|
105
|
+
InjectionToken from `@smartsoft001/angular` that allows replacing the default `NotificationStandardComponent` with a custom implementation. Provide a `Type<NotificationBaseComponent>` in your application or component providers; `provideSmartPresets()` provides `NotificationPresetComponent` for it together with every other preset.
|
|
106
|
+
|
|
98
107
|
```typescript
|
|
99
108
|
import { NOTIFICATION_STANDARD_COMPONENT_TOKEN } from '@smartsoft001/angular';
|
|
100
|
-
```
|
|
101
|
-
|
|
102
|
-
InjectionToken that allows replacing the default `NotificationStandardComponent` with a custom implementation. Provide a `Type<NotificationBaseComponent>` to override.
|
|
103
109
|
|
|
104
|
-
```typescript
|
|
105
|
-
// In your app module or component providers:
|
|
106
110
|
providers: [
|
|
107
111
|
{
|
|
108
112
|
provide: NOTIFICATION_STANDARD_COMPONENT_TOKEN,
|
|
@@ -118,7 +122,6 @@ import {
|
|
|
118
122
|
ChangeDetectionStrategy,
|
|
119
123
|
Component,
|
|
120
124
|
computed,
|
|
121
|
-
input,
|
|
122
125
|
ViewEncapsulation,
|
|
123
126
|
} from '@angular/core';
|
|
124
127
|
|
|
@@ -161,9 +164,6 @@ import { NotificationBaseComponent } from '@smartsoft001/angular';
|
|
|
161
164
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
162
165
|
})
|
|
163
166
|
export class MyCustomNotificationComponent extends NotificationBaseComponent {
|
|
164
|
-
// NgComponentOutlet passes 'cssClass' by canonical name, not the 'class' alias.
|
|
165
|
-
override cssClass = input<string>('');
|
|
166
|
-
|
|
167
167
|
containerClasses = computed(() => {
|
|
168
168
|
const classes = ['my-notification-container'];
|
|
169
169
|
const extra = this.cssClass();
|
|
@@ -173,9 +173,8 @@ export class MyCustomNotificationComponent extends NotificationBaseComponent {
|
|
|
173
173
|
}
|
|
174
174
|
```
|
|
175
175
|
|
|
176
|
-
When extending the base directly, remember to:
|
|
176
|
+
The inherited `cssClass` (input alias `class`) receives the class passed to `<smart-notification>`, and the wrapper re-emits the outputs. When extending the base directly, remember to:
|
|
177
177
|
|
|
178
|
-
- declare `cssClass = input<string>('')` explicitly (no `class` alias) if the component is used via `NgComponentOutlet` through `NOTIFICATION_STANDARD_COMPONENT_TOKEN`, because `NgComponentOutlet` passes inputs by canonical name (not by alias),
|
|
179
178
|
- call `this.dismiss()` from your close handler — it already emits the `dismissed` output,
|
|
180
179
|
- call `this.invokeAction(action.id)` from each action button — it already emits the `actionClick` output with `{ actionId }`.
|
|
181
180
|
|
|
@@ -228,7 +227,7 @@ When extending the base directly, remember to:
|
|
|
228
227
|
- Wrapper: `packages/shared/angular/src/lib/components/notification/notification.component.ts`
|
|
229
228
|
- Standard: `packages/shared/angular/src/lib/components/notification/standard/standard.component.ts`
|
|
230
229
|
- Preset variation: `packages/shared/angular/src/lib/components/notification/preset/preset.component.ts`
|
|
231
|
-
- Preset class recipes: `packages/shared/angular/src/lib/components/notification/preset/preset-classes.util.ts`
|
|
230
|
+
- Preset class recipes (internal, not exported): `packages/shared/angular/src/lib/components/notification/preset/preset-classes.util.ts`
|
|
232
231
|
- Base class: `packages/shared/angular/src/lib/components/notification/base/base.component.ts`
|
|
233
232
|
- Token: `packages/shared/angular/src/lib/shared.inectors.ts` (`NOTIFICATION_STANDARD_COMPONENT_TOKEN`)
|
|
234
233
|
- Interfaces: `packages/shared/angular/src/lib/models/interfaces.ts` (`INotificationAction`, `INotificationOptions`, `SmartNotificationVariant`)
|
|
@@ -18,24 +18,24 @@ The `<smart-page>` component provides a flexible page-header/layout wrapper with
|
|
|
18
18
|
|
|
19
19
|
### PageComponent (`<smart-page>`)
|
|
20
20
|
|
|
21
|
-
Main wrapper component. Always renders via `NgComponentOutlet`. Looks up the target variant component from a merged map of `baseMap` + the optional `PAGE_VARIANT_COMPONENTS_TOKEN` map, keyed by `options.variant` (default `'standard'`). Falls back to `PageStandardComponent` when the variant is unknown. Captures `<ng-content>` into a `TemplateRef` and passes it to the target component as `options.bodyTpl` unless the caller provided an explicit `bodyTpl`.
|
|
21
|
+
Main wrapper component. Always renders via `NgComponentOutlet`, forwarding `options` and the `class`. Looks up the target variant component from a merged map of `baseMap` + the optional `PAGE_VARIANT_COMPONENTS_TOKEN` map, keyed by `options.variant` (default `'standard'`). Falls back to `PageStandardComponent` when the variant is unknown. Captures `<ng-content>` into a `TemplateRef` and passes it to the target component as `options.bodyTpl` unless the caller provided an explicit `bodyTpl`.
|
|
22
22
|
|
|
23
23
|
### PageStandardComponent (`<smart-page-standard>`)
|
|
24
24
|
|
|
25
|
-
Default concrete implementation and the value for `baseMap['standard']`. Renders a Tailwind-styled header with title, optional back button, optional search input, `endButtons` via `<smart-button>`, and a body section driven by `options.bodyTpl`.
|
|
25
|
+
Default concrete implementation and the value for `baseMap['standard']`. Renders a Tailwind-styled header with the translated title, optional back button, optional search input, `endButtons` via `<smart-button>`, and a body section driven by `options.bodyTpl`. Header and body sit in one root element (`data-role="page"`) that takes the `class` (`cssClass`, declared without the alias like the preset's); of the slot templates it renders only `bodyTpl`.
|
|
26
26
|
|
|
27
27
|
### PageBaseComponent (abstract)
|
|
28
28
|
|
|
29
|
-
Abstract base directive for extending custom page variants. Exposes `options`, `cssClass
|
|
29
|
+
Abstract base directive for extending custom page variants. Exposes `options`, `cssClass` (input alias `class`), `back()` (`Location.back()`), `isMobile`, and a `contentTpl` view child for variants that need to re-project the main content. It sets the host height to `100%`.
|
|
30
30
|
|
|
31
31
|
## API
|
|
32
32
|
|
|
33
33
|
### Inputs
|
|
34
34
|
|
|
35
|
-
| Input | Type | Default | Description
|
|
36
|
-
| --------- | --------------------------------- | ------- |
|
|
37
|
-
| `options` | `InputSignal<IPageOptions\|null>` | - | Page configuration (see `IPageOptions`)
|
|
38
|
-
| `class` | `InputSignal<string>` | `''` | External CSS classes (alias for `cssClass`) |
|
|
35
|
+
| Input | Type | Default | Description |
|
|
36
|
+
| --------- | --------------------------------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
37
|
+
| `options` | `InputSignal<IPageOptions\|null>` | - | Page configuration (see `IPageOptions`) |
|
|
38
|
+
| `class` | `InputSignal<string>` | `''` | External CSS classes (alias for `cssClass`), forwarded to the variant; the standard and preset variants put them on their root (`data-role="page"`) |
|
|
39
39
|
|
|
40
40
|
### SmartPageVariant
|
|
41
41
|
|
|
@@ -47,6 +47,27 @@ Variant identifier used to select a concrete page component from the merged vari
|
|
|
47
47
|
|
|
48
48
|
### IPageOptions
|
|
49
49
|
|
|
50
|
+
| Field | Type | Default | Description |
|
|
51
|
+
| ---------------- | ------------------------------------------------------ | ------------ | ----------------------------------------------------------------------------------------------------------- |
|
|
52
|
+
| `title` | `string` | required | Page title, passed through `TranslatePipe` (a key or text). |
|
|
53
|
+
| `hideHeader` | `boolean` | - | Hides the header block (title, buttons, search; in the preset also the breadcrumbs, meta and filters rows). |
|
|
54
|
+
| `showBackButton` | `boolean` | - | Renders a back arrow that calls `Location.back()`. |
|
|
55
|
+
| `endButtons` | `Array<IIconButtonOptions>` | `[]` | Action buttons rendered via `<smart-button>` (secondary, `md`). |
|
|
56
|
+
| `search` | `{ text: Signal<string>; set: (txt: string) => void }` | - | Inline search input bound to `text` / `set` (placeholder: the `search` translation). |
|
|
57
|
+
| `variant` | `SmartPageVariant` | `'standard'` | Selects which variant component to render. |
|
|
58
|
+
| `bodyTpl` | `TemplateRef<unknown>` | the content | Explicit body template; falls back to the projected `<ng-content>`. |
|
|
59
|
+
| `hideMenuButton` | `boolean` | - | Preset only: hides the decorative menu (hamburger) button, which has no action of its own. |
|
|
60
|
+
| `breadcrumbsTpl` | `TemplateRef<unknown>` | - | Preset only: breadcrumbs row at the top of the header. |
|
|
61
|
+
| `subtitleTpl` | `TemplateRef<unknown>` | - | Preset only: subtitle under the title. |
|
|
62
|
+
| `avatarTpl` | `TemplateRef<unknown>` | - | Preset only: avatar next to the title. |
|
|
63
|
+
| `logoTpl` | `TemplateRef<unknown>` | - | Preset only: logo next to the title. |
|
|
64
|
+
| `metaTpl` | `TemplateRef<unknown>` | - | Preset only: meta row (status, timestamps, ...) under the title. |
|
|
65
|
+
| `statsTpl` | `TemplateRef<unknown>` | - | Preset only: stats, in the meta row. |
|
|
66
|
+
| `bannerTpl` | `TemplateRef<unknown>` | - | Preset only: full-width strip above the header. |
|
|
67
|
+
| `filtersTpl` | `TemplateRef<unknown>` | - | Preset only: filters bar under the header. |
|
|
68
|
+
| `sidebarTpl` | `TemplateRef<unknown>` | - | Preset only: an `<aside>` next to the body card (`lg` and up). |
|
|
69
|
+
| `navTpl` | `TemplateRef<unknown>` | - | Not read by the built-in implementations; available to a custom implementation. |
|
|
70
|
+
|
|
50
71
|
```typescript
|
|
51
72
|
interface IPageOptions {
|
|
52
73
|
title: string;
|
|
@@ -70,47 +91,25 @@ interface IPageOptions {
|
|
|
70
91
|
}
|
|
71
92
|
```
|
|
72
93
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
|
76
|
-
|
|
|
77
|
-
| `
|
|
78
|
-
| `
|
|
79
|
-
| `
|
|
80
|
-
| `
|
|
81
|
-
| `
|
|
82
|
-
| `
|
|
83
|
-
| `
|
|
84
|
-
| `metaTpl` | `TemplateRef<unknown>` | Meta slot (status, timestamps, etc.). |
|
|
85
|
-
| `avatarTpl` | `TemplateRef<unknown>` | Avatar slot. |
|
|
86
|
-
| `bannerTpl` | `TemplateRef<unknown>` | Banner slot. |
|
|
87
|
-
| `filtersTpl` | `TemplateRef<unknown>` | Filters slot. |
|
|
88
|
-
| `logoTpl` | `TemplateRef<unknown>` | Logo slot. |
|
|
89
|
-
| `statsTpl` | `TemplateRef<unknown>` | Stats slot. |
|
|
90
|
-
| `subtitleTpl` | `TemplateRef<unknown>` | Subtitle slot. |
|
|
91
|
-
| `navTpl` | `TemplateRef<unknown>` | Navigation slot. |
|
|
92
|
-
| `sidebarTpl` | `TemplateRef<unknown>` | Sidebar slot. |
|
|
93
|
-
|
|
94
|
-
### IIconButtonOptions (relevant fields)
|
|
95
|
-
|
|
96
|
-
| Field | Type | Description |
|
|
97
|
-
| ----------- | --------------------- | --------------------------------- |
|
|
98
|
-
| `icon` | `string` | Icon name (tracked by the `@for`) |
|
|
99
|
-
| `text` | `string` | Button label (translated) |
|
|
100
|
-
| `number` | `number` | Optional badge counter |
|
|
101
|
-
| `handler` | `() => void` | Click handler |
|
|
102
|
-
| `disabled$` | `Observable<boolean>` | Optional disabled stream |
|
|
94
|
+
### IIconButtonOptions
|
|
95
|
+
|
|
96
|
+
| Field | Type | Default | Description |
|
|
97
|
+
| ----------- | ------------------------ | -------- | ----------------------------------------------------------------------------------------------------- |
|
|
98
|
+
| `icon` | `string` | required | Identifier of the button (the `@for` track key, so keep it unique). |
|
|
99
|
+
| `text` | `string` | - | Button label (translated). |
|
|
100
|
+
| `handler` | `() => void` | - | Click handler. |
|
|
101
|
+
| `number` | `number` | - | A count badge. |
|
|
102
|
+
| `disabled$` | `Observable<boolean>` | - | Disables the button while it emits `true`. |
|
|
103
|
+
| `component` | `any` | - | Not read by the built-in implementations; available to a custom implementation (e.g. a popover body). |
|
|
104
|
+
| `type` | `'default' \| 'popover'` | - | Not read by the built-in implementations; available to a custom implementation. |
|
|
103
105
|
|
|
104
106
|
### PAGE_VARIANT_COMPONENTS_TOKEN
|
|
105
107
|
|
|
108
|
+
InjectionToken from `@smartsoft001/angular`, of type `Partial<Record<SmartPageVariant, Type<PageBaseComponent>>>`. Provide a map to register additional variants. The map is merged on top of `baseMap` (which contains the default `{ standard: PageStandardComponent }`), so you can both add new variants and override `'standard'`.
|
|
109
|
+
|
|
106
110
|
```typescript
|
|
107
111
|
import { PAGE_VARIANT_COMPONENTS_TOKEN } from '@smartsoft001/angular';
|
|
108
|
-
```
|
|
109
|
-
|
|
110
|
-
InjectionToken of type `Partial<Record<SmartPageVariant, Type<PageBaseComponent>>>`. Provide a map to register additional variants. The map is merged on top of `baseMap` (which contains the default `{ standard: PageStandardComponent }`), so you can both add new variants and override `'standard'`.
|
|
111
112
|
|
|
112
|
-
```typescript
|
|
113
|
-
// In your app providers:
|
|
114
113
|
providers: [
|
|
115
114
|
{
|
|
116
115
|
provide: PAGE_VARIANT_COMPONENTS_TOKEN,
|
|
@@ -125,7 +124,7 @@ providers: [
|
|
|
125
124
|
## Extending the Base Class
|
|
126
125
|
|
|
127
126
|
```typescript
|
|
128
|
-
import { Component, ViewEncapsulation
|
|
127
|
+
import { Component, ViewEncapsulation } from '@angular/core';
|
|
129
128
|
import { NgTemplateOutlet } from '@angular/common';
|
|
130
129
|
import { PageBaseComponent } from '@smartsoft001/angular';
|
|
131
130
|
|
|
@@ -147,10 +146,7 @@ import { PageBaseComponent } from '@smartsoft001/angular';
|
|
|
147
146
|
imports: [NgTemplateOutlet],
|
|
148
147
|
encapsulation: ViewEncapsulation.None,
|
|
149
148
|
})
|
|
150
|
-
export class MyCustomPageComponent extends PageBaseComponent {
|
|
151
|
-
// NgComponentOutlet passes 'cssClass' (not aliased 'class') so declare it explicitly
|
|
152
|
-
override cssClass = input<string>('');
|
|
153
|
-
}
|
|
149
|
+
export class MyCustomPageComponent extends PageBaseComponent {}
|
|
154
150
|
```
|
|
155
151
|
|
|
156
152
|
## Usage Examples
|
|
@@ -221,13 +217,15 @@ export class MyCustomPageComponent extends PageBaseComponent {
|
|
|
221
217
|
</smart-page>
|
|
222
218
|
```
|
|
223
219
|
|
|
220
|
+
The class lands on the root element of the variant (`data-role="page"`), in the standard page and in the preset alike.
|
|
221
|
+
|
|
224
222
|
## Preset
|
|
225
223
|
|
|
226
224
|
`PagePresetComponent` (`<smart-page-preset>`) is a styled `'preset'` variant that extends `PageStandardComponent`. It renders a full application-shell layout instead of the plain standard header: a bordered `<header>`, a gray page body and a content card. Every utility is `smart:`-prefixed with explicit `smart:dark:*` twins.
|
|
227
225
|
|
|
228
226
|
### Registration
|
|
229
227
|
|
|
230
|
-
The preset is dispatched by map key `'preset'`
|
|
228
|
+
The preset is dispatched by map key `'preset'`. Register the ready-made map `PAGE_PRESET_VARIANT_COMPONENTS` (`{ preset: PagePresetComponent }`) for `PAGE_VARIANT_COMPONENTS_TOKEN` and set `variant: 'preset'` on the pages that should use it; the built-in `'standard'` variant is untouched. `provideSmartPresets()` instead registers the preset for both `'standard'` and `'preset'`, so every page renders it.
|
|
231
229
|
|
|
232
230
|
```typescript
|
|
233
231
|
import {
|
|
@@ -243,8 +241,6 @@ providers: [
|
|
|
243
241
|
];
|
|
244
242
|
```
|
|
245
243
|
|
|
246
|
-
Then set `variant: 'preset'` on `IPageOptions`:
|
|
247
|
-
|
|
248
244
|
```html
|
|
249
245
|
<smart-page [options]="{ title: 'Alice', variant: 'preset' }">
|
|
250
246
|
<p>Body rendered inside the content card.</p>
|
|
@@ -270,12 +266,12 @@ The back button (`button[data-role="back"]`) appears only when `showBackButton`
|
|
|
270
266
|
|
|
271
267
|
### cssClass
|
|
272
268
|
|
|
273
|
-
|
|
269
|
+
The preset declares `cssClass` without the `class` alias: on the `<smart-page-preset>` selector bind `[cssClass]`; on `<smart-page>` pass `class` as usual. External classes land on the `data-role="page"` wrapper.
|
|
274
270
|
|
|
275
271
|
### Documented gaps
|
|
276
272
|
|
|
277
273
|
- `hideMenuButton` only toggles a decorative hamburger button; there is no menu panel wired to it.
|
|
278
|
-
- Unused slots (`bannerTpl`, `breadcrumbsTpl`, `metaTpl`, `statsTpl`, `filtersTpl`, `sidebarTpl`, `avatarTpl`, `logoTpl`, `subtitleTpl`) simply render nothing when omitted; `navTpl` is not consumed by this preset.
|
|
274
|
+
- Unused slots (`bannerTpl`, `breadcrumbsTpl`, `metaTpl`, `statsTpl`, `filtersTpl`, `sidebarTpl`, `avatarTpl`, `logoTpl`, `subtitleTpl`) simply render nothing when omitted; `navTpl` is not consumed by this preset (nor by the standard variant).
|
|
279
275
|
|
|
280
276
|
## File Locations
|
|
281
277
|
|
|
@@ -17,11 +17,11 @@ The `<smart-page-heading>` component provides a composable page heading region w
|
|
|
17
17
|
|
|
18
18
|
### PageHeadingComponent (`<smart-page-heading>`)
|
|
19
19
|
|
|
20
|
-
Main wrapper component. Renders `PageHeadingStandardComponent` by default. When `PAGE_HEADING_STANDARD_COMPONENT_TOKEN` is provided, renders the injected component via `NgComponentOutlet`.
|
|
20
|
+
Main wrapper component. Renders `PageHeadingStandardComponent` by default. When `PAGE_HEADING_STANDARD_COMPONENT_TOKEN` is provided (or `provideSmartPresets()` registers the preset), renders the injected component via `NgComponentOutlet`, forwarding `options` and the `class`.
|
|
21
21
|
|
|
22
22
|
### PageHeadingStandardComponent (`<smart-page-heading-standard>`)
|
|
23
23
|
|
|
24
|
-
Barebones placeholder concrete implementation. Always renders a wrapper `<div>` and a `<header>`. Renders any of the optional slots (`breadcrumbsTpl`, `bannerTpl`, `avatarTpl`, `logoTpl`, `metaTpl`, `statsTpl`, `actionsTpl`, `filtersTpl`) only when provided
|
|
24
|
+
Barebones placeholder concrete implementation. Always renders a wrapper `<div>` and a `<header>`. Renders any of the optional slots (`breadcrumbsTpl`, `bannerTpl`, `avatarTpl`, `logoTpl`, `metaTpl`, `statsTpl`, `actionsTpl`, `filtersTpl`) only when provided; it does not read `navTpl` or `presentation`. Renders `<h1>` with `options.title` and `<p class="subtitle">` with `options.subtitle` only when those strings are non-empty. The external `cssClass` is applied to the wrapper. It does not include Tailwind UI styling — it exists solely as the default structural placeholder until a custom implementation is registered through the token.
|
|
25
25
|
|
|
26
26
|
### PageHeadingBaseComponent (abstract)
|
|
27
27
|
|
|
@@ -38,6 +38,23 @@ Abstract base directive for extending custom page-heading implementations. Expos
|
|
|
38
38
|
|
|
39
39
|
### IPageHeadingOptions
|
|
40
40
|
|
|
41
|
+
All properties are optional; a section is rendered only when its template or string is provided.
|
|
42
|
+
|
|
43
|
+
| Field | Type | Default | Description |
|
|
44
|
+
| ---------------- | ------------------------------------------------------------------------ | ------------ | ----------------------------------------------------------------------------------------------- |
|
|
45
|
+
| `title` | `string` | - | The page title, an `<h1>` (the preset puts it in the brand zone, after the `logoTpl`). |
|
|
46
|
+
| `subtitle` | `string` | - | Text under the title. |
|
|
47
|
+
| `actionsTpl` | `TemplateRef<unknown>` | - | Action buttons (the preset's actions zone, hidden below `md` and repeated in the mobile panel). |
|
|
48
|
+
| `avatarTpl` | `TemplateRef<unknown>` | - | An avatar (the preset shows it in place of the actions in the `user` layout only). |
|
|
49
|
+
| `logoTpl` | `TemplateRef<unknown>` | - | A logo (the preset's brand zone). |
|
|
50
|
+
| `breadcrumbsTpl` | `TemplateRef<unknown>` | - | Standard only: breadcrumbs above the header. |
|
|
51
|
+
| `bannerTpl` | `TemplateRef<unknown>` | - | Standard only: a banner above the header. |
|
|
52
|
+
| `metaTpl` | `TemplateRef<unknown>` | - | Standard only: meta information (dates, location, counts). |
|
|
53
|
+
| `statsTpl` | `TemplateRef<unknown>` | - | Standard only: a stats row. |
|
|
54
|
+
| `filtersTpl` | `TemplateRef<unknown>` | - | Standard only: filter controls. |
|
|
55
|
+
| `navTpl` | `TemplateRef<unknown>` | - | Preset only: the desktop nav zone (hidden below `md`, repeated in the mobile panel). |
|
|
56
|
+
| `presentation` | `{ layout?: 'links-left' \| 'links-center' \| 'links-right' \| 'user' }` | `links-left` | Preset only: the arrangement of the bar (see the layouts below). |
|
|
57
|
+
|
|
41
58
|
```typescript
|
|
42
59
|
interface IPageHeadingOptions {
|
|
43
60
|
title?: string;
|
|
@@ -50,20 +67,20 @@ interface IPageHeadingOptions {
|
|
|
50
67
|
statsTpl?: TemplateRef<unknown>;
|
|
51
68
|
logoTpl?: TemplateRef<unknown>;
|
|
52
69
|
filtersTpl?: TemplateRef<unknown>;
|
|
70
|
+
navTpl?: TemplateRef<unknown>;
|
|
71
|
+
presentation?: {
|
|
72
|
+
layout?: 'links-left' | 'links-center' | 'links-right' | 'user';
|
|
73
|
+
};
|
|
53
74
|
}
|
|
54
75
|
```
|
|
55
76
|
|
|
56
|
-
All properties are optional. The default `PageHeadingStandardComponent` consumes every property; a section is rendered only when its template/string is provided.
|
|
57
|
-
|
|
58
77
|
## PAGE_HEADING_STANDARD_COMPONENT_TOKEN
|
|
59
78
|
|
|
79
|
+
InjectionToken from `@smartsoft001/angular` that allows replacing the default `PageHeadingStandardComponent` with a custom implementation. Provide a `Type<PageHeadingBaseComponent>` in your application or component providers; `provideSmartPresets()` provides `PageHeadingPresetComponent` for it together with every other preset.
|
|
80
|
+
|
|
60
81
|
```typescript
|
|
61
82
|
import { PAGE_HEADING_STANDARD_COMPONENT_TOKEN } from '@smartsoft001/angular';
|
|
62
|
-
```
|
|
63
83
|
|
|
64
|
-
InjectionToken that allows replacing the default `PageHeadingStandardComponent` with a custom implementation. Provide a `Type<PageHeadingBaseComponent>` to override.
|
|
65
|
-
|
|
66
|
-
```typescript
|
|
67
84
|
providers: [
|
|
68
85
|
{
|
|
69
86
|
provide: PAGE_HEADING_STANDARD_COMPONENT_TOKEN,
|
|
@@ -79,7 +96,6 @@ import {
|
|
|
79
96
|
ChangeDetectionStrategy,
|
|
80
97
|
Component,
|
|
81
98
|
computed,
|
|
82
|
-
input,
|
|
83
99
|
ViewEncapsulation,
|
|
84
100
|
} from '@angular/core';
|
|
85
101
|
import { NgTemplateOutlet } from '@angular/common';
|
|
@@ -112,9 +128,6 @@ import { PageHeadingBaseComponent } from '@smartsoft001/angular';
|
|
|
112
128
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
113
129
|
})
|
|
114
130
|
export class MyCustomPageHeadingComponent extends PageHeadingBaseComponent {
|
|
115
|
-
// NgComponentOutlet passes 'cssClass' by canonical name, not the 'class' alias.
|
|
116
|
-
override cssClass = input<string>('');
|
|
117
|
-
|
|
118
131
|
containerClasses = computed(() => {
|
|
119
132
|
const classes = ['my-page-heading'];
|
|
120
133
|
const extra = this.cssClass();
|
|
@@ -179,12 +192,17 @@ export class MyCustomPageHeadingComponent extends PageHeadingBaseComponent {
|
|
|
179
192
|
`PageHeadingPresetComponent` (`smart-page-heading-preset`) is a HyperUI-styled
|
|
180
193
|
variation. Unlike the standard page-heading (a page title block), this preset
|
|
181
194
|
**intentionally renders a NAVBAR look**: a sticky-ready `<header>` bar with a
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
195
|
+
brand zone (the `logoTpl`, followed by the `title` as an `<h1>` and the
|
|
196
|
+
`subtitle` under it), a responsive desktop nav zone, a CTA/actions zone (or a
|
|
197
|
+
user avatar zone), and a mobile hamburger that toggles a collapsible panel. The
|
|
198
|
+
collapse is driven by a local `menuOpened` signal — no external JS runtime. It
|
|
199
|
+
does not render the breadcrumbs, banner, meta, stats and filters slots.
|
|
200
|
+
|
|
201
|
+
Register it through `PAGE_HEADING_STANDARD_COMPONENT_TOKEN` (or with
|
|
202
|
+
`provideSmartPresets()`) to restyle every `<smart-page-heading>`, or use
|
|
203
|
+
`<smart-page-heading-preset>` directly. It declares `cssClass` without the
|
|
204
|
+
`class` alias: on the preset selector bind `[cssClass]`; on
|
|
205
|
+
`<smart-page-heading>` pass `class` as usual.
|
|
188
206
|
|
|
189
207
|
### Layouts (`presentation.layout`)
|
|
190
208
|
|
|
@@ -195,16 +213,15 @@ Register it through `PAGE_HEADING_STANDARD_COMPONENT_TOKEN` to restyle every
|
|
|
195
213
|
| `links-right` | Logo left (flex-1), nav + CTAs grouped on the right |
|
|
196
214
|
| `user` | Like `links-right`, but an `avatarTpl` zone instead of CTAs |
|
|
197
215
|
|
|
198
|
-
###
|
|
216
|
+
### Preset-only `IPageHeadingOptions` fields
|
|
199
217
|
|
|
200
218
|
- `navTpl?: TemplateRef<unknown>` — desktop nav content (hidden below `md`,
|
|
201
|
-
repeated inside the mobile panel when open).
|
|
219
|
+
repeated inside the mobile panel when open).
|
|
202
220
|
- `presentation?: { layout?: 'links-left' | 'links-center' | 'links-right' | 'user' }`
|
|
203
|
-
— selects the navbar arrangement (default `links-left`).
|
|
221
|
+
— selects the navbar arrangement (default `links-left`).
|
|
204
222
|
|
|
205
|
-
|
|
206
|
-
`avatarTpl`
|
|
207
|
-
zones respectively.
|
|
223
|
+
`logoTpl`, `title` and `subtitle` fill the brand zone, `actionsTpl` the CTA zone
|
|
224
|
+
and `avatarTpl` the user zone (`user` layout).
|
|
208
225
|
|
|
209
226
|
### Token registration
|
|
210
227
|
|
|
@@ -222,7 +239,7 @@ providers: [
|
|
|
222
239
|
|
|
223
240
|
### Example nav recipe
|
|
224
241
|
|
|
225
|
-
The preset renders only the nav **zone** wrapper; supply the list via `navTpl
|
|
242
|
+
The preset renders only the nav **zone** wrapper; supply the list via `navTpl`, as in the template below.
|
|
226
243
|
|
|
227
244
|
```html
|
|
228
245
|
<ng-template #nav>
|
|
@@ -17,25 +17,25 @@ The `<smart-paging>` component provides a flexible pagination wrapper with an In
|
|
|
17
17
|
|
|
18
18
|
### PagingComponent (`<smart-paging>`)
|
|
19
19
|
|
|
20
|
-
Main wrapper component. Renders `PagingStandardComponent` by default
|
|
20
|
+
Main wrapper component. Renders `PagingStandardComponent` by default, or the component provided for `PAGING_STANDARD_COMPONENT_TOKEN`. It creates that component once with `ViewContainerRef.createComponent` (not `NgComponentOutlet`), marks its host with `data-smart-paging-host="standard"` or `"injected"`, and re-emits its `pageChange` as its own. On every change it hands `currentPage`, `totalPages`, `pageSize`, `totalItems`, `variant` and `class` to the rendered component with `setInput`, resolved to the names that component declares: a custom implementation that redeclares `cssClass` without the `class` alias still gets the classes, and an input the component does not declare is skipped.
|
|
21
|
+
|
|
22
|
+
The page is **owned by the parent**: bind `currentPage` and update it from `(pageChange)`. `goToPage` emits any page from 1 to `totalPages` (the current one included) and ignores the rest; `nextPage` and `previousPage` do nothing on the last or first page.
|
|
21
23
|
|
|
22
24
|
### PagingStandardComponent (`<smart-paging-standard>`)
|
|
23
25
|
|
|
24
|
-
Default concrete implementation
|
|
26
|
+
Default concrete implementation: a `<nav>` with prev/next buttons (translated through the `prev` and `next` keys), numeric page buttons with `'...'` gaps and `aria-current="page"` on the active page, styled with `smart:` Tailwind classes including dark mode and disabled states. The `class` input goes on the `<nav>`. It renders no results summary, so `pageSize` and `totalItems` change nothing here, and `variant` only shows up as the `data-variant` attribute of the `<nav>`.
|
|
25
27
|
|
|
26
28
|
### PagingPresetComponent (`<smart-paging-preset>`)
|
|
27
29
|
|
|
28
|
-
Styled variation that extends `PagingBaseComponent` and is a drop-in replacement for `PagingStandardComponent`. Register it via `PAGING_STANDARD_COMPONENT_TOKEN` to restyle every `<smart-paging>`, or use the `<smart-paging-preset>` selector directly. Translates the Preline pagination examples into `smart:`-prefixed vanilla Tailwind classes with explicit `dark:` variants. It drives page state purely through the inherited signals/methods (`pages`, `canGoBack`, `canGoForward`, `goToPage`, `nextPage`, `previousPage`) — no Preline JS runtime is required. The `variant` input selects the layout:
|
|
30
|
+
Styled variation that extends `PagingBaseComponent` and is a drop-in replacement for `PagingStandardComponent`. Register it via `PAGING_STANDARD_COMPONENT_TOKEN` (or register every preset at once with `provideSmartPresets()`) to restyle every `<smart-paging>`, or use the `<smart-paging-preset>` selector directly. Translates the Preline pagination examples into `smart:`-prefixed vanilla Tailwind classes with explicit `dark:` variants. It drives page state purely through the inherited signals/methods (`pages`, `canGoBack`, `canGoForward`, `goToPage`, `nextPage`, `previousPage`) — no Preline JS runtime is required. The `variant` input selects the layout:
|
|
29
31
|
|
|
30
|
-
- `card-footer` — a "Showing X to Y of Z results" summary (built from `showingFrom`/`showingTo`/`totalItems`) alongside the nav, justified between on `sm`+ screens;
|
|
32
|
+
- `card-footer` — a "Showing X to Y of Z results" summary (built from `showingFrom`/`showingTo`/`totalItems`, so it needs `pageSize` and `totalItems`) alongside the nav, justified between on `sm`+ screens;
|
|
31
33
|
- `centered` — the nav centered horizontally;
|
|
32
34
|
- `simple` — the bare nav.
|
|
33
35
|
|
|
34
|
-
The
|
|
36
|
+
The "Showing … results", "Previous" and "Next" texts of the preset are plain English, not translated. The `class` input goes on the outer container `<div>`, not on the `<nav>`. The per-variant class recipes are internal to the preset (not exported from `@smartsoft001/angular`).
|
|
35
37
|
|
|
36
|
-
|
|
37
|
-
>
|
|
38
|
-
> `PagingComponent` forwards the `variant` input (via `setInput('variant', …)`, including later changes), so `<smart-paging variant="centered">` selects the preset layout when the preset is registered. The standard component ignores it visually and only exposes it as a `data-variant` attribute on its `<nav>`.
|
|
38
|
+
`PagingPresetComponent` keeps the inherited `cssClass` input with its `class` alias, so `class` works the same on `<smart-paging>` and on `<smart-paging-preset>`. `<smart-paging variant="centered">` selects the preset layout when the preset is registered, and later changes of `variant` reach it too.
|
|
39
39
|
|
|
40
40
|
### PagingBaseComponent (abstract)
|
|
41
41
|
|
|
@@ -49,16 +49,16 @@ Abstract base directive for extending custom paging implementations. Provides si
|
|
|
49
49
|
| ------------- | ---------------------------- | --------------- | ------------------------------------------------------------------------------- |
|
|
50
50
|
| `currentPage` | `InputSignal<number>` | `1` | Current active page |
|
|
51
51
|
| `totalPages` | `InputSignal<number>` | `1` | Total number of pages |
|
|
52
|
-
| `pageSize` | `InputSignal<number>` | `10` | Items per page
|
|
53
|
-
| `totalItems` | `InputSignal<number>` | `0` | Total number of items
|
|
52
|
+
| `pageSize` | `InputSignal<number>` | `10` | Items per page; only the preset's `card-footer` summary uses it |
|
|
53
|
+
| `totalItems` | `InputSignal<number>` | `0` | Total number of items; only the preset's `card-footer` summary uses it |
|
|
54
54
|
| `variant` | `InputSignal<PagingVariant>` | `'card-footer'` | Layout variant, styled by the preset; the standard exposes it as `data-variant` |
|
|
55
|
-
| `class` | `InputSignal<string>` | `''` | External CSS classes (alias for `cssClass`)
|
|
55
|
+
| `class` | `InputSignal<string>` | `''` | External CSS classes (alias for `cssClass`), forwarded to the rendered paging |
|
|
56
56
|
|
|
57
57
|
### Outputs
|
|
58
58
|
|
|
59
|
-
| Output | Type | Description
|
|
60
|
-
| ------------ | ----------------------- |
|
|
61
|
-
| `pageChange` | `OutputEmitter<number>` | Emits the requested page number |
|
|
59
|
+
| Output | Type | Description |
|
|
60
|
+
| ------------ | ----------------------- | --------------------------------------------------- |
|
|
61
|
+
| `pageChange` | `OutputEmitter<number>` | Emits the requested page number (1 to `totalPages`) |
|
|
62
62
|
|
|
63
63
|
### PagingVariant
|
|
64
64
|
|
|
@@ -72,7 +72,7 @@ type PagingVariant = 'card-footer' | 'centered' | 'simple';
|
|
|
72
72
|
import { PAGING_STANDARD_COMPONENT_TOKEN } from '@smartsoft001/angular';
|
|
73
73
|
```
|
|
74
74
|
|
|
75
|
-
InjectionToken that allows replacing the default `PagingStandardComponent` with a custom implementation. Provide a `Type<PagingBaseComponent>` to override.
|
|
75
|
+
InjectionToken that allows replacing the default `PagingStandardComponent` with a custom implementation. Provide a `Type<PagingBaseComponent>` to override; `provideSmartPresets()` provides `PagingPresetComponent` for it together with every other preset.
|
|
76
76
|
|
|
77
77
|
```typescript
|
|
78
78
|
// In your app module or component providers:
|
|
@@ -86,6 +86,8 @@ providers: [
|
|
|
86
86
|
|
|
87
87
|
## Extending the Base Class
|
|
88
88
|
|
|
89
|
+
The base class brings every input, the `pageChange` output, the computed helpers and the navigation methods. The `class` passed to `<smart-paging>` arrives in the inherited `cssClass` input, so a custom implementation only adds its template.
|
|
90
|
+
|
|
89
91
|
```typescript
|
|
90
92
|
import { Component, ViewEncapsulation } from '@angular/core';
|
|
91
93
|
import { PagingBaseComponent } from '@smartsoft001/angular';
|