@ferrlabs/ui-ng 1.52.5 → 1.53.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 +52 -0
- package/fesm2022/ferrlabs-ui-ng.mjs +842 -7
- package/fesm2022/ferrlabs-ui-ng.mjs.map +1 -1
- package/package.json +1 -1
- package/types/ferrlabs-ui-ng.d.ts +191 -1
- package/types/ferrlabs-ui-ng.d.ts.map +1 -1
package/README.md
CHANGED
|
@@ -41,6 +41,58 @@ import { ButtonComponent } from '@ferrlabs/ui-ng';
|
|
|
41
41
|
export class Demo {}
|
|
42
42
|
```
|
|
43
43
|
|
|
44
|
+
## Splitter
|
|
45
|
+
|
|
46
|
+
Resizable panes with a draggable, keyboard accessible handle between each pair.
|
|
47
|
+
|
|
48
|
+
```ts
|
|
49
|
+
import { SplitterComponent, SplitterPaneComponent } from '@ferrlabs/ui-ng';
|
|
50
|
+
|
|
51
|
+
@Component({
|
|
52
|
+
imports: [SplitterComponent, SplitterPaneComponent],
|
|
53
|
+
template: `
|
|
54
|
+
<flr-splitter storageKey="editor" [stackBelow]="640" (resizeEnd)="onResize($event)">
|
|
55
|
+
<flr-splitter-pane label="Sidebar" defaultSize="30%" minSize="160" maxSize="50%" collapsible>
|
|
56
|
+
...
|
|
57
|
+
</flr-splitter-pane>
|
|
58
|
+
<flr-splitter-pane label="Content" minSize="240">...</flr-splitter-pane>
|
|
59
|
+
</flr-splitter>
|
|
60
|
+
`,
|
|
61
|
+
})
|
|
62
|
+
export class Demo {}
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
`flr-splitter` inputs: `orientation` (`'horizontal'` panes side by side, the default, or `'vertical'`
|
|
66
|
+
panes stacked), `stacked` (force the stacked layout), `stackBelow` (width in px under which a
|
|
67
|
+
horizontal splitter stacks and drops its handles), `storageKey` (persist sizes and collapsed state in
|
|
68
|
+
`localStorage` under `flr-splitter:<key>`), `keyboardStep` (px per arrow press, Shift is 5x, default
|
|
69
|
+
10). Output: `resizeEnd` with `{ sizes, ratios, collapsed }`, emitted when a drag ends and after each
|
|
70
|
+
keyboard resize, collapse or reset.
|
|
71
|
+
|
|
72
|
+
Screen reader text is overridable, English by default: `resetAnnouncement` (string, said after a
|
|
73
|
+
reset), `sizeAnnouncement` (`(label, percent, collapsed) => string`), `paneLabel`
|
|
74
|
+
(`(position) => string`, the fallback for panes without a `label`, 1-based) and `resizeLabel`
|
|
75
|
+
(`(paneLabel) => string`, the handle's `aria-label`).
|
|
76
|
+
|
|
77
|
+
`flr-splitter-pane` inputs: `defaultSize`, `minSize`, `maxSize` (px number or `'30%'`), `collapsible`,
|
|
78
|
+
`label` (used in the handle label and the announcements), `handleLabel` (replaces the handle's
|
|
79
|
+
`aria-label` for this pane), and `[(collapsed)]`. Panes without a
|
|
80
|
+
`defaultSize` share the remaining space.
|
|
81
|
+
|
|
82
|
+
The splitter fills its parent (`width` and `height` 100%), so give the parent a definite size, in
|
|
83
|
+
particular for `orientation="vertical"`. Sizes are kept as ratios of the container, so they follow
|
|
84
|
+
window resizes; min and max still apply. A px `defaultSize` stays in px until the first resize.
|
|
85
|
+
|
|
86
|
+
Interaction: drag with mouse, touch or pen; arrow keys resize (Shift for bigger steps), Home and End
|
|
87
|
+
jump to min and max, Enter collapses or expands a collapsible neighbour, double-click resets sizes
|
|
88
|
+
and expands collapsed panes. The handle is a focusable `role="separator"` with `aria-valuenow`,
|
|
89
|
+
`aria-valuemin`, `aria-valuemax` (percent of the container) and `aria-controls` pointing at the pane
|
|
90
|
+
before it, with a 24px hit area. `aria-orientation` is the separator's own: a horizontal splitter has
|
|
91
|
+
vertical separators. The new size is announced through the CDK `LiveAnnouncer` (polite). Right-to-left
|
|
92
|
+
direction is read from CSS `direction`. Stored sizes are restored once per `storageKey`, so adding
|
|
93
|
+
or removing a pane later keeps the live layout. A drag is cancelled if its handle goes away
|
|
94
|
+
(for example when the splitter crosses `stackBelow`).
|
|
95
|
+
|
|
44
96
|
## Versioned docs (`@ferrlabs/ui-ng/docs`)
|
|
45
97
|
|
|
46
98
|
Brand-agnostic versioned-documentation layout, shared across product sites.
|