ng-hub-ui-forms 22.23.0 → 22.23.2
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.
|
@@ -9453,6 +9453,22 @@ function hubMinFiles(min) {
|
|
|
9453
9453
|
};
|
|
9454
9454
|
}
|
|
9455
9455
|
|
|
9456
|
+
/**
|
|
9457
|
+
* A control the adapter creates is embedded, not stacked.
|
|
9458
|
+
*
|
|
9459
|
+
* Field hosts carry `margin-bottom: var(--hub-field-stack-gap)` so that fields written one
|
|
9460
|
+
* under another in a form breathe. A control created *into another component's chrome* —
|
|
9461
|
+
* a table's search group, a paginator's row — is not in that list and never was: the gap
|
|
9462
|
+
* made the group taller than the field, so anything stretching beside it came out taller
|
|
9463
|
+
* too. A table's search button overshot its own field by exactly that margin.
|
|
9464
|
+
*
|
|
9465
|
+
* Zeroed on the host through the token the family already exposes, so nothing has to write
|
|
9466
|
+
* a rule that reaches into the control — and so every library that wires this adapter gets
|
|
9467
|
+
* it, rather than each one discovering it separately.
|
|
9468
|
+
*/
|
|
9469
|
+
function markEmbedded(element) {
|
|
9470
|
+
element.style.setProperty('--hub-field-stack-gap', '0');
|
|
9471
|
+
}
|
|
9456
9472
|
/**
|
|
9457
9473
|
* Ready-made {@link HubFormControlAdapter} backed by `HubInputComponent` /
|
|
9458
9474
|
* `HubSelectComponent`.
|
|
@@ -9469,6 +9485,7 @@ const hubFormControlAdapter = {
|
|
|
9469
9485
|
create(container, config) {
|
|
9470
9486
|
if (config.kind === 'select') {
|
|
9471
9487
|
const ref = container.createComponent(HubSelectComponent);
|
|
9488
|
+
markEmbedded(ref.location.nativeElement);
|
|
9472
9489
|
ref.setInput('items', (config.options ?? []).map((option) => ({ ...option })));
|
|
9473
9490
|
ref.setInput('bindLabel', 'label');
|
|
9474
9491
|
ref.setInput('bindValue', 'value');
|
|
@@ -9492,6 +9509,7 @@ const hubFormControlAdapter = {
|
|
|
9492
9509
|
};
|
|
9493
9510
|
}
|
|
9494
9511
|
const ref = container.createComponent(HubInputComponent);
|
|
9512
|
+
markEmbedded(ref.location.nativeElement);
|
|
9495
9513
|
ref.setInput('type', config.type ?? 'text');
|
|
9496
9514
|
if (config.placeholder) {
|
|
9497
9515
|
ref.setInput('placeholder', config.placeholder);
|