ng-hub-ui-forms 22.23.2 → 22.25.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 +23 -0
- package/fesm2022/ng-hub-ui-forms.mjs +222 -67
- package/fesm2022/ng-hub-ui-forms.mjs.map +1 -1
- package/package.json +2 -3
- package/styles/_group-addons.scss +2 -8
- package/styles/_tokens.scss +30 -1
- package/types/ng-hub-ui-forms.d.ts +68 -1
- package/styles/group-flattening.spec.ts +0 -574
- package/styles/readonly-theme.spec.ts +0 -71
package/README.md
CHANGED
|
@@ -99,6 +99,7 @@ mode — no Bootstrap dependency.
|
|
|
99
99
|
- **Validators & helpers** — `hubAreEqual` cross-field validator, the file validators (`hubAcceptedFiles`, `hubMaxFileSize`, `hubMinFileSize`, `hubMaxTotalSize`, `hubMaxFiles`, `hubMinFiles`), `hubValidationError` / `hubFormText` projection directives, and a set of utility pipes.
|
|
100
100
|
- **Signal Forms ready** — an opt-in [`ng-hub-ui-forms/signals`](#-signal-forms-opt-in) secondary entry point integrates Angular Signal Forms; the core stays Reactive-Forms-based and Angular-21-safe.
|
|
101
101
|
- **Theming** — every colour, border, radius and spacing is a `--hub-*` CSS custom property; ships shared SCSS tokens for consumers.
|
|
102
|
+
- **Right-to-left** — every field mirrors under `dir="rtl"`: the primitives use logical CSS properties throughout, and the three whose geometry is only half CSS are handled explicitly — the slider (a native range mirrors, but the background image that fills its track does not), the switch (its knob and the transition that names it move together) and the segmented control (which re-measures its indicator when direction changes, since a flip re-lays the options out without resizing anything).
|
|
102
103
|
- **Cross-library adapter** — `hubFormControlAdapter` lets other libraries render `hub-input` / `hub-select` on demand without hard-depending on this package (see below).
|
|
103
104
|
|
|
104
105
|
---
|
|
@@ -232,6 +233,28 @@ provideHubForms({
|
|
|
232
233
|
<hub-select formControlName="city" label="City" [items]="cities" bindLabel="name" bindValue="id" groupBy="country" />
|
|
233
234
|
```
|
|
234
235
|
|
|
236
|
+
#### Floating label
|
|
237
|
+
|
|
238
|
+
```html
|
|
239
|
+
<hub-select formControlName="country" labelType="floating" label="Country" [items]="countries" bindLabel="name" bindValue="code" />
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
The label sits inside the control and lifts on focus or on a value, on the same travel as
|
|
243
|
+
`hub-input` and `hub-datepicker` — so a form can float every label instead of floating its text fields and
|
|
244
|
+
stacking the selects beside them. A `placeholder` set as well is shown only once the label
|
|
245
|
+
has lifted, since until then the label is standing in its place.
|
|
246
|
+
|
|
247
|
+
Only the `dropdown` format floats. The deprecated `buttons` / `checkbox` / `radio` have no
|
|
248
|
+
box to float into and keep a stacked label.
|
|
249
|
+
|
|
250
|
+
`hub-datepicker` floats the same way, and drives it from the field's state rather than from
|
|
251
|
+
`:focus`: its calendar is an overlay, so opening it takes focus out of the input, and a label
|
|
252
|
+
keyed on the pseudo-class would drop back over the value at the one moment you are using it.
|
|
253
|
+
|
|
254
|
+
The geometry is shared by all three through three tokens, so they float alike and are tuned in
|
|
255
|
+
one place: `--hub-field-floating-inset` (how far the value drops), `--hub-field-floating-travel`
|
|
256
|
+
(how far the label rises) and `--hub-field-floating-scale`.
|
|
257
|
+
|
|
235
258
|
#### Addons and attached content
|
|
236
259
|
|
|
237
260
|
`prepend` / `append` are group addons carrying **text** — a currency, a unit, a protocol.
|