@smartsoft001/claude-plugins 2.124.0 → 2.126.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/.claude-plugin/plugin.json +1 -1
- package/plugins/smart/skills/angular-components-accordion/SKILL.md +38 -0
- package/plugins/smart/skills/angular-components-action-panel/SKILL.md +49 -0
- package/plugins/smart/skills/angular-components-avatar/SKILL.md +8 -0
- package/plugins/smart/skills/angular-components-badge/SKILL.md +47 -3
- package/plugins/smart/skills/angular-components-breadcrumbs/SKILL.md +9 -0
- package/plugins/smart/skills/angular-components-button/SKILL.md +18 -0
- package/plugins/smart/skills/angular-components-button-group/SKILL.md +11 -0
- package/plugins/smart/skills/angular-components-calendar/SKILL.md +7 -0
- package/plugins/smart/skills/angular-components-card/SKILL.md +20 -0
- package/plugins/smart/skills/angular-components-card-heading/SKILL.md +59 -0
- package/plugins/smart/skills/angular-components-command-palette/SKILL.md +47 -0
- package/plugins/smart/skills/angular-components-container/SKILL.md +31 -0
- package/plugins/smart/skills/angular-components-date-edit/SKILL.md +26 -0
- package/plugins/smart/skills/angular-components-date-range/SKILL.md +34 -0
- package/plugins/smart/skills/angular-components-description-list/SKILL.md +22 -0
- package/plugins/smart/skills/angular-components-detail/SKILL.md +49 -0
- package/plugins/smart/skills/angular-components-divider/SKILL.md +23 -0
- package/plugins/smart/skills/angular-components-drawer/SKILL.md +10 -0
- package/plugins/smart/skills/angular-components-dropdown/SKILL.md +8 -0
- package/plugins/smart/skills/angular-components-empty-state/SKILL.md +5 -0
- package/plugins/smart/skills/angular-components-feed/SKILL.md +9 -0
- package/plugins/smart/skills/angular-components-form/SKILL.md +28 -0
- package/plugins/smart/skills/angular-components-grid-list/SKILL.md +33 -0
- package/plugins/smart/skills/angular-components-icon/SKILL.md +131 -0
- package/plugins/smart/skills/angular-components-info/SKILL.md +8 -0
- package/plugins/smart/skills/angular-components-input/SKILL.md +56 -0
- package/plugins/smart/skills/angular-components-list/SKILL.md +50 -0
- package/plugins/smart/skills/angular-components-media-object/SKILL.md +53 -0
- package/plugins/smart/skills/angular-components-modal/SKILL.md +11 -0
- package/plugins/smart/skills/angular-components-multi-column-layout/SKILL.md +44 -0
- package/plugins/smart/skills/angular-components-navbar/SKILL.md +21 -0
- package/plugins/smart/skills/angular-components-notification/SKILL.md +16 -1
- package/plugins/smart/skills/angular-components-page/SKILL.md +58 -0
- package/plugins/smart/skills/angular-components-page-heading/SKILL.md +78 -0
- package/plugins/smart/skills/angular-components-paging/SKILL.md +50 -0
- package/plugins/smart/skills/angular-components-progress-bars/SKILL.md +13 -0
- package/plugins/smart/skills/angular-components-section-heading/SKILL.md +36 -0
- package/plugins/smart/skills/angular-components-sidebar-layout/SKILL.md +45 -0
- package/plugins/smart/skills/angular-components-sign-in-form/SKILL.md +39 -0
- package/plugins/smart/skills/angular-components-stacked-layout/SKILL.md +41 -0
- package/plugins/smart/skills/angular-components-stats/SKILL.md +43 -0
- package/plugins/smart/skills/angular-components-tabs/SKILL.md +43 -0
- package/plugins/smart/skills/angular-components-toggle/SKILL.md +42 -0
- package/plugins/smart/skills/angular-components-vertical-navigation/SKILL.md +5 -0
- package/plugins/smart/skills/smart-crud/SKILL.md +212 -0
|
@@ -23,6 +23,12 @@ Main wrapper component. Renders `StatsStandardComponent` by default. When `STATS
|
|
|
23
23
|
|
|
24
24
|
Barebones placeholder concrete implementation. Renders a wrapper `<div>` containing an optional `<h3 class="title">` and a `<dl>` with one `<div class="item">` per item. Each item renders an optional icon (`iconTpl` in `<div class="icon">`), label (`<dt class="label">`), value (`<dd class="value">`), optional previous value (`<dd class="previous">`), optional change with `data-trend` attribute (`<dd class="change">`), and optional action template (`actionTpl` in `<div class="action">`). The external `cssClass` is applied to the root wrapper. It does not include any visual styling — it exists solely as the default structural placeholder until a custom implementation is registered through the token.
|
|
25
25
|
|
|
26
|
+
### StatsPresetComponent (`<smart-stats-preset>`)
|
|
27
|
+
|
|
28
|
+
Styled variation that extends `StatsBaseComponent` and is a drop-in replacement for `StatsStandardComponent`. Register it via `STATS_STANDARD_COMPONENT_TOKEN` to restyle every `<smart-stats>`, or use the `<smart-stats-preset>` selector directly. Renders the Preline "Three-Column Stats with Primary Accent" look: a responsive grid of stat blocks, each with an optional leading icon (`iconTpl`), a `label` heading, the big primary-accent `value` (with an optional inline `change` badge coloured by `trend` — green for `up`, red for `down`, gray for `neutral`/unset), an optional muted `previousValue` sub-line, and an optional `actionTpl`. Column count comes from `options.columns` (default `3`); an optional `options.title` renders as a heading above the grid. All classes are `smart:`-prefixed Tailwind with explicit `dark:` variants. The class recipes live in `preset/preset-classes.util.ts` (`getStatsContainerClasses`, `getStatsGridClasses`, `getStatsChangeClasses`, etc.).
|
|
29
|
+
|
|
30
|
+
> Because `StatsComponent` renders injected components via `NgComponentOutlet` (which passes inputs by canonical name), `StatsPresetComponent` overrides `cssClass` as `input<string>('')` **without** the `class` alias. Bind it as `[cssClass]` when using the `<smart-stats-preset>` selector directly, or just pass `class` on `<smart-stats>` (the wrapper forwards it).
|
|
31
|
+
|
|
26
32
|
### StatsBaseComponent (abstract)
|
|
27
33
|
|
|
28
34
|
Abstract base directive for extending custom stats implementations. Exposes `options` as an `InputSignal<IStatsOptions | undefined>` and `cssClass` as an `InputSignal<string>` (with alias `class`).
|
|
@@ -204,10 +210,47 @@ export class MyCustomStatsComponent extends StatsBaseComponent {
|
|
|
204
210
|
/>
|
|
205
211
|
```
|
|
206
212
|
|
|
213
|
+
### Using the preset variation
|
|
214
|
+
|
|
215
|
+
```typescript
|
|
216
|
+
// Register globally (or in a feature's providers) to restyle every <smart-stats>:
|
|
217
|
+
import {
|
|
218
|
+
STATS_STANDARD_COMPONENT_TOKEN,
|
|
219
|
+
StatsPresetComponent,
|
|
220
|
+
} from '@smartsoft001/angular';
|
|
221
|
+
|
|
222
|
+
providers: [
|
|
223
|
+
{ provide: STATS_STANDARD_COMPONENT_TOKEN, useValue: StatsPresetComponent },
|
|
224
|
+
];
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
```html
|
|
228
|
+
<!-- Then drive the look via options (columns, trend-coloured change badges) -->
|
|
229
|
+
<smart-stats
|
|
230
|
+
[options]="{
|
|
231
|
+
title: 'By the numbers',
|
|
232
|
+
columns: 3,
|
|
233
|
+
items: [
|
|
234
|
+
{ label: 'Accuracy rate', value: '99.95%', previousValue: 'in fulfilling orders' },
|
|
235
|
+
{ label: 'Conversion', value: '92%', change: '+7%', trend: 'up' },
|
|
236
|
+
],
|
|
237
|
+
}"
|
|
238
|
+
/>
|
|
239
|
+
|
|
240
|
+
<!-- Or use the variation selector directly (note [cssClass], not class) -->
|
|
241
|
+
<smart-stats-preset
|
|
242
|
+
[options]="{ columns: 2, items: stats }"
|
|
243
|
+
[cssClass]="'smart:py-4'"
|
|
244
|
+
/>
|
|
245
|
+
```
|
|
246
|
+
|
|
207
247
|
## File Locations
|
|
208
248
|
|
|
209
249
|
- Wrapper: `packages/shared/angular/src/lib/components/stats/stats.component.ts`
|
|
210
250
|
- Standard: `packages/shared/angular/src/lib/components/stats/standard/standard.component.ts`
|
|
251
|
+
- Preset variation: `packages/shared/angular/src/lib/components/stats/preset/preset.component.ts`
|
|
252
|
+
- Preset class recipes: `packages/shared/angular/src/lib/components/stats/preset/preset-classes.util.ts`
|
|
211
253
|
- Base class: `packages/shared/angular/src/lib/components/stats/base/base.component.ts`
|
|
254
|
+
- Stories: `packages/shared/angular/src/lib/components/stats/stats.component.stories.ts`
|
|
212
255
|
- Token: `packages/shared/angular/src/lib/shared.inectors.ts` (`STATS_STANDARD_COMPONENT_TOKEN`)
|
|
213
256
|
- Interfaces: `packages/shared/angular/src/lib/models/interfaces.ts` (`IStatsOptions`, `IStatItem`)
|
|
@@ -23,6 +23,12 @@ Main wrapper. Delegates to `TabsStandardComponent` by default. When `TABS_STANDA
|
|
|
23
23
|
|
|
24
24
|
Barebones placeholder using native HTML. Renders an outer wrapper with `cssClass`, an optional mobile `<select>` (rendered when `options.showMobileSelect` is `true` or unset and `items` is non-empty), and a `<nav class="tabs-desktop">` containing a `<ul class="tabs-list">` of items. Each item renders as `<a class="tab-link">` when `href` is provided, otherwise `<button class="tab-button">` emitting `tabChange` and updating `selectedId`. Adds `current` class and `aria-current="page"` when `item.id === selectedId()`. Supports optional `iconTpl` and `badge` per item.
|
|
25
25
|
|
|
26
|
+
### TabsPresetComponent (`<smart-tabs-preset>`)
|
|
27
|
+
|
|
28
|
+
Styled variation that extends `TabsBaseComponent` and is a drop-in replacement for `TabsStandardComponent`. Register it via `TABS_STANDARD_COMPONENT_TOKEN` to restyle every `<smart-tabs>`, or use the `<smart-tabs-preset>` selector directly. It renders the translated Preline tab nav for every `SmartTabsLayout` (`underline`, `underline-with-icons`, `underline-with-badges`, `underline-full-width`, `pills`, `pills-on-gray`, `pills-with-brand-color`, `bar-with-underline`, `simple`), selected through `options.layout` (default `'underline'`). Honors `options.items` (rendering `<a role="tab">` when `href` is set, otherwise `<button role="tab">`), `options.ariaLabel`, per-item `iconTpl` and `badge`, and `options.showMobileSelect` (default `true` → renders a `<select>` shown only below `sm` and hides the nav below `sm`). The active tab is driven by the `selectedId` model (falling back to the first item) via `(click)` — Preline's Tabs JS plugin is **not** used. ARIA (`role=tablist/tab`, `aria-selected`, `aria-controls`, `aria-orientation`) is kept on the markup. All classes are `smart:`-prefixed Tailwind with explicit `dark:` variants; the per-layout class recipes live in `preset/preset-classes.util.ts`.
|
|
29
|
+
|
|
30
|
+
> Because `TabsComponent` renders injected components via `NgComponentOutlet` (which passes inputs by canonical name), `TabsPresetComponent` overrides `cssClass` as `input<string>('')` **without** the `class` alias. Bind it as `[cssClass]` when using the `<smart-tabs-preset>` selector directly, or just pass `class` on `<smart-tabs>` (the wrapper forwards it). Note: `NgComponentOutlet` does not wire outputs, so `tabChange` does not bubble through `<smart-tabs>` when the preset is registered via the token; subscribe to it on `<smart-tabs-preset>` directly if you need the event.
|
|
31
|
+
|
|
26
32
|
### TabsBaseComponent (abstract)
|
|
27
33
|
|
|
28
34
|
Abstract base directive. Exposes:
|
|
@@ -172,10 +178,47 @@ export class MyCustomTabsComponent extends TabsBaseComponent {
|
|
|
172
178
|
/>
|
|
173
179
|
```
|
|
174
180
|
|
|
181
|
+
### Using the preset variation
|
|
182
|
+
|
|
183
|
+
```typescript
|
|
184
|
+
// Register globally (or in a feature's providers) to restyle every <smart-tabs>:
|
|
185
|
+
import {
|
|
186
|
+
TABS_STANDARD_COMPONENT_TOKEN,
|
|
187
|
+
TabsPresetComponent,
|
|
188
|
+
} from '@smartsoft001/angular';
|
|
189
|
+
|
|
190
|
+
providers: [
|
|
191
|
+
{ provide: TABS_STANDARD_COMPONENT_TOKEN, useValue: TabsPresetComponent },
|
|
192
|
+
];
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
```html
|
|
196
|
+
<!-- Then drive the look via options.layout -->
|
|
197
|
+
<smart-tabs
|
|
198
|
+
[(selectedId)]="active"
|
|
199
|
+
[options]="{
|
|
200
|
+
layout: 'pills-with-brand-color',
|
|
201
|
+
items: [
|
|
202
|
+
{ id: 'overview', label: 'Overview' },
|
|
203
|
+
{ id: 'settings', label: 'Settings' },
|
|
204
|
+
],
|
|
205
|
+
}"
|
|
206
|
+
/>
|
|
207
|
+
|
|
208
|
+
<!-- Or use the variation selector directly (note [cssClass], not class) -->
|
|
209
|
+
<smart-tabs-preset
|
|
210
|
+
[(selectedId)]="active"
|
|
211
|
+
[options]="{ layout: 'underline', items: items }"
|
|
212
|
+
/>
|
|
213
|
+
```
|
|
214
|
+
|
|
175
215
|
## File Locations
|
|
176
216
|
|
|
177
217
|
- Wrapper: `packages/shared/angular/src/lib/components/tabs/tabs.component.ts`
|
|
178
218
|
- Standard: `packages/shared/angular/src/lib/components/tabs/standard/standard.component.ts`
|
|
219
|
+
- Preset variation: `packages/shared/angular/src/lib/components/tabs/preset/preset.component.ts`
|
|
220
|
+
- Preset class recipes: `packages/shared/angular/src/lib/components/tabs/preset/preset-classes.util.ts`
|
|
179
221
|
- Base class: `packages/shared/angular/src/lib/components/tabs/base/base.component.ts`
|
|
222
|
+
- Stories: `packages/shared/angular/src/lib/components/tabs/tabs.component.stories.ts`
|
|
180
223
|
- Token: `packages/shared/angular/src/lib/shared.inectors.ts` (`TABS_STANDARD_COMPONENT_TOKEN`)
|
|
181
224
|
- Interfaces: `packages/shared/angular/src/lib/models/interfaces.ts` (`ITabsOptions`, `ITabItem`, `SmartTabsLayout`)
|
|
@@ -23,6 +23,12 @@ Main wrapper component. Renders `ToggleStandardComponent` by default. When `TOGG
|
|
|
23
23
|
|
|
24
24
|
Barebones placeholder concrete implementation. Renders a minimal `<input type="checkbox">` bound to `value` and `disabled`, with an optional `aria-label` from `options.ariaLabel`, and the external `cssClass` applied to the input element. It does not include Tailwind UI styling — it exists solely as the default structural placeholder until a custom implementation is registered through the token.
|
|
25
25
|
|
|
26
|
+
### TogglePresetComponent (`<smart-toggle-preset>`)
|
|
27
|
+
|
|
28
|
+
Styled variation that extends `ToggleBaseComponent` and is a drop-in replacement for `ToggleStandardComponent`. Register it via `TOGGLE_STANDARD_COMPONENT_TOKEN` to restyle every `<smart-toggle>`, or use the `<smart-toggle-preset>` selector directly. It renders the Preline **default switch**: a hidden, accessible `<input type="checkbox">` (with `peer sr-only`) drives the track / thumb visuals through `peer-checked` / `peer-disabled` states, while the `value` model holds the checked state (updated via the checkbox `change` event). Honors `options.label` and `options.description` (rendered beside the switch), `options.labelPosition` (`'left'` | `'right'`, default `'right'`), `options.ariaLabel` (forwarded to the checkbox), and `disabled`. All classes are `smart:`-prefixed Tailwind with explicit `dark:` variants. The class recipes live in `preset/preset-classes.util.ts` (`getToggleContainerClasses`, `getToggleSwitchClasses`, `getToggleTrackClasses`, `getToggleThumbClasses`, `getToggleTextWrapClasses`, `getToggleLabelClasses`, `getToggleDescriptionClasses`).
|
|
29
|
+
|
|
30
|
+
> Because `ToggleComponent` renders injected components via `NgComponentOutlet` (which passes inputs by canonical name), `TogglePresetComponent` overrides `cssClass` as `input<string>('')` **without** the `class` alias. Bind it as `[cssClass]` when using the `<smart-toggle-preset>` selector directly, or just pass `class` on `<smart-toggle>` (the wrapper forwards it). Note that the Preline doc's size, soft-color, rounded, icon, tooltip, and validation-state variants are **not** exposed, because `IToggleOptions` has no size/variant/color fields; the preset renders the default medium pill switch in the primary (blue) color.
|
|
31
|
+
|
|
26
32
|
### ToggleBaseComponent (abstract)
|
|
27
33
|
|
|
28
34
|
Abstract base directive for extending custom toggle implementations. Exposes `value` as a two-way `ModelSignal<boolean>` (default `false`), `disabled` as an `InputSignal<boolean>` (default `false`), `options` as an `InputSignal<IToggleOptions | undefined>`, `cssClass` as an `InputSignal<string>` (with alias `class`), and a `toggle()` method that calls `value.set(!value())` when `disabled()` is `false`.
|
|
@@ -146,10 +152,46 @@ When extending the base directly, remember to:
|
|
|
146
152
|
<smart-toggle [(value)]="enabled" class="smart:my-2" />
|
|
147
153
|
```
|
|
148
154
|
|
|
155
|
+
### Using the preset variation
|
|
156
|
+
|
|
157
|
+
```typescript
|
|
158
|
+
// Register globally (or in a feature's providers) to restyle every <smart-toggle>:
|
|
159
|
+
import {
|
|
160
|
+
TOGGLE_STANDARD_COMPONENT_TOKEN,
|
|
161
|
+
TogglePresetComponent,
|
|
162
|
+
} from '@smartsoft001/angular';
|
|
163
|
+
|
|
164
|
+
providers: [
|
|
165
|
+
{ provide: TOGGLE_STANDARD_COMPONENT_TOKEN, useValue: TogglePresetComponent },
|
|
166
|
+
];
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
```html
|
|
170
|
+
<!-- Then drive it through value + options -->
|
|
171
|
+
<smart-toggle [(value)]="enabled" [options]="{ label: 'Notifications' }" />
|
|
172
|
+
<smart-toggle
|
|
173
|
+
[(value)]="enabled"
|
|
174
|
+
[options]="{
|
|
175
|
+
label: 'Dark mode',
|
|
176
|
+
description: 'Use the dark theme',
|
|
177
|
+
labelPosition: 'left',
|
|
178
|
+
}"
|
|
179
|
+
/>
|
|
180
|
+
|
|
181
|
+
<!-- Or use the variation selector directly (note [cssClass], not class) -->
|
|
182
|
+
<smart-toggle-preset
|
|
183
|
+
[(value)]="enabled"
|
|
184
|
+
[options]="{ ariaLabel: 'Use setting' }"
|
|
185
|
+
/>
|
|
186
|
+
```
|
|
187
|
+
|
|
149
188
|
## File Locations
|
|
150
189
|
|
|
151
190
|
- Wrapper: `packages/shared/angular/src/lib/components/toggle/toggle.component.ts`
|
|
152
191
|
- Standard: `packages/shared/angular/src/lib/components/toggle/standard/standard.component.ts`
|
|
192
|
+
- Preset variation: `packages/shared/angular/src/lib/components/toggle/preset/preset.component.ts`
|
|
193
|
+
- Preset class recipes: `packages/shared/angular/src/lib/components/toggle/preset/preset-classes.util.ts`
|
|
194
|
+
- Stories: `packages/shared/angular/src/lib/components/toggle/toggle.component.stories.ts`
|
|
153
195
|
- Base class: `packages/shared/angular/src/lib/components/toggle/base/base.component.ts`
|
|
154
196
|
- Token: `packages/shared/angular/src/lib/shared.inectors.ts` (`TOGGLE_STANDARD_COMPONENT_TOKEN`)
|
|
155
197
|
- Interface: `packages/shared/angular/src/lib/models/interfaces.ts` (`IToggleOptions`)
|
|
@@ -23,6 +23,10 @@ Main wrapper. Delegates to `VerticalNavigationStandardComponent` by default. Whe
|
|
|
23
23
|
|
|
24
24
|
Barebones placeholder using native HTML. Renders an outer wrapper with `cssClass`, a `<nav class="vertical-navigation">` (with `aria-label` from `options.ariaLabel` or default `"Sidebar"`), and a `<ul>` of groups. Each group renders an optional `<div class="group-title">` and a `<ul>` of items; each item renders as `<a class="item-link">` (when `href` provided) or `<button class="item-button">` (otherwise, emitting `itemClick`). Items get `current` class and `aria-current="page"` when `item.current === true`. Supports `iconTpl`, `initial` (e.g. project letter), `label`, and `badge`.
|
|
25
25
|
|
|
26
|
+
### VerticalNavigationPresetComponent (`<smart-vertical-navigation-preset>`)
|
|
27
|
+
|
|
28
|
+
Fully-styled, drop-in concrete implementation extending `VerticalNavigationBaseComponent`. Renders the Preline vertical-tabs look: a container with a trailing border (`border-e-2`), and each item rendered as a tab (`<a>` for `href`, `<button>` otherwise) with its own trailing border. The `current` item gains the primary accent (`border-blue-600`, `text-blue-600`, `font-medium`); inactive items are muted gray with a primary hover/focus. Supports `iconTpl`, `initial`, `label`, `badge`, and group titles. All classes are `smart:`-prefixed Tailwind with explicit `dark:` variants. Register it through `VERTICAL_NAVIGATION_STANDARD_COMPONENT_TOKEN` to restyle every `<smart-vertical-navigation>`, or use the selector directly. Because `NgComponentOutlet` passes inputs by canonical name, this component overrides `cssClass = input<string>('')` (no `class` alias).
|
|
29
|
+
|
|
26
30
|
### VerticalNavigationBaseComponent (abstract)
|
|
27
31
|
|
|
28
32
|
Abstract base directive. Exposes:
|
|
@@ -153,6 +157,7 @@ export class MyCustomVerticalNavigationComponent extends VerticalNavigationBaseC
|
|
|
153
157
|
|
|
154
158
|
- Wrapper: `packages/shared/angular/src/lib/components/vertical-navigation/vertical-navigation.component.ts`
|
|
155
159
|
- Standard: `packages/shared/angular/src/lib/components/vertical-navigation/standard/standard.component.ts`
|
|
160
|
+
- Preset: `packages/shared/angular/src/lib/components/vertical-navigation/preset/preset.component.ts`
|
|
156
161
|
- Base class: `packages/shared/angular/src/lib/components/vertical-navigation/base/base.component.ts`
|
|
157
162
|
- Token: `packages/shared/angular/src/lib/shared.inectors.ts` (`VERTICAL_NAVIGATION_STANDARD_COMPONENT_TOKEN`)
|
|
158
163
|
- Interfaces: `packages/shared/angular/src/lib/models/interfaces.ts` (`IVerticalNavOptions`, `IVerticalNavGroup`, `IVerticalNavItem`, `SmartVerticalNavLayout`)
|
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: smart-crud
|
|
3
|
+
description: CRUD module API — config-driven list/item pages, filters, export, multiselect and groups in @smartsoft001/crud-shell-angular. Use when building or customizing CRUD screens, filters, or extending CRUD components.
|
|
4
|
+
user-invocable: false
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# CRUD Module (`@smartsoft001/crud-shell-angular`)
|
|
8
|
+
|
|
9
|
+
The CRUD module is the **config / metadata-driven container layer** for CRUD screens. It is not a
|
|
10
|
+
primitive-component library: you describe the entity (model decorators) and the screen behavior (a
|
|
11
|
+
config object), and the engine **generates** the UI by composing free `@smartsoft001/angular`
|
|
12
|
+
components. This skill describes how to interact with the module and its code.
|
|
13
|
+
|
|
14
|
+
## When to Use This Skill
|
|
15
|
+
|
|
16
|
+
- Building or customizing a CRUD list/item screen
|
|
17
|
+
- Configuring or extending filters, export, multiselect or grouped lists
|
|
18
|
+
- Working with `CrudModule.forFeature`, `CrudConfig` / `CrudFullConfig`
|
|
19
|
+
- Extending CRUD base components (e.g. for the pro library) or providing model-label / possibilities providers
|
|
20
|
+
|
|
21
|
+
## Architecture
|
|
22
|
+
|
|
23
|
+
- **Config / metadata-driven.** Three inputs drive every screen: (1) `@Model` / `@Field`
|
|
24
|
+
decorators + `FieldType` from `@smartsoft001/models`; (2) a `CrudFullConfig`; (3) the engine
|
|
25
|
+
(`CreateDynamicComponent` + the page components) which instantiates children dynamically.
|
|
26
|
+
- **Engine-generated.** Only the page containers (`smart-crud-list-page`, `smart-crud-item-page`)
|
|
27
|
+
and `smart-crud-export` are hand-placed. Lists, details, forms, filter widgets are mounted by
|
|
28
|
+
the engine from config + model metadata.
|
|
29
|
+
- **Base + token.** Each container component is a thin `@Directive()` base (logic only) + concrete
|
|
30
|
+
implementation. Bases are exported from the package barrel so other libraries can `extends` them.
|
|
31
|
+
- **Free / pro split.** The free module renders with free `@smartsoft001/angular` components
|
|
32
|
+
(Tailwind `smart:` prefix, signals, OnPush, HTML-template-first). The pro library
|
|
33
|
+
(`@smartsoft001/pro-crud-shell-angular`, FRA-294) extends these base classes and registers
|
|
34
|
+
richer `smartpro-*` implementations. **Pro ships its own companion skill (FRA-294).**
|
|
35
|
+
|
|
36
|
+
## Module Setup
|
|
37
|
+
|
|
38
|
+
```typescript
|
|
39
|
+
import { CrudModule } from '@smartsoft001/crud-shell-angular';
|
|
40
|
+
|
|
41
|
+
CrudModule.forFeature({
|
|
42
|
+
routing: true, // true -> CrudFullModule (pages + routing); false -> CrudCoreModule
|
|
43
|
+
config: userConfig, // CrudFullConfig (routing:true) or CrudConfig (routing:false)
|
|
44
|
+
socket: false, // optional realtime provider wiring (inert stub today)
|
|
45
|
+
});
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
`forFeature` provides `CrudConfig` / `CrudFullConfig` (from the passed config), `FILE_SERVICE_CONFIG`
|
|
49
|
+
(from `config.apiUrl`), and the `SocketService` / `NotSocketService` provider. `CrudCoreModule`
|
|
50
|
+
registers the NgRx reducer (`NgrxStoreService.addReducer(config.entity, …)`) and the
|
|
51
|
+
`CrudModelLabelProvider` for `IModelLabelProvider`.
|
|
52
|
+
|
|
53
|
+
## Configuration
|
|
54
|
+
|
|
55
|
+
### `CrudConfig<T>`
|
|
56
|
+
|
|
57
|
+
- `apiUrl: string` — backend base URL
|
|
58
|
+
- `entity: string` — entity name, keys the reducer
|
|
59
|
+
- `type?: any` — `@Model`-decorated class
|
|
60
|
+
- `reducerFactory?: () => any` — custom reducer (defaults to `getReducer`)
|
|
61
|
+
- `baseQuery?: Array<ICrudFilterQueryItem>` — always-applied query items
|
|
62
|
+
|
|
63
|
+
### `CrudFullConfig<T>` (extends `CrudConfig<T>`)
|
|
64
|
+
|
|
65
|
+
- `title: string`
|
|
66
|
+
- `details?` / `edit?` — `boolean | { cellPipe?; components?: { top?; bottom? } }`
|
|
67
|
+
- `add?` — `boolean | { components?: { top?; bottom? } }`
|
|
68
|
+
- `remove?` / `search?` / `export?` — `boolean`
|
|
69
|
+
- `pagination?: { limit: number }`
|
|
70
|
+
- `sort?` — `boolean | { default?: string; defaultDesc?: boolean }`
|
|
71
|
+
- `list?` — `{ cellPipe?; components?: { top?; multi? }; mode?: ListMode; paginationMode?: PaginationMode; resetQuery?: 'beforeInit'; groups?: Array<ICrudListGroup> }`
|
|
72
|
+
- `buttons?: Array<IIconButtonOptions>`
|
|
73
|
+
- `inputComponents?: { [key: string]: Type<InputBaseComponent<T>> }`
|
|
74
|
+
- `cssClass?: string` — **tier-2 styling**, bound as `[class]` on the page `<smart-page>`
|
|
75
|
+
- `variant?: SmartPageVariant` — **tier-2 styling**, threaded into `pageOptions().variant`
|
|
76
|
+
|
|
77
|
+
## Components
|
|
78
|
+
|
|
79
|
+
| Selector | Purpose |
|
|
80
|
+
| ---------------------------------- | ------------------------------------------------------------------- |
|
|
81
|
+
| `smart-crud-list-page` | List container (wraps `<smart-page>`; search, header buttons, list) |
|
|
82
|
+
| `smart-crud-item-page` | Item container (create / update / details; mode action buttons) |
|
|
83
|
+
| `smart-crud-export` | Export trigger + post-export popover |
|
|
84
|
+
| `smart-crud-filters` | Filters panel (header + scrollable per-field filters) |
|
|
85
|
+
| `smart-crud-filters-config` | Active-filter chips (dismissible badges; removes active query) |
|
|
86
|
+
| `smart-crud-multiselect` | Multi-select header / action bar (`selected: N`, close) |
|
|
87
|
+
| `smart-crud-group` | Grouped-list disclosure (accessible HTML accordion, two-way `show`) |
|
|
88
|
+
| `smart-crud-filter` | **Filter dispatcher** — `@switch` on `FieldType` to the widgets |
|
|
89
|
+
| `smart-crud-filter-text` | Text filter |
|
|
90
|
+
| `smart-crud-filter-int` | Integer filter (value + advanced min/max range) |
|
|
91
|
+
| `smart-crud-filter-flag` | Boolean flag filter |
|
|
92
|
+
| `smart-crud-filter-radio` | Single-choice (radio) filter |
|
|
93
|
+
| `smart-crud-filter-check` | Multi-choice (checkbox list) filter |
|
|
94
|
+
| `smart-crud-filter-date` | Single-date filter |
|
|
95
|
+
| `smart-crud-filter-date-time` | Datetime "from"/"to" range filter |
|
|
96
|
+
| `smart-crud-filter-date-with-edit` | Editable-date filter (value + advanced min/max range) |
|
|
97
|
+
|
|
98
|
+
The page wrappers have `*-standard` variant children (`smart-crud-list-standard-page`,
|
|
99
|
+
`smart-crud-item-standard-page`) that hold the generated body.
|
|
100
|
+
|
|
101
|
+
## Filter Widgets
|
|
102
|
+
|
|
103
|
+
`smart-crud-filter` dispatches on `item().fieldType` (default branch = `text`). Each widget reuses
|
|
104
|
+
shared `smart-input-*` / `smart-date-edit` where the shape fits, is **OnPush**, and binds via a
|
|
105
|
+
reactive `FormControl` bridged to the filter state.
|
|
106
|
+
|
|
107
|
+
| `FieldType` | Widget | Rendering |
|
|
108
|
+
| ---------------- | ---------------------------------- | ------------------------------------------------------- |
|
|
109
|
+
| `text` (default) | `smart-crud-filter-text` | `smart-input-text` |
|
|
110
|
+
| `flag` | `smart-crud-filter-flag` | `smart-input-flag` |
|
|
111
|
+
| `radio` | `smart-crud-filter-radio` | `smart-input-radio` (+ possibilities bridge) |
|
|
112
|
+
| `int` | `smart-crud-filter-int` | `smart-input-int` + native "from"/"to" range inputs |
|
|
113
|
+
| `check` | `smart-crud-filter-check` | Native Tailwind checkbox list (scalar-id + array value) |
|
|
114
|
+
| `date` | `smart-crud-filter-date` | `smart-date-edit` |
|
|
115
|
+
| `dateTime` | `smart-crud-filter-date-time` | Native `<input type="datetime-local">` "from"/"to" |
|
|
116
|
+
| `dateWithEdit` | `smart-crud-filter-date-with-edit` | `smart-date-edit` + native "from"/"to" range |
|
|
117
|
+
|
|
118
|
+
**Possibilities bridge.** Radio/check options flow through `options.possibilities` on the shared
|
|
119
|
+
input; the base maps them to the `{ id, text, checked }` shape.
|
|
120
|
+
|
|
121
|
+
**Filter base API** (`BaseComponent<T>`, in `components/filter/base/base.component.ts`):
|
|
122
|
+
|
|
123
|
+
- `bindControl(type: string | null = null): UntypedFormControl` — builds a reactive control seeded
|
|
124
|
+
from the query slot (`null` -> `value`, `'>='` -> `minValue`, `'<='` -> `maxValue`) and wired so
|
|
125
|
+
every change re-runs the debounced `refresh(v, type)`. `bindValueControl()` is the `null` slot.
|
|
126
|
+
- `buildInputOptions(control, withPossibilities = false): InputOptions` — builds the `InputOptions`
|
|
127
|
+
for the shared input; maps `possibilities` into `{ id, text, checked }` when requested.
|
|
128
|
+
- `hasValue` / `hasMinValue` / `hasMaxValue` — OnPush-safe `computed` signals for clear-button
|
|
129
|
+
visibility (replace `@if (value)` style checks).
|
|
130
|
+
- `value` / `minValue` / `maxValue` getters/setters and `clear()` read/write the filter query slots.
|
|
131
|
+
- `item` / `filter` inputs carry the `IModelFilter` and `ICrudFilter` state.
|
|
132
|
+
|
|
133
|
+
## Styling (3-tier)
|
|
134
|
+
|
|
135
|
+
1. **Tailwind theme**, `smart:` prefix — all templates use prefixed utilities shared with
|
|
136
|
+
`@smartsoft001/angular`.
|
|
137
|
+
2. **Declarative `cssClass` / `variant` on `CrudFullConfig`** — threaded into the page:
|
|
138
|
+
`variant` -> `pageOptions().variant`; `cssClass` -> `[class]` on `<smart-page>`.
|
|
139
|
+
3. **`class` on hand-placed entry points only** — `smart-crud-list-page`, `smart-crud-item-page`,
|
|
140
|
+
`smart-crud-export`. Engine-generated leaf components do not expose `class`; style via tiers 1–2.
|
|
141
|
+
|
|
142
|
+
## Extension Points
|
|
143
|
+
|
|
144
|
+
Exported `@Directive()` base classes (logic only) — extend + register a `smartpro-*` concrete:
|
|
145
|
+
|
|
146
|
+
| Base class | Concrete |
|
|
147
|
+
| -------------------------- | ------------------------ |
|
|
148
|
+
| `ExportBaseComponent` | `smart-crud-export` |
|
|
149
|
+
| `MultiselectBaseComponent` | `smart-crud-multiselect` |
|
|
150
|
+
| `FiltersBaseComponent` | `smart-crud-filters` |
|
|
151
|
+
| `GroupBaseComponent` | `smart-crud-group` |
|
|
152
|
+
| `BaseComponent` (filter) | `smart-crud-filter-*` |
|
|
153
|
+
|
|
154
|
+
Pro extends these via the InjectionToken override precedent from `@smartsoft001/angular`
|
|
155
|
+
(`*_STANDARD_COMPONENT_TOKEN`) — e.g. a rich `smartpro-accordion`-backed group.
|
|
156
|
+
|
|
157
|
+
## Providers
|
|
158
|
+
|
|
159
|
+
- **`CrudModelLabelProvider`** — registered for `IModelLabelProvider` in `CrudCoreModule` /
|
|
160
|
+
`CrudComponentsModule`. Delegates to an app-level `IModelLabelProvider` higher in the injector
|
|
161
|
+
tree (via `skipSelf`) if present; otherwise translates `MODEL.<key>`. Override at the app level.
|
|
162
|
+
- **`CRUD_MODEL_POSSIBILITIES_PROVIDER`** (deprecated; prefer `MODEL_POSSIBILITIES_PROVIDER` from
|
|
163
|
+
`@smartsoft001/angular`) — `InjectionToken<ICrudModelPossibilitiesProvider>`. When provided, the
|
|
164
|
+
filter base resolves possibilities for `config.type` + field key from it (injected `{ optional: true }`).
|
|
165
|
+
|
|
166
|
+
## Examples
|
|
167
|
+
|
|
168
|
+
```typescript
|
|
169
|
+
import { CrudFullConfig } from '@smartsoft001/crud-shell-angular';
|
|
170
|
+
import { ListMode, PaginationMode } from '@smartsoft001/angular';
|
|
171
|
+
|
|
172
|
+
const config: CrudFullConfig<User> = {
|
|
173
|
+
apiUrl: 'https://api.example.com',
|
|
174
|
+
entity: 'user',
|
|
175
|
+
type: User,
|
|
176
|
+
title: 'Users',
|
|
177
|
+
details: true,
|
|
178
|
+
edit: true,
|
|
179
|
+
add: true,
|
|
180
|
+
remove: true,
|
|
181
|
+
search: true,
|
|
182
|
+
export: true,
|
|
183
|
+
pagination: { limit: 25 },
|
|
184
|
+
sort: { default: 'lastName', defaultDesc: false },
|
|
185
|
+
list: {
|
|
186
|
+
mode: ListMode.desktop,
|
|
187
|
+
paginationMode: PaginationMode.singlePage,
|
|
188
|
+
groups: [
|
|
189
|
+
{ key: 'active', value: 'true', text: 'Active', show: true },
|
|
190
|
+
{ key: 'active', value: 'false', text: 'Inactive' },
|
|
191
|
+
],
|
|
192
|
+
},
|
|
193
|
+
cssClass: 'smart:bg-gray-50',
|
|
194
|
+
variant: 'standard',
|
|
195
|
+
};
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
```html
|
|
199
|
+
<smart-crud-list-page></smart-crud-list-page>
|
|
200
|
+
<smart-crud-item-page></smart-crud-item-page>
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
Fields participate in filters via `@Field({ filter: true, fieldType: FieldType.* })` on the model;
|
|
204
|
+
the engine renders the matching `smart-crud-filter-*` widget through the `smart-crud-filter`
|
|
205
|
+
dispatcher inside `smart-crud-filters`.
|
|
206
|
+
|
|
207
|
+
## File Locations
|
|
208
|
+
|
|
209
|
+
- Module / config: `packages/crud/shell/angular/src/lib/crud.module.ts`, `crud.config.ts`
|
|
210
|
+
- Components: `packages/crud/shell/angular/src/lib/components/` (`export`, `filters`, `filters-config`, `multiselect`, `group`, `filter/*`)
|
|
211
|
+
- Pages: `packages/crud/shell/angular/src/lib/pages/{list,item}`
|
|
212
|
+
- Providers: `packages/crud/shell/angular/src/lib/providers/{model-label,model-possibilities}`
|