@smartsoft001/claude-plugins 2.200.0 → 2.202.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/plugins/smart-angular/.claude-plugin/plugin.json +1 -1
- package/plugins/smart-angular/skills/angular-components-accordion/SKILL.md +84 -80
- package/plugins/smart-angular/skills/angular-components-action-panel/SKILL.md +35 -60
- package/plugins/smart-angular/skills/angular-components-alert/SKILL.md +24 -29
- package/plugins/smart-angular/skills/angular-components-avatar/SKILL.md +30 -30
- package/plugins/smart-angular/skills/angular-components-badge/SKILL.md +18 -12
- package/plugins/smart-angular/skills/angular-components-breadcrumbs/SKILL.md +27 -10
- package/plugins/smart-angular/skills/angular-components-button/SKILL.md +43 -17
- package/plugins/smart-angular/skills/angular-components-button-group/SKILL.md +26 -14
- package/plugins/smart-angular/skills/angular-components-calendar/SKILL.md +47 -28
- package/plugins/smart-angular/skills/angular-components-card/SKILL.md +29 -22
- package/plugins/smart-angular/skills/angular-components-card-heading/SKILL.md +24 -18
- package/plugins/smart-angular/skills/angular-components-command-palette/SKILL.md +41 -32
- package/plugins/smart-angular/skills/angular-components-container/SKILL.md +21 -20
- package/plugins/smart-angular/skills/angular-components-date-edit/SKILL.md +48 -45
- package/plugins/smart-angular/skills/angular-components-date-range/SKILL.md +72 -82
- package/plugins/smart-angular/skills/angular-components-description-list/SKILL.md +23 -10
- package/plugins/smart-angular/skills/angular-components-detail/SKILL.md +20 -8
- package/plugins/smart-angular/skills/angular-components-details/SKILL.md +35 -12
- package/plugins/smart-angular/skills/angular-components-divider/SKILL.md +36 -18
- package/plugins/smart-angular/skills/angular-components-drawer/SKILL.md +28 -23
- package/plugins/smart-angular/skills/angular-components-dropdown/SKILL.md +35 -16
- package/plugins/smart-angular/skills/angular-components-empty-state/SKILL.md +49 -11
- package/plugins/smart-angular/skills/angular-components-feed/SKILL.md +45 -12
- package/plugins/smart-angular/skills/angular-components-form/SKILL.md +53 -25
- package/plugins/smart-angular/skills/angular-components-grid-list/SKILL.md +37 -13
- package/plugins/smart-angular/skills/angular-components-icon/SKILL.md +8 -8
- package/plugins/smart-angular/skills/angular-components-info/SKILL.md +19 -15
- package/plugins/smart-angular/skills/angular-components-input/SKILL.md +78 -49
- package/plugins/smart-angular/skills/angular-components-list/SKILL.md +85 -78
- package/plugins/smart-angular/skills/angular-components-list-container/SKILL.md +24 -32
- package/plugins/smart-angular/skills/angular-components-media-object/SKILL.md +19 -17
- package/plugins/smart-angular/skills/angular-components-modal/SKILL.md +23 -16
- package/plugins/smart-angular/skills/angular-components-multi-column-layout/SKILL.md +19 -16
- package/plugins/smart-angular/skills/angular-components-navbar/SKILL.md +38 -21
- package/plugins/smart-angular/skills/angular-components-notification/SKILL.md +32 -33
- package/plugins/smart-angular/skills/angular-components-page/SKILL.md +46 -52
- package/plugins/smart-angular/skills/angular-components-page-heading/SKILL.md +42 -25
- package/plugins/smart-angular/skills/angular-components-paging/SKILL.md +17 -15
- package/plugins/smart-angular/skills/angular-components-password-strength/SKILL.md +21 -19
- package/plugins/smart-angular/skills/angular-components-progress-bars/SKILL.md +61 -24
- package/plugins/smart-angular/skills/angular-components-searchbar/SKILL.md +30 -37
- package/plugins/smart-angular/skills/angular-components-section-heading/SKILL.md +38 -27
- package/plugins/smart-angular/skills/angular-components-select-menu/SKILL.md +33 -17
- package/plugins/smart-angular/skills/angular-components-sidebar-layout/SKILL.md +30 -26
- package/plugins/smart-angular/skills/angular-components-sidebar-navigation/SKILL.md +79 -16
- package/plugins/smart-angular/skills/angular-components-sign-in-form/SKILL.md +64 -24
- package/plugins/smart-angular/skills/angular-components-stacked-layout/SKILL.md +24 -23
- package/plugins/smart-angular/skills/angular-components-stacked-list/SKILL.md +40 -21
- package/plugins/smart-angular/skills/angular-components-stats/SKILL.md +28 -15
- package/plugins/smart-angular/skills/angular-components-table/SKILL.md +42 -22
- package/plugins/smart-angular/skills/angular-components-tabs/SKILL.md +37 -13
- package/plugins/smart-angular/skills/angular-components-textarea/SKILL.md +48 -46
- package/plugins/smart-angular/skills/angular-components-toggle/SKILL.md +21 -28
- package/plugins/smart-angular/skills/angular-components-vertical-navigation/SKILL.md +66 -24
- package/plugins/smart-core/.claude-plugin/plugin.json +1 -1
- package/plugins/smart-react/.claude-plugin/plugin.json +1 -1
- package/plugins/smart-react/skills/react-components-action-panel/SKILL.md +13 -13
- package/plugins/smart-react/skills/react-components-alert/SKILL.md +2 -2
- package/plugins/smart-react/skills/react-components-avatar/SKILL.md +11 -11
- package/plugins/smart-react/skills/react-components-badge/SKILL.md +2 -2
- package/plugins/smart-react/skills/react-components-breadcrumbs/SKILL.md +7 -7
- package/plugins/smart-react/skills/react-components-button/SKILL.md +20 -20
- package/plugins/smart-react/skills/react-components-button-group/SKILL.md +2 -2
- package/plugins/smart-react/skills/react-components-calendar/SKILL.md +13 -13
- package/plugins/smart-react/skills/react-components-card/SKILL.md +1 -1
- package/plugins/smart-react/skills/react-components-card-heading/SKILL.md +2 -2
- package/plugins/smart-react/skills/react-components-command-palette/SKILL.md +3 -3
- package/plugins/smart-react/skills/react-components-container/SKILL.md +6 -6
- package/plugins/smart-react/skills/react-components-date-edit/SKILL.md +1 -1
- package/plugins/smart-react/skills/react-components-date-range/SKILL.md +4 -4
- package/plugins/smart-react/skills/react-components-description-list/SKILL.md +1 -1
- package/plugins/smart-react/skills/react-components-detail/SKILL.md +25 -16
- package/plugins/smart-react/skills/react-components-details/SKILL.md +10 -10
- package/plugins/smart-react/skills/react-components-divider/SKILL.md +6 -6
- package/plugins/smart-react/skills/react-components-drawer/SKILL.md +1 -1
- package/plugins/smart-react/skills/react-components-dropdown/SKILL.md +1 -1
- package/plugins/smart-react/skills/react-components-empty-state/SKILL.md +1 -1
- package/plugins/smart-react/skills/react-components-feed/SKILL.md +1 -1
- package/plugins/smart-react/skills/react-components-grid-list/SKILL.md +1 -1
- package/plugins/smart-react/skills/react-components-info/SKILL.md +3 -1
- package/plugins/smart-react/skills/react-components-input/SKILL.md +41 -17
- package/plugins/smart-react/skills/react-components-list/SKILL.md +34 -31
- package/plugins/smart-react/skills/react-components-list-container/SKILL.md +6 -6
- package/plugins/smart-react/skills/react-components-loader/SKILL.md +1 -1
- package/plugins/smart-react/skills/react-components-media-object/SKILL.md +1 -1
- package/plugins/smart-react/skills/react-components-modal/SKILL.md +8 -8
- package/plugins/smart-react/skills/react-components-multi-column-layout/SKILL.md +1 -1
- package/plugins/smart-react/skills/react-components-navbar/SKILL.md +1 -1
- package/plugins/smart-react/skills/react-components-notification/SKILL.md +9 -9
- package/plugins/smart-react/skills/react-components-page-heading/SKILL.md +6 -6
- package/plugins/smart-react/skills/react-components-paging/SKILL.md +28 -28
- package/plugins/smart-react/skills/react-components-password-strength/SKILL.md +4 -4
- package/plugins/smart-react/skills/react-components-progress-bars/SKILL.md +19 -19
- package/plugins/smart-react/skills/react-components-searchbar/SKILL.md +10 -10
- package/plugins/smart-react/skills/react-components-section-heading/SKILL.md +13 -13
- package/plugins/smart-react/skills/react-components-select-menu/SKILL.md +19 -19
- package/plugins/smart-react/skills/react-components-sidebar-layout/SKILL.md +9 -9
- package/plugins/smart-react/skills/react-components-sidebar-navigation/SKILL.md +29 -29
- package/plugins/smart-react/skills/react-components-sign-in-form/SKILL.md +3 -3
- package/plugins/smart-react/skills/react-components-stacked-layout/SKILL.md +1 -1
- package/plugins/smart-react/skills/react-components-stacked-list/SKILL.md +2 -2
- package/plugins/smart-react/skills/react-components-stats/SKILL.md +2 -2
- package/plugins/smart-react/skills/react-components-table/SKILL.md +1 -1
- package/plugins/smart-react/skills/react-components-tabs/SKILL.md +2 -2
- package/plugins/smart-react/skills/react-components-textarea/SKILL.md +8 -8
- package/plugins/smart-react/skills/react-components-toggle/SKILL.md +3 -2
- package/plugins/smart-react/skills/react-components-vertical-navigation/SKILL.md +7 -7
|
@@ -25,9 +25,9 @@ Barebones placeholder concrete implementation. Renders a wrapper `<div>` contain
|
|
|
25
25
|
|
|
26
26
|
### FeedPresetComponent (`<smart-feed-preset>`)
|
|
27
27
|
|
|
28
|
-
Styled variation that extends `FeedBaseComponent` and is a drop-in replacement for `FeedStandardComponent`. Register it
|
|
28
|
+
Styled variation that extends `FeedBaseComponent` and is a drop-in replacement for `FeedStandardComponent`. Register it for `FEED_STANDARD_COMPONENT_TOKEN` to restyle every `<smart-feed>` (or every preset at once with `provideSmartPresets()`), or use the `<smart-feed-preset>` selector directly. It renders the Preline timeline look in vanilla Tailwind: a vertical rail (drawn with an `after:` pseudo-element, hidden on the last item) with a per-event circular marker, a left-hand side timestamp column, the event title (rendered as a link when `href` is set), an event description, and nested comments shown as Preline-style author rows. The marker chooses `iconTpl` first, then `avatarUrl` (image), then a default dot. Comments render the author avatar when `authorAvatarUrl` is set, otherwise an initials fallback derived from the first letter of `authorName`. The `emptyTpl`, `commentSubmitTpl`, and `footerTpl` slots are honored. All classes are `smart:`-prefixed Tailwind with explicit `dark:` variants; 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-feed-preset>` selector directly; `class` on `<smart-feed>` reaches it through the wrapper.
|
|
31
31
|
|
|
32
32
|
### FeedBaseComponent (abstract)
|
|
33
33
|
|
|
@@ -37,13 +37,50 @@ Abstract base directive for extending custom feed implementations. Exposes `opti
|
|
|
37
37
|
|
|
38
38
|
### Inputs
|
|
39
39
|
|
|
40
|
-
| Input | Type | Default | Description
|
|
41
|
-
| --------- | ---------------------------------------- | ------- |
|
|
42
|
-
| `options` | `InputSignal<IFeedOptions \| undefined>` | - |
|
|
43
|
-
| `class` | `InputSignal<string>` | `''` |
|
|
40
|
+
| Input | Type | Default | Description |
|
|
41
|
+
| --------- | ---------------------------------------- | ------- | ------------------------------------------------------------- |
|
|
42
|
+
| `options` | `InputSignal<IFeedOptions \| undefined>` | - | Header, events and slots |
|
|
43
|
+
| `class` | `InputSignal<string>` | `''` | Classes on the root element (`cssClass` input, alias `class`) |
|
|
44
44
|
|
|
45
45
|
### IFeedOptions
|
|
46
46
|
|
|
47
|
+
| Field | Type | Default | Description |
|
|
48
|
+
| ------------------ | ---------------------- | ------- | ------------------------------------------------------------------------------- |
|
|
49
|
+
| `title` | `string` | - | Heading above the feed. |
|
|
50
|
+
| `description` | `string` | - | Text under the heading. |
|
|
51
|
+
| `events` | `IFeedEvent[]` | `[]` | The events, in the order shown. |
|
|
52
|
+
| `emptyTpl` | `TemplateRef<unknown>` | - | Rendered instead of the list when there are no events. |
|
|
53
|
+
| `commentSubmitTpl` | `TemplateRef<unknown>` | - | A slot below the feed, e.g. a comment form. |
|
|
54
|
+
| `footerTpl` | `TemplateRef<unknown>` | - | A slot at the end. |
|
|
55
|
+
| `variant` | `SmartFeedVariant` | - | Not read by the built-in implementations; available to a custom implementation. |
|
|
56
|
+
|
|
57
|
+
`SmartFeedVariant` is `'simple' | 'with-comments' | 'multiple-types'`.
|
|
58
|
+
|
|
59
|
+
### IFeedEvent
|
|
60
|
+
|
|
61
|
+
| Field | Type | Default | Description |
|
|
62
|
+
| ------------- | ---------------------- | -------- | ------------------------------------------------------------------------------- |
|
|
63
|
+
| `id` | `string` | - | Track key of the event. |
|
|
64
|
+
| `title` | `string` | required | Event title; a link when `href` is set. |
|
|
65
|
+
| `description` | `string` | - | Event text. |
|
|
66
|
+
| `timestamp` | `string` | - | Display text for the time (e.g. "2h ago"). |
|
|
67
|
+
| `iconTpl` | `TemplateRef<unknown>` | - | Marker icon; wins over `avatarUrl`. |
|
|
68
|
+
| `avatarUrl` | `string` | - | Marker avatar. |
|
|
69
|
+
| `href` | `string` | - | Makes the title a link. |
|
|
70
|
+
| `comments` | `IFeedComment[]` | - | Comments listed under the event. |
|
|
71
|
+
| `ariaLabel` | `string` | - | Accessible name of the event. |
|
|
72
|
+
| `type` | `string` | - | Not read by the built-in implementations; available to a custom implementation. |
|
|
73
|
+
|
|
74
|
+
### IFeedComment
|
|
75
|
+
|
|
76
|
+
| Field | Type | Default | Description |
|
|
77
|
+
| ----------------- | -------- | -------- | ---------------------------------------------------------------- |
|
|
78
|
+
| `id` | `string` | - | Track key of the comment. |
|
|
79
|
+
| `authorName` | `string` | required | Author shown with the comment (initials fallback in the preset). |
|
|
80
|
+
| `authorAvatarUrl` | `string` | - | Author avatar. |
|
|
81
|
+
| `content` | `string` | required | Comment text. |
|
|
82
|
+
| `timestamp` | `string` | - | Display text for the time. |
|
|
83
|
+
|
|
47
84
|
```typescript
|
|
48
85
|
interface IFeedOptions {
|
|
49
86
|
title?: string;
|
|
@@ -77,7 +114,7 @@ interface IFeedComment {
|
|
|
77
114
|
}
|
|
78
115
|
```
|
|
79
116
|
|
|
80
|
-
|
|
117
|
+
Both the standard and the preset read every field except `IFeedOptions.variant` and `IFeedEvent.type`; a section is rendered only when its template/string is provided. Within an event, `iconTpl` takes precedence over `avatarUrl` when both are set.
|
|
81
118
|
|
|
82
119
|
## FEED_STANDARD_COMPONENT_TOKEN
|
|
83
120
|
|
|
@@ -85,7 +122,7 @@ All properties are optional except `IFeedEvent.title` and `IFeedComment.{authorN
|
|
|
85
122
|
import { FEED_STANDARD_COMPONENT_TOKEN } from '@smartsoft001/angular';
|
|
86
123
|
```
|
|
87
124
|
|
|
88
|
-
InjectionToken that allows replacing the default `FeedStandardComponent` with a custom implementation. Provide a `Type<FeedBaseComponent>` to override.
|
|
125
|
+
InjectionToken that allows replacing the default `FeedStandardComponent` with a custom implementation. Provide a `Type<FeedBaseComponent>` to override; the wrapper passes `options` and the class on.
|
|
89
126
|
|
|
90
127
|
```typescript
|
|
91
128
|
providers: [
|
|
@@ -100,7 +137,6 @@ import {
|
|
|
100
137
|
ChangeDetectionStrategy,
|
|
101
138
|
Component,
|
|
102
139
|
computed,
|
|
103
|
-
input,
|
|
104
140
|
ViewEncapsulation,
|
|
105
141
|
} from '@angular/core';
|
|
106
142
|
import { NgTemplateOutlet } from '@angular/common';
|
|
@@ -131,9 +167,6 @@ import { FeedBaseComponent } from '@smartsoft001/angular';
|
|
|
131
167
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
132
168
|
})
|
|
133
169
|
export class MyCustomFeedComponent extends FeedBaseComponent {
|
|
134
|
-
// NgComponentOutlet passes 'cssClass' by canonical name, not the 'class' alias.
|
|
135
|
-
override cssClass = input<string>('');
|
|
136
|
-
|
|
137
170
|
containerClasses = computed(() => {
|
|
138
171
|
const classes = ['my-feed'];
|
|
139
172
|
const extra = this.cssClass();
|
|
@@ -19,40 +19,61 @@ The `<smart-form>` component renders a reactive form driven by `@Field()` model
|
|
|
19
19
|
|
|
20
20
|
### FormComponent (`<smart-form>`)
|
|
21
21
|
|
|
22
|
-
Main wrapper. Holds all reactive-form logic: builds the form via `FormFactory
|
|
22
|
+
Main wrapper. Holds all reactive-form logic: builds the form via `FormFactory` (or takes `options.control`), disables it while `loading$` emits `true`, wraps the body in a `<form>` that emits `invokeSubmit` on submit and on Enter (`keyup.enter`), and emits `valueChange`, `valuePartialChange` and `validChange` from its own subscription to the form group. Renders `FormStandardComponent` by default. When `FORM_STANDARD_COMPONENT_TOKEN` is provided, renders the injected component via `NgComponentOutlet`, passing `options`, the built `form` and the class, and re-emitting the body's `invokeSubmit`.
|
|
23
23
|
|
|
24
24
|
### FormStandardComponent (`<smart-form-standard>`)
|
|
25
25
|
|
|
26
|
-
Default concrete implementation.
|
|
26
|
+
Default concrete implementation. A container with dividers that renders one `<smart-input>` per control of the form (skipping missing and `__smartDisabled` controls), with the field's `possibilities` and `inputComponents` entry.
|
|
27
27
|
|
|
28
28
|
### FormBaseComponent (abstract)
|
|
29
29
|
|
|
30
|
-
Abstract base directive.
|
|
30
|
+
Abstract base directive. Extend it to build custom form implementations. It exposes:
|
|
31
|
+
|
|
32
|
+
- inputs `form` (`UntypedFormGroup`, required), `options` (`IFormOptions<T>`, required) and `cssClass` (alias `class`)
|
|
33
|
+
- the `invokeSubmit` output (`OutputEmitterRef<any>`) and `submit()`, which emits it with the form value
|
|
34
|
+
- `fields` (the keys of `form.controls`), `model`, `mode` (`''` when unset), `possibilities`, `inputComponents`, `treeLevel`, all read from the inputs
|
|
35
|
+
- `getUntypedFormControl(field)` and the hooks `afterSetForm()` and `afterSetOptions()`
|
|
31
36
|
|
|
32
37
|
## API
|
|
33
38
|
|
|
34
39
|
### Inputs
|
|
35
40
|
|
|
36
|
-
| Input | Type
|
|
37
|
-
| --------- |
|
|
38
|
-
| `options` | `InputSignal<IFormOptions<T>>`
|
|
39
|
-
| `class` | `InputSignal<string>`
|
|
41
|
+
| Input | Type | Default | Description |
|
|
42
|
+
| --------- | ------------------------------ | ---------- | --------------------------------------------------------------- |
|
|
43
|
+
| `options` | `InputSignal<IFormOptions<T>>` | _required_ | The model, the mode and the other form options |
|
|
44
|
+
| `class` | `InputSignal<string>` | `''` | Classes on the body container (`cssClass` input, alias `class`) |
|
|
40
45
|
|
|
41
46
|
### Outputs
|
|
42
47
|
|
|
43
|
-
| Output | Type | Description
|
|
44
|
-
| -------------------- | ------------------------------ |
|
|
45
|
-
| `invokeSubmit` | `OutputEmitterRef<T>` | Emits the form value
|
|
46
|
-
| `valueChange` | `OutputEmitterRef<T>` | Emits the full form value on every change
|
|
47
|
-
| `valuePartialChange` | `OutputEmitterRef<Partial<T>>` | Emits
|
|
48
|
-
| `validChange` | `OutputEmitterRef<boolean>` | Emits form validity on every change
|
|
48
|
+
| Output | Type | Description |
|
|
49
|
+
| -------------------- | ------------------------------ | ----------------------------------------------------------------------------------------- |
|
|
50
|
+
| `invokeSubmit` | `OutputEmitterRef<T>` | Emits the form value (`form.value`) on submit and on Enter. |
|
|
51
|
+
| `valueChange` | `OutputEmitterRef<T>` | Emits the full form value on every change, and once when the form is ready |
|
|
52
|
+
| `valuePartialChange` | `OutputEmitterRef<Partial<T>>` | Emits the values of the dirty controls (`<key>Confirm` controls left out) on every change |
|
|
53
|
+
| `validChange` | `OutputEmitterRef<boolean>` | Emits form validity on every change |
|
|
54
|
+
|
|
55
|
+
`<smart-form>` does not block the submit of an invalid form: keep `validChange` in state and check it before saving.
|
|
49
56
|
|
|
50
57
|
### IFormOptions
|
|
51
58
|
|
|
59
|
+
| Field | Type | Default | Description |
|
|
60
|
+
| ----------------- | ---------------------------------------------------------------------------------- | ---------- | ------------------------------------------------------------------------------------------------------------------------------- |
|
|
61
|
+
| `model` | `T` | required | The model instance (a `@Model` class); the factory builds one control per `@Field` the mode includes. |
|
|
62
|
+
| `show` | `boolean` | required | Required by the type; not read by the built-in implementations (pass `true`). |
|
|
63
|
+
| `mode` | `'create' \| 'update' \| string` | `'create'` | Which fields and which mode options the factory uses. The inputs merge the options of the mode they receive (`''` without one). |
|
|
64
|
+
| `control` | `AbstractControl` | - | A ready form group; without it the form is built from `model` by `FormFactory`. |
|
|
65
|
+
| `loading$` | `Observable<boolean>` | - | Disables the whole form while it emits `true`, enables it on `false`. |
|
|
66
|
+
| `uniqueProvider` | `(values: Record<keyof T, any>) => Promise<boolean>` | - | Async check of `unique` fields, passed to the factory. |
|
|
67
|
+
| `possibilities` | `{ [key: string]: WritableSignal<{ id: any; text: string; checked: boolean }[]> }` | `{}` | Options of choice fields (`radio`, `check`, `enum`, ...), by field key. |
|
|
68
|
+
| `inputComponents` | `{ [key: string]: InputBaseComponentType<T> }` | `{}` | Field components by field key, used instead of the type's component. |
|
|
69
|
+
| `treeLevel` | `number` | `1` | Nesting depth; written to the host as the `tree-level` attribute. |
|
|
70
|
+
| `fieldOptions` | `IFieldOptions` | - | Not read by the built-in implementations; available to a custom implementation. |
|
|
71
|
+
| `modelOptions` | `IModelOptions` | - | Not read by the built-in implementations; available to a custom implementation. |
|
|
72
|
+
|
|
52
73
|
```typescript
|
|
53
74
|
interface IFormOptions<T> {
|
|
54
75
|
model: T; // Model instance (decorated with @Model / @Field)
|
|
55
|
-
show: boolean; //
|
|
76
|
+
show: boolean; // Required by the type, not read
|
|
56
77
|
treeLevel?: number; // Nesting depth in hierarchical forms
|
|
57
78
|
control?: AbstractControl; // Pre-built form group — skips FormFactory when provided
|
|
58
79
|
mode?: 'create' | 'update' | string; // Merges @Field({ create: … }) or { update: … } overrides
|
|
@@ -66,8 +87,8 @@ interface IFormOptions<T> {
|
|
|
66
87
|
inputComponents?: {
|
|
67
88
|
[key: string]: InputBaseComponentType<T>;
|
|
68
89
|
}; // Per-field component overrides keyed by field name
|
|
69
|
-
fieldOptions?: IFieldOptions; //
|
|
70
|
-
modelOptions?: IModelOptions; //
|
|
90
|
+
fieldOptions?: IFieldOptions; // Not read by the built-in implementations
|
|
91
|
+
modelOptions?: IModelOptions; // Not read by the built-in implementations
|
|
71
92
|
}
|
|
72
93
|
```
|
|
73
94
|
|
|
@@ -77,7 +98,7 @@ interface IFormOptions<T> {
|
|
|
77
98
|
import { FORM_STANDARD_COMPONENT_TOKEN } from '@smartsoft001/angular';
|
|
78
99
|
```
|
|
79
100
|
|
|
80
|
-
InjectionToken that allows replacing the default `FormStandardComponent` with a custom implementation. Provide a `Type<FormBaseComponent<T
|
|
101
|
+
InjectionToken that allows replacing the default `FormStandardComponent` with a custom implementation. Provide a `Type<FormBaseComponent<T>>`; it renders inside the wrapper's `<form>`, so a `type="submit"` button submits it.
|
|
81
102
|
|
|
82
103
|
```typescript
|
|
83
104
|
providers: [
|
|
@@ -89,22 +110,29 @@ providers: [
|
|
|
89
110
|
|
|
90
111
|
```typescript
|
|
91
112
|
import { Component, ViewEncapsulation } from '@angular/core';
|
|
92
|
-
import { FormBaseComponent } from '@smartsoft001/angular';
|
|
93
|
-
import { SmartInputComponent } from '@smartsoft001/angular';
|
|
113
|
+
import { FormBaseComponent, InputComponent } from '@smartsoft001/angular';
|
|
94
114
|
|
|
95
115
|
@Component({
|
|
96
116
|
selector: 'my-custom-form',
|
|
97
117
|
template: `
|
|
98
|
-
<
|
|
99
|
-
@for (field of fields; track field
|
|
118
|
+
<div [class]="cssClass()">
|
|
119
|
+
@for (field of fields; track field) {
|
|
100
120
|
<div class="my-field-row">
|
|
101
|
-
<smart-input
|
|
121
|
+
<smart-input
|
|
122
|
+
[options]="{
|
|
123
|
+
treeLevel: treeLevel ?? 0,
|
|
124
|
+
fieldKey: field,
|
|
125
|
+
control: getUntypedFormControl(field),
|
|
126
|
+
model: model,
|
|
127
|
+
mode: mode,
|
|
128
|
+
}"
|
|
129
|
+
/>
|
|
102
130
|
</div>
|
|
103
131
|
}
|
|
104
132
|
<button type="submit">Save</button>
|
|
105
|
-
</
|
|
133
|
+
</div>
|
|
106
134
|
`,
|
|
107
|
-
imports: [
|
|
135
|
+
imports: [InputComponent],
|
|
108
136
|
encapsulation: ViewEncapsulation.None,
|
|
109
137
|
})
|
|
110
138
|
export class MyCustomFormComponent extends FormBaseComponent<any> {}
|
|
@@ -154,7 +182,7 @@ Each field is rendered via `<smart-input>`. Per-field dispatch by `FieldType` is
|
|
|
154
182
|
|
|
155
183
|
`FormPresetComponent` (`<smart-form-preset>`) is a styled, drop-in replacement for `FormStandardComponent`. It extends the standard component and reuses all of its logic (field iteration, statuses, submit-on-enter, and the value/valid/partial outputs on the wrapper). The preset only restyles the **shell**: the form root gets a vertical rhythm (`smart:space-y-5`) and each field row is wrapped in a `data-role="field"` element (with the field key on `data-key`); the root carries `data-role="form"`.
|
|
156
184
|
|
|
157
|
-
**The form preset does NOT restyle field internals.** Each field is still rendered by `<smart-input>`, so to get the full styled look, register the input presets alongside it
|
|
185
|
+
**The form preset does NOT restyle field internals.** Each field is still rendered by `<smart-input>`, so to get the full styled look, register the input presets alongside it: provide `FormPresetComponent` for `FORM_STANDARD_COMPONENT_TOKEN` and `INPUT_PRESET_FIELD_COMPONENTS` for `INPUT_FIELD_COMPONENTS_TOKEN`, or register every preset at once with `provideSmartPresets()`.
|
|
158
186
|
|
|
159
187
|
```typescript
|
|
160
188
|
import {
|
|
@@ -31,13 +31,41 @@ Abstract base directive for extending custom grid-list implementations. Exposes
|
|
|
31
31
|
|
|
32
32
|
### Inputs
|
|
33
33
|
|
|
34
|
-
| Input | Type | Default | Description
|
|
35
|
-
| --------- | -------------------------------------------- | ------- |
|
|
36
|
-
| `options` | `InputSignal<IGridListOptions \| undefined>` | - |
|
|
37
|
-
| `class` | `InputSignal<string>` | `''` |
|
|
34
|
+
| Input | Type | Default | Description |
|
|
35
|
+
| --------- | -------------------------------------------- | ------- | ------------------------------------------------------------- |
|
|
36
|
+
| `options` | `InputSignal<IGridListOptions \| undefined>` | - | Header, items, grid shape and slots |
|
|
37
|
+
| `class` | `InputSignal<string>` | `''` | Classes on the root element (`cssClass` input, alias `class`) |
|
|
38
38
|
|
|
39
39
|
### IGridListOptions
|
|
40
40
|
|
|
41
|
+
| Field | Type | Default | Description |
|
|
42
|
+
| ------------- | ---------------------- | --------- | ---------------------------------------------------------------------------------------------------------------- |
|
|
43
|
+
| `title` | `string` | - | Heading above the grid. |
|
|
44
|
+
| `description` | `string` | - | Text under the heading. |
|
|
45
|
+
| `items` | `IGridListItem[]` | `[]` | The tiles. |
|
|
46
|
+
| `columns` | `SmartGridListColumns` | - | Preset only: one column on mobile, two from `sm`, the requested count from `lg` (`1` or unset stays one column). |
|
|
47
|
+
| `gap` | `'sm' \| 'md' \| 'lg'` | `'md'` | Preset only: the spacing between tiles. |
|
|
48
|
+
| `layout` | `SmartGridListLayout` | `'cards'` | Preset only: media on top (`cards`), an inline row (`horizontal`) or a centred logo (`logos`). |
|
|
49
|
+
| `emptyTpl` | `TemplateRef<unknown>` | - | Shown when there are no items (the preset falls back to an untranslated "No items to display."). |
|
|
50
|
+
| `footerTpl` | `TemplateRef<unknown>` | - | A slot below the grid. |
|
|
51
|
+
|
|
52
|
+
`SmartGridListColumns` is `1 | 2 | 3 | 4 | 5 | 6`; `SmartGridListLayout` is `'cards' | 'horizontal' | 'logos'`.
|
|
53
|
+
|
|
54
|
+
### IGridListItem
|
|
55
|
+
|
|
56
|
+
| Field | Type | Default | Description |
|
|
57
|
+
| ------------- | ---------------------- | -------- | -------------------------------------- |
|
|
58
|
+
| `id` | `string` | - | Track key of the tile. |
|
|
59
|
+
| `title` | `string` | required | Tile title; a link when `href` is set. |
|
|
60
|
+
| `description` | `string` | - | Tile text. |
|
|
61
|
+
| `imageUrl` | `string` | - | Tile image. |
|
|
62
|
+
| `imageAlt` | `string` | - | Alt text of the image. |
|
|
63
|
+
| `href` | `string` | - | Makes the title a link. |
|
|
64
|
+
| `iconTpl` | `TemplateRef<unknown>` | - | Media icon; wins over `imageUrl`. |
|
|
65
|
+
| `badgeTpl` | `TemplateRef<unknown>` | - | Badge next to the title. |
|
|
66
|
+
| `actionTpl` | `TemplateRef<unknown>` | - | Action slot of the tile. |
|
|
67
|
+
| `ariaLabel` | `string` | - | Accessible name of the tile. |
|
|
68
|
+
|
|
41
69
|
```typescript
|
|
42
70
|
interface IGridListOptions {
|
|
43
71
|
title?: string;
|
|
@@ -64,7 +92,7 @@ interface IGridListItem {
|
|
|
64
92
|
}
|
|
65
93
|
```
|
|
66
94
|
|
|
67
|
-
|
|
95
|
+
The standard renders every field except `columns`, `gap` and `layout`, which only shape the preset's grid (or a custom implementation's); a section is rendered only when its template/string is provided. Within an item, `iconTpl` takes precedence over `imageUrl` when both are set.
|
|
68
96
|
|
|
69
97
|
## GRID_LIST_STANDARD_COMPONENT_TOKEN
|
|
70
98
|
|
|
@@ -72,7 +100,7 @@ All properties are optional except `IGridListItem.title`. The default `GridListS
|
|
|
72
100
|
import { GRID_LIST_STANDARD_COMPONENT_TOKEN } from '@smartsoft001/angular';
|
|
73
101
|
```
|
|
74
102
|
|
|
75
|
-
InjectionToken that allows replacing the default `GridListStandardComponent` with a custom implementation. Provide a `Type<GridListBaseComponent>` to override.
|
|
103
|
+
InjectionToken that allows replacing the default `GridListStandardComponent` with a custom implementation. Provide a `Type<GridListBaseComponent>` to override; the wrapper passes `options` and the class on.
|
|
76
104
|
|
|
77
105
|
```typescript
|
|
78
106
|
providers: [
|
|
@@ -90,7 +118,6 @@ import {
|
|
|
90
118
|
ChangeDetectionStrategy,
|
|
91
119
|
Component,
|
|
92
120
|
computed,
|
|
93
|
-
input,
|
|
94
121
|
ViewEncapsulation,
|
|
95
122
|
} from '@angular/core';
|
|
96
123
|
import { NgTemplateOutlet } from '@angular/common';
|
|
@@ -128,9 +155,6 @@ import { GridListBaseComponent } from '@smartsoft001/angular';
|
|
|
128
155
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
129
156
|
})
|
|
130
157
|
export class MyCustomGridListComponent extends GridListBaseComponent {
|
|
131
|
-
// NgComponentOutlet passes 'cssClass' by canonical name, not the 'class' alias.
|
|
132
|
-
override cssClass = input<string>('');
|
|
133
|
-
|
|
134
158
|
containerClasses = computed(() => {
|
|
135
159
|
const classes = ['my-grid-list'];
|
|
136
160
|
const extra = this.cssClass();
|
|
@@ -228,7 +252,7 @@ Layout:
|
|
|
228
252
|
|
|
229
253
|
Every zone is addressable via `data-role` hooks: `header`, `grid`, `item`, `media`, `title`, `description`, `badge`, `action`, `empty`, `footer`.
|
|
230
254
|
|
|
231
|
-
Register it
|
|
255
|
+
Register it for `GRID_LIST_STANDARD_COMPONENT_TOKEN` to restyle every `<smart-grid-list>`, or register every preset at once with `provideSmartPresets()`.
|
|
232
256
|
|
|
233
257
|
```typescript
|
|
234
258
|
providers: [
|
|
@@ -239,9 +263,9 @@ providers: [
|
|
|
239
263
|
];
|
|
240
264
|
```
|
|
241
265
|
|
|
242
|
-
|
|
266
|
+
The preset declares `cssClass` without the `class` alias, so bind `[cssClass]` when you use the `<smart-grid-list-preset>` selector directly; `class` on `<smart-grid-list>` reaches it through the wrapper and is merged onto the root wrapper.
|
|
243
267
|
|
|
244
|
-
|
|
268
|
+
The class recipes are internal (not exported from `@smartsoft001/angular`).
|
|
245
269
|
|
|
246
270
|
Documented gaps: `layout` only affects the tile interior arrangement (not per-item overrides); there is no built-in pagination or selection state.
|
|
247
271
|
|
|
@@ -21,23 +21,23 @@ other component groups the icon has **no `*_STANDARD_COMPONENT_TOKEN`** and **no
|
|
|
21
21
|
|
|
22
22
|
### `smart-icon`
|
|
23
23
|
|
|
24
|
-
| Input | Type | Default | Description
|
|
25
|
-
| ---------- | ---------------------------- | ----------- |
|
|
26
|
-
| `name` | `IconName` | `undefined` | Which built-in glyph to render
|
|
27
|
-
| `template` | `TemplateRef<unknown>\|null` | `null` | Custom SVG; overrides `name` when set
|
|
28
|
-
| `class` | `string` | `''` | Extra CSS class forwarded to the glyph |
|
|
24
|
+
| Input | Type | Default | Description |
|
|
25
|
+
| ---------- | ---------------------------- | ----------- | -------------------------------------------------------------------- |
|
|
26
|
+
| `name` | `IconName` | `undefined` | Which built-in glyph to render |
|
|
27
|
+
| `template` | `TemplateRef<unknown>\|null` | `null` | Custom SVG; overrides `name` when set |
|
|
28
|
+
| `class` | `string` | `''` | Extra CSS class forwarded to the glyph (not applied to a `template`) |
|
|
29
29
|
|
|
30
30
|
`class` is the alias of the internal `cssClass` input (`input('', { alias: 'class' })`).
|
|
31
31
|
|
|
32
32
|
### IconName
|
|
33
33
|
|
|
34
|
+
`IconName` is `'spinner' | 'chevron-down' | 'chevron-up'`; `<smart-icon>` renders nothing for another value.
|
|
35
|
+
|
|
34
36
|
```typescript
|
|
35
37
|
type IconName = 'spinner' | 'chevron-down' | 'chevron-up';
|
|
36
38
|
```
|
|
37
39
|
|
|
38
|
-
Each value maps to a standalone component (`smart-icon-spinner`,
|
|
39
|
-
`smart-icon-chevron-down`, `smart-icon-chevron-up`) that renders a raw `<svg>`
|
|
40
|
-
with `smart:`-prefixed Tailwind sizing.
|
|
40
|
+
Each value maps to a standalone glyph component that renders a raw `<svg>` (`smart:size-5` plus the `class`; the spinner also spins): `IconSpinnerComponent` (`smart-icon-spinner`), `IconChevronDownComponent` (`smart-icon-chevron-down`) and `IconChevronUpComponent` (`smart-icon-chevron-up`). They extend `IconBaseComponent`, which declares the `cssClass` input (alias `class`).
|
|
41
41
|
|
|
42
42
|
### Dispatch
|
|
43
43
|
|
|
@@ -30,13 +30,15 @@ Default concrete implementation. Renders:
|
|
|
30
30
|
|
|
31
31
|
### InfoPresetComponent (`<smart-info-preset>`)
|
|
32
32
|
|
|
33
|
-
Styled variation that extends `InfoBaseComponent` and is a drop-in replacement for `InfoStandardComponent`. Register it via `INFO_STANDARD_COMPONENT_TOKEN` to restyle every `<smart-info>`, or use the `<smart-info-preset>` selector directly. It renders the Preline **Tooltip** look: a circular icon toggle plus a small tooltip bubble. Visibility is driven by Angular hover/focus (`(mouseenter)`/`(mouseleave)` + `(focus)`/`(blur)`) using the inherited `isOpen` signal and `@if` — Preline's JS plugin is not installed. It keeps the translated Preline visual classes
|
|
33
|
+
Styled variation that extends `InfoBaseComponent` and is a drop-in replacement for `InfoStandardComponent`. Register it via `INFO_STANDARD_COMPONENT_TOKEN` (or register every preset at once with `provideSmartPresets()`) to restyle every `<smart-info>`, or use the `<smart-info-preset>` selector directly. It renders the Preline **Tooltip** look: a circular icon toggle plus a small tooltip bubble. Visibility is driven by Angular hover/focus (`(mouseenter)`/`(mouseleave)` + `(focus)`/`(blur)`) using the inherited `isOpen` signal and `@if` — Preline's JS plugin is not installed. It keeps the translated Preline visual classes and renders `role="tooltip"` with `aria-describedby` wiring on the toggle. All classes are `smart:`-prefixed Tailwind with explicit `dark:` variants; the class recipes are internal to the preset (not exported).
|
|
34
34
|
|
|
35
|
-
|
|
35
|
+
The preset adds one input of its own, `placement`, described in the API section. It is only available on the `<smart-info-preset>` selector: the `<smart-info>` wrapper forwards `options` and `class` only, so a preset registered through the token always opens its tooltip on `'top'`.
|
|
36
|
+
|
|
37
|
+
The preset declares `cssClass` without the `class` alias, so on the `<smart-info-preset>` selector bind it as `[cssClass]`; on `<smart-info>` pass `class` as usual (the wrapper forwards it to whichever implementation it renders).
|
|
36
38
|
|
|
37
39
|
### InfoBaseComponent (abstract)
|
|
38
40
|
|
|
39
|
-
Abstract base directive for extending custom info implementations. Exposes `options`, `cssClass
|
|
41
|
+
Abstract base directive for extending custom info implementations. Exposes `options`, `cssClass` (input alias `class`), the `isOpen` signal, and `toggle()`/`open()`/`close()` methods.
|
|
40
42
|
|
|
41
43
|
## API
|
|
42
44
|
|
|
@@ -47,26 +49,31 @@ Abstract base directive for extending custom info implementations. Exposes `opti
|
|
|
47
49
|
| `options` | `InputSignal<IInfoOptions>` | required | Info configuration |
|
|
48
50
|
| `class` | `InputSignal<string>` | `''` | External CSS classes (alias for `cssClass`) |
|
|
49
51
|
|
|
52
|
+
`InfoPresetComponent` (the `<smart-info-preset>` selector only) adds one input.
|
|
53
|
+
|
|
54
|
+
| Input | Type | Default | Description |
|
|
55
|
+
| ----------- | ---------------------------------------- | ------- | ---------------------------------------- |
|
|
56
|
+
| `placement` | `'top' \| 'bottom' \| 'left' \| 'right'` | `'top'` | Side of the toggle the tooltip opens on. |
|
|
57
|
+
|
|
50
58
|
### IInfoOptions
|
|
51
59
|
|
|
60
|
+
| Field | Type | Default | Description |
|
|
61
|
+
| ------ | -------- | -------- | ---------------------------------------------------------------------------------------- |
|
|
62
|
+
| `text` | `string` | required | The text of the popover, rendered through `TranslatePipe` (it may be a translation key). |
|
|
63
|
+
|
|
52
64
|
```typescript
|
|
53
65
|
interface IInfoOptions {
|
|
54
66
|
text: string;
|
|
55
67
|
}
|
|
56
68
|
```
|
|
57
69
|
|
|
58
|
-
The `text` value is rendered inside the popover through `TranslatePipe`, so it may be a translation key.
|
|
59
|
-
|
|
60
70
|
### INFO_STANDARD_COMPONENT_TOKEN
|
|
61
71
|
|
|
72
|
+
InjectionToken from `@smartsoft001/angular` that allows replacing the default `InfoStandardComponent` with a custom implementation. Provide a `Type<InfoBaseComponent>` in your application or component providers; `provideSmartPresets()` provides `InfoPresetComponent` for it together with every other preset.
|
|
73
|
+
|
|
62
74
|
```typescript
|
|
63
75
|
import { INFO_STANDARD_COMPONENT_TOKEN } from '@smartsoft001/angular';
|
|
64
|
-
```
|
|
65
|
-
|
|
66
|
-
InjectionToken that allows replacing the default `InfoStandardComponent` with a custom implementation. Provide a `Type<InfoBaseComponent>` to override.
|
|
67
76
|
|
|
68
|
-
```typescript
|
|
69
|
-
// In your app module or component providers:
|
|
70
77
|
providers: [
|
|
71
78
|
{
|
|
72
79
|
provide: INFO_STANDARD_COMPONENT_TOKEN,
|
|
@@ -126,10 +133,7 @@ export class MyCustomInfoComponent extends InfoBaseComponent {
|
|
|
126
133
|
}
|
|
127
134
|
```
|
|
128
135
|
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
- declare `cssClass = input<string>('')` explicitly (no `class` alias) if the component is used via `NgComponentOutlet` through `INFO_STANDARD_COMPONENT_TOKEN`, because `NgComponentOutlet` passes inputs by canonical name (not by alias),
|
|
132
|
-
- implement a close-on-outside-click listener yourself if the popover should close when clicking outside — the base class does not do it for you.
|
|
136
|
+
The inherited `cssClass` (input alias `class`) receives the class passed to `<smart-info>`: the wrapper forwards it under the name the rendered component declares. Implement a close-on-outside-click listener yourself if the popover should close when clicking outside — the base class does not do it for you.
|
|
133
137
|
|
|
134
138
|
## Usage Examples
|
|
135
139
|
|
|
@@ -162,7 +166,7 @@ When extending the base directly, remember to:
|
|
|
162
166
|
- Wrapper: `packages/shared/angular/src/lib/components/info/info.component.ts`
|
|
163
167
|
- Standard: `packages/shared/angular/src/lib/components/info/standard/standard.component.ts`
|
|
164
168
|
- Preset variation: `packages/shared/angular/src/lib/components/info/preset/preset.component.ts`
|
|
165
|
-
- Preset class recipes: `packages/shared/angular/src/lib/components/info/preset/preset-classes.util.ts`
|
|
169
|
+
- Preset class recipes (internal, not exported): `packages/shared/angular/src/lib/components/info/preset/preset-classes.util.ts`
|
|
166
170
|
- Base class: `packages/shared/angular/src/lib/components/info/base/base.component.ts`
|
|
167
171
|
- Token: `packages/shared/angular/src/lib/shared.inectors.ts` (`INFO_STANDARD_COMPONENT_TOKEN`)
|
|
168
172
|
- Interface: `packages/shared/angular/src/lib/models/interfaces.ts` (`IInfoOptions`)
|