ng-hub-ui-panels 22.7.0 → 22.8.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/README.md
CHANGED
|
@@ -115,7 +115,8 @@ its own.
|
|
|
115
115
|
- **Routing** — a panel with a `routerLink` turns the content area into a `<router-outlet>` that follows the URL.
|
|
116
116
|
- **Keyboard & a11y** — roving tabindex, Arrow/Home/End/Delete keys, and correct `role="tablist"`/`tab`/`tabpanel` and accordion `aria-expanded`/`aria-controls` semantics.
|
|
117
117
|
- **Strip layout** — `vertical`, `justified` and `scrollable` header strips.
|
|
118
|
-
- **Accordion options** — `multiple` expansion
|
|
118
|
+
- **Accordion options** — `multiple` expansion, edge-to-edge `flush` layout and a `togglePosition` chevron side (`end` by default, RTL-aware), with an animated grid-based collapse.
|
|
119
|
+
- **Accordion row actions** — `hubPanelHeadingActions` projects real controls beside the disclosure button (never inside it), so an edit/delete affordance stays valid, keyboard-reachable and visible while the row is collapsed.
|
|
119
120
|
- **Custom headers** — project any markup with the `hubPanelHeading` directive.
|
|
120
121
|
- **Removable panels** — opt-in `removable` panels close with a ✕ button or the Delete key.
|
|
121
122
|
- **Theming** — every token is a `--hub-panels-*` CSS custom property; the accordion view also honours the `--hub-accordion-*` contract.
|
|
@@ -167,6 +168,46 @@ npm install ng-hub-ui-panels
|
|
|
167
168
|
</hub-panels>
|
|
168
169
|
```
|
|
169
170
|
|
|
171
|
+
#### Row actions — `hubPanelHeadingActions`
|
|
172
|
+
|
|
173
|
+
`hubPanelHeading` projects **inside** the disclosure `<button>`, so it cannot host
|
|
174
|
+
controls: a `<button>` nested in another button is invalid HTML and unreachable by
|
|
175
|
+
keyboard. `hubPanelHeader` is no help either — it lives inside the collapse region
|
|
176
|
+
and disappears when the row closes.
|
|
177
|
+
|
|
178
|
+
`hubPanelHeadingActions` is the slot for row affordances that must stay usable while
|
|
179
|
+
the row is collapsed. It renders in the header row, **beside** the button, so its
|
|
180
|
+
controls are real controls and a click never toggles the panel.
|
|
181
|
+
|
|
182
|
+
```html
|
|
183
|
+
<hub-panels type="accordion" multiple>
|
|
184
|
+
<hub-panel>
|
|
185
|
+
<ng-template hubPanelHeading>Shipping address</ng-template>
|
|
186
|
+
<ng-template hubPanelHeadingActions>
|
|
187
|
+
<button type="button" (click)="edit()">Edit</button>
|
|
188
|
+
<button type="button" (click)="remove()">Delete</button>
|
|
189
|
+
</ng-template>
|
|
190
|
+
…
|
|
191
|
+
</hub-panel>
|
|
192
|
+
</hub-panels>
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
#### Chevron side — `togglePosition`
|
|
196
|
+
|
|
197
|
+
`'end'` (default) trails the heading with the chevron; `'start'` leads it. Only the
|
|
198
|
+
visual order changes — the DOM is untouched — and the offsets are logical, so the
|
|
199
|
+
chevron lands on the right edge under `dir="rtl"` without any extra rule.
|
|
200
|
+
|
|
201
|
+
```html
|
|
202
|
+
<hub-panels type="accordion" togglePosition="start">…</hub-panels>
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
Set the default for the whole app through `PanelsConfig`:
|
|
206
|
+
|
|
207
|
+
```ts
|
|
208
|
+
providers: [{ provide: PanelsConfig, useValue: { ...new PanelsConfig(), togglePosition: 'start' } }];
|
|
209
|
+
```
|
|
210
|
+
|
|
170
211
|
### Cards
|
|
171
212
|
|
|
172
213
|
`type="card"` drops the navigation strip entirely: every panel is always visible
|