ng-hub-ui-forms 22.40.0 → 22.42.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 +22 -0
- package/fesm2022/ng-hub-ui-forms.mjs +244 -27
- package/fesm2022/ng-hub-ui-forms.mjs.map +1 -1
- package/package.json +1 -1
- package/styles/_tokens.scss +2 -0
- package/types/ng-hub-ui-forms.d.ts +116 -2
package/README.md
CHANGED
|
@@ -38,6 +38,7 @@ This library is part of the **ng-hub-ui** ecosystem:
|
|
|
38
38
|
- [**ng-hub-ui-portal**](https://www.npmjs.com/package/ng-hub-ui-portal)
|
|
39
39
|
- [**ng-hub-ui-skeleton**](https://www.npmjs.com/package/ng-hub-ui-skeleton)
|
|
40
40
|
- [**ng-hub-ui-sortable**](https://www.npmjs.com/package/ng-hub-ui-sortable)
|
|
41
|
+
- [**ng-hub-ui-spreadsheet**](https://www.npmjs.com/package/ng-hub-ui-spreadsheet)
|
|
41
42
|
- [**ng-hub-ui-stepper**](https://www.npmjs.com/package/ng-hub-ui-stepper)
|
|
42
43
|
- [**ng-hub-ui-utils**](https://www.npmjs.com/package/ng-hub-ui-utils)
|
|
43
44
|
|
|
@@ -810,6 +811,25 @@ form = new FormGroup(
|
|
|
810
811
|
On submit, each invalid field shows its error and the cross-field `hubAreEqual`
|
|
811
812
|
error is surfaced by the fieldset/form — no manual error markup anywhere.
|
|
812
813
|
|
|
814
|
+
#### Taking the reader to the errors
|
|
815
|
+
|
|
816
|
+
`hubScrollToError` on the submit button scrolls to the first error left on screen and focuses its
|
|
817
|
+
control; each further press moves to the next one, and after the last it starts again. A field's
|
|
818
|
+
control and its message count once. Left empty it walks the button's own form, the one it sits in
|
|
819
|
+
or the one its `form` attribute names:
|
|
820
|
+
|
|
821
|
+
```html
|
|
822
|
+
<form id="customer" [formGroup]="form" hubForm (submit)="save()">…</form>
|
|
823
|
+
<button hubButton type="submit" form="customer" hubScrollToError>Save</button>
|
|
824
|
+
|
|
825
|
+
<!-- any other block, with a product's own error marks as well -->
|
|
826
|
+
<section #sheet>…</section>
|
|
827
|
+
<button [hubScrollToError]="sheet" hubScrollToErrorSelector=".my-error">Check</button>
|
|
828
|
+
```
|
|
829
|
+
|
|
830
|
+
A template reference on `<form hubForm>` names the component, not the element, which is why the
|
|
831
|
+
form is reached through the button rather than passed in.
|
|
832
|
+
|
|
813
833
|
#### Two ways to write the fieldset
|
|
814
834
|
|
|
815
835
|
`hubFieldset` is an attribute on the native element, so the group costs one element instead of
|
|
@@ -944,6 +964,8 @@ check mark (unset, each mark is black or white, whichever reads on its swatch).
|
|
|
944
964
|
|
|
945
965
|
**`hub-select` inside a modal** — the dropdown panel stacks through `--hub-select-dropdown-zindex` (default `calc(var(--hub-sys-zindex-modal, 1055) + 5)`; the previous `--hub-select-dropdown-z-index` spelling is deprecated but still honoured), so a select opened inside a `HubModal` renders above the dialog instead of being clipped underneath it.
|
|
946
966
|
|
|
967
|
+
**Width of the list** — the panel is never narrower than the control and grows to its longest option, up to `--hub-select-dropdown-max-width` (default `24rem`) and never past the screen. When it would run off the screen from the control's start, it lines up with the control's end.
|
|
968
|
+
|
|
947
969
|
**`hub-datepicker` inside a modal** — the same guarantee, through `--hub-datepicker-overlay-zindex` (default `calc(var(--hub-sys-zindex-modal, 1055) + 5)`): a calendar opened inside a `HubModal` is drawn over the dialog, and its backdrop one layer under the calendar but still over the dialog, so clicking outside closes it. One token moves both:
|
|
948
970
|
|
|
949
971
|
```css
|