forty-cdk 0.41.0 → 0.41.1

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.
@@ -278,6 +278,8 @@ export const appConfig: ApplicationConfig = {
278
278
 
279
279
  `[forComboboxContent]` follows the floating-overlay convention: the consumer's signal drives `@if`, the directive emits dismiss events when it wants to be unmounted. No `[hidden]`. The visible input lives outside the overlay; only the listbox surface portals.
280
280
 
281
+ An open combobox with neither `[forComboboxContent]` nor `[forComboboxList]` mounted warns in dev mode (`FORCDK-CORE-014`). A `[forComboboxList]` mounted on its own counts as the surface, which is the shape for a combobox embedded in a panel it does not own, such as a popover's: bind the combobox's `open` to the panel's open signal and render the input and the list inside that panel's `@if`. The input's `aria-controls` names the list and Escape on the input closes it; outside presses are the enclosing panel's to handle, because no `[forComboboxContent]` pushes a dismissible layer.
282
+
281
283
  ## Anchoring to a field box
282
284
 
283
285
  By default the listbox is positioned against `[forComboboxInput]`. When the input lives inside a decorated field box (padding, a prefix icon, a clear button, or the multi-mode chip cluster), anchoring to the bare `<input>` makes the panel narrower than the visible field and offset from its edge. Wrap the field box in `[forComboboxAnchor]` so floating-ui positions (and sizes, via `--for-floating-anchor-width`) the listbox against the box instead:
@@ -2,7 +2,7 @@ import * as i0 from "@angular/core";
2
2
  import { DOCUMENT, Directive, ElementRef, InjectionToken, afterNextRender, booleanAttribute, computed, effect, inject, input, linkedSignal, model, numberAttribute, output, signal, untracked } from "@angular/core";
3
3
  import { Collection, FOR_FIELD_ANCHOR_CONTEXT, FOR_FIELD_CONTEXT, LabelCache, RootedRegistry, VirtualizedNavigator, VirtualizedResume, accessibleTextContent, assertInputBound, assertRootContext, composedContains, createPointerHighlight, defaultCompareWith, defaultItemToFormValue, firstEnabledHandle, focusAfterPress, foldTypeaheadText, fortyError, hostAriaLabel, hostButtonType, hostId, hostLabelledBy, injectFieldAnchor, injectFieldLabelExemption, injectHiddenInput, injectNativeFormReset, injectNativeFormResetToInitial, injectPointerMove, injectTextDirection, isImeComposing, isUnset, lastEnabledHandle, lookupByValue, nextEnabledHandle, orphanContextError, pressFocusesDescendant, preventPointerFocus, reflectDisabled, registerA11yName, registerHandle, resolveActiveElement, resolveTextInput, runVirtualizedNavigatorBridge, selectionMembership, singleSelected, toggleInArray, unresolvedRootError, unsetInput } from "forty-cdk/core";
4
4
  import { warnIfMountedWhileClosed, warnIfOpenWithoutContent } from "forty-cdk/core-overlay";
5
- import { AnchoredFormValueControlBase, OverlayController, anchorSlot, injectIdentifiedSlot, injectOverlayShell } from "forty-cdk/core-anchored";
5
+ import { AnchoredFormValueControlBase, OverlayController, anchorSlot, floatingPositioner, injectIdentifiedSlot, injectOverlayShell } from "forty-cdk/core-anchored";
6
6
  import { FOR_COMBOBOX_DEFAULTS, FOR_COMBOBOX_DEFAULTS as FOR_COMBOBOX_DEFAULTS$1, provideForComboboxDefaults } from "forty-cdk/defaults";
7
7
  function createActiveIdSignal(source) {
8
8
  return linkedSignal({
@@ -326,7 +326,7 @@ var ForCombobox = class ForCombobox extends AnchoredFormValueControlBase {
326
326
  piece: "[forComboboxContent]",
327
327
  condition: "combobox.open()",
328
328
  open: this.open,
329
- content: this.content
329
+ content: () => this.content() ?? this.list()
330
330
  });
331
331
  injectHiddenInput({
332
332
  name: this.name,
@@ -1756,8 +1756,7 @@ var ForComboboxContent = class ForComboboxContent {
1756
1756
  });
1757
1757
  const hasTrigger = computed(() => ctx.trigger() !== null, ...ngDevMode ? [{ debugName: "hasTrigger" }] : /* istanbul ignore next */ []);
1758
1758
  const config = {
1759
- positioner: {
1760
- kind: "floating",
1759
+ positioner: floatingPositioner({
1761
1760
  reference: ctx.anchor,
1762
1761
  open: ctx.open,
1763
1762
  side: ctx.side,
@@ -1770,7 +1769,7 @@ var ForComboboxContent = class ForComboboxContent {
1770
1769
  hideWhenDetached: ctx.hideWhenDetached,
1771
1770
  clipUntilPositioned: ctx.clipUntilPositioned,
1772
1771
  onFirstPosition: () => ctx.scrollActiveOptionIntoView()
1773
- },
1772
+ }),
1774
1773
  dismiss: {
1775
1774
  dismissible: ctx.dismissible,
1776
1775
  requestClose: (reason) => ctx.requestClose(reason),