@smartsoft001/claude-plugins 2.201.0 → 2.202.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/plugins/smart-angular/.claude-plugin/plugin.json +1 -1
- package/plugins/smart-angular/skills/angular-components-accordion/SKILL.md +84 -80
- package/plugins/smart-angular/skills/angular-components-action-panel/SKILL.md +35 -60
- package/plugins/smart-angular/skills/angular-components-alert/SKILL.md +24 -29
- package/plugins/smart-angular/skills/angular-components-avatar/SKILL.md +30 -30
- package/plugins/smart-angular/skills/angular-components-badge/SKILL.md +18 -12
- package/plugins/smart-angular/skills/angular-components-breadcrumbs/SKILL.md +27 -10
- package/plugins/smart-angular/skills/angular-components-button/SKILL.md +43 -17
- package/plugins/smart-angular/skills/angular-components-button-group/SKILL.md +26 -14
- package/plugins/smart-angular/skills/angular-components-calendar/SKILL.md +47 -28
- package/plugins/smart-angular/skills/angular-components-card/SKILL.md +29 -22
- package/plugins/smart-angular/skills/angular-components-card-heading/SKILL.md +24 -18
- package/plugins/smart-angular/skills/angular-components-command-palette/SKILL.md +41 -32
- package/plugins/smart-angular/skills/angular-components-container/SKILL.md +21 -20
- package/plugins/smart-angular/skills/angular-components-date-edit/SKILL.md +48 -45
- package/plugins/smart-angular/skills/angular-components-date-range/SKILL.md +72 -82
- package/plugins/smart-angular/skills/angular-components-description-list/SKILL.md +23 -10
- package/plugins/smart-angular/skills/angular-components-detail/SKILL.md +20 -8
- package/plugins/smart-angular/skills/angular-components-details/SKILL.md +35 -12
- package/plugins/smart-angular/skills/angular-components-divider/SKILL.md +36 -18
- package/plugins/smart-angular/skills/angular-components-drawer/SKILL.md +28 -23
- package/plugins/smart-angular/skills/angular-components-dropdown/SKILL.md +35 -16
- package/plugins/smart-angular/skills/angular-components-empty-state/SKILL.md +49 -11
- package/plugins/smart-angular/skills/angular-components-feed/SKILL.md +45 -12
- package/plugins/smart-angular/skills/angular-components-form/SKILL.md +53 -25
- package/plugins/smart-angular/skills/angular-components-grid-list/SKILL.md +37 -13
- package/plugins/smart-angular/skills/angular-components-icon/SKILL.md +8 -8
- package/plugins/smart-angular/skills/angular-components-info/SKILL.md +19 -15
- package/plugins/smart-angular/skills/angular-components-input/SKILL.md +78 -49
- package/plugins/smart-angular/skills/angular-components-list/SKILL.md +85 -78
- package/plugins/smart-angular/skills/angular-components-list-container/SKILL.md +24 -32
- package/plugins/smart-angular/skills/angular-components-media-object/SKILL.md +19 -17
- package/plugins/smart-angular/skills/angular-components-modal/SKILL.md +23 -16
- package/plugins/smart-angular/skills/angular-components-multi-column-layout/SKILL.md +19 -16
- package/plugins/smart-angular/skills/angular-components-navbar/SKILL.md +38 -21
- package/plugins/smart-angular/skills/angular-components-notification/SKILL.md +32 -33
- package/plugins/smart-angular/skills/angular-components-page/SKILL.md +46 -52
- package/plugins/smart-angular/skills/angular-components-page-heading/SKILL.md +42 -25
- package/plugins/smart-angular/skills/angular-components-paging/SKILL.md +17 -15
- package/plugins/smart-angular/skills/angular-components-password-strength/SKILL.md +21 -19
- package/plugins/smart-angular/skills/angular-components-progress-bars/SKILL.md +61 -24
- package/plugins/smart-angular/skills/angular-components-searchbar/SKILL.md +30 -37
- package/plugins/smart-angular/skills/angular-components-section-heading/SKILL.md +38 -27
- package/plugins/smart-angular/skills/angular-components-select-menu/SKILL.md +33 -17
- package/plugins/smart-angular/skills/angular-components-sidebar-layout/SKILL.md +30 -26
- package/plugins/smart-angular/skills/angular-components-sidebar-navigation/SKILL.md +79 -16
- package/plugins/smart-angular/skills/angular-components-sign-in-form/SKILL.md +64 -24
- package/plugins/smart-angular/skills/angular-components-stacked-layout/SKILL.md +24 -23
- package/plugins/smart-angular/skills/angular-components-stacked-list/SKILL.md +40 -21
- package/plugins/smart-angular/skills/angular-components-stats/SKILL.md +28 -15
- package/plugins/smart-angular/skills/angular-components-table/SKILL.md +42 -22
- package/plugins/smart-angular/skills/angular-components-tabs/SKILL.md +37 -13
- package/plugins/smart-angular/skills/angular-components-textarea/SKILL.md +48 -46
- package/plugins/smart-angular/skills/angular-components-toggle/SKILL.md +21 -28
- package/plugins/smart-angular/skills/angular-components-vertical-navigation/SKILL.md +66 -24
- package/plugins/smart-core/.claude-plugin/plugin.json +1 -1
- package/plugins/smart-react/.claude-plugin/plugin.json +1 -1
- package/plugins/smart-react/skills/react-components-action-panel/SKILL.md +13 -13
- package/plugins/smart-react/skills/react-components-alert/SKILL.md +2 -2
- package/plugins/smart-react/skills/react-components-avatar/SKILL.md +11 -11
- package/plugins/smart-react/skills/react-components-badge/SKILL.md +2 -2
- package/plugins/smart-react/skills/react-components-breadcrumbs/SKILL.md +7 -7
- package/plugins/smart-react/skills/react-components-button/SKILL.md +20 -20
- package/plugins/smart-react/skills/react-components-button-group/SKILL.md +2 -2
- package/plugins/smart-react/skills/react-components-calendar/SKILL.md +13 -13
- package/plugins/smart-react/skills/react-components-card/SKILL.md +1 -1
- package/plugins/smart-react/skills/react-components-card-heading/SKILL.md +2 -2
- package/plugins/smart-react/skills/react-components-command-palette/SKILL.md +3 -3
- package/plugins/smart-react/skills/react-components-container/SKILL.md +6 -6
- package/plugins/smart-react/skills/react-components-date-edit/SKILL.md +1 -1
- package/plugins/smart-react/skills/react-components-date-range/SKILL.md +4 -4
- package/plugins/smart-react/skills/react-components-description-list/SKILL.md +1 -1
- package/plugins/smart-react/skills/react-components-detail/SKILL.md +25 -16
- package/plugins/smart-react/skills/react-components-details/SKILL.md +10 -10
- package/plugins/smart-react/skills/react-components-divider/SKILL.md +6 -6
- package/plugins/smart-react/skills/react-components-drawer/SKILL.md +1 -1
- package/plugins/smart-react/skills/react-components-dropdown/SKILL.md +1 -1
- package/plugins/smart-react/skills/react-components-empty-state/SKILL.md +1 -1
- package/plugins/smart-react/skills/react-components-feed/SKILL.md +1 -1
- package/plugins/smart-react/skills/react-components-grid-list/SKILL.md +1 -1
- package/plugins/smart-react/skills/react-components-info/SKILL.md +3 -1
- package/plugins/smart-react/skills/react-components-input/SKILL.md +41 -17
- package/plugins/smart-react/skills/react-components-list/SKILL.md +34 -31
- package/plugins/smart-react/skills/react-components-list-container/SKILL.md +6 -6
- package/plugins/smart-react/skills/react-components-loader/SKILL.md +1 -1
- package/plugins/smart-react/skills/react-components-media-object/SKILL.md +1 -1
- package/plugins/smart-react/skills/react-components-modal/SKILL.md +8 -8
- package/plugins/smart-react/skills/react-components-multi-column-layout/SKILL.md +1 -1
- package/plugins/smart-react/skills/react-components-navbar/SKILL.md +1 -1
- package/plugins/smart-react/skills/react-components-notification/SKILL.md +9 -9
- package/plugins/smart-react/skills/react-components-page-heading/SKILL.md +6 -6
- package/plugins/smart-react/skills/react-components-paging/SKILL.md +28 -28
- package/plugins/smart-react/skills/react-components-password-strength/SKILL.md +4 -4
- package/plugins/smart-react/skills/react-components-progress-bars/SKILL.md +19 -19
- package/plugins/smart-react/skills/react-components-searchbar/SKILL.md +10 -10
- package/plugins/smart-react/skills/react-components-section-heading/SKILL.md +13 -13
- package/plugins/smart-react/skills/react-components-select-menu/SKILL.md +19 -19
- package/plugins/smart-react/skills/react-components-sidebar-layout/SKILL.md +9 -9
- package/plugins/smart-react/skills/react-components-sidebar-navigation/SKILL.md +29 -29
- package/plugins/smart-react/skills/react-components-sign-in-form/SKILL.md +3 -3
- package/plugins/smart-react/skills/react-components-stacked-layout/SKILL.md +1 -1
- package/plugins/smart-react/skills/react-components-stacked-list/SKILL.md +2 -2
- package/plugins/smart-react/skills/react-components-stats/SKILL.md +2 -2
- package/plugins/smart-react/skills/react-components-table/SKILL.md +1 -1
- package/plugins/smart-react/skills/react-components-tabs/SKILL.md +2 -2
- package/plugins/smart-react/skills/react-components-textarea/SKILL.md +8 -8
- package/plugins/smart-react/skills/react-components-toggle/SKILL.md +3 -2
- package/plugins/smart-react/skills/react-components-vertical-navigation/SKILL.md +7 -7
|
@@ -53,13 +53,22 @@ Abstract base directive for all detail sub-components. Provides:
|
|
|
53
53
|
|
|
54
54
|
### DetailComponent Inputs
|
|
55
55
|
|
|
56
|
-
| Input | Type | Default | Description
|
|
57
|
-
| --------- | --------------------------------------------- | -------- |
|
|
58
|
-
| `options` | `InputSignal<IDetailOptions<T> \| undefined>` | required | Field configuration
|
|
59
|
-
| `type` | `InputSignal<any>` | required | Model class (used by `ModelLabelPipe`)
|
|
56
|
+
| Input | Type | Default | Description |
|
|
57
|
+
| --------- | --------------------------------------------- | -------- | --------------------------------------------------------------------------------------------------------------- |
|
|
58
|
+
| `options` | `InputSignal<IDetailOptions<T> \| undefined>` | required | Field configuration |
|
|
59
|
+
| `type` | `InputSignal<any>` | required | Model class (used by `ModelLabelPipe`) |
|
|
60
|
+
| `class` | `InputSignal<string>` | `''` | Classes forwarded to the field sub-component (`cssClass` input, alias `class`); the host is `display: contents` |
|
|
60
61
|
|
|
61
62
|
### IDetailOptions
|
|
62
63
|
|
|
64
|
+
| Field | Type | Default | Description |
|
|
65
|
+
| ---------- | ----------------- | -------- | -------------------------------------------------------------------------------------------------------------------------- |
|
|
66
|
+
| `key` | `string` | required | The field key. |
|
|
67
|
+
| `item` | `Signal<T>` | - | The record. While it is missing or returns nothing, the wrapper shows a skeleton instead of the value. |
|
|
68
|
+
| `options` | `IFieldOptions` | required | The field's `@Field` options: `type` picks the sub-component (`text` when unset or unmapped), `info` adds an info tooltip. |
|
|
69
|
+
| `cellPipe` | `ICellPipe<T>` | - | Formats the value. Read by the `text` and `phoneNumberPl` sub-components (standard and preset). |
|
|
70
|
+
| `loading` | `Signal<boolean>` | - | Not read by the built-in implementations; available to a custom implementation. |
|
|
71
|
+
|
|
63
72
|
```typescript
|
|
64
73
|
interface IDetailOptions<T> {
|
|
65
74
|
key: string;
|
|
@@ -70,7 +79,7 @@ interface IDetailOptions<T> {
|
|
|
70
79
|
}
|
|
71
80
|
```
|
|
72
81
|
|
|
73
|
-
|
|
82
|
+
`IFieldOptions` comes from `@smartsoft001/models` (the `@Field` decorator options); the wrapper reads its `type` and `info`.
|
|
74
83
|
|
|
75
84
|
### DETAIL_FIELD_COMPONENTS_TOKEN
|
|
76
85
|
|
|
@@ -105,7 +114,8 @@ URLs are removed, while basic formatting (`<b>`, `<em>`, `<a href="https://...">
|
|
|
105
114
|
The sanitizer also strips inline `style` attributes, for example the colours and alignment the
|
|
106
115
|
rich-text editor writes. A consumer who needs raw HTML for a field it trusts can return `SafeHtml`
|
|
107
116
|
from its own `cellPipe` (`ICellPipe.transform` is typed as `string`, so cast the result). A
|
|
108
|
-
tested version lives in
|
|
117
|
+
tested version, `TrustedDescriptionCellPipe`, lives in
|
|
118
|
+
`docs/examples/angular/src/components/detail/trusted-html.example.ts`.
|
|
109
119
|
|
|
110
120
|
```typescript
|
|
111
121
|
@Injectable()
|
|
@@ -145,7 +155,9 @@ Fifteen field types ship a Preline-styled **preset** (`Detail<Field>PresetCompon
|
|
|
145
155
|
| `object` | `DetailObjectPresetComponent` | Card envelope around the untouched nested details |
|
|
146
156
|
| `array` | `DetailArrayPresetComponent` | `space-y-2` stack of item cards; em-dash when empty |
|
|
147
157
|
|
|
148
|
-
Apply them
|
|
158
|
+
Apply them all by providing the ready-made partial map `DETAIL_PRESET_FIELD_COMPONENTS` for
|
|
159
|
+
`DETAIL_FIELD_COMPONENTS_TOKEN`, or register every preset of the library at once with
|
|
160
|
+
`provideSmartPresets()`.
|
|
149
161
|
|
|
150
162
|
```typescript
|
|
151
163
|
import {
|
|
@@ -161,7 +173,7 @@ providers: [
|
|
|
161
173
|
];
|
|
162
174
|
```
|
|
163
175
|
|
|
164
|
-
Notes:
|
|
176
|
+
Notes on the preset map:
|
|
165
177
|
|
|
166
178
|
- The map is partial — all other field types keep their standard components (maps merge over `baseMap`).
|
|
167
179
|
Registering `text` in the map does NOT change the fallback for unmapped/unknown types — the map is
|
|
@@ -18,7 +18,7 @@ The `<smart-details>` component renders a list of model fields decorated with `@
|
|
|
18
18
|
|
|
19
19
|
### DetailsComponent (`<smart-details>`)
|
|
20
20
|
|
|
21
|
-
Main wrapper. Renders `DetailsStandardComponent` by default. When `DETAILS_STANDARD_COMPONENT_TOKEN` is provided, renders the injected component via `NgComponentOutlet`, passing `options` and `class` as inputs.
|
|
21
|
+
Main wrapper. Renders `DetailsStandardComponent` by default. When `DETAILS_STANDARD_COMPONENT_TOKEN` is provided, renders the injected component via `NgComponentOutlet`, passing `options` and the `class` value as inputs (under `class` when the component keeps the base's alias, `cssClass` when it redeclares the input).
|
|
22
22
|
|
|
23
23
|
### DetailsStandardComponent (`<smart-details-standard>`)
|
|
24
24
|
|
|
@@ -26,25 +26,48 @@ Default concrete implementation. Generic Tailwind-styled `<dl>` placeholder that
|
|
|
26
26
|
|
|
27
27
|
### DetailsBaseComponent (abstract)
|
|
28
28
|
|
|
29
|
-
Abstract base directive.
|
|
29
|
+
Abstract base directive. Extend it to build custom details implementations. It exposes:
|
|
30
|
+
|
|
31
|
+
- `fields`: the fields of `options.type` marked `@Field({ details })`, without those whose `details.permissions` the user lacks and those whose `enabled` specification (`details.enabled`, else the field's `enabled`) the item fails; a specification can refer to the outermost details' item as `$root`
|
|
32
|
+
- `type`: `options.type`
|
|
33
|
+
- `item`: a `Signal` of `options.item()` converted to an instance of `options.type`
|
|
34
|
+
- `loading`: `options.loading`
|
|
35
|
+
- `cellPipe`: a `WritableSignal` of `options.cellPipe` (`null` without one)
|
|
36
|
+
- `componentFactories`: `options.componentFactories` (`null` without them), created in the `#topTpl` / `#bottomTpl` view containers of the template
|
|
30
37
|
|
|
31
38
|
## API
|
|
32
39
|
|
|
33
40
|
### Inputs
|
|
34
41
|
|
|
35
|
-
| Input | Type
|
|
36
|
-
| --------- |
|
|
37
|
-
| `options` | `InputSignal<IDetailsOptions<T
|
|
38
|
-
| `class` | `InputSignal<string>`
|
|
42
|
+
| Input | Type | Default | Description |
|
|
43
|
+
| --------- | ---------------------------------------------- | ----------- | ---------------------------------------------------------- |
|
|
44
|
+
| `options` | `InputSignal<IDetailsOptions<T> \| undefined>` | `undefined` | Details configuration |
|
|
45
|
+
| `class` | `InputSignal<string>` | `''` | Classes on the container (`cssClass` input, alias `class`) |
|
|
39
46
|
|
|
40
47
|
### IDetailsOptions
|
|
41
48
|
|
|
49
|
+
| Field | Type | Default | Description |
|
|
50
|
+
| -------------------- | -------------------------------- | -------- | ----------------------------------------------------------------------------------------------------------------- |
|
|
51
|
+
| `type` | `any` | required | The `@Model` class whose `details` fields are shown. |
|
|
52
|
+
| `item` | `Signal<T>` | required | The record (a plain object is converted to `type`); while it returns nothing the fields show skeletons. |
|
|
53
|
+
| `cellPipe` | `ICellPipe<T>` | - | Formats the values of the `text` and `phoneNumberPl` fields (see `angular-components-detail`). |
|
|
54
|
+
| `componentFactories` | `IDetailsComponentFactories<T>` | - | Components created above (`top`) and below (`bottom`) the fields. |
|
|
55
|
+
| `loading` | `Signal<boolean>` | - | Passed to every `<smart-detail>`; not read by the built-in implementations; available to a custom implementation. |
|
|
56
|
+
| `title` | `string` | - | Not read by `<smart-details>`; `DetailsPage` uses it as the page title. |
|
|
57
|
+
| `itemHandler` | `((id: string) => void) \| null` | - | Not read by `<smart-details>`; `DetailsPage` adds a forward button that calls it with the item's `id`. |
|
|
58
|
+
| `removeHandler` | `((item: T) => void) \| null` | - | Not read by `<smart-details>`; `DetailsPage` adds a remove button that calls it with the item. |
|
|
59
|
+
|
|
60
|
+
`IDetailsComponentFactories<T>` has two optional fields, `top` and `bottom`, each a `Type<any>` created without inputs.
|
|
61
|
+
|
|
42
62
|
```typescript
|
|
43
|
-
interface IDetailsOptions<T
|
|
63
|
+
interface IDetailsOptions<T extends IEntity<string>> {
|
|
64
|
+
title?: string;
|
|
65
|
+
cellPipe?: ICellPipe<T>;
|
|
44
66
|
type: any; // Model class (decorated with @Model)
|
|
45
|
-
item: Signal<T
|
|
67
|
+
item: Signal<T>;
|
|
46
68
|
loading?: Signal<boolean>;
|
|
47
|
-
|
|
69
|
+
itemHandler?: ((id: string) => void) | null;
|
|
70
|
+
removeHandler?: ((item: T) => void) | null;
|
|
48
71
|
componentFactories?: IDetailsComponentFactories<T>;
|
|
49
72
|
}
|
|
50
73
|
```
|
|
@@ -55,7 +78,7 @@ interface IDetailsOptions<T> {
|
|
|
55
78
|
import { DETAILS_STANDARD_COMPONENT_TOKEN } from '@smartsoft001/angular';
|
|
56
79
|
```
|
|
57
80
|
|
|
58
|
-
InjectionToken that allows replacing the default `DetailsStandardComponent` with a custom implementation. Provide a `Type<DetailsBaseComponent<T>>`.
|
|
81
|
+
InjectionToken that allows replacing the default `DetailsStandardComponent` with a custom implementation. Provide a `Type<DetailsBaseComponent<T>>`. There is no details preset: the field values follow the detail field components (`DETAIL_PRESET_FIELD_COMPONENTS`, registered by `provideSmartPresets()`).
|
|
59
82
|
|
|
60
83
|
```typescript
|
|
61
84
|
providers: [
|
|
@@ -103,9 +126,9 @@ export class MyCustomDetailsComponent extends DetailsBaseComponent<any> {}
|
|
|
103
126
|
[options]="{ type: UserModel, item: userSignal }"
|
|
104
127
|
></smart-details>
|
|
105
128
|
|
|
106
|
-
<!--
|
|
129
|
+
<!-- Skeletons while the item is not loaded yet -->
|
|
107
130
|
<smart-details
|
|
108
|
-
[options]="{ type: UserModel, item:
|
|
131
|
+
[options]="{ type: UserModel, item: userOrUndefinedSignal }"
|
|
109
132
|
></smart-details>
|
|
110
133
|
```
|
|
111
134
|
|
|
@@ -25,11 +25,16 @@ Default concrete implementation. Renders a `<div role="separator">` host with op
|
|
|
25
25
|
|
|
26
26
|
### DividerPresetComponent (`<smart-divider-preset>`)
|
|
27
27
|
|
|
28
|
-
Styled variation that extends `DividerBaseComponent` and is a drop-in replacement for `DividerStandardComponent`. Register it
|
|
28
|
+
Styled variation that extends `DividerBaseComponent` and is a drop-in replacement for `DividerStandardComponent`. Register it for `DIVIDER_STANDARD_COMPONENT_TOKEN` to restyle every `<smart-divider>` (or every preset at once with `provideSmartPresets()`), or use the `<smart-divider-preset>` selector directly. It translates Preline's divider patterns to `smart:`-prefixed Tailwind (with explicit `dark:` variants), one per variant:
|
|
29
29
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
30
|
+
- plain: an `<hr>`, when there is no content and no `variant`
|
|
31
|
+
- `with-label`, `with-icon`, `with-title`: the content (`label`, else `title`; `title` first for `with-title`, in Preline's uppercase muted "Or" style) with connecting line(s) placed by `options.position` (default `center`); `iconName` is shown before it
|
|
32
|
+
- `with-button`: only the `actionLabel` button (with `iconName` before its text) on the line; `label` and `title` are not shown
|
|
33
|
+
- `with-toolbar`: the content (`label`, else `title`), a line, then the `actionLabel` button; `options.position` does not apply
|
|
34
|
+
|
|
35
|
+
When `options.variant` is omitted the variant is **inferred** from the inputs: `actionLabel` → `with-button`, `title` → `with-title`, `iconName` → `with-icon`, `label` → `with-label`, otherwise the plain `<hr>`.
|
|
36
|
+
|
|
37
|
+
The preset declares `cssClass` without the `class` alias, so bind `[cssClass]` when you use the `<smart-divider-preset>` selector directly; `class` on `<smart-divider>` reaches it through the wrapper. `iconName` has no icon-font dependency: it is rendered as the text content of a `size-4` icon slot, so an icon font (e.g. Material Icons) gets the correct sizing. The class recipes are internal (not exported from `@smartsoft001/angular`).
|
|
33
38
|
|
|
34
39
|
```typescript
|
|
35
40
|
import {
|
|
@@ -47,29 +52,34 @@ providers: [
|
|
|
47
52
|
|
|
48
53
|
### DividerBaseComponent (abstract)
|
|
49
54
|
|
|
50
|
-
Abstract base directive for extending custom divider implementations.
|
|
55
|
+
Abstract base directive for extending custom divider implementations. It declares the inputs and the output below (`cssClass` with the `class` alias).
|
|
51
56
|
|
|
52
57
|
## API
|
|
53
58
|
|
|
54
59
|
### Inputs
|
|
55
60
|
|
|
56
|
-
| Input | Type
|
|
57
|
-
| ------------- |
|
|
58
|
-
| `label` | `InputSignal<string>` | `undefined` |
|
|
59
|
-
| `iconName` | `InputSignal<string>` | `undefined` | Icon
|
|
60
|
-
| `title` | `InputSignal<string>` | `undefined` |
|
|
61
|
-
| `actionLabel` | `InputSignal<string>` | `undefined` |
|
|
62
|
-
| `options` | `InputSignal<IDividerOptions>` | `undefined` |
|
|
63
|
-
| `class` | `InputSignal<string>`
|
|
61
|
+
| Input | Type | Default | Description |
|
|
62
|
+
| ------------- | ------------------------------------------- | ----------- | ---------------------------------------------------------------------------------------- |
|
|
63
|
+
| `label` | `InputSignal<string \| undefined>` | `undefined` | Short text on the line (standard: a `<span>`) |
|
|
64
|
+
| `iconName` | `InputSignal<string \| undefined>` | `undefined` | Icon text before the content or the action. Preset only: the standard does not render it |
|
|
65
|
+
| `title` | `InputSignal<string \| undefined>` | `undefined` | Heading on the line (standard: an `<h3>`) |
|
|
66
|
+
| `actionLabel` | `InputSignal<string \| undefined>` | `undefined` | Renders a button with this text that emits `actionClick` |
|
|
67
|
+
| `options` | `InputSignal<IDividerOptions \| undefined>` | `undefined` | Variant and position |
|
|
68
|
+
| `class` | `InputSignal<string>` | `''` | Classes on the root element (`cssClass` input, alias `class`) |
|
|
64
69
|
|
|
65
70
|
### Outputs
|
|
66
71
|
|
|
67
|
-
| Output | Type
|
|
68
|
-
| ------------- |
|
|
69
|
-
| `actionClick` | `
|
|
72
|
+
| Output | Type | Description |
|
|
73
|
+
| ------------- | ------------------------ | ----------------------------------------- |
|
|
74
|
+
| `actionClick` | `OutputEmitterRef<void>` | Emitted when the action button is clicked |
|
|
70
75
|
|
|
71
76
|
### IDividerOptions
|
|
72
77
|
|
|
78
|
+
| Field | Type | Default | Description |
|
|
79
|
+
| ---------- | ------------------------------- | ---------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
80
|
+
| `variant` | `SmartDividerVariant` | inferred | `'with-label'`, `'with-icon'`, `'with-title'`, `'with-button'` or `'with-toolbar'`. Preset only; the standard ignores it. |
|
|
81
|
+
| `position` | `'left' \| 'center' \| 'right'` | `'center'` | Where the content sits on the line (preset, except `with-toolbar`). The standard only writes it to the `data-position` attribute of its root, for your own CSS. |
|
|
82
|
+
|
|
73
83
|
```typescript
|
|
74
84
|
interface IDividerOptions {
|
|
75
85
|
variant?: SmartDividerVariant; // 'with-label' | 'with-icon' | 'with-title' | 'with-button' | 'with-toolbar'
|
|
@@ -83,7 +93,7 @@ interface IDividerOptions {
|
|
|
83
93
|
import { DIVIDER_STANDARD_COMPONENT_TOKEN } from '@smartsoft001/angular';
|
|
84
94
|
```
|
|
85
95
|
|
|
86
|
-
InjectionToken that allows replacing the default `DividerStandardComponent` with a custom implementation. Provide a `Type<DividerBaseComponent>` to override.
|
|
96
|
+
InjectionToken that allows replacing the default `DividerStandardComponent` with a custom implementation. Provide a `Type<DividerBaseComponent>` to override. The wrapper passes the inputs it has on and re-emits the implementation's `actionClick`.
|
|
87
97
|
|
|
88
98
|
```typescript
|
|
89
99
|
// In your app module or component providers:
|
|
@@ -134,9 +144,17 @@ export class MyCustomDividerComponent extends DividerBaseComponent {}
|
|
|
134
144
|
<!-- With label -->
|
|
135
145
|
<smart-divider label="Continue with" />
|
|
136
146
|
|
|
137
|
-
<!-- With title
|
|
147
|
+
<!-- With title on the left (preset) -->
|
|
138
148
|
<smart-divider title="Section" [options]="{ position: 'left' }" />
|
|
139
149
|
|
|
150
|
+
<!-- Title, line and action in one row (preset) -->
|
|
151
|
+
<smart-divider
|
|
152
|
+
title="Team members"
|
|
153
|
+
actionLabel="Add member"
|
|
154
|
+
[options]="{ variant: 'with-toolbar' }"
|
|
155
|
+
(actionClick)="onAdd()"
|
|
156
|
+
/>
|
|
157
|
+
|
|
140
158
|
<!-- With action button -->
|
|
141
159
|
<smart-divider actionLabel="Add item" (actionClick)="onAdd()" />
|
|
142
160
|
|
|
@@ -25,11 +25,11 @@ Barebones placeholder concrete implementation. When `open()` is `true`, renders
|
|
|
25
25
|
|
|
26
26
|
### DrawerPresetComponent (`<smart-drawer-preset>`)
|
|
27
27
|
|
|
28
|
-
Fully-styled variation that extends `DrawerBaseComponent` and is a drop-in replacement for `DrawerStandardComponent`. Register it
|
|
28
|
+
Fully-styled variation that extends `DrawerBaseComponent` and is a drop-in replacement for `DrawerStandardComponent`. Register it for `DRAWER_STANDARD_COMPONENT_TOKEN` to restyle every `<smart-drawer>` (or every preset at once with `provideSmartPresets()`), or use the `<smart-drawer-preset>` selector directly. It renders the translated Preline **offcanvas** look: a fixed, sliding side panel (`role="dialog"`, `aria-modal="true"`, `tabindex="-1"`) with a header (title + circular close button with the Preline X icon), a `<ng-content />` body, and an optional dimmed backdrop. It consumes `options.position` (`left`/`right`, default `right` → `data-position` + start/end placement), `options.wide` (`max-w-xs` → `max-w-md`), `options.withOverlay` (renders a click-to-close backdrop), and `options.brandedHeader` (blue header bar with inverted title/close styling). Open/close is Angular-driven via the `open` model + `@if` and `close()` (no Preline JS runtime). All classes are `smart:`-prefixed Tailwind with explicit `dark:` variants; the class recipes are internal (not exported from `@smartsoft001/angular`). The header is always rendered, with or without `title`.
|
|
29
29
|
|
|
30
|
-
>
|
|
30
|
+
> The preset declares `cssClass` without the `class` alias, so bind `[cssClass]` when you use the `<smart-drawer-preset>` selector directly; `class` on `<smart-drawer>` reaches it through the wrapper.
|
|
31
31
|
>
|
|
32
|
-
> The preset
|
|
32
|
+
> The preset's body is its `<ng-content />`: the wrapper hands the content projected into `<smart-drawer>` to the registered implementation, and the `<smart-drawer-preset>` selector takes projected content directly. It does not consume `options.stickyFooter` (no footer slot in the base API) or `options.variant` (content-type variants are projected content, not built into the offcanvas shell). Top/bottom placements from the Preline reference are not expressible — `IDrawerOptions.position` is `left | right` only.
|
|
33
33
|
|
|
34
34
|
### DrawerBaseComponent (abstract)
|
|
35
35
|
|
|
@@ -39,21 +39,33 @@ Abstract base directive for extending custom drawer implementations. Exposes `op
|
|
|
39
39
|
|
|
40
40
|
### Inputs
|
|
41
41
|
|
|
42
|
-
| Input | Type | Default | Description
|
|
43
|
-
| --------- | ------------------------------------------ | ------- |
|
|
44
|
-
| `open` | `ModelSignal<boolean>` | `false` | Whether the drawer is open (two-way bindable)
|
|
45
|
-
| `title` | `InputSignal<string \| undefined>` | - | Optional drawer title (renders header when set)
|
|
46
|
-
| `options` | `InputSignal<IDrawerOptions \| undefined>` | - | Optional configuration
|
|
47
|
-
| `class` | `InputSignal<string>` | `''` |
|
|
42
|
+
| Input | Type | Default | Description |
|
|
43
|
+
| --------- | ------------------------------------------ | ------- | ------------------------------------------------------ |
|
|
44
|
+
| `open` | `ModelSignal<boolean>` | `false` | Whether the drawer is open (two-way bindable) |
|
|
45
|
+
| `title` | `InputSignal<string \| undefined>` | - | Optional drawer title (renders header when set) |
|
|
46
|
+
| `options` | `InputSignal<IDrawerOptions \| undefined>` | - | Optional configuration |
|
|
47
|
+
| `class` | `InputSignal<string>` | `''` | Classes on the panel (`cssClass` input, alias `class`) |
|
|
48
48
|
|
|
49
49
|
### Outputs
|
|
50
50
|
|
|
51
|
-
| Output
|
|
52
|
-
|
|
|
53
|
-
| `closed`
|
|
51
|
+
| Output | Type | Description |
|
|
52
|
+
| ------------ | --------------------------- | ---------------------------------------------------------------------------------- |
|
|
53
|
+
| `closed` | `OutputEmitterRef<void>` | Emitted when the drawer closes itself (`close()`: the close button or the overlay) |
|
|
54
|
+
| `openChange` | `OutputEmitterRef<boolean>` | The `open` model's change event, for `[(open)]` |
|
|
54
55
|
|
|
55
56
|
### IDrawerOptions
|
|
56
57
|
|
|
58
|
+
| Field | Type | Default | Description |
|
|
59
|
+
| --------------- | -------------------- | --------- | ------------------------------------------------------------------------------------------------------------------------ |
|
|
60
|
+
| `position` | `'left' \| 'right'` | `'right'` | The side the panel opens on. The standard writes it to the `data-position` attribute; the preset places the panel there. |
|
|
61
|
+
| `withOverlay` | `boolean` | - | Renders a backdrop; a click on it closes the drawer (standard and preset). |
|
|
62
|
+
| `wide` | `boolean` | - | A wider panel (`max-w-md` instead of `max-w-xs`). Preset only. |
|
|
63
|
+
| `brandedHeader` | `boolean` | - | A blue header bar with inverted title and close button. Preset only. |
|
|
64
|
+
| `stickyFooter` | `boolean` | - | Not read by the built-in implementations; available to a custom implementation. |
|
|
65
|
+
| `variant` | `SmartDrawerVariant` | - | Not read by the built-in implementations; available to a custom implementation. |
|
|
66
|
+
|
|
67
|
+
`SmartDrawerVariant` is `'empty' | 'create-form' | 'user-profile' | 'contact-list' | 'file-details'`.
|
|
68
|
+
|
|
57
69
|
```typescript
|
|
58
70
|
interface IDrawerOptions {
|
|
59
71
|
position?: 'left' | 'right';
|
|
@@ -68,7 +80,7 @@ type SmartDrawerVariant =
|
|
|
68
80
|
'empty' | 'create-form' | 'user-profile' | 'contact-list' | 'file-details';
|
|
69
81
|
```
|
|
70
82
|
|
|
71
|
-
The standard component only consumes `position` (mapped to the `data-position` attribute on the aside, default `'right'`) and `withOverlay` (toggles the backdrop overlay).
|
|
83
|
+
The standard component only consumes `position` (mapped to the `data-position` attribute on the aside, default `'right'`) and `withOverlay` (toggles the backdrop overlay).
|
|
72
84
|
|
|
73
85
|
## DRAWER_STANDARD_COMPONENT_TOKEN
|
|
74
86
|
|
|
@@ -76,7 +88,7 @@ The standard component only consumes `position` (mapped to the `data-position` a
|
|
|
76
88
|
import { DRAWER_STANDARD_COMPONENT_TOKEN } from '@smartsoft001/angular';
|
|
77
89
|
```
|
|
78
90
|
|
|
79
|
-
InjectionToken that allows replacing the default `DrawerStandardComponent` with a custom implementation. Provide a `Type<DrawerBaseComponent>` to override.
|
|
91
|
+
InjectionToken that allows replacing the default `DrawerStandardComponent` with a custom implementation. Provide a `Type<DrawerBaseComponent>` to override. The wrapper passes `open`, `title`, `options` and the class, hands over the projected content, and re-emits the implementation's `closed` and `open` changes.
|
|
80
92
|
|
|
81
93
|
```typescript
|
|
82
94
|
// In your app module or component providers:
|
|
@@ -95,7 +107,6 @@ import {
|
|
|
95
107
|
ChangeDetectionStrategy,
|
|
96
108
|
Component,
|
|
97
109
|
computed,
|
|
98
|
-
input,
|
|
99
110
|
ViewEncapsulation,
|
|
100
111
|
} from '@angular/core';
|
|
101
112
|
|
|
@@ -130,9 +141,6 @@ import { DrawerBaseComponent } from '@smartsoft001/angular';
|
|
|
130
141
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
131
142
|
})
|
|
132
143
|
export class MyCustomDrawerComponent extends DrawerBaseComponent {
|
|
133
|
-
// NgComponentOutlet passes 'cssClass' by canonical name, not the 'class' alias.
|
|
134
|
-
override cssClass = input<string>('');
|
|
135
|
-
|
|
136
144
|
containerClasses = computed(() => {
|
|
137
145
|
const classes = ['my-drawer'];
|
|
138
146
|
if (this.options()?.wide) classes.push('my-drawer--wide');
|
|
@@ -143,12 +151,9 @@ export class MyCustomDrawerComponent extends DrawerBaseComponent {
|
|
|
143
151
|
}
|
|
144
152
|
```
|
|
145
153
|
|
|
146
|
-
When extending the base directly,
|
|
147
|
-
|
|
148
|
-
- declare `cssClass = input<string>('')` explicitly (no `class` alias) if the component is used via `NgComponentOutlet` through `DRAWER_STANDARD_COMPONENT_TOKEN`, because `NgComponentOutlet` passes inputs by canonical name (not by alias),
|
|
149
|
-
- call `this.close()` from your close affordances — it sets `open` to `false` and emits `closed` for you.
|
|
154
|
+
When extending the base directly, call `this.close()` from your close affordances: it sets `open` to `false` and emits `closed` for you. Keep the inherited `cssClass` (alias `class`): the wrapper passes the class under the name the component declares.
|
|
150
155
|
|
|
151
|
-
|
|
156
|
+
## Content Projection
|
|
152
157
|
|
|
153
158
|
`DrawerStandardComponent` uses `<ng-content />` to project arbitrary children. A custom implementation registered via `DRAWER_STANDARD_COMPONENT_TOKEN` receives the same content in its default `<ng-content />` slot, so it can show or hide the slot with `@if (open())` like the standard drawer, and control flow at the root of the projected content keeps working. The content arrives wrapped in one `display: contents` element: selectors on the slot's parent that target its direct children (`space-y-*`, `divide-*`, `> *`) do not reach the projected nodes.
|
|
154
159
|
|
|
@@ -21,38 +21,52 @@ Main wrapper component. Renders `DropdownStandardComponent` by default. When `DR
|
|
|
21
21
|
|
|
22
22
|
### DropdownStandardComponent (`<smart-dropdown-standard>`)
|
|
23
23
|
|
|
24
|
-
Default concrete implementation. Renders a trigger button and a menu
|
|
24
|
+
Default concrete implementation, unstyled (class hooks `smart-dropdown-trigger`, `smart-dropdown-header`). Renders a trigger button showing `triggerLabel`, or the projected content without it, and while open a `<ul role="menu">`: a header item with `options.headerLabel` when `options.variant` is `'with-header'`, then one `menuitem` button per item (`disabled` respected) and a `separator` for each `divider` item.
|
|
25
25
|
|
|
26
26
|
### DropdownPresetComponent (`<smart-dropdown-preset>`)
|
|
27
27
|
|
|
28
|
-
Fully styled variation that extends `DropdownBaseComponent` and is a drop-in replacement for `DropdownStandardComponent`. Register it
|
|
28
|
+
Fully styled variation that extends `DropdownBaseComponent` and is a drop-in replacement for `DropdownStandardComponent`. Register it for `DROPDOWN_STANDARD_COMPONENT_TOKEN` to restyle every `<smart-dropdown>` (or every preset at once with `provideSmartPresets()`), or use the `<smart-dropdown-preset>` selector directly. Renders a trigger button (with a rotating chevron) and a menu, dispatched through `options.variant` (default `'simple'`): `simple`, `with-dividers` (items split into divider-separated groups at each `divider` item; the other variants leave `divider` items out), `with-icons` (renders each `item.icon` string), `with-header` (a header block from `options.headerLabel`, items shown with icons), and `minimal` (borderless ghost trigger). The trigger shows `triggerLabel`, or `Actions` without it: the preset does not render projected content. All classes are `smart:`-prefixed Tailwind with explicit `dark:` variants. Open/close is driven by the inherited `open` signal + a `(click)` toggle and `@if` — Preline's JS plugin is NOT used, but its visual classes and ARIA (`aria-haspopup="menu"`, `aria-expanded`) are preserved. The class recipes are internal (not exported from `@smartsoft001/angular`).
|
|
29
29
|
|
|
30
|
-
>
|
|
30
|
+
> The preset declares `cssClass` without the `class` alias, so bind `[cssClass]` when you use the `<smart-dropdown-preset>` selector directly; `class` on `<smart-dropdown>` reaches it through the wrapper.
|
|
31
31
|
|
|
32
32
|
### DropdownBaseComponent (abstract)
|
|
33
33
|
|
|
34
|
-
Abstract base directive for extending custom dropdown implementations.
|
|
34
|
+
Abstract base directive for extending custom dropdown implementations. Besides the inputs and the output below it provides:
|
|
35
|
+
|
|
36
|
+
- `toggle()`: opens or closes the menu
|
|
37
|
+
- `close()`: closes the menu
|
|
38
|
+
- `selectItem(itemId)`: emits `selectedItem` with `{ itemId }` and closes the menu
|
|
35
39
|
|
|
36
40
|
## API
|
|
37
41
|
|
|
38
42
|
### Inputs
|
|
39
43
|
|
|
40
|
-
| Input | Type
|
|
41
|
-
| -------------- |
|
|
42
|
-
| `items` | `InputSignal<IDropdownItem[]>`
|
|
43
|
-
| `triggerLabel` | `InputSignal<string>` | `undefined` | Trigger text
|
|
44
|
-
| `open` | `ModelSignal<boolean>`
|
|
45
|
-
| `options` | `InputSignal<IDropdownOptions>` | `undefined` |
|
|
46
|
-
| `class` | `InputSignal<string>`
|
|
44
|
+
| Input | Type | Default | Description |
|
|
45
|
+
| -------------- | -------------------------------------------- | ----------- | -------------------------------------------------------------------------------------------------- |
|
|
46
|
+
| `items` | `InputSignal<IDropdownItem[]>` | `[]` | Menu items |
|
|
47
|
+
| `triggerLabel` | `InputSignal<string \| undefined>` | `undefined` | Trigger text. Without it the standard renders the projected content and the preset shows `Actions` |
|
|
48
|
+
| `open` | `ModelSignal<boolean>` | `false` | Two-way bindable open/closed state |
|
|
49
|
+
| `options` | `InputSignal<IDropdownOptions \| undefined>` | `undefined` | Variant and header label |
|
|
50
|
+
| `class` | `InputSignal<string>` | `''` | Classes on the root element (`cssClass` input, alias `class`) |
|
|
47
51
|
|
|
48
52
|
### Outputs
|
|
49
53
|
|
|
50
|
-
| Output | Type
|
|
51
|
-
| -------------- |
|
|
52
|
-
| `selectedItem` | `{ itemId: string }
|
|
54
|
+
| Output | Type | Description |
|
|
55
|
+
| -------------- | -------------------------------------- | --------------------------------------------------- |
|
|
56
|
+
| `selectedItem` | `OutputEmitterRef<{ itemId: string }>` | Emits when a menu item is selected; closes the menu |
|
|
57
|
+
| `openChange` | `OutputEmitterRef<boolean>` | The `open` model's change event, for `[(open)]` |
|
|
53
58
|
|
|
54
59
|
### IDropdownItem
|
|
55
60
|
|
|
61
|
+
| Field | Type | Default | Description |
|
|
62
|
+
| ---------- | --------- | -------- | ------------------------------------------------------------------------------------------------------------------- |
|
|
63
|
+
| `id` | `string` | required | Reported as `itemId`. |
|
|
64
|
+
| `label` | `string` | required | Item text. |
|
|
65
|
+
| `icon` | `string` | - | Text or glyph before the label. Preset only, in the `with-icons` and `with-header` variants. |
|
|
66
|
+
| `disabled` | `boolean` | - | Disables the item. |
|
|
67
|
+
| `divider` | `boolean` | - | Makes the entry a separator (standard); the preset's `with-dividers` variant splits the menu there, others hide it. |
|
|
68
|
+
| `href` | `string` | - | Not read by the built-in implementations (no item renders as a link); available to a custom implementation. |
|
|
69
|
+
|
|
56
70
|
```typescript
|
|
57
71
|
interface IDropdownItem {
|
|
58
72
|
id: string;
|
|
@@ -66,6 +80,11 @@ interface IDropdownItem {
|
|
|
66
80
|
|
|
67
81
|
### IDropdownOptions
|
|
68
82
|
|
|
83
|
+
| Field | Type | Default | Description |
|
|
84
|
+
| ------------- | ---------------------- | ---------- | --------------------------------------------------------------------------------------------------------------------------------- |
|
|
85
|
+
| `variant` | `SmartDropdownVariant` | `'simple'` | `'simple'`, `'with-dividers'`, `'with-icons'`, `'minimal'` or `'with-header'` (preset). The standard only checks `'with-header'`. |
|
|
86
|
+
| `headerLabel` | `string` | - | Header text, shown by both implementations when `variant` is `'with-header'`. |
|
|
87
|
+
|
|
69
88
|
```typescript
|
|
70
89
|
type SmartDropdownVariant =
|
|
71
90
|
'simple' | 'with-dividers' | 'with-icons' | 'minimal' | 'with-header';
|
|
@@ -82,7 +101,7 @@ interface IDropdownOptions {
|
|
|
82
101
|
import { DROPDOWN_STANDARD_COMPONENT_TOKEN } from '@smartsoft001/angular';
|
|
83
102
|
```
|
|
84
103
|
|
|
85
|
-
InjectionToken that allows replacing the default `DropdownStandardComponent` with a custom implementation. Provide a `Type<DropdownBaseComponent>` to override.
|
|
104
|
+
InjectionToken that allows replacing the default `DropdownStandardComponent` with a custom implementation. Provide a `Type<DropdownBaseComponent>` to override. The wrapper passes its inputs and the projected content on, and re-emits the implementation's `selectedItem` and `open` changes.
|
|
86
105
|
|
|
87
106
|
```typescript
|
|
88
107
|
// In your app module or component providers:
|
|
@@ -154,7 +173,7 @@ export class MyCustomDropdownComponent extends DropdownBaseComponent {}
|
|
|
154
173
|
]"
|
|
155
174
|
/>
|
|
156
175
|
|
|
157
|
-
<!-- With custom trigger content via ng-content -->
|
|
176
|
+
<!-- With custom trigger content via ng-content (standard only) -->
|
|
158
177
|
<smart-dropdown [items]="items">
|
|
159
178
|
<span class="icon-menu"></span> Menu
|
|
160
179
|
</smart-dropdown>
|
|
@@ -17,7 +17,7 @@ The `<smart-empty-state>` component renders an empty-state placeholder with an o
|
|
|
17
17
|
|
|
18
18
|
### EmptyStateComponent (`<smart-empty-state>`)
|
|
19
19
|
|
|
20
|
-
Main wrapper. Delegates to `EmptyStateStandardComponent` by default. When `EMPTY_STATE_STANDARD_COMPONENT_TOKEN` is provided, renders the injected component via `NgComponentOutlet`. Re-emits `actionClick` and `itemClick
|
|
20
|
+
Main wrapper. Delegates to `EmptyStateStandardComponent` by default. When `EMPTY_STATE_STANDARD_COMPONENT_TOKEN` is provided, renders the injected component via `NgComponentOutlet`. Re-emits `actionClick` and `itemClick` of whichever implementation it renders.
|
|
21
21
|
|
|
22
22
|
### EmptyStateStandardComponent (`<smart-empty-state-standard>`)
|
|
23
23
|
|
|
@@ -25,7 +25,7 @@ Barebones placeholder using native HTML. Renders an outer wrapper with `cssClass
|
|
|
25
25
|
|
|
26
26
|
### EmptyStatePresetComponent (`<smart-empty-state-preset>`)
|
|
27
27
|
|
|
28
|
-
Fully-styled drop-in replacement for `EmptyStateStandardComponent`, adapting Preline's "Invoice Table Empty State" centered block: a rounded icon tile (`iconTpl`), title, description, a "Learn more" text link (`footerLinkLabel` / `footerLinkHref`) and a row of action buttons. Optional `items` render as a simple bordered list so it stays a full drop-in. All Tailwind classes are `smart:`-prefixed with explicit `dark:` variants. Action `variant` maps to
|
|
28
|
+
Fully-styled drop-in replacement for `EmptyStateStandardComponent`, adapting Preline's "Invoice Table Empty State" centered block: a rounded icon tile (`iconTpl`), title, description, a "Learn more" text link (`footerLinkLabel` / `footerLinkHref`) and a row of action buttons. Optional `items` render as a simple bordered list so it stays a full drop-in. All Tailwind classes are `smart:`-prefixed with explicit `dark:` variants. Action `variant` maps to `primary` (blue button), `secondary` (white/layer button), `ghost` (text + hover) and `link` (inline blue link); without a `variant` an action with `href` is a `link` and one without is `primary`. Register it for `EMPTY_STATE_STANDARD_COMPONENT_TOKEN` to restyle every `<smart-empty-state>` (or every preset at once with `provideSmartPresets()`), or use the selector directly. The preset declares `cssClass` without the `class` alias, so bind `[cssClass]` on the `<smart-empty-state-preset>` selector; `class` on `<smart-empty-state>` reaches it through the wrapper.
|
|
29
29
|
|
|
30
30
|
### EmptyStateBaseComponent (abstract)
|
|
31
31
|
|
|
@@ -43,10 +43,10 @@ Abstract base directive. Exposes:
|
|
|
43
43
|
|
|
44
44
|
### Inputs
|
|
45
45
|
|
|
46
|
-
| Input | Type | Default | Description
|
|
47
|
-
| --------- | ---------------------------------------------- | ------- |
|
|
48
|
-
| `options` | `InputSignal<IEmptyStateOptions \| undefined>` | - | Empty state configuration
|
|
49
|
-
| `class` | `InputSignal<string>` | `''` |
|
|
46
|
+
| Input | Type | Default | Description |
|
|
47
|
+
| --------- | ---------------------------------------------- | ------- | ------------------------------------------------------------- |
|
|
48
|
+
| `options` | `InputSignal<IEmptyStateOptions \| undefined>` | - | Empty state configuration |
|
|
49
|
+
| `class` | `InputSignal<string>` | `''` | Classes on the root element (`cssClass` input, alias `class`) |
|
|
50
50
|
|
|
51
51
|
### Outputs
|
|
52
52
|
|
|
@@ -57,6 +57,46 @@ Abstract base directive. Exposes:
|
|
|
57
57
|
|
|
58
58
|
### IEmptyStateOptions
|
|
59
59
|
|
|
60
|
+
All fields are optional. The standard and the preset read every field except `layout`.
|
|
61
|
+
|
|
62
|
+
| Field | Type | Default | Description |
|
|
63
|
+
| ----------------- | ----------------------- | ------- | ------------------------------------------------------------------------------- |
|
|
64
|
+
| `title` | `string` | - | Heading. |
|
|
65
|
+
| `description` | `string` | - | Text under the heading. |
|
|
66
|
+
| `iconTpl` | `TemplateRef<unknown>` | - | Icon or illustration above the title. |
|
|
67
|
+
| `actions` | `IEmptyStateAction[]` | `[]` | Buttons / links under the description. |
|
|
68
|
+
| `items` | `IEmptyStateItem[]` | `[]` | Suggested items (starting points, templates, recommendations) listed below. |
|
|
69
|
+
| `itemsTitle` | `string` | - | Heading of the items list. |
|
|
70
|
+
| `formTpl` | `TemplateRef<unknown>` | - | A form slot (e.g. an invite input). |
|
|
71
|
+
| `footerLinkLabel` | `string` | - | Text of the footer link (a plain text without `footerLinkHref`). |
|
|
72
|
+
| `footerLinkHref` | `string` | - | Target of the footer link. |
|
|
73
|
+
| `layout` | `SmartEmptyStateLayout` | - | Not read by the built-in implementations; available to a custom implementation. |
|
|
74
|
+
|
|
75
|
+
`SmartEmptyStateLayout` is `'simple' | 'dashed-border' | 'starting-points' | 'with-recommendations' | 'with-templates' | 'with-recommendations-grid'`.
|
|
76
|
+
|
|
77
|
+
### IEmptyStateAction
|
|
78
|
+
|
|
79
|
+
| Field | Type | Default | Description |
|
|
80
|
+
| --------- | ----------------------------------------------- | -------- | ---------------------------------------------------------------------- |
|
|
81
|
+
| `id` | `string` | required | Reported as `actionId`. |
|
|
82
|
+
| `label` | `string` | - | Button / link text. |
|
|
83
|
+
| `href` | `string` | - | Renders a link instead of a button (a link emits no `actionClick`). |
|
|
84
|
+
| `variant` | `'primary' \| 'secondary' \| 'ghost' \| 'link'` | - | Look of the action; defaults to `link` with `href`, `primary` without. |
|
|
85
|
+
| `iconTpl` | `TemplateRef<unknown>` | - | Icon next to the label. |
|
|
86
|
+
|
|
87
|
+
### IEmptyStateItem
|
|
88
|
+
|
|
89
|
+
| Field | Type | Default | Description |
|
|
90
|
+
| ------------- | ---------------------- | -------- | ---------------------------------------------------------------- |
|
|
91
|
+
| `id` | `string` | required | Reported as `itemId`. |
|
|
92
|
+
| `title` | `string` | - | Item title. |
|
|
93
|
+
| `description` | `string` | - | Item text. |
|
|
94
|
+
| `href` | `string` | - | Renders the item as a link (no `itemClick`) instead of a button. |
|
|
95
|
+
| `iconTpl` | `TemplateRef<unknown>` | - | Item icon. |
|
|
96
|
+
| `imageUrl` | `string` | - | Item image. |
|
|
97
|
+
| `imageAlt` | `string` | - | Alt text of the image. |
|
|
98
|
+
| `meta` | `string` | - | Small extra text. |
|
|
99
|
+
|
|
60
100
|
```typescript
|
|
61
101
|
type SmartEmptyStateLayout =
|
|
62
102
|
| 'simple'
|
|
@@ -101,6 +141,8 @@ interface IEmptyStateItem {
|
|
|
101
141
|
|
|
102
142
|
## EMPTY_STATE_STANDARD_COMPONENT_TOKEN
|
|
103
143
|
|
|
144
|
+
Provide a `Type<EmptyStateBaseComponent>` for `EMPTY_STATE_STANDARD_COMPONENT_TOKEN` to render it in every `<smart-empty-state>` below that injector; the wrapper passes `options` and the class on and re-emits its `actionClick` and `itemClick`.
|
|
145
|
+
|
|
104
146
|
```typescript
|
|
105
147
|
import { EMPTY_STATE_STANDARD_COMPONENT_TOKEN } from '@smartsoft001/angular';
|
|
106
148
|
|
|
@@ -118,7 +160,6 @@ providers: [
|
|
|
118
160
|
import {
|
|
119
161
|
ChangeDetectionStrategy,
|
|
120
162
|
Component,
|
|
121
|
-
input,
|
|
122
163
|
ViewEncapsulation,
|
|
123
164
|
} from '@angular/core';
|
|
124
165
|
|
|
@@ -147,10 +188,7 @@ import { EmptyStateBaseComponent } from '@smartsoft001/angular';
|
|
|
147
188
|
encapsulation: ViewEncapsulation.None,
|
|
148
189
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
149
190
|
})
|
|
150
|
-
export class MyCustomEmptyStateComponent extends EmptyStateBaseComponent {
|
|
151
|
-
// NgComponentOutlet passes 'cssClass' by canonical name, not the 'class' alias.
|
|
152
|
-
override cssClass = input<string>('');
|
|
153
|
-
}
|
|
191
|
+
export class MyCustomEmptyStateComponent extends EmptyStateBaseComponent {}
|
|
154
192
|
```
|
|
155
193
|
|
|
156
194
|
## Usage Examples
|