ng-hub-ui-forms 22.2.0 â 22.4.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 +51 -2
- package/fesm2022/ng-hub-ui-forms.mjs +397 -12
- package/fesm2022/ng-hub-ui-forms.mjs.map +1 -1
- package/ng-hub-ui-forms-22.4.0.tgz +0 -0
- package/package.json +1 -1
- package/src/lib/styles/_tokens.scss +46 -3
- package/src/lib/styles/index.scss +3 -0
- package/src/lib/styles/mixins/_segmented-theme.scss +66 -0
- package/types/ng-hub-ui-forms.d.ts +189 -5
- package/ng-hub-ui-forms-22.2.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), `hub-otp-input`, `hub-textarea` (+ `hubAutoresize`), `hub-slider
|
|
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`), `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, typeahead, custom templates; the `buttons` / `checkbox` / `radio` formats are **deprecated** â use `hub-segmented`), `hub-datepicker` (single & range, keyboard nav, i18n).
|
|
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 and more, app-wide or per instance.
|
|
@@ -156,6 +156,33 @@ npm install ng-hub-ui-forms @angular/cdk
|
|
|
156
156
|
<hub-input formControlName="darkMode" format="switch" label="Dark mode" />
|
|
157
157
|
```
|
|
158
158
|
|
|
159
|
+
#### Icon affix & typeahead (search boxes)
|
|
160
|
+
|
|
161
|
+
Project a leading / trailing icon **inside** the field, emit a debounced term on every keystroke, and let the field render its own clear button:
|
|
162
|
+
|
|
163
|
+
```html
|
|
164
|
+
<!-- Project any icon (any pack via the shorthand) + debounced search + built-in clear -->
|
|
165
|
+
<hub-input
|
|
166
|
+
label="Search frameworks"
|
|
167
|
+
[clearable]="true"
|
|
168
|
+
[debounceTime]="300"
|
|
169
|
+
(search)="onSearch($event)"
|
|
170
|
+
>
|
|
171
|
+
<hub-icon hubInputPrefix name="fa:solid:magnifying-glass" />
|
|
172
|
+
</hub-input>
|
|
173
|
+
|
|
174
|
+
<!-- Projected affixes for any content (a unit label, an inline SVGâŚ) -->
|
|
175
|
+
<hub-input label="Amount">
|
|
176
|
+
<span hubInputPrefix>âŹ</span>
|
|
177
|
+
</hub-input>
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
- Project a `<hub-icon>` (or any element) into `hubInputPrefix` / `hubInputSuffix`; the field themes it with its `--hub-input-icon-*` tokens.
|
|
181
|
+
- `[clearable]` renders an internal â button once the field holds a value â it resets the control and emits an empty `search` term (no manual suffix wiring). The glyph is the swappable `--hub-input-clear-icon` token.
|
|
182
|
+
- The control reserves inline padding automatically so its text never sits under the affix.
|
|
183
|
+
- Affixes use logical CSS properties, so `start`/`end` follow the writing direction and **flip automatically under `dir="rtl"`**.
|
|
184
|
+
- `(search)` fires `debounceTime` ms after typing stops (`0` = every keystroke); identical consecutive terms are skipped, and `valueChange` stays synchronous.
|
|
185
|
+
|
|
159
186
|
### Select
|
|
160
187
|
|
|
161
188
|
```html
|
|
@@ -264,7 +291,7 @@ shared SCSS tokens; import them once at the app root:
|
|
|
264
291
|
```css
|
|
265
292
|
hub-input,
|
|
266
293
|
hub-select {
|
|
267
|
-
--hub-
|
|
294
|
+
--hub-input-border-color: #cbd5e1;
|
|
268
295
|
--hub-select-option-selected-bg: #e0e7ff;
|
|
269
296
|
}
|
|
270
297
|
```
|
|
@@ -281,6 +308,28 @@ hub-input {
|
|
|
281
308
|
}
|
|
282
309
|
```
|
|
283
310
|
|
|
311
|
+
**`hub-slider`** â `--hub-slider-track-fill` takes a full `<image>` (e.g. a `linear-gradient(to right, âŚ)`) for the filled part of the track, which renders intact clipped to the current percentage; `--hub-slider-value-space` is the value-bubble headroom and collapses to `0` on a `[showValue]="false"` (flush) slider:
|
|
312
|
+
|
|
313
|
+
```css
|
|
314
|
+
.gradient-slider {
|
|
315
|
+
--hub-slider-track-fill: linear-gradient(to right, #22c55e, #eab308, #ef4444);
|
|
316
|
+
}
|
|
317
|
+
```
|
|
318
|
+
|
|
319
|
+
**`hub-select` inside a modal** â the dropdown panel stacks through `--hub-select-dropdown-z-index` (default `calc(var(--hub-sys-zindex-modal, 1055) + 5)`), so a select opened inside a `HubModal` renders above the dialog instead of being clipped underneath it.
|
|
320
|
+
|
|
321
|
+
**`hub-segmented` variants & theming** â the `color` input tints the selected segment from the semantic families (`<hub-segmented color="primary">`); any of the `--hub-segmented-*` slots can be set directly, or in one call with the SCSS mixin:
|
|
322
|
+
|
|
323
|
+
```scss
|
|
324
|
+
@use 'ng-hub-ui-forms/styles' as *;
|
|
325
|
+
|
|
326
|
+
.brand-toggle {
|
|
327
|
+
@include hub-segmented-theme($selected-bg: gold, $selected-color: #111, $radius: 999px);
|
|
328
|
+
}
|
|
329
|
+
```
|
|
330
|
+
|
|
331
|
+
In single-select mode the selected pill slides between options (`--hub-segmented-indicator-transition`, default `0.2s ease`; disabled under `prefers-reduced-motion`).
|
|
332
|
+
|
|
284
333
|
---
|
|
285
334
|
|
|
286
335
|
## ⨠Signal Forms (opt-in)
|