@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,7 +17,7 @@ The `<smart-stacked-layout>` component provides a top-to-bottom application shel
|
|
|
17
17
|
|
|
18
18
|
### StackedLayoutComponent (`<smart-stacked-layout>`)
|
|
19
19
|
|
|
20
|
-
Main wrapper component. Renders `StackedLayoutStandardComponent` by default. When `STACKED_LAYOUT_STANDARD_COMPONENT_TOKEN` is provided, renders the injected component via `NgComponentOutlet
|
|
20
|
+
Main wrapper component. Renders `StackedLayoutStandardComponent` by default. When `STACKED_LAYOUT_STANDARD_COMPONENT_TOKEN` is provided, renders the injected component via `NgComponentOutlet` and hands it the `options` and `class` inputs. Accepts main content via projected `<ng-content>`, which reaches the `<ng-content />` of whichever implementation renders (the standard, the preset or a custom one).
|
|
21
21
|
|
|
22
22
|
### StackedLayoutStandardComponent (`<smart-stacked-layout-standard>`)
|
|
23
23
|
|
|
@@ -38,6 +38,15 @@ Abstract base directive for extending custom stacked-layout implementations. Exp
|
|
|
38
38
|
|
|
39
39
|
### IStackedLayoutOptions
|
|
40
40
|
|
|
41
|
+
| Field | Type | Default | Description |
|
|
42
|
+
| ---------------- | ---------------------------------- | ------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
|
|
43
|
+
| `title` | `string` | - | Page title, rendered as `<h1 data-role="title">` when `headerTpl` is not set. |
|
|
44
|
+
| `navTpl` | `TemplateRef<unknown>` | - | Navigation at the top (inside the `<nav>`). |
|
|
45
|
+
| `headerTpl` | `TemplateRef<unknown>` | - | The page header beneath the navigation; wins over `title`. |
|
|
46
|
+
| `containerWidth` | `SmartStackedLayoutContainerWidth` | `'xl'` | Width of the header and content containers in the preset (see the mapping below); the standard only exposes it as `data-container-width`. |
|
|
47
|
+
|
|
48
|
+
`SmartStackedLayoutContainerWidth` is `'sm' | 'md' | 'lg' | 'xl' | 'full'`.
|
|
49
|
+
|
|
41
50
|
```typescript
|
|
42
51
|
type SmartStackedLayoutContainerWidth = 'sm' | 'md' | 'lg' | 'xl' | 'full';
|
|
43
52
|
|
|
@@ -45,22 +54,17 @@ interface IStackedLayoutOptions {
|
|
|
45
54
|
title?: string;
|
|
46
55
|
navTpl?: TemplateRef<unknown>;
|
|
47
56
|
headerTpl?: TemplateRef<unknown>;
|
|
48
|
-
containerWidth?: SmartStackedLayoutContainerWidth;
|
|
57
|
+
containerWidth?: SmartStackedLayoutContainerWidth; // styled by the preset
|
|
49
58
|
}
|
|
50
59
|
```
|
|
51
60
|
|
|
52
|
-
The default `StackedLayoutStandardComponent` consumes `navTpl` (rendered inside the top `<nav>`), `headerTpl` (rendered as a secondary `<header>` block beneath the navigation) and `title` (rendered as `<header><h1 data-role="title">` when there is no `headerTpl`, the same precedence as the preset). `containerWidth` is purely visual: the standard only exposes it as `data-container-width` on the root (default `'xl'`), and the max-width is styled by `StackedLayoutPresetComponent`.
|
|
53
|
-
|
|
54
61
|
## STACKED_LAYOUT_STANDARD_COMPONENT_TOKEN
|
|
55
62
|
|
|
63
|
+
InjectionToken that allows replacing the default `StackedLayoutStandardComponent` with a custom implementation. Provide a component class extending `StackedLayoutBaseComponent` under `STACKED_LAYOUT_STANDARD_COMPONENT_TOKEN`; every `<smart-stacked-layout>` below that injector renders it.
|
|
64
|
+
|
|
56
65
|
```typescript
|
|
57
66
|
import { STACKED_LAYOUT_STANDARD_COMPONENT_TOKEN } from '@smartsoft001/angular';
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
InjectionToken that allows replacing the default `StackedLayoutStandardComponent` with a custom implementation. Provide a `Type<StackedLayoutBaseComponent>` to override.
|
|
61
67
|
|
|
62
|
-
```typescript
|
|
63
|
-
// In your app module or component providers:
|
|
64
68
|
providers: [
|
|
65
69
|
{
|
|
66
70
|
provide: STACKED_LAYOUT_STANDARD_COMPONENT_TOKEN,
|
|
@@ -76,7 +80,6 @@ import {
|
|
|
76
80
|
ChangeDetectionStrategy,
|
|
77
81
|
Component,
|
|
78
82
|
computed,
|
|
79
|
-
input,
|
|
80
83
|
ViewEncapsulation,
|
|
81
84
|
} from '@angular/core';
|
|
82
85
|
import { NgTemplateOutlet } from '@angular/common';
|
|
@@ -109,9 +112,6 @@ import { StackedLayoutBaseComponent } from '@smartsoft001/angular';
|
|
|
109
112
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
110
113
|
})
|
|
111
114
|
export class MyCustomStackedLayoutComponent extends StackedLayoutBaseComponent {
|
|
112
|
-
// NgComponentOutlet passes 'cssClass' by canonical name, not the 'class' alias.
|
|
113
|
-
override cssClass = input<string>('');
|
|
114
|
-
|
|
115
115
|
containerClasses = computed(() => {
|
|
116
116
|
const classes = ['my-stacked-layout'];
|
|
117
117
|
const extra = this.cssClass();
|
|
@@ -123,8 +123,7 @@ export class MyCustomStackedLayoutComponent extends StackedLayoutBaseComponent {
|
|
|
123
123
|
|
|
124
124
|
When extending the base directly, remember to:
|
|
125
125
|
|
|
126
|
-
-
|
|
127
|
-
- accept main content via `<ng-content>` so consumers can project arbitrary page content,
|
|
126
|
+
- accept main content via `<ng-content>` so consumers can project arbitrary page content (the wrapper projects its content into it),
|
|
128
127
|
- use `[ngTemplateOutlet]` to render `options().navTpl` and `options().headerTpl`.
|
|
129
128
|
|
|
130
129
|
## Usage Examples
|
|
@@ -164,13 +163,14 @@ When extending the base directly, remember to:
|
|
|
164
163
|
|
|
165
164
|
- Wrapper: `packages/shared/angular/src/lib/components/stacked-layout/stacked-layout.component.ts`
|
|
166
165
|
- Standard: `packages/shared/angular/src/lib/components/stacked-layout/standard/standard.component.ts`
|
|
166
|
+
- Preset: `packages/shared/angular/src/lib/components/stacked-layout/preset/preset.component.ts`
|
|
167
167
|
- Base class: `packages/shared/angular/src/lib/components/stacked-layout/base/base.component.ts`
|
|
168
168
|
- Token: `packages/shared/angular/src/lib/shared.inectors.ts` (`STACKED_LAYOUT_STANDARD_COMPONENT_TOKEN`)
|
|
169
169
|
- Interface: `packages/shared/angular/src/lib/models/interfaces.ts` (`IStackedLayoutOptions`)
|
|
170
170
|
|
|
171
171
|
## HyperUI preset
|
|
172
172
|
|
|
173
|
-
`StackedLayoutPresetComponent` (`<smart-stacked-layout-preset>`) is the HyperUI-styled drop-in for `StackedLayoutStandardComponent`. It uses the same `IStackedLayoutOptions` API — no interface changes, no new options fields — and delivers the page scaffold in the HyperUI container rhythm
|
|
173
|
+
`StackedLayoutPresetComponent` (`<smart-stacked-layout-preset>`) is the HyperUI-styled drop-in for `StackedLayoutStandardComponent`. It uses the same `IStackedLayoutOptions` API — no interface changes, no new options fields — and delivers the page scaffold in the HyperUI container rhythm.
|
|
174
174
|
|
|
175
175
|
- **Page root** (`data-role="root"`): full-height gray surface — `smart:min-h-full smart:bg-gray-50 smart:dark:bg-gray-900`. The external `cssClass` is merged here.
|
|
176
176
|
- **Header zone**: white bar (`smart:bg-white smart:shadow-sm smart:dark:bg-gray-800 smart:dark:border-b smart:dark:border-gray-700`) whose inner container (`data-role="header"`, `smart:py-4`) renders `navTpl` (`data-role="nav"`), then `headerTpl` if present, else `title` as an `<h1 data-role="title">` fallback.
|
|
@@ -178,7 +178,7 @@ When extending the base directly, remember to:
|
|
|
178
178
|
|
|
179
179
|
### containerWidth mapping
|
|
180
180
|
|
|
181
|
-
Both the header and content containers share the base `smart:mx-auto smart:px-4 smart:sm:px-6 smart:lg:px-8` plus a max-width from `options.containerWidth
|
|
181
|
+
Both the header and content containers share the base `smart:mx-auto smart:px-4 smart:sm:px-6 smart:lg:px-8` plus a max-width from `options.containerWidth`, as listed below.
|
|
182
182
|
|
|
183
183
|
| containerWidth | max-width class |
|
|
184
184
|
| -------------------- | ------------------ |
|
|
@@ -190,9 +190,13 @@ Both the header and content containers share the base `smart:mx-auto smart:px-4
|
|
|
190
190
|
|
|
191
191
|
### Token registration
|
|
192
192
|
|
|
193
|
+
Provide `StackedLayoutPresetComponent` under `STACKED_LAYOUT_STANDARD_COMPONENT_TOKEN` to restyle every `<smart-stacked-layout>`, or register every preset of the library at once with `provideSmartPresets()`. The preset declares `cssClass` without the `class` alias: bind `[cssClass]` when you use `<smart-stacked-layout-preset>` directly; on `<smart-stacked-layout>` pass `class` as usual.
|
|
194
|
+
|
|
193
195
|
```typescript
|
|
194
|
-
import {
|
|
195
|
-
|
|
196
|
+
import {
|
|
197
|
+
STACKED_LAYOUT_STANDARD_COMPONENT_TOKEN,
|
|
198
|
+
StackedLayoutPresetComponent,
|
|
199
|
+
} from '@smartsoft001/angular';
|
|
196
200
|
|
|
197
201
|
providers: [
|
|
198
202
|
{
|
|
@@ -204,7 +208,4 @@ providers: [
|
|
|
204
208
|
|
|
205
209
|
### Documented gaps
|
|
206
210
|
|
|
207
|
-
The preset delivers the
|
|
208
|
-
|
|
209
|
-
- Preset: `packages/shared/angular/src/lib/components/stacked-layout/preset/preset.component.ts`
|
|
210
|
-
- Class recipes: `packages/shared/angular/src/lib/components/stacked-layout/preset/preset-classes.util.ts`
|
|
211
|
+
The preset delivers the page scaffold only. For "content + image" sections, project `<smart-section-heading>` blocks (with the section-heading preset) into the stacked-layout content region.
|
|
@@ -17,11 +17,11 @@ The `<smart-stacked-list>` component renders a vertical list of records with opt
|
|
|
17
17
|
|
|
18
18
|
### StackedListComponent (`<smart-stacked-list>`)
|
|
19
19
|
|
|
20
|
-
Main wrapper component. Renders `StackedListStandardComponent` by default. When `STACKED_LIST_STANDARD_COMPONENT_TOKEN` is provided, renders the injected component via `NgComponentOutlet
|
|
20
|
+
Main wrapper component. Renders `StackedListStandardComponent` by default. When `STACKED_LIST_STANDARD_COMPONENT_TOKEN` is provided, renders the injected component via `NgComponentOutlet` and hands it the `options` and `class` inputs.
|
|
21
21
|
|
|
22
22
|
### StackedListStandardComponent (`<smart-stacked-list-standard>`)
|
|
23
23
|
|
|
24
|
-
Barebones placeholder concrete implementation. Renders a wrapper `<div>` containing an optional `<h3 class="title">`, optional `<p class="description">`, and a `<ul role="list">` with one `<li class="item">` per item. Each item renders the icon/avatar (icon template wins over avatar URL), a body group with the title (rendered as `<a class="title">` if `href` is provided, otherwise `<span class="title">`) and optional description/meta, and optional badge/action template slots. When the item list is empty, the optional `emptyTpl` is rendered inside `<div class="empty">`. A bottom `footerTpl` renders inside `<div class="footer">`. The external `cssClass` is applied to the root wrapper. It does not include any visual 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 wrapper `<div>` containing an optional `<h3 class="title">`, optional `<p class="description">`, and a `<ul role="list">` with one `<li class="item">` per item (with `aria-label` from the item's `ariaLabel`). Each item renders the icon/avatar (icon template wins over avatar URL), a body group with the title (rendered as `<a class="title">` if `href` is provided, otherwise `<span class="title">`) and optional description/meta, and optional badge/action template slots. When the item list is empty, the optional `emptyTpl` is rendered inside `<div class="empty">`. A bottom `footerTpl` renders inside `<div class="footer">`. The external `cssClass` is applied to the root wrapper. It does not include any visual styling — it exists solely as the default structural placeholder until a custom implementation is registered through the token.
|
|
25
25
|
|
|
26
26
|
### StackedListPresetComponent (`<smart-stacked-list-preset>`)
|
|
27
27
|
|
|
@@ -42,13 +42,40 @@ Abstract base directive for extending custom stacked-list implementations. Expos
|
|
|
42
42
|
|
|
43
43
|
### IStackedListOptions
|
|
44
44
|
|
|
45
|
+
All properties are optional except `IStackedListItem.title`. A section is rendered only when its template/string is provided.
|
|
46
|
+
|
|
47
|
+
| Field | Type | Default | Description |
|
|
48
|
+
| ------------------- | ---------------------- | ------- | ------------------------------------------------------------------------------------------------------------------- |
|
|
49
|
+
| `title` | `string` | - | Heading above the list (`<h3>`). |
|
|
50
|
+
| `description` | `string` | - | Text under the heading. |
|
|
51
|
+
| `items` | `IStackedListItem[]` | `[]` | The rows. |
|
|
52
|
+
| `emptyTpl` | `TemplateRef<unknown>` | - | Rendered instead of the list when `items` is empty. |
|
|
53
|
+
| `footerTpl` | `TemplateRef<unknown>` | - | A slot below the list. |
|
|
54
|
+
| `withDividers` | `boolean` | - | Preset only: hairlines between rows. The standard ignores it. |
|
|
55
|
+
| `fullWidthOnMobile` | `boolean` | - | Preset only: a card that bleeds to the screen edge below `sm` and is rounded from `sm` up. The standard ignores it. |
|
|
56
|
+
|
|
57
|
+
### IStackedListItem
|
|
58
|
+
|
|
59
|
+
| Field | Type | Default | Description |
|
|
60
|
+
| ------------- | ---------------------- | -------- | -------------------------------------------------------- |
|
|
61
|
+
| `id` | `string` | - | Tracking key of the row (the index is used without it). |
|
|
62
|
+
| `title` | `string` | required | Row title; a plain `<a href>` when `href` is set. |
|
|
63
|
+
| `description` | `string` | - | Second line. |
|
|
64
|
+
| `meta` | `string` | - | Small extra line (date, role). |
|
|
65
|
+
| `avatarUrl` | `string` | - | Leading avatar image. |
|
|
66
|
+
| `iconTpl` | `TemplateRef<unknown>` | - | Leading icon; wins over `avatarUrl`. |
|
|
67
|
+
| `href` | `string` | - | Makes the title a link. |
|
|
68
|
+
| `badgeTpl` | `TemplateRef<unknown>` | - | Trailing badge. |
|
|
69
|
+
| `actionTpl` | `TemplateRef<unknown>` | - | Trailing action. |
|
|
70
|
+
| `ariaLabel` | `string` | - | Accessible name of the row (`aria-label` on the `<li>`). |
|
|
71
|
+
|
|
45
72
|
```typescript
|
|
46
73
|
interface IStackedListOptions {
|
|
47
74
|
title?: string;
|
|
48
75
|
description?: string;
|
|
49
76
|
items?: IStackedListItem[];
|
|
50
|
-
withDividers?: boolean;
|
|
51
|
-
fullWidthOnMobile?: boolean;
|
|
77
|
+
withDividers?: boolean; // preset only
|
|
78
|
+
fullWidthOnMobile?: boolean; // preset only
|
|
52
79
|
emptyTpl?: TemplateRef<unknown>;
|
|
53
80
|
footerTpl?: TemplateRef<unknown>;
|
|
54
81
|
}
|
|
@@ -67,13 +94,11 @@ interface IStackedListItem {
|
|
|
67
94
|
}
|
|
68
95
|
```
|
|
69
96
|
|
|
70
|
-
All properties are optional except `IStackedListItem.title`. The default `StackedListStandardComponent` renders every content property but ignores the `withDividers` and `fullWidthOnMobile` layout hints; `StackedListPresetComponent` honours them (see [Preset](#preset)). A section is rendered only when its template/string is provided. Within an item, `iconTpl` wins over `avatarUrl` when both are set.
|
|
71
|
-
|
|
72
97
|
## Preset
|
|
73
98
|
|
|
74
99
|
`StackedListPresetComponent` (selector `smart-stacked-list-preset`) is the styled skin used by the Storybook stories and the docs site. It extends `StackedListBaseComponent`, so it takes the same `options` and `cssClass` inputs.
|
|
75
100
|
|
|
76
|
-
It renders the Tailwind UI stacked list look in `smart:`-prefixed Tailwind v4 classes with a `smart:dark:` variant on every colour
|
|
101
|
+
It renders the Tailwind UI stacked list look in `smart:`-prefixed Tailwind v4 classes with a `smart:dark:` variant on every colour.
|
|
77
102
|
|
|
78
103
|
- **Header**: `text-base font-semibold` gray-900 / white title and a `text-sm` gray-500 / gray-400 description.
|
|
79
104
|
- **Rows**: `flex items-center justify-between gap-x-6 py-5`. The leading media is a `size-12` rounded-full avatar (`avatarUrl`) or a gray-100 / gray-800 rounded-full tile wrapping `iconTpl` (the icon template wins). The body shows the title (`text-sm/6 font-semibold`, rendered as a link with hover underline when `href` is set), a truncated `text-xs/5` description and a meta line. `badgeTpl` and `actionTpl` render in a trailing group.
|
|
@@ -81,14 +106,14 @@ It renders the Tailwind UI stacked list look in `smart:`-prefixed Tailwind v4 cl
|
|
|
81
106
|
- **Footer**: `footerTpl` renders under the list.
|
|
82
107
|
- **External class**: `cssClass` is appended to the root wrapper.
|
|
83
108
|
|
|
84
|
-
It honours both layout hints that the standard component ignores
|
|
109
|
+
It honours both layout hints that the standard component ignores, as the table shows.
|
|
85
110
|
|
|
86
111
|
| Option | Preset behaviour |
|
|
87
112
|
| ------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
88
113
|
| `withDividers` | `true` draws `divide-y` gray-100 / white-10 hairlines between rows. Unset or `false` separates rows by spacing only. |
|
|
89
114
|
| `fullWidthOnMobile` | `true` renders the list as a white / gray-900 card with a ring. Below `sm` it bleeds to the screen edge (`-mx-4`, square corners); from `sm` up it is a `rounded-xl` card. Rows get `px-4 sm:px-6` padding. |
|
|
90
115
|
|
|
91
|
-
|
|
116
|
+
Provide `StackedListPresetComponent` under `STACKED_LIST_STANDARD_COMPONENT_TOKEN` to restyle every `<smart-stacked-list>`, or register every preset of the library at once with `provideSmartPresets()`.
|
|
92
117
|
|
|
93
118
|
```typescript
|
|
94
119
|
import {
|
|
@@ -104,19 +129,17 @@ providers: [
|
|
|
104
129
|
];
|
|
105
130
|
```
|
|
106
131
|
|
|
107
|
-
> `
|
|
132
|
+
> `StackedListPresetComponent` declares `cssClass` as `input<string>('')` **without** the `class` alias. When you use the `<smart-stacked-list-preset>` selector directly, bind `[cssClass]`. On `<smart-stacked-list>` just pass `class` and the wrapper forwards it.
|
|
108
133
|
|
|
109
|
-
The class recipes
|
|
134
|
+
The class recipes are internal to the preset and not exported.
|
|
110
135
|
|
|
111
136
|
## STACKED_LIST_STANDARD_COMPONENT_TOKEN
|
|
112
137
|
|
|
138
|
+
InjectionToken that allows replacing the default `StackedListStandardComponent` with a custom implementation. Provide a component class extending `StackedListBaseComponent` under `STACKED_LIST_STANDARD_COMPONENT_TOKEN`; every `<smart-stacked-list>` below that injector renders it.
|
|
139
|
+
|
|
113
140
|
```typescript
|
|
114
141
|
import { STACKED_LIST_STANDARD_COMPONENT_TOKEN } from '@smartsoft001/angular';
|
|
115
|
-
```
|
|
116
142
|
|
|
117
|
-
InjectionToken that allows replacing the default `StackedListStandardComponent` with a custom implementation. Provide a `Type<StackedListBaseComponent>` to override.
|
|
118
|
-
|
|
119
|
-
```typescript
|
|
120
143
|
providers: [
|
|
121
144
|
{
|
|
122
145
|
provide: STACKED_LIST_STANDARD_COMPONENT_TOKEN,
|
|
@@ -132,7 +155,6 @@ import {
|
|
|
132
155
|
ChangeDetectionStrategy,
|
|
133
156
|
Component,
|
|
134
157
|
computed,
|
|
135
|
-
input,
|
|
136
158
|
ViewEncapsulation,
|
|
137
159
|
} from '@angular/core';
|
|
138
160
|
import { NgTemplateOutlet } from '@angular/common';
|
|
@@ -167,9 +189,6 @@ import { StackedListBaseComponent } from '@smartsoft001/angular';
|
|
|
167
189
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
168
190
|
})
|
|
169
191
|
export class MyCustomStackedListComponent extends StackedListBaseComponent {
|
|
170
|
-
// NgComponentOutlet passes 'cssClass' by canonical name, not the 'class' alias.
|
|
171
|
-
override cssClass = input<string>('');
|
|
172
|
-
|
|
173
192
|
containerClasses = computed(() => {
|
|
174
193
|
const classes = ['my-stacked-list'];
|
|
175
194
|
const extra = this.cssClass();
|
|
@@ -219,7 +238,7 @@ export class MyCustomStackedListComponent extends StackedListBaseComponent {
|
|
|
219
238
|
title: 'Lindsay Walton',
|
|
220
239
|
description: 'Front-end Developer',
|
|
221
240
|
meta: 'Joined 2026-01-12',
|
|
222
|
-
avatarUrl: '/img
|
|
241
|
+
avatarUrl: 'https://i.pravatar.cc/96?img=47',
|
|
223
242
|
badgeTpl: activeBadge,
|
|
224
243
|
},
|
|
225
244
|
],
|
|
@@ -228,7 +247,7 @@ export class MyCustomStackedListComponent extends StackedListBaseComponent {
|
|
|
228
247
|
|
|
229
248
|
<!-- With per-item action and footer -->
|
|
230
249
|
<ng-template #removeAction>
|
|
231
|
-
<button>Remove</button>
|
|
250
|
+
<smart-button [options]="removeButton">Remove</smart-button>
|
|
232
251
|
</ng-template>
|
|
233
252
|
|
|
234
253
|
<ng-template #footer>
|
|
@@ -17,17 +17,17 @@ The `<smart-stats>` component renders a list of statistic cards (label/value pai
|
|
|
17
17
|
|
|
18
18
|
### StatsComponent (`<smart-stats>`)
|
|
19
19
|
|
|
20
|
-
Main wrapper component. Renders `StatsStandardComponent` by default. When `STATS_STANDARD_COMPONENT_TOKEN` is provided, renders the injected component via `NgComponentOutlet
|
|
20
|
+
Main wrapper component. Renders `StatsStandardComponent` by default. When `STATS_STANDARD_COMPONENT_TOKEN` is provided, renders the injected component via `NgComponentOutlet` and hands it the `options` and `class` inputs.
|
|
21
21
|
|
|
22
22
|
### StatsStandardComponent (`<smart-stats-standard>`)
|
|
23
23
|
|
|
24
|
-
Barebones placeholder concrete implementation. Renders a wrapper `<div>` containing an optional `<h3 class="title">` and a `<dl>` with one `<div class="item">` per item. Each item renders an optional icon (`iconTpl` in `<div class="icon">`), label (`<dt class="label">`), value (`<dd class="value">`), optional previous value (`<dd class="previous">`), optional change with `data-trend` attribute (`<dd class="change">`), and optional action template (`actionTpl` in `<div class="action">`). The external `cssClass` is applied to the root wrapper. It does not include any visual 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 wrapper `<div>` containing an optional `<h3 class="title">` and a `<dl>` with one `<div class="item">` per item (with `aria-label` from the item's `ariaLabel`). Each item renders an optional icon (`iconTpl` in `<div class="icon">`), label (`<dt class="label">`), value (`<dd class="value">`), optional previous value (`<dd class="previous">`), optional change with `data-trend` attribute (`<dd class="change">`), and optional action template (`actionTpl` in `<div class="action">`). The external `cssClass` is applied to the root wrapper. It does not read `columns` and does not include any visual styling — it exists solely as the default structural placeholder until a custom implementation is registered through the token.
|
|
25
25
|
|
|
26
26
|
### StatsPresetComponent (`<smart-stats-preset>`)
|
|
27
27
|
|
|
28
|
-
Styled variation that extends `StatsBaseComponent` and is a drop-in replacement for `StatsStandardComponent`. Register it via `STATS_STANDARD_COMPONENT_TOKEN` to restyle every `<smart-stats>`, or use the `<smart-stats-preset>` selector directly. Renders the Preline "Three-Column Stats with Primary Accent" look: a responsive grid of stat blocks, each with an optional leading icon (`iconTpl`), a `label` heading, the big primary-accent `value` (with an optional inline `change` badge coloured by `trend` — green for `up`, red for `down`, gray for `neutral`/unset), an optional muted `previousValue` sub-line, and an optional `actionTpl`. Column count comes from `options.columns` (default `3`); an optional `options.title` renders as a heading above the grid. All classes are `smart:`-prefixed Tailwind with explicit `dark:` variants. The class recipes
|
|
28
|
+
Styled variation that extends `StatsBaseComponent` and is a drop-in replacement for `StatsStandardComponent`. Register it via `STATS_STANDARD_COMPONENT_TOKEN` (or every preset at once with `provideSmartPresets()`) to restyle every `<smart-stats>`, or use the `<smart-stats-preset>` selector directly. Renders the Preline "Three-Column Stats with Primary Accent" look: a responsive grid of stat blocks, each with an optional leading icon (`iconTpl`), a `label` heading, the big primary-accent `value` (with an optional inline `change` badge coloured by `trend` — green for `up`, red for `down`, gray for `neutral`/unset), an optional muted `previousValue` sub-line, and an optional `actionTpl`. Column count comes from `options.columns` (default `3`); an optional `options.title` renders as a heading above the grid. All classes are `smart:`-prefixed Tailwind with explicit `dark:` variants. The class recipes are internal to the preset and not exported.
|
|
29
29
|
|
|
30
|
-
>
|
|
30
|
+
> `StatsPresetComponent` declares `cssClass` as `input<string>('')` **without** the `class` alias. Bind it as `[cssClass]` when using the `<smart-stats-preset>` selector directly, or just pass `class` on `<smart-stats>` (the wrapper forwards it).
|
|
31
31
|
|
|
32
32
|
### StatsBaseComponent (abstract)
|
|
33
33
|
|
|
@@ -44,11 +44,32 @@ Abstract base directive for extending custom stats implementations. Exposes `opt
|
|
|
44
44
|
|
|
45
45
|
### IStatsOptions
|
|
46
46
|
|
|
47
|
+
| Field | Type | Default | Description |
|
|
48
|
+
| --------- | ------------------ | -------- | -------------------------------------------------------------------------------------------------------------------- |
|
|
49
|
+
| `title` | `string` | - | Heading above the stats (`<h3>` in the standard, `<h2>` in the preset). |
|
|
50
|
+
| `items` | `IStatItem[]` | required | The figures. |
|
|
51
|
+
| `columns` | `1 \| 2 \| 3 \| 4` | `3` | Preset only: the number of grid columns on wide screens (the grid collapses on small ones). The standard ignores it. |
|
|
52
|
+
|
|
53
|
+
### IStatItem
|
|
54
|
+
|
|
55
|
+
A part of an item is rendered only when its field is set.
|
|
56
|
+
|
|
57
|
+
| Field | Type | Default | Description |
|
|
58
|
+
| --------------- | ----------------------------- | -------- | -------------------------------------------------------------------------------------------------------------- |
|
|
59
|
+
| `label` | `string` | required | What the figure is. |
|
|
60
|
+
| `value` | `string \| number` | required | The figure. |
|
|
61
|
+
| `previousValue` | `string \| number` | - | A muted sub-line (previous value or context text). |
|
|
62
|
+
| `change` | `string` | - | The change text (e.g. `+4.75%`). |
|
|
63
|
+
| `trend` | `'up' \| 'down' \| 'neutral'` | - | The standard exposes it as `data-trend` on the change; the preset colours the change badge green, red or gray. |
|
|
64
|
+
| `iconTpl` | `TemplateRef<unknown>` | - | Leading icon. |
|
|
65
|
+
| `actionTpl` | `TemplateRef<unknown>` | - | An action (e.g. "View all"). |
|
|
66
|
+
| `ariaLabel` | `string` | - | Accessible name of the item. |
|
|
67
|
+
|
|
47
68
|
```typescript
|
|
48
69
|
interface IStatsOptions {
|
|
49
70
|
title?: string;
|
|
50
71
|
items: IStatItem[];
|
|
51
|
-
columns?: 1 | 2 | 3 | 4;
|
|
72
|
+
columns?: 1 | 2 | 3 | 4; // preset only
|
|
52
73
|
}
|
|
53
74
|
|
|
54
75
|
interface IStatItem {
|
|
@@ -63,17 +84,13 @@ interface IStatItem {
|
|
|
63
84
|
}
|
|
64
85
|
```
|
|
65
86
|
|
|
66
|
-
`items` is required. The default `StatsStandardComponent` consumes every property; a section is rendered only when its template/string is provided. The `trend` value is exposed via the `data-trend` attribute on `<dd class="change">` for downstream styling. `columns` is a hint for custom implementations to lay out the grid; the default placeholder ignores it.
|
|
67
|
-
|
|
68
87
|
## STATS_STANDARD_COMPONENT_TOKEN
|
|
69
88
|
|
|
89
|
+
InjectionToken that allows replacing the default `StatsStandardComponent` with a custom implementation. Provide a component class extending `StatsBaseComponent` under `STATS_STANDARD_COMPONENT_TOKEN`; every `<smart-stats>` below that injector renders it.
|
|
90
|
+
|
|
70
91
|
```typescript
|
|
71
92
|
import { STATS_STANDARD_COMPONENT_TOKEN } from '@smartsoft001/angular';
|
|
72
|
-
```
|
|
73
|
-
|
|
74
|
-
InjectionToken that allows replacing the default `StatsStandardComponent` with a custom implementation. Provide a `Type<StatsBaseComponent>` to override.
|
|
75
93
|
|
|
76
|
-
```typescript
|
|
77
94
|
providers: [
|
|
78
95
|
{
|
|
79
96
|
provide: STATS_STANDARD_COMPONENT_TOKEN,
|
|
@@ -89,7 +106,6 @@ import {
|
|
|
89
106
|
ChangeDetectionStrategy,
|
|
90
107
|
Component,
|
|
91
108
|
computed,
|
|
92
|
-
input,
|
|
93
109
|
ViewEncapsulation,
|
|
94
110
|
} from '@angular/core';
|
|
95
111
|
import { NgTemplateOutlet } from '@angular/common';
|
|
@@ -121,9 +137,6 @@ import { StatsBaseComponent } from '@smartsoft001/angular';
|
|
|
121
137
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
122
138
|
})
|
|
123
139
|
export class MyCustomStatsComponent extends StatsBaseComponent {
|
|
124
|
-
// NgComponentOutlet passes 'cssClass' by canonical name, not the 'class' alias.
|
|
125
|
-
override cssClass = input<string>('');
|
|
126
|
-
|
|
127
140
|
containerClasses = computed(() => {
|
|
128
141
|
const classes = ['my-stats'];
|
|
129
142
|
const extra = this.cssClass();
|
|
@@ -17,11 +17,11 @@ The `<smart-table>` component renders a tabular data view with optional title, d
|
|
|
17
17
|
|
|
18
18
|
### TableComponent (`<smart-table>`)
|
|
19
19
|
|
|
20
|
-
Main wrapper component. Renders `TableStandardComponent` by default. When `TABLE_STANDARD_COMPONENT_TOKEN` is provided, renders the injected component via `NgComponentOutlet
|
|
20
|
+
Main wrapper component. Renders `TableStandardComponent` by default. When `TABLE_STANDARD_COMPONENT_TOKEN` is provided, renders the injected component via `NgComponentOutlet` and hands it the `options` and `class` inputs.
|
|
21
21
|
|
|
22
22
|
### TableStandardComponent (`<smart-table-standard>`)
|
|
23
23
|
|
|
24
|
-
Barebones placeholder concrete implementation. Renders a wrapper `<div>` containing an optional `<h3 class="title">`, optional `<p class="description">`, optional toolbar slot, and a `<table>` with `<thead>` (one `<th>` per column) and `<tbody>` (one `<tr>` per row, one `<td>` per column reading the value via `row[col.key]`). When `withCheckboxes` is set, an extra
|
|
24
|
+
Barebones placeholder concrete implementation. Renders a wrapper `<div>` containing an optional `<h3 class="title">`, optional `<p class="description">`, optional toolbar slot, and — only when there is at least one column — a `<table>` with `<thead>` (one `<th>` per column, with the column `label` or, without it, the `key`, and the column's `ariaLabel` and `data-align`) and `<tbody>` (one `<tr>` per row, one `<td>` per column reading the value via `row[col.key]`). When `withCheckboxes` is set, an extra column of plain, unbound checkboxes is rendered before all data columns. Per-column `cellTpl` (context `{ $implicit: row, column }`) and `headerTpl` templates override the default text rendering. When `rows` is empty and `emptyTpl` is provided, the empty template is rendered as a single full-width row. A bottom `footerTpl` renders inside `<div class="footer">`. The external `cssClass` is applied to the root wrapper. It does not include any visual styling — it exists solely as the default structural placeholder until a custom implementation is registered through the token.
|
|
25
25
|
|
|
26
26
|
### TablePresetComponent (`<smart-table-preset>`)
|
|
27
27
|
|
|
@@ -42,16 +42,44 @@ Abstract base directive for extending custom table implementations. Exposes `opt
|
|
|
42
42
|
|
|
43
43
|
### ITableOptions
|
|
44
44
|
|
|
45
|
+
All properties are optional except `ITableColumn.key`. A section is rendered only when its template/string is provided.
|
|
46
|
+
|
|
47
|
+
| Field | Type | Default | Description |
|
|
48
|
+
| ---------------- | ---------------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------- |
|
|
49
|
+
| `title` | `string` | - | Heading above the table. |
|
|
50
|
+
| `description` | `string` | - | Text under the heading. |
|
|
51
|
+
| `toolbarTpl` | `TemplateRef<unknown>` | - | A slot above the table (filters, buttons). |
|
|
52
|
+
| `columns` | `ITableColumn[]` | `[]` | The columns; without any, no `<table>` is rendered. |
|
|
53
|
+
| `rows` | `TableRow[]` | `[]` | The rows, as records (`Record<string, unknown>`). |
|
|
54
|
+
| `withCheckboxes` | `boolean` | - | A checkbox column: plain, unbound inputs in the standard; select-all and row highlight in the preset (internal state, no outputs). |
|
|
55
|
+
| `emptyTpl` | `TemplateRef<unknown>` | - | A full-width row shown when there are no rows. |
|
|
56
|
+
| `footerTpl` | `TemplateRef<unknown>` | - | A slot below the table. |
|
|
57
|
+
| `striped` | `boolean` | - | Preset only: zebra rows. The standard ignores it. |
|
|
58
|
+
| `stickyHeader` | `boolean` | - | Preset only: the body scrolls under a sticky header. The standard ignores it. |
|
|
59
|
+
| `withBorder` | `boolean` | - | Preset only: a bordered card frame. The standard ignores it. |
|
|
60
|
+
|
|
61
|
+
### ITableColumn
|
|
62
|
+
|
|
63
|
+
| Field | Type | Default | Description |
|
|
64
|
+
| ----------- | ------------------------------- | -------- | ------------------------------------------------------------------------------------------ |
|
|
65
|
+
| `key` | `string` | required | The row field shown in the column. |
|
|
66
|
+
| `label` | `string` | `key` | Header text. |
|
|
67
|
+
| `align` | `'left' \| 'center' \| 'right'` | `'left'` | The standard only sets `data-align`; the preset aligns the header and the body cells. |
|
|
68
|
+
| `sortable` | `boolean` | - | Preset only: a header button that sorts the rows client-side (internal state, no outputs). |
|
|
69
|
+
| `cellTpl` | `TemplateRef<unknown>` | - | Body cell content, with the context `{ $implicit: row, column }`. |
|
|
70
|
+
| `headerTpl` | `TemplateRef<unknown>` | - | Header content; wins over `label`. |
|
|
71
|
+
| `ariaLabel` | `string` | - | Accessible name of the header cell. |
|
|
72
|
+
|
|
45
73
|
```typescript
|
|
46
74
|
interface ITableOptions {
|
|
47
75
|
title?: string;
|
|
48
76
|
description?: string;
|
|
49
77
|
columns?: ITableColumn[];
|
|
50
78
|
rows?: TableRow[];
|
|
51
|
-
striped?: boolean;
|
|
52
|
-
stickyHeader?: boolean;
|
|
79
|
+
striped?: boolean; // preset only
|
|
80
|
+
stickyHeader?: boolean; // preset only
|
|
53
81
|
withCheckboxes?: boolean;
|
|
54
|
-
withBorder?: boolean;
|
|
82
|
+
withBorder?: boolean; // preset only
|
|
55
83
|
emptyTpl?: TemplateRef<unknown>;
|
|
56
84
|
footerTpl?: TemplateRef<unknown>;
|
|
57
85
|
toolbarTpl?: TemplateRef<unknown>;
|
|
@@ -61,8 +89,8 @@ interface ITableColumn {
|
|
|
61
89
|
key: string;
|
|
62
90
|
label?: string;
|
|
63
91
|
align?: 'left' | 'center' | 'right';
|
|
64
|
-
sortable?: boolean;
|
|
65
|
-
cellTpl?: TemplateRef<unknown>;
|
|
92
|
+
sortable?: boolean; // preset only
|
|
93
|
+
cellTpl?: TemplateRef<unknown>; // context: { $implicit: row, column }
|
|
66
94
|
headerTpl?: TemplateRef<unknown>;
|
|
67
95
|
ariaLabel?: string;
|
|
68
96
|
}
|
|
@@ -70,17 +98,13 @@ interface ITableColumn {
|
|
|
70
98
|
type TableRow = Record<string, unknown>;
|
|
71
99
|
```
|
|
72
100
|
|
|
73
|
-
All properties are optional except `ITableColumn.key`. The default `TableStandardComponent` consumes every property; a section is rendered only when its template/string is provided. `striped`, `stickyHeader`, `withBorder`, `align` and `sortable` are layout hints: the standard placeholder ignores them visually (it only sets `data-align`), while `TablePresetComponent` honours every one of them (see [Preset](#preset)).
|
|
74
|
-
|
|
75
101
|
## TABLE_STANDARD_COMPONENT_TOKEN
|
|
76
102
|
|
|
103
|
+
InjectionToken that allows replacing the default `TableStandardComponent` with a custom implementation. Provide a component class extending `TableBaseComponent` under `TABLE_STANDARD_COMPONENT_TOKEN`; every `<smart-table>` below that injector renders it.
|
|
104
|
+
|
|
77
105
|
```typescript
|
|
78
106
|
import { TABLE_STANDARD_COMPONENT_TOKEN } from '@smartsoft001/angular';
|
|
79
|
-
```
|
|
80
107
|
|
|
81
|
-
InjectionToken that allows replacing the default `TableStandardComponent` with a custom implementation. Provide a `Type<TableBaseComponent>` to override.
|
|
82
|
-
|
|
83
|
-
```typescript
|
|
84
108
|
providers: [
|
|
85
109
|
{
|
|
86
110
|
provide: TABLE_STANDARD_COMPONENT_TOKEN,
|
|
@@ -91,9 +115,9 @@ providers: [
|
|
|
91
115
|
|
|
92
116
|
## Preset
|
|
93
117
|
|
|
94
|
-
`TablePresetComponent` (`<smart-table-preset>`) extends `TableBaseComponent`, so it takes the same `options` input, and it renders everything the standard component renders in the Tailwind UI table look. Every class carries the `smart:` prefix and has an explicit `smart:dark:*` twin. The class recipes
|
|
118
|
+
`TablePresetComponent` (`<smart-table-preset>`) extends `TableBaseComponent`, so it takes the same `options` input, and it renders everything the standard component renders in the Tailwind UI table look. Every class carries the `smart:` prefix and has an explicit `smart:dark:*` twin. The class recipes are internal to the preset and not exported.
|
|
95
119
|
|
|
96
|
-
|
|
120
|
+
It styles the parts listed below.
|
|
97
121
|
|
|
98
122
|
- **Header** (`data-role="header"`, only rendered when there is a title, description or toolbar). The title is an `<h3>` with `text-base font-semibold text-gray-900 dark:text-white`. The description uses `text-sm text-gray-500 dark:text-gray-400`. `toolbarTpl` sits on the right of the header on `sm+` screens.
|
|
99
123
|
- **Table.** `min-w-full divide-y divide-gray-300 dark:divide-white/15`. Header cells use `text-sm font-semibold text-gray-900 dark:text-white`. Body cells use `whitespace-nowrap text-sm`: the first data column is emphasised (`font-medium text-gray-900 dark:text-white`) and the rest are muted (`text-gray-500 dark:text-gray-400`).
|
|
@@ -101,7 +125,7 @@ What it styles:
|
|
|
101
125
|
- **Slots.** `cellTpl` gets `{ $implicit: row, column }`. `headerTpl` replaces the label. `emptyTpl` renders in a centred row that spans every column (checkbox column included). `footerTpl` renders under the table.
|
|
102
126
|
- **External class.** Merged onto the root `<div>` next to `w-full`.
|
|
103
127
|
|
|
104
|
-
The options the standard component ignores, which the preset honours
|
|
128
|
+
The table lists the options the standard component ignores, which the preset honours.
|
|
105
129
|
|
|
106
130
|
| Option | Preset rendering |
|
|
107
131
|
| ----------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
@@ -114,9 +138,9 @@ The options the standard component ignores, which the preset honours:
|
|
|
114
138
|
|
|
115
139
|
The flags combine freely (for example striped + bordered + sortable + checkboxes).
|
|
116
140
|
|
|
117
|
-
|
|
141
|
+
The preset declares `cssClass` without the inherited `class` alias. Pass `class` on `<smart-table>` as usual, or bind `[cssClass]` when you use `<smart-table-preset>` directly.
|
|
118
142
|
|
|
119
|
-
|
|
143
|
+
Provide `TablePresetComponent` under `TABLE_STANDARD_COMPONENT_TOKEN` to restyle every `<smart-table>`, or register every preset of the library at once with `provideSmartPresets()`.
|
|
120
144
|
|
|
121
145
|
```typescript
|
|
122
146
|
import {
|
|
@@ -141,7 +165,6 @@ import {
|
|
|
141
165
|
ChangeDetectionStrategy,
|
|
142
166
|
Component,
|
|
143
167
|
computed,
|
|
144
|
-
input,
|
|
145
168
|
ViewEncapsulation,
|
|
146
169
|
} from '@angular/core';
|
|
147
170
|
import { NgTemplateOutlet } from '@angular/common';
|
|
@@ -180,9 +203,6 @@ import { TableBaseComponent } from '@smartsoft001/angular';
|
|
|
180
203
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
181
204
|
})
|
|
182
205
|
export class MyCustomTableComponent extends TableBaseComponent {
|
|
183
|
-
// NgComponentOutlet passes 'cssClass' by canonical name, not the 'class' alias.
|
|
184
|
-
override cssClass = input<string>('');
|
|
185
|
-
|
|
186
206
|
containerClasses = computed(() => {
|
|
187
207
|
const classes = ['my-table'];
|
|
188
208
|
const extra = this.cssClass();
|