ng-hub-ui-forms 22.13.0 → 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 +46 -1
- package/fesm2022/ng-hub-ui-forms.mjs +1259 -141
- package/fesm2022/ng-hub-ui-forms.mjs.map +1 -1
- package/package.json +1 -1
- package/styles/_tokens.scss +10 -1
- package/styles/mixins/_file-input-theme.scss +71 -36
- package/styles/mixins/_forms-theme.scss +11 -6
- package/styles/mixins/_segmented-theme.scss +13 -7
- package/styles/readonly-theme.spec.ts +5 -18
- package/types/ng-hub-ui-forms.d.ts +189 -33
- package/ng-hub-ui-forms-22.13.0.tgz +0 -0
package/README.md
CHANGED
|
@@ -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`.
|