ng-hub-ui-forms 22.12.2 → 22.14.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
@@ -9,11 +9,11 @@ entirely through `--hub-*` CSS variables, no Bootstrap required.
9
9
 
10
10
  ## Documentation and Live Examples
11
11
 
12
- This package is part of [Hub UI](https://hubui.dev/), a collection of Angular component libraries for standalone apps.
12
+ This package is part of [Hub UI](https://hubui.dev/en/), a collection of Angular component libraries for standalone apps.
13
13
 
14
- - Docs: https://hubui.dev/forms/overview/
15
- - Live examples: https://hubui.dev/forms/examples/
16
- - Hub UI: https://hubui.dev/
14
+ - Docs: https://hubui.dev/en/forms/overview/
15
+ - Live examples: https://hubui.dev/en/forms/examples/
16
+ - Hub UI: https://hubui.dev/en/
17
17
 
18
18
  ## 🧩 Library Family `ng-hub-ui`
19
19
 
@@ -92,7 +92,7 @@ mode — no Bootstrap dependency.
92
92
 
93
93
  ## 🎯 Features
94
94
 
95
- - **Fields** — `hub-input` (text/number/email/password/color/switch/checkbox/counter, with input-group addons & masks, projected in-field affixes, a built-in `clearable` button and debounced typeahead `search`; the `file` format is **deprecated** → use `hub-file-input`), `hub-otp-input`, `hub-textarea` (+ `hubAutoresize`), `hub-slider` (single / dual thumb, gradient fill), `hub-segmented` (segmented control field — single & multiple selection, horizontal & vertical, with label + validation), `hub-select` (dropdown format, grouping, client-side search via `searchable` **and** server-side async typeahead via a `typeahead` Subject, tag creation with `addTag`, custom templates; the `buttons` / `checkbox` / `radio` formats are **deprecated** → use `hub-segmented`), `hub-datepicker` (single & range, keyboard nav, i18n), `hub-file-input` (drag & drop, clipboard paste, type/size limits, previews, optional upload progress).
95
+ - **Fields** — `hub-input` (text/number/email/password/color/switch/checkbox/counter, with input-group addons & masks, projected in-field affixes, a built-in `clearable` button and debounced typeahead `search`; the `file` format is **deprecated** → use `hub-file-input`), `hub-otp-input`, `hub-textarea` (+ `hubAutoresize`), `hub-slider` (single / dual thumb, gradient fill), `hub-segmented` (segmented control field — single & multiple selection, horizontal & vertical, with label + validation), `hub-select` (dropdown format, grouping, client-side search via `searchable` **and** server-side async typeahead via a `typeahead` Subject, tag creation with `addTag`, custom templates; the `buttons` / `checkbox` / `radio` formats are **deprecated** → use `hub-segmented`), `hub-datepicker` (single & range at any granularity from a year to a second, time picking, min/max down to the minute, keyboard nav, i18n), `hub-file-input` (drag & drop, clipboard paste, type/size limits, previews, optional upload progress).
96
96
  - **Automatic error display** — bind a field and its control errors render below it; `hub-fieldset`, `form[hubForm]` and `hub-legend` surface group- and form-level (cross-field) errors the same way, with zero wiring.
97
97
  - **Containers** — `hub-fieldset` / `form[hubForm]` group fields and show their group errors; `hub-legend` renders an accessible legend.
98
98
  - **Configurable** — `provideHubForms({ … })` sets the invalid-feedback templates, datepicker locale/labels, file-input labels and more, app-wide or per instance.
@@ -296,6 +296,51 @@ A projected `hubSegmentedOption` template replaces each segment's content (icons
296
296
  <hub-datepicker formControlName="range" mode="range" label="Stay" />
297
297
  ```
298
298
 
299
+ `granularity` sets how precise each picked point is, and selects the panel with it. It is
300
+ orthogonal to `mode`: `mode` says how many points are picked, `granularity` how precise each
301
+ one is.
302
+
303
+ ```html
304
+ <!-- a validity window: each endpoint carries its own time -->
305
+ <hub-datepicker formControlName="window" mode="range" granularity="minute" [minuteStep]="15" />
306
+
307
+ <!-- coarse units get a 12-cell period grid instead of the calendar -->
308
+ <hub-datepicker formControlName="billingPeriod" granularity="month" />
309
+ ```
310
+
311
+ | `granularity` | Panel | Value (default `valueFormat`) |
312
+ | --- | --- | --- |
313
+ | `year` | Decade grid | `"2026"` |
314
+ | `month` | 12-month grid | `"2026-09"` |
315
+ | `day` *(default)* | Calendar | `"2026-09-01"` |
316
+ | `hour` / `minute` / `second` | Calendar + time strip | `"2026-09-01T09:30:00+02:00"` |
317
+
318
+ **The value's timezone.** At `day` and coarser it is a bare calendar date with no zone attached,
319
+ exactly as before. From `hour` onwards it is a full ISO 8601 timestamp carrying **the reader's
320
+ local wall clock and the offset of that very date** — `+02:00` in Madrid in September, `+01:00`
321
+ for the same clock in January. It denotes an unambiguous instant; convert with
322
+ `new Date(value).toISOString()` if you need UTC.
323
+
324
+ `min` and `max` honour the time too: a day is disabled only when no instant of it is allowed, so
325
+ `min="2026-09-01T14:00"` leaves 1 September clickable and the time controls refuse the earlier
326
+ hours.
327
+
328
+ Three independent axes control the formats:
329
+
330
+ ```html
331
+ <!-- what the control holds: 'iso' (default) | 'date' | 'timestamp' | (date) => unknown -->
332
+ <hub-datepicker formControlName="due" valueFormat="date" />
333
+
334
+ <!-- what the user reads: Intl options | an Angular pattern | (date) => string -->
335
+ <hub-datepicker formControlName="due" displayFormat="dd/MM/yyyy HH:mm" />
336
+
337
+ <!-- how an incoming value is read; also applies to min/max -->
338
+ <hub-datepicker formControlName="due" [parse]="parseLegacyDate" />
339
+ ```
340
+
341
+ ISO strings of any width, `Date` instances and epoch milliseconds are detected automatically, so
342
+ `parse` is only needed for dialects outside that set.
343
+
299
344
  ### File input
300
345
 
301
346
  Drag & drop, clipboard paste, constraints and previews. The control value stays native — a `File`, a `File[]`, or `null` — so it goes straight into a `FormData`.