@agorapulse/ui-components 22.4.11 → 22.4.13-beta.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.
Files changed (46) hide show
  1. package/agorapulse-ui-components-22.4.13-beta.1.tgz +0 -0
  2. package/fesm2022/agorapulse-ui-components-action-dropdown.mjs +1 -1
  3. package/fesm2022/agorapulse-ui-components-action-dropdown.mjs.map +1 -1
  4. package/fesm2022/agorapulse-ui-components-autocomplete.mjs.map +1 -1
  5. package/fesm2022/agorapulse-ui-components-avatar-group.mjs +1 -1
  6. package/fesm2022/agorapulse-ui-components-avatar-group.mjs.map +1 -1
  7. package/fesm2022/agorapulse-ui-components-datepicker.mjs +6 -5
  8. package/fesm2022/agorapulse-ui-components-datepicker.mjs.map +1 -1
  9. package/fesm2022/agorapulse-ui-components-filter-chips-list.mjs +4 -3
  10. package/fesm2022/agorapulse-ui-components-filter-chips-list.mjs.map +1 -1
  11. package/fesm2022/agorapulse-ui-components-filter-dropdown.mjs +3 -3
  12. package/fesm2022/agorapulse-ui-components-filter-dropdown.mjs.map +1 -1
  13. package/fesm2022/agorapulse-ui-components-floating.mjs +1 -1
  14. package/fesm2022/agorapulse-ui-components-floating.mjs.map +1 -1
  15. package/fesm2022/agorapulse-ui-components-form-field.mjs +168 -5
  16. package/fesm2022/agorapulse-ui-components-form-field.mjs.map +1 -1
  17. package/fesm2022/agorapulse-ui-components-form-message.mjs +14 -1
  18. package/fesm2022/agorapulse-ui-components-form-message.mjs.map +1 -1
  19. package/fesm2022/agorapulse-ui-components-input.mjs +5 -1
  20. package/fesm2022/agorapulse-ui-components-input.mjs.map +1 -1
  21. package/fesm2022/agorapulse-ui-components-labels.mjs +1 -1
  22. package/fesm2022/agorapulse-ui-components-labels.mjs.map +1 -1
  23. package/fesm2022/agorapulse-ui-components-nav-selector.mjs +4 -4
  24. package/fesm2022/agorapulse-ui-components-nav-selector.mjs.map +1 -1
  25. package/fesm2022/agorapulse-ui-components-overflow-base.mjs +1 -1
  26. package/fesm2022/agorapulse-ui-components-overflow-base.mjs.map +1 -1
  27. package/fesm2022/agorapulse-ui-components-radio-button-card.mjs +1 -1
  28. package/fesm2022/agorapulse-ui-components-radio-button-card.mjs.map +1 -1
  29. package/fesm2022/agorapulse-ui-components-segmented-control.mjs +4 -3
  30. package/fesm2022/agorapulse-ui-components-segmented-control.mjs.map +1 -1
  31. package/fesm2022/agorapulse-ui-components-select.mjs +25 -11
  32. package/fesm2022/agorapulse-ui-components-select.mjs.map +1 -1
  33. package/fesm2022/agorapulse-ui-components-selection-dropdown.mjs +1 -1
  34. package/fesm2022/agorapulse-ui-components-selection-dropdown.mjs.map +1 -1
  35. package/fesm2022/agorapulse-ui-components-tooltip.mjs +19 -4
  36. package/fesm2022/agorapulse-ui-components-tooltip.mjs.map +1 -1
  37. package/package.json +1 -1
  38. package/types/agorapulse-ui-components-autocomplete.d.ts +1 -2
  39. package/types/agorapulse-ui-components-datepicker.d.ts +2 -3
  40. package/types/agorapulse-ui-components-floating.d.ts +5 -0
  41. package/types/agorapulse-ui-components-form-field.d.ts +76 -4
  42. package/types/agorapulse-ui-components-form-message.d.ts +2 -0
  43. package/types/agorapulse-ui-components-input.d.ts +2 -1
  44. package/types/agorapulse-ui-components-select.d.ts +5 -1
  45. package/types/agorapulse-ui-components-tooltip.d.ts +9 -2
  46. package/agorapulse-ui-components-22.4.11.tgz +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"agorapulse-ui-components-floating.mjs","sources":["../../../libs/ui-components/floating/src/anchor.ts","../../../libs/ui-components/floating/src/rect.ts","../../../libs/ui-components/floating/src/placement.ts","../../../libs/ui-components/floating/src/arrow/arrow-geometry.ts","../../../libs/ui-components/floating/src/arrow/arrow-offset.ts","../../../libs/ui-components/floating/src/arrow/arrow-placement.ts","../../../libs/ui-components/floating/src/arrow/ap-arrow.middleware.ts","../../../libs/ui-components/floating/src/arrow/arrow-styles.ts","../../../libs/ui-components/floating/src/floating-overlay.helper.ts","../../../libs/ui-components/floating/src/agorapulse-ui-components-floating.ts"],"sourcesContent":["import { FloatingPlacement } from './placement';\nimport { FloatingRect } from './rect';\n\n/** What the panel connects to. */\nexport type FloatingAnchorMode = 'trigger' | 'pointer' | 'pointer-free';\n\n/**\n * The placement derived when `placement` is unset. Reads the **configured** anchor mode, not the\n * resolved one: a keyboard opening falls back to the trigger, and if the alignment followed, the\n * component would change shape between mouse and keyboard.\n */\nexport function defaultPlacementFor(anchor: FloatingAnchorMode): FloatingPlacement {\n return anchor === 'trigger' ? 'bottom-start' : 'bottom';\n}\n\n/**\n * `'pointer'` is a hybrid whose zero dimension is the **cross-axis** one; a lateral panel built\n * from a fully point-like anchor would sit inside its own trigger. `'pointer-free'` is the point\n * itself. Both fall back to the trigger when there is no click.\n *\n * @param vertical The opening axis. Invariant under the flip, which only swaps the main axis.\n */\nexport function resolveAnchorRect(\n anchor: FloatingAnchorMode,\n triggerRect: FloatingRect,\n vertical: boolean,\n clickPoint?: { x: number; y: number }\n): FloatingRect {\n if (anchor === 'trigger' || !clickPoint) {\n return triggerRect;\n }\n\n if (anchor === 'pointer-free') {\n return { x: clickPoint.x, y: clickPoint.y, width: 0, height: 0 };\n }\n\n return vertical\n ? { x: clickPoint.x, y: triggerRect.y, width: 0, height: triggerRect.height }\n : { x: triggerRect.x, y: clickPoint.y, width: triggerRect.width, height: 0 };\n}\n\n/**\n * A keyboard-synthesised click carries `detail: 0` and `clientX: 0`, which without this guard puts\n * the pointer anchor in the screen's top-left corner.\n * Only a `click` is checked, because `detail` counts clicks and is 0 on a hover too.\n */\nexport function clickPointOf(event?: MouseEvent): { x: number; y: number } | undefined {\n if (!event || (event.type === 'click' && event.detail === 0)) {\n return undefined;\n }\n\n return { x: event.clientX, y: event.clientY };\n}\n\n/** A point expressed as a proportion of the trigger, on each axis. */\nexport interface ClickRatio {\n x: number;\n y: number;\n}\n\n/**\n * A ratio names a place on the trigger where a viewport coordinate names a place in the window,\n * which is what makes a pointer anchor survive scrolling, resizing and shifting. `undefined` for a\n * trigger with no area, so the anchor falls back to the element rather than divide by zero.\n */\nexport function resolveClickRatio(triggerRect: FloatingRect, clickPoint?: { x: number; y: number }): ClickRatio | undefined {\n if (!clickPoint || triggerRect.width <= 0 || triggerRect.height <= 0) {\n return undefined;\n }\n\n return {\n x: (clickPoint.x - triggerRect.x) / triggerRect.width,\n y: (clickPoint.y - triggerRect.y) / triggerRect.height,\n };\n}\n\n/** The inverse: the viewport point this ratio names within a **fresh** trigger rect. */\nexport function pointFromRatio(triggerRect: FloatingRect, ratio?: ClickRatio): { x: number; y: number } | undefined {\n if (!ratio) {\n return undefined;\n }\n\n return {\n x: triggerRect.x + ratio.x * triggerRect.width,\n y: triggerRect.y + ratio.y * triggerRect.height,\n };\n}\n","/** A minimal rect — neither `DOMRect` nor any DOM dependency, so the pure units stay pure. */\nexport interface FloatingRect {\n x: number;\n y: number;\n width: number;\n height: number;\n}\n\n/**\n * Whole pixels, to match the panel's rounded translate and to stop the hiding test flickering on\n * sub-pixel noise.\n */\nexport function roundRect(rect: FloatingRect): FloatingRect {\n return {\n x: Math.round(rect.x),\n y: Math.round(rect.y),\n width: Math.round(rect.width),\n height: Math.round(rect.height),\n };\n}\n\nexport function overlaps(a: FloatingRect, b: FloatingRect): boolean {\n return a.x < b.x + b.width && b.x < a.x + a.width && a.y < b.y + b.height && b.y < a.y + a.height;\n}\n","import { Placement, Side } from '@floating-ui/dom';\n\n/**\n * The twelve placements, aliased from Floating UI rather than redeclared. The trade-off: this puts\n * `@floating-ui/dom` in our **public** type surface, so its next major would move our types too.\n *\n * There is no `'auto'`; an unset placement is derived by `defaultPlacementFor`.\n */\nexport type FloatingPlacement = Placement;\n\n/** The four opening sides. Floating UI's `Side`, for the same reason. */\nexport type FloatingSide = Side;\n\nexport function sideOf(placement: FloatingPlacement): FloatingSide {\n return placement.split('-')[0] as FloatingSide;\n}\n\nexport function isVertical(placement: FloatingPlacement): boolean {\n const side = sideOf(placement);\n return side === 'top' || side === 'bottom';\n}\n","/**\n * The arrow drawing's dimensions, shared by the offset computation, the CSS insets and the\n * stylesheet. The mask's `path` in `_floating-arrow.scss` encodes them too and cannot follow a\n * variable, so changing either number here means redrawing that SVG.\n */\nexport const ARROW_WIDTH = 16;\nexport const ARROW_HEIGHT = 8;\n","import { FloatingSide, isVertical } from '../placement';\nimport { FloatingRect } from '../rect';\nimport { ARROW_WIDTH } from './arrow-geometry';\n\nexport interface ArrowOffsetInput {\n /** The side of the panel the arrow sits on — the **resolved** side, not the wanted one. */\n side: FloatingSide;\n anchorRect: FloatingRect;\n floatingRect: FloatingRect;\n /** `'anchor'` aims at the anchor ∩ panel intersection's centre, `'pointer'` at the click. */\n targetMode: 'anchor' | 'pointer';\n clickPoint?: { x: number; y: number };\n}\n\nexport interface ArrowOffsetResult {\n /** The arrow's offset from the panel's start edge, along the cross axis. */\n offset: number;\n clamped: boolean;\n /** The click fell outside the panel, so the intersection centre was used instead. */\n fellBack: boolean;\n /** The panel is too narrow: the clamp range inverts and the arrow is centred outright. */\n centered: boolean;\n}\n\n/** The surface's own corner radius, which the tip must not encroach on. */\nconst RADIUS = 4;\n\n/**\n * Three rules, in order:\n *\n * 1. Aim at the centre of the **anchor ∩ panel intersection**, never the anchor's own centre —\n * `apArrow` documents why this diverges from Floating UI.\n * 2. In `'pointer'` mode, aim at the click, falling back to rule 1 — discontinuously, as the\n * plates specify — when the click lands outside the panel.\n * 3. Clamp to leave the corner radius clear. Below `arrow + 2 × radius` = 24px the range inverts,\n * and the arrow is centred outright.\n *\n * The flags say which rule applied, so the generated plate cases can assert the path taken.\n */\nexport function resolveArrowOffset(input: ArrowOffsetInput): ArrowOffsetResult {\n const vertical = isVertical(input.side);\n const panel = input.floatingRect;\n const anchor = input.anchorRect;\n\n const panelStart = vertical ? panel.x : panel.y;\n const panelEnd = panelStart + (vertical ? panel.width : panel.height);\n const size = vertical ? panel.width : panel.height;\n const anchorStart = vertical ? anchor.x : anchor.y;\n const anchorEnd = anchorStart + (vertical ? anchor.width : anchor.height);\n const click = input.clickPoint ? (vertical ? input.clickPoint.x : input.clickPoint.y) : undefined;\n\n const aimsAtPointer = input.targetMode === 'pointer' && click !== undefined && click >= panelStart && click <= panelEnd;\n\n let target: number;\n let fellBack = false;\n if (aimsAtPointer && click !== undefined) {\n target = click;\n } else {\n fellBack = input.targetMode === 'pointer';\n const from = Math.max(panelStart, anchorStart);\n const to = Math.min(panelEnd, anchorEnd);\n target = to >= from ? (from + to) / 2 : (panelStart + panelEnd) / 2;\n }\n\n const raw = target - panelStart - ARROW_WIDTH / 2;\n const low = RADIUS;\n const high = size - ARROW_WIDTH - RADIUS;\n\n if (high < low) {\n return { offset: (size - ARROW_WIDTH) / 2, clamped: false, fellBack, centered: true };\n }\n\n const offset = Math.max(low, Math.min(high, raw));\n return { offset, clamped: Math.abs(offset - raw) > 0.5, fellBack, centered: false };\n}\n","import { FloatingPlacement, FloatingSide, sideOf } from '../placement';\nimport { ARROW_HEIGHT, ARROW_WIDTH } from './arrow-geometry';\n\nconst OPPOSITE: Record<FloatingSide, FloatingSide> = {\n top: 'bottom',\n bottom: 'top',\n left: 'right',\n right: 'left',\n};\n\n/**\n * The panel edge an arrow sits on: a panel placed `bottom` hangs below its anchor, so its tip is on\n * its top edge. Give it the **resolved** placement, or a flipped panel grows its arrow away.\n */\nexport function arrowSideFor(placement: FloatingPlacement): FloatingSide {\n return OPPOSITE[sideOf(placement)];\n}\n\n/** Ready-to-use CSS values, `'auto'` for the sides that do not apply. */\nexport interface ArrowPlacement {\n top: string;\n right: string;\n bottom: string;\n left: string;\n rotate: string;\n}\n\n/** One pixel of overlap, or a sub-pixel seam opens at the joint. */\nconst OVERLAP = 1;\n\n/** How far it stands out on the main axis, measured from the panel's edge. */\nconst MAIN_INSET = ARROW_HEIGHT - OVERLAP;\n\n/**\n * The same laterally. A ±90° rotation turns about the box's centre, so the unrotated box is pushed\n * out by half its width less the half height it gains back, for the footprint to clear by `MAIN_INSET`.\n */\nconst SIDE_INSET = ARROW_WIDTH / 2 + ARROW_HEIGHT / 2 - OVERLAP;\n\n/** Compensation for that same rotation centre, on the cross axis. */\nconst CROSS_SHIFT = (ARROW_WIDTH - ARROW_HEIGHT) / 2;\n\n/**\n * The insets and rotation `_floating-arrow.scss` reads off the pane. The rotation-centre\n * compensation lives here rather than in the stylesheet, where it could not be tested.\n *\n * @param side The panel edge the arrow sits on — the **resolved** side, not the wanted one.\n * @param offset The offset from the panel's start edge, along the cross axis.\n */\nexport function resolveArrowPlacement(side: FloatingSide, offset: number): ArrowPlacement {\n const auto = 'auto';\n\n if (side === 'top') {\n return { top: `${-MAIN_INSET}px`, right: auto, bottom: auto, left: `${offset}px`, rotate: '0deg' };\n }\n\n if (side === 'bottom') {\n return { top: auto, right: auto, bottom: `${-MAIN_INSET}px`, left: `${offset}px`, rotate: '180deg' };\n }\n\n const cross = `${offset + CROSS_SHIFT}px`;\n\n return side === 'left'\n ? { top: cross, right: auto, bottom: auto, left: `${-SIDE_INSET}px`, rotate: '-90deg' }\n : { top: cross, right: `${-SIDE_INSET}px`, bottom: auto, left: auto, rotate: '90deg' };\n}\n","import { Middleware, MiddlewareState } from '@floating-ui/dom';\nimport { ClickRatio, FloatingAnchorMode } from '../anchor';\nimport { FloatingSide } from '../placement';\nimport { FloatingRect, overlaps, roundRect } from '../rect';\nimport { resolveArrowOffset } from './arrow-offset';\nimport { arrowSideFor } from './arrow-placement';\n\nexport interface ApArrowOptions {\n /** What the tip aims at — see {@link resolveArrowOffset}. */\n targetMode: 'anchor' | 'pointer';\n /** The configured anchor mode. Decides how the click is recovered from the reference rect. */\n anchorMode: FloatingAnchorMode;\n /** The clicked point as a proportion of the trigger. Absent on a keyboard opening. */\n clickRatio?: ClickRatio;\n}\n\n/** What the middleware leaves in `middlewareData.apArrow`. */\nexport interface ApArrowData {\n /** The arrow's offset from the panel's start edge, along the cross axis. */\n offset: number;\n /** The side of the panel the arrow sits on — read from the **resolved** placement. */\n side: FloatingSide;\n /** The panel covers its **anchor** — in the POI mode the trigger may be covered on purpose. */\n hidden: boolean;\n}\n\nexport const AP_ARROW = 'apArrow';\n\n/**\n * Replaces Floating UI's `arrow`, which aims at the centre of the *reference*: on a 280px trigger\n * with a 100px panel that centre is out of reach and the tip clamps to a corner at 80, where the\n * intersection's centre is 42 (plate 22). {@link resolveArrowOffset} holds the rule.\n *\n * Must run last, after `shift`, since it reads the panel's final position.\n */\nexport function apArrow(options: ApArrowOptions): Middleware {\n return {\n name: AP_ARROW,\n options,\n fn(state: MiddlewareState) {\n // Both rects come from Floating UI, in one space. Measuring the pane here would not.\n const anchorRect = roundRect(state.rects.reference);\n const floatingRect = roundRect({\n x: state.x,\n y: state.y,\n width: state.rects.floating.width,\n height: state.rects.floating.height,\n });\n\n const { offset } = resolveArrowOffset({\n side: arrowSideFor(state.placement),\n anchorRect,\n floatingRect,\n targetMode: options.targetMode,\n clickPoint: clickPointIn(anchorRect, options),\n });\n\n const data: ApArrowData = {\n offset,\n side: arrowSideFor(state.placement),\n hidden: overlaps(floatingRect, anchorRect),\n };\n return { data };\n },\n };\n}\n\n/**\n * In the pointer modes the reference **is** the click, so its origin is the point. Its coordinate\n * on the main axis is the trigger's and goes unread: the offset only ever reads the cross axis.\n */\nfunction clickPointIn(anchorRect: FloatingRect, { anchorMode, clickRatio }: ApArrowOptions): { x: number; y: number } | undefined {\n if (!clickRatio) {\n return undefined;\n }\n if (anchorMode !== 'trigger') {\n return { x: anchorRect.x, y: anchorRect.y };\n }\n return {\n x: anchorRect.x + clickRatio.x * anchorRect.width,\n y: anchorRect.y + clickRatio.y * anchorRect.height,\n };\n}\n","import { ApArrowData } from './ap-arrow.middleware';\nimport { ARROW_HEIGHT, ARROW_WIDTH } from './arrow-geometry';\nimport { resolveArrowPlacement } from './arrow-placement';\n\n/**\n * Set on the pane when an arrow is asked for. The drawing is global CSS because the pane belongs to\n * no component's DOM, so no encapsulated stylesheet can reach it.\n */\nexport const ARROW_CLASS = 'ap-floating-arrow';\n\n/**\n * Written on the first computation only: `getComputedStyle` forces a style recalculation, and the\n * update cycle runs on every scroll of every scrollable ancestor.\n *\n * **A contract for panels that ask for an arrow**: the pane's first element child must be the\n * styled surface, not a wrapper around it. The arrow's colour is lifted off that element, and the\n * stylesheet neutralises its shadow — a wrapper yields a transparent tip and two shadows at the\n * joint.\n *\n * Only CSS knows which element carries a background, so this is checked in a browser, never in a\n * unit test.\n *\n * @returns whether the surface was there to read, so the caller can retry on the next pass.\n */\nexport function writeArrowInvariants(pane: HTMLElement): boolean {\n pane.style.setProperty('--ap-floating-arrow-width', `${ARROW_WIDTH}px`);\n pane.style.setProperty('--ap-floating-arrow-height', `${ARROW_HEIGHT}px`);\n\n const surface = pane.firstElementChild;\n if (!surface) {\n return false;\n }\n\n pane.style.setProperty('--ap-arrow-background', getComputedStyle(surface).backgroundColor);\n return true;\n}\n\n/** The half that moves with the panel. */\nexport function writeArrowStyles(pane: HTMLElement, arrow: ApArrowData): void {\n const placement = resolveArrowPlacement(arrow.side, arrow.offset);\n\n pane.style.setProperty('--ap-arrow-top', placement.top);\n pane.style.setProperty('--ap-arrow-right', placement.right);\n pane.style.setProperty('--ap-arrow-bottom', placement.bottom);\n pane.style.setProperty('--ap-arrow-left', placement.left);\n pane.style.setProperty('--ap-arrow-rotate', placement.rotate);\n pane.style.setProperty('--ap-arrow-visibility', arrow.hidden ? 'hidden' : 'visible');\n}\n","import { Overlay, OverlayRef } from '@angular/cdk/overlay';\nimport { ComponentPortal, TemplatePortal } from '@angular/cdk/portal';\nimport { ComponentRef, DestroyRef, ElementRef, inject, signal, TemplateRef, Type, ViewContainerRef } from '@angular/core';\nimport { autoUpdate, computePosition, flip, offset, shift, size, VirtualElement } from '@floating-ui/dom';\nimport { filter } from 'rxjs/operators';\nimport {\n clickPointOf,\n ClickRatio,\n defaultPlacementFor,\n FloatingAnchorMode,\n pointFromRatio,\n resolveAnchorRect,\n resolveClickRatio,\n} from './anchor';\nimport { AP_ARROW, apArrow, ApArrowData } from './arrow/ap-arrow.middleware';\nimport { ARROW_HEIGHT } from './arrow/arrow-geometry';\nimport { ARROW_CLASS, writeArrowInvariants, writeArrowStyles } from './arrow/arrow-styles';\nimport { FloatingPlacement, isVertical } from './placement';\nimport { FloatingRect, roundRect } from './rect';\n\nexport interface FloatingOverlayConfig {\n /** Unset means derived from `anchor`. There is no `'auto'` value. */\n placement?: FloatingPlacement;\n anchor?: FloatingAnchorMode;\n arrow?: boolean;\n arrowTarget?: 'anchor' | 'pointer';\n showBackdrop?: boolean;\n panelClass?: string | string[];\n /**\n * Paints in the browser top layer, above every z-index, body-appended ng-select panels included.\n * For a transient surface that can open from inside one, like a tooltip. Unset keeps the normal layer.\n */\n topLayer?: boolean;\n /** Fallback for the two handlers below. */\n onClose?: () => void;\n /** Escape, which always closes. Unset means `onClose`. */\n onEscape?: () => void;\n /** Outside click. Unset means `onClose`. */\n onOutsideClick?: () => void;\n /**\n * Elements that carry their own toggle, so a click on them is not \"the outside\". Read on every\n * event, since the list may change while the floating is open.\n *\n * Without this, the CDK's capture-phase dispatcher closes before a secondary trigger sees the\n * click, that trigger reopens, and the toggle never closes again.\n */\n additionalTriggers?: () => readonly HTMLElement[];\n}\n\n/** The visual gap between anchor and panel. An arrow adds its own length: the tip must clear the edge. */\n/** Read by a surface that wants to fit: `max-height: var(--ap-floating-available-height)`. */\nexport const AVAILABLE_HEIGHT = '--ap-floating-available-height';\n\n/** Read by a surface that sizes to its content: `max-width: var(--ap-floating-available-width)`. */\nexport const AVAILABLE_WIDTH = '--ap-floating-available-width';\n\nconst GAP = 4;\n\nconst VIEWPORT_MARGIN = 8;\n\ninterface Measurable {\n getBoundingClientRect: () => { left: number; top: number; width: number; height: number };\n}\n\nfunction toRect(source: Measurable): FloatingRect {\n const rect = source.getBoundingClientRect();\n return roundRect({ x: rect.left, y: rect.top, width: rect.width, height: rect.height });\n}\n\ninterface AnchorState {\n target: HTMLElement;\n mode: FloatingAnchorMode;\n /** The opening axis. Invariant under the flip, which only swaps the main axis. */\n vertical: boolean;\n /** The click as a proportion of the trigger, so it survives scrolling, resizing and shifting. */\n ratio?: ClickRatio;\n}\n\nexport function createFloatingOverlay() {\n const elementRef = inject(ElementRef);\n const overlay = inject(Overlay);\n const viewContainerRef = inject(ViewContainerRef);\n\n let _overlayRef: OverlayRef | null = null;\n let stopAutoUpdate: (() => void) | null = null;\n let reposition: (() => void) | null = null;\n let anchorState: AnchorState | null = null;\n const isOpen = signal(false);\n\n inject(DestroyRef).onDestroy(() => close());\n\n /**\n * Opens the floating on a `TemplateRef`, attached as is, or on a component whose `ComponentRef`\n * is handed back, typed on the component, so the caller can set its inputs.\n *\n * The position keeps itself current, so inputs set after this returns need no refresh.\n */\n function open<T = unknown>(\n content: TemplateRef<unknown> | Type<T>,\n triggerElement?: HTMLElement,\n config?: FloatingOverlayConfig,\n event?: MouseEvent\n ): ComponentRef<T> | null {\n if (isOpen()) return null;\n\n const target = triggerElement ?? elementRef.nativeElement;\n const mode = config?.anchor ?? 'trigger';\n const placement = config?.placement ?? defaultPlacementFor(mode);\n\n anchorState = captureAnchor(target, mode, placement, event);\n\n disposeOverlay();\n _overlayRef = createOverlay(config);\n const pane = _overlayRef.overlayElement;\n // Floating UI's coordinates are viewport-relative; the CDK's `absolute` would misread them.\n pane.style.position = 'fixed';\n pane.style.left = '0';\n pane.style.top = '0';\n\n const panelRef = attachContent(content);\n isOpen.set(true);\n\n if (config?.arrow === true) {\n // On opening, so the pane carries the single silhouette's shadow before the first frame.\n pane.classList.add(ARROW_CLASS);\n }\n\n watchPosition(pane, placement, config);\n watchDismissal(target, config);\n\n return panelRef;\n }\n\n function captureAnchor(target: HTMLElement, mode: FloatingAnchorMode, placement: FloatingPlacement, event?: MouseEvent): AnchorState {\n return { target, mode, vertical: isVertical(placement), ratio: resolveClickRatio(toRect(target), clickPointOf(event)) };\n }\n\n /**\n * The reference **is** the anchor in all three modes, which is what lets the arrow read\n * `rects.reference` rather than rebuild it. `contextElement` is load-bearing: without it\n * `autoUpdate` cannot find the scrollable ancestors of an anchor that has no DOM node.\n */\n function toReference(state: AnchorState): HTMLElement | VirtualElement {\n if (state.mode === 'trigger' || !state.ratio) {\n return state.target;\n }\n\n return {\n contextElement: state.target,\n getBoundingClientRect: () => {\n const trigger = toRect(state.target);\n const rect = resolveAnchorRect(state.mode, trigger, state.vertical, pointFromRatio(trigger, state.ratio));\n return new DOMRect(rect.x, rect.y, rect.width, rect.height);\n },\n };\n }\n\n function createOverlay(config?: FloatingOverlayConfig): OverlayRef {\n return overlay.create({\n hasBackdrop: config?.showBackdrop ?? false,\n backdropClass: '',\n panelClass: config?.panelClass ?? '',\n // No scroll strategy: `autoUpdate` owns the update cycle, and the CDK's default is a no-op.\n usePopover: config?.topLayer ?? false,\n });\n }\n\n function attachContent<T>(content: TemplateRef<unknown> | Type<T>): ComponentRef<T> | null {\n if (!_overlayRef) return null;\n if (content instanceof TemplateRef) {\n _overlayRef.attach(new TemplatePortal(content, viewContainerRef));\n return null;\n }\n return _overlayRef.attach(new ComponentPortal(content, viewContainerRef));\n }\n\n /**\n * `autoUpdate` is the whole update cycle: scrollable ancestors of both boxes, the viewport,\n * both boxes' own resizing, and layout shifts. Nothing else here watches anything.\n */\n function watchPosition(pane: HTMLElement, placement: FloatingPlacement, config?: FloatingOverlayConfig): void {\n const state = anchorState;\n if (!state) return;\n const reference = toReference(state);\n\n const middleware = [\n offset(config?.arrow === true ? GAP + ARROW_HEIGHT : GAP),\n flip({ crossAxis: false, flipAlignment: false, padding: VIEWPORT_MARGIN }),\n shift({ padding: VIEWPORT_MARGIN }),\n // After flip and shift, so what it publishes is the room left on the side they settled on.\n size({\n padding: VIEWPORT_MARGIN,\n apply: ({ availableWidth, availableHeight }) => {\n pane.style.setProperty(AVAILABLE_WIDTH, `${Math.round(availableWidth)}px`);\n pane.style.setProperty(AVAILABLE_HEIGHT, `${Math.round(availableHeight)}px`);\n },\n }),\n ];\n if (config?.arrow === true) {\n middleware.push(apArrow({ targetMode: config.arrowTarget ?? 'anchor', anchorMode: state.mode, clickRatio: state.ratio }));\n }\n\n let invariantsWritten = false;\n\n reposition = () => {\n // A detached trigger measures as a zero rect at the viewport origin: keep the last position instead.\n if (!state.target.isConnected) return;\n void computePosition(reference, pane, { strategy: 'fixed', placement, middleware }).then(position => {\n // Whole pixels: a fractional translate blurs text on a non-retina screen.\n pane.style.transform = `translate(${Math.round(position.x)}px, ${Math.round(position.y)}px)`;\n const arrow: ApArrowData | undefined = position.middlewareData[AP_ARROW];\n if (arrow) {\n invariantsWritten = invariantsWritten || writeArrowInvariants(pane);\n writeArrowStyles(pane, arrow);\n }\n });\n };\n\n stopAutoUpdate = autoUpdate(reference, pane, reposition);\n }\n\n function watchDismissal(target: HTMLElement, config?: FloatingOverlayConfig): void {\n if (!_overlayRef) return;\n\n const closeHandler = config?.onClose ?? (() => close());\n const outsideHandler = config?.onOutsideClick ?? closeHandler;\n const escapeHandler = config?.onEscape ?? closeHandler;\n\n const ownsGesture = (node: Node): boolean =>\n target.contains(node) || (config?.additionalTriggers?.() ?? []).some(element => element.contains(node));\n\n // No `take(1)`: a handler may decline to close, and it must still hear the next gesture. Dispose ends both.\n _overlayRef\n .outsidePointerEvents()\n .pipe(filter(pointerEvent => !(pointerEvent.target instanceof Node && ownsGesture(pointerEvent.target))))\n .subscribe(() => outsideHandler());\n\n _overlayRef\n .keydownEvents()\n .pipe(filter(keyEvent => keyEvent.key === 'Escape'))\n .subscribe(() => escapeHandler());\n }\n\n /** The observers never outlive their overlay: they would reposition it after its destruction. */\n function disposeOverlay(): void {\n stopAutoUpdate?.();\n stopAutoUpdate = null;\n reposition = null;\n _overlayRef?.dispose();\n _overlayRef = null;\n }\n\n function close(): void {\n if (!isOpen()) return;\n\n anchorState = null;\n disposeOverlay();\n isOpen.set(false);\n }\n\n /** Recomputes now. For a caller that knows the geometry changed before any observer can see it. */\n function updatePosition(): void {\n reposition?.();\n }\n\n return {\n get overlayRef() {\n return _overlayRef;\n },\n isOpen: isOpen.asReadonly(),\n open,\n close,\n updatePosition,\n };\n}\n\nexport type FloatingOverlayInstance = ReturnType<typeof createFloatingOverlay>;\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;AAMA;;;;AAIG;AACG,SAAU,mBAAmB,CAAC,MAA0B,EAAA;IAC1D,OAAO,MAAM,KAAK,SAAS,GAAG,cAAc,GAAG,QAAQ;AAC3D;AAEA;;;;;;AAMG;AACG,SAAU,iBAAiB,CAC7B,MAA0B,EAC1B,WAAyB,EACzB,QAAiB,EACjB,UAAqC,EAAA;AAErC,IAAA,IAAI,MAAM,KAAK,SAAS,IAAI,CAAC,UAAU,EAAE;AACrC,QAAA,OAAO,WAAW;IACtB;AAEA,IAAA,IAAI,MAAM,KAAK,cAAc,EAAE;QAC3B,OAAO,EAAE,CAAC,EAAE,UAAU,CAAC,CAAC,EAAE,CAAC,EAAE,UAAU,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE;IACpE;AAEA,IAAA,OAAO;UACD,EAAE,CAAC,EAAE,UAAU,CAAC,CAAC,EAAE,CAAC,EAAE,WAAW,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,WAAW,CAAC,MAAM;UACzE,EAAE,CAAC,EAAE,WAAW,CAAC,CAAC,EAAE,CAAC,EAAE,UAAU,CAAC,CAAC,EAAE,KAAK,EAAE,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,CAAC,EAAE;AACpF;AAEA;;;;AAIG;AACG,SAAU,YAAY,CAAC,KAAkB,EAAA;AAC3C,IAAA,IAAI,CAAC,KAAK,KAAK,KAAK,CAAC,IAAI,KAAK,OAAO,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,CAAC,EAAE;AAC1D,QAAA,OAAO,SAAS;IACpB;AAEA,IAAA,OAAO,EAAE,CAAC,EAAE,KAAK,CAAC,OAAO,EAAE,CAAC,EAAE,KAAK,CAAC,OAAO,E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,SAAS,cAAc,GAAA;QACnB,UAAU,IAAI;IAClB;IAEA,OAAO;AACH,QAAA,IAAI,UAAU,GAAA;AACV,YAAA,OAAO,WAAW;QACtB,CAAC;AACD,QAAA,MAAM,EAAE,MAAM,CAAC,UAAU,EAAE;QAC3B,IAAI;QACJ,KAAK;QACL,cAAc;KACjB;AACL;;AClRA;;AAEG;;;;"}
1
+ {"version":3,"file":"agorapulse-ui-components-floating.mjs","sources":["../../../libs/ui-components/floating/src/anchor.ts","../../../libs/ui-components/floating/src/rect.ts","../../../libs/ui-components/floating/src/placement.ts","../../../libs/ui-components/floating/src/arrow/arrow-geometry.ts","../../../libs/ui-components/floating/src/arrow/arrow-offset.ts","../../../libs/ui-components/floating/src/arrow/arrow-placement.ts","../../../libs/ui-components/floating/src/arrow/ap-arrow.middleware.ts","../../../libs/ui-components/floating/src/arrow/arrow-styles.ts","../../../libs/ui-components/floating/src/floating-overlay.helper.ts","../../../libs/ui-components/floating/src/agorapulse-ui-components-floating.ts"],"sourcesContent":["import { FloatingPlacement } from './placement';\nimport { FloatingRect } from './rect';\n\n/** What the panel connects to. */\nexport type FloatingAnchorMode = 'trigger' | 'pointer' | 'pointer-free';\n\n/**\n * The placement derived when `placement` is unset. Reads the **configured** anchor mode, not the\n * resolved one: a keyboard opening falls back to the trigger, and if the alignment followed, the\n * component would change shape between mouse and keyboard.\n */\nexport function defaultPlacementFor(anchor: FloatingAnchorMode): FloatingPlacement {\n return anchor === 'trigger' ? 'bottom-start' : 'bottom';\n}\n\n/**\n * `'pointer'` is a hybrid whose zero dimension is the **cross-axis** one; a lateral panel built\n * from a fully point-like anchor would sit inside its own trigger. `'pointer-free'` is the point\n * itself. Both fall back to the trigger when there is no click.\n *\n * @param vertical The opening axis. Invariant under the flip, which only swaps the main axis.\n */\nexport function resolveAnchorRect(\n anchor: FloatingAnchorMode,\n triggerRect: FloatingRect,\n vertical: boolean,\n clickPoint?: { x: number; y: number }\n): FloatingRect {\n if (anchor === 'trigger' || !clickPoint) {\n return triggerRect;\n }\n\n if (anchor === 'pointer-free') {\n return { x: clickPoint.x, y: clickPoint.y, width: 0, height: 0 };\n }\n\n return vertical\n ? { x: clickPoint.x, y: triggerRect.y, width: 0, height: triggerRect.height }\n : { x: triggerRect.x, y: clickPoint.y, width: triggerRect.width, height: 0 };\n}\n\n/**\n * A keyboard-synthesised click carries `detail: 0` and `clientX: 0`, which without this guard puts\n * the pointer anchor in the screen's top-left corner.\n * Only a `click` is checked, because `detail` counts clicks and is 0 on a hover too.\n */\nexport function clickPointOf(event?: MouseEvent): { x: number; y: number } | undefined {\n if (!event || (event.type === 'click' && event.detail === 0)) {\n return undefined;\n }\n\n return { x: event.clientX, y: event.clientY };\n}\n\n/** A point expressed as a proportion of the trigger, on each axis. */\nexport interface ClickRatio {\n x: number;\n y: number;\n}\n\n/**\n * A ratio names a place on the trigger where a viewport coordinate names a place in the window,\n * which is what makes a pointer anchor survive scrolling, resizing and shifting. `undefined` for a\n * trigger with no area, so the anchor falls back to the element rather than divide by zero.\n */\nexport function resolveClickRatio(triggerRect: FloatingRect, clickPoint?: { x: number; y: number }): ClickRatio | undefined {\n if (!clickPoint || triggerRect.width <= 0 || triggerRect.height <= 0) {\n return undefined;\n }\n\n return {\n x: (clickPoint.x - triggerRect.x) / triggerRect.width,\n y: (clickPoint.y - triggerRect.y) / triggerRect.height,\n };\n}\n\n/** The inverse: the viewport point this ratio names within a **fresh** trigger rect. */\nexport function pointFromRatio(triggerRect: FloatingRect, ratio?: ClickRatio): { x: number; y: number } | undefined {\n if (!ratio) {\n return undefined;\n }\n\n return {\n x: triggerRect.x + ratio.x * triggerRect.width,\n y: triggerRect.y + ratio.y * triggerRect.height,\n };\n}\n","/** A minimal rect — neither `DOMRect` nor any DOM dependency, so the pure units stay pure. */\nexport interface FloatingRect {\n x: number;\n y: number;\n width: number;\n height: number;\n}\n\n/**\n * Whole pixels, to match the panel's rounded translate and to stop the hiding test flickering on\n * sub-pixel noise.\n */\nexport function roundRect(rect: FloatingRect): FloatingRect {\n return {\n x: Math.round(rect.x),\n y: Math.round(rect.y),\n width: Math.round(rect.width),\n height: Math.round(rect.height),\n };\n}\n\nexport function overlaps(a: FloatingRect, b: FloatingRect): boolean {\n return a.x < b.x + b.width && b.x < a.x + a.width && a.y < b.y + b.height && b.y < a.y + a.height;\n}\n","import { Placement, Side } from '@floating-ui/dom';\n\n/**\n * The twelve placements, aliased from Floating UI rather than redeclared. The trade-off: this puts\n * `@floating-ui/dom` in our **public** type surface, so its next major would move our types too.\n *\n * There is no `'auto'`; an unset placement is derived by `defaultPlacementFor`.\n */\nexport type FloatingPlacement = Placement;\n\n/** The four opening sides. Floating UI's `Side`, for the same reason. */\nexport type FloatingSide = Side;\n\nexport function sideOf(placement: FloatingPlacement): FloatingSide {\n return placement.split('-')[0] as FloatingSide;\n}\n\nexport function isVertical(placement: FloatingPlacement): boolean {\n const side = sideOf(placement);\n return side === 'top' || side === 'bottom';\n}\n","/**\n * The arrow drawing's dimensions, shared by the offset computation, the CSS insets and the\n * stylesheet. The mask's `path` in `_floating-arrow.scss` encodes them too and cannot follow a\n * variable, so changing either number here means redrawing that SVG.\n */\nexport const ARROW_WIDTH = 16;\nexport const ARROW_HEIGHT = 8;\n","import { FloatingSide, isVertical } from '../placement';\nimport { FloatingRect } from '../rect';\nimport { ARROW_WIDTH } from './arrow-geometry';\n\nexport interface ArrowOffsetInput {\n /** The side of the panel the arrow sits on — the **resolved** side, not the wanted one. */\n side: FloatingSide;\n anchorRect: FloatingRect;\n floatingRect: FloatingRect;\n /** `'anchor'` aims at the anchor ∩ panel intersection's centre, `'pointer'` at the click. */\n targetMode: 'anchor' | 'pointer';\n clickPoint?: { x: number; y: number };\n}\n\nexport interface ArrowOffsetResult {\n /** The arrow's offset from the panel's start edge, along the cross axis. */\n offset: number;\n clamped: boolean;\n /** The click fell outside the panel, so the intersection centre was used instead. */\n fellBack: boolean;\n /** The panel is too narrow: the clamp range inverts and the arrow is centred outright. */\n centered: boolean;\n}\n\n/** The surface's own corner radius, which the tip must not encroach on. */\nconst RADIUS = 4;\n\n/**\n * Three rules, in order:\n *\n * 1. Aim at the centre of the **anchor ∩ panel intersection**, never the anchor's own centre —\n * `apArrow` documents why this diverges from Floating UI.\n * 2. In `'pointer'` mode, aim at the click, falling back to rule 1 — discontinuously, as the\n * plates specify — when the click lands outside the panel.\n * 3. Clamp to leave the corner radius clear. Below `arrow + 2 × radius` = 24px the range inverts,\n * and the arrow is centred outright.\n *\n * The flags say which rule applied, so the generated plate cases can assert the path taken.\n */\nexport function resolveArrowOffset(input: ArrowOffsetInput): ArrowOffsetResult {\n const vertical = isVertical(input.side);\n const panel = input.floatingRect;\n const anchor = input.anchorRect;\n\n const panelStart = vertical ? panel.x : panel.y;\n const panelEnd = panelStart + (vertical ? panel.width : panel.height);\n const size = vertical ? panel.width : panel.height;\n const anchorStart = vertical ? anchor.x : anchor.y;\n const anchorEnd = anchorStart + (vertical ? anchor.width : anchor.height);\n const click = input.clickPoint ? (vertical ? input.clickPoint.x : input.clickPoint.y) : undefined;\n\n const aimsAtPointer = input.targetMode === 'pointer' && click !== undefined && click >= panelStart && click <= panelEnd;\n\n let target: number;\n let fellBack = false;\n if (aimsAtPointer && click !== undefined) {\n target = click;\n } else {\n fellBack = input.targetMode === 'pointer';\n const from = Math.max(panelStart, anchorStart);\n const to = Math.min(panelEnd, anchorEnd);\n target = to >= from ? (from + to) / 2 : (panelStart + panelEnd) / 2;\n }\n\n const raw = target - panelStart - ARROW_WIDTH / 2;\n const low = RADIUS;\n const high = size - ARROW_WIDTH - RADIUS;\n\n if (high < low) {\n return { offset: (size - ARROW_WIDTH) / 2, clamped: false, fellBack, centered: true };\n }\n\n const offset = Math.max(low, Math.min(high, raw));\n return { offset, clamped: Math.abs(offset - raw) > 0.5, fellBack, centered: false };\n}\n","import { FloatingPlacement, FloatingSide, sideOf } from '../placement';\nimport { ARROW_HEIGHT, ARROW_WIDTH } from './arrow-geometry';\n\nconst OPPOSITE: Record<FloatingSide, FloatingSide> = {\n top: 'bottom',\n bottom: 'top',\n left: 'right',\n right: 'left',\n};\n\n/**\n * The panel edge an arrow sits on: a panel placed `bottom` hangs below its anchor, so its tip is on\n * its top edge. Give it the **resolved** placement, or a flipped panel grows its arrow away.\n */\nexport function arrowSideFor(placement: FloatingPlacement): FloatingSide {\n return OPPOSITE[sideOf(placement)];\n}\n\n/** Ready-to-use CSS values, `'auto'` for the sides that do not apply. */\nexport interface ArrowPlacement {\n top: string;\n right: string;\n bottom: string;\n left: string;\n rotate: string;\n}\n\n/** One pixel of overlap, or a sub-pixel seam opens at the joint. */\nconst OVERLAP = 1;\n\n/** How far it stands out on the main axis, measured from the panel's edge. */\nconst MAIN_INSET = ARROW_HEIGHT - OVERLAP;\n\n/**\n * The same laterally. A ±90° rotation turns about the box's centre, so the unrotated box is pushed\n * out by half its width less the half height it gains back, for the footprint to clear by `MAIN_INSET`.\n */\nconst SIDE_INSET = ARROW_WIDTH / 2 + ARROW_HEIGHT / 2 - OVERLAP;\n\n/** Compensation for that same rotation centre, on the cross axis. */\nconst CROSS_SHIFT = (ARROW_WIDTH - ARROW_HEIGHT) / 2;\n\n/**\n * The insets and rotation `_floating-arrow.scss` reads off the pane. The rotation-centre\n * compensation lives here rather than in the stylesheet, where it could not be tested.\n *\n * @param side The panel edge the arrow sits on — the **resolved** side, not the wanted one.\n * @param offset The offset from the panel's start edge, along the cross axis.\n */\nexport function resolveArrowPlacement(side: FloatingSide, offset: number): ArrowPlacement {\n const auto = 'auto';\n\n if (side === 'top') {\n return { top: `${-MAIN_INSET}px`, right: auto, bottom: auto, left: `${offset}px`, rotate: '0deg' };\n }\n\n if (side === 'bottom') {\n return { top: auto, right: auto, bottom: `${-MAIN_INSET}px`, left: `${offset}px`, rotate: '180deg' };\n }\n\n const cross = `${offset + CROSS_SHIFT}px`;\n\n return side === 'left'\n ? { top: cross, right: auto, bottom: auto, left: `${-SIDE_INSET}px`, rotate: '-90deg' }\n : { top: cross, right: `${-SIDE_INSET}px`, bottom: auto, left: auto, rotate: '90deg' };\n}\n","import { Middleware, MiddlewareState } from '@floating-ui/dom';\nimport { ClickRatio, FloatingAnchorMode } from '../anchor';\nimport { FloatingSide } from '../placement';\nimport { FloatingRect, overlaps, roundRect } from '../rect';\nimport { resolveArrowOffset } from './arrow-offset';\nimport { arrowSideFor } from './arrow-placement';\n\nexport interface ApArrowOptions {\n /** What the tip aims at — see {@link resolveArrowOffset}. */\n targetMode: 'anchor' | 'pointer';\n /** The configured anchor mode. Decides how the click is recovered from the reference rect. */\n anchorMode: FloatingAnchorMode;\n /** The clicked point as a proportion of the trigger. Absent on a keyboard opening. */\n clickRatio?: ClickRatio;\n}\n\n/** What the middleware leaves in `middlewareData.apArrow`. */\nexport interface ApArrowData {\n /** The arrow's offset from the panel's start edge, along the cross axis. */\n offset: number;\n /** The side of the panel the arrow sits on — read from the **resolved** placement. */\n side: FloatingSide;\n /** The panel covers its **anchor** — in the POI mode the trigger may be covered on purpose. */\n hidden: boolean;\n}\n\nexport const AP_ARROW = 'apArrow';\n\n/**\n * Replaces Floating UI's `arrow`, which aims at the centre of the *reference*: on a 280px trigger\n * with a 100px panel that centre is out of reach and the tip clamps to a corner at 80, where the\n * intersection's centre is 42 (plate 22). {@link resolveArrowOffset} holds the rule.\n *\n * Must run last, after `shift`, since it reads the panel's final position.\n */\nexport function apArrow(options: ApArrowOptions): Middleware {\n return {\n name: AP_ARROW,\n options,\n fn(state: MiddlewareState) {\n // Both rects come from Floating UI, in one space. Measuring the pane here would not.\n const anchorRect = roundRect(state.rects.reference);\n const floatingRect = roundRect({\n x: state.x,\n y: state.y,\n width: state.rects.floating.width,\n height: state.rects.floating.height,\n });\n\n const { offset } = resolveArrowOffset({\n side: arrowSideFor(state.placement),\n anchorRect,\n floatingRect,\n targetMode: options.targetMode,\n clickPoint: clickPointIn(anchorRect, options),\n });\n\n const data: ApArrowData = {\n offset,\n side: arrowSideFor(state.placement),\n hidden: overlaps(floatingRect, anchorRect),\n };\n return { data };\n },\n };\n}\n\n/**\n * In the pointer modes the reference **is** the click, so its origin is the point. Its coordinate\n * on the main axis is the trigger's and goes unread: the offset only ever reads the cross axis.\n */\nfunction clickPointIn(anchorRect: FloatingRect, { anchorMode, clickRatio }: ApArrowOptions): { x: number; y: number } | undefined {\n if (!clickRatio) {\n return undefined;\n }\n if (anchorMode !== 'trigger') {\n return { x: anchorRect.x, y: anchorRect.y };\n }\n return {\n x: anchorRect.x + clickRatio.x * anchorRect.width,\n y: anchorRect.y + clickRatio.y * anchorRect.height,\n };\n}\n","import { ApArrowData } from './ap-arrow.middleware';\nimport { ARROW_HEIGHT, ARROW_WIDTH } from './arrow-geometry';\nimport { resolveArrowPlacement } from './arrow-placement';\n\n/**\n * Set on the pane when an arrow is asked for. The drawing is global CSS because the pane belongs to\n * no component's DOM, so no encapsulated stylesheet can reach it.\n */\nexport const ARROW_CLASS = 'ap-floating-arrow';\n\n/**\n * Written on the first computation only: `getComputedStyle` forces a style recalculation, and the\n * update cycle runs on every scroll of every scrollable ancestor.\n *\n * **A contract for panels that ask for an arrow**: the pane's first element child must be the\n * styled surface, not a wrapper around it. The arrow's colour is lifted off that element, and the\n * stylesheet neutralises its shadow — a wrapper yields a transparent tip and two shadows at the\n * joint.\n *\n * Only CSS knows which element carries a background, so this is checked in a browser, never in a\n * unit test.\n *\n * @returns whether the surface was there to read, so the caller can retry on the next pass.\n */\nexport function writeArrowInvariants(pane: HTMLElement): boolean {\n pane.style.setProperty('--ap-floating-arrow-width', `${ARROW_WIDTH}px`);\n pane.style.setProperty('--ap-floating-arrow-height', `${ARROW_HEIGHT}px`);\n\n const surface = pane.firstElementChild;\n if (!surface) {\n return false;\n }\n\n pane.style.setProperty('--ap-arrow-background', getComputedStyle(surface).backgroundColor);\n return true;\n}\n\n/** The half that moves with the panel. */\nexport function writeArrowStyles(pane: HTMLElement, arrow: ApArrowData): void {\n const placement = resolveArrowPlacement(arrow.side, arrow.offset);\n\n pane.style.setProperty('--ap-arrow-top', placement.top);\n pane.style.setProperty('--ap-arrow-right', placement.right);\n pane.style.setProperty('--ap-arrow-bottom', placement.bottom);\n pane.style.setProperty('--ap-arrow-left', placement.left);\n pane.style.setProperty('--ap-arrow-rotate', placement.rotate);\n pane.style.setProperty('--ap-arrow-visibility', arrow.hidden ? 'hidden' : 'visible');\n}\n","import { Overlay, OverlayRef } from '@angular/cdk/overlay';\nimport { ComponentPortal, TemplatePortal } from '@angular/cdk/portal';\nimport { ComponentRef, DestroyRef, ElementRef, inject, signal, TemplateRef, Type, ViewContainerRef } from '@angular/core';\nimport { autoUpdate, computePosition, flip, offset, shift, size, VirtualElement } from '@floating-ui/dom';\nimport { filter } from 'rxjs/operators';\nimport {\n clickPointOf,\n ClickRatio,\n defaultPlacementFor,\n FloatingAnchorMode,\n pointFromRatio,\n resolveAnchorRect,\n resolveClickRatio,\n} from './anchor';\nimport { AP_ARROW, apArrow, ApArrowData } from './arrow/ap-arrow.middleware';\nimport { ARROW_HEIGHT } from './arrow/arrow-geometry';\nimport { ARROW_CLASS, writeArrowInvariants, writeArrowStyles } from './arrow/arrow-styles';\nimport { FloatingPlacement, isVertical } from './placement';\nimport { FloatingRect, roundRect } from './rect';\n\nexport interface FloatingOverlayConfig {\n /** Unset means derived from `anchor`. There is no `'auto'` value. */\n placement?: FloatingPlacement;\n anchor?: FloatingAnchorMode;\n arrow?: boolean;\n arrowTarget?: 'anchor' | 'pointer';\n showBackdrop?: boolean;\n panelClass?: string | string[];\n /**\n * Paints in the browser top layer, above every z-index, body-appended ng-select panels included.\n * For a transient surface that can open from inside one, like a tooltip. Unset keeps the normal layer.\n */\n topLayer?: boolean;\n /**\n * What the panel slides to stay inside. `'trigger'` keeps it within the trigger's box, for a panel\n * opened at a point on a wide trigger. Unset means the viewport.\n */\n boundary?: 'viewport' | 'trigger';\n /** Fallback for the two handlers below. */\n onClose?: () => void;\n /** Escape, which always closes. Unset means `onClose`. */\n onEscape?: () => void;\n /** Outside click. Unset means `onClose`. */\n onOutsideClick?: () => void;\n /**\n * Elements that carry their own toggle, so a click on them is not \"the outside\". Read on every\n * event, since the list may change while the floating is open.\n *\n * Without this, the CDK's capture-phase dispatcher closes before a secondary trigger sees the\n * click, that trigger reopens, and the toggle never closes again.\n */\n additionalTriggers?: () => readonly HTMLElement[];\n}\n\n/** The visual gap between anchor and panel. An arrow adds its own length: the tip must clear the edge. */\n/** Read by a surface that wants to fit: `max-height: var(--ap-floating-available-height)`. */\nexport const AVAILABLE_HEIGHT = '--ap-floating-available-height';\n\n/** Read by a surface that sizes to its content: `max-width: var(--ap-floating-available-width)`. */\nexport const AVAILABLE_WIDTH = '--ap-floating-available-width';\n\nconst GAP = 4;\n\nconst VIEWPORT_MARGIN = 8;\n\ninterface Measurable {\n getBoundingClientRect: () => { left: number; top: number; width: number; height: number };\n}\n\nfunction toRect(source: Measurable): FloatingRect {\n const rect = source.getBoundingClientRect();\n return roundRect({ x: rect.left, y: rect.top, width: rect.width, height: rect.height });\n}\n\ninterface AnchorState {\n target: HTMLElement;\n mode: FloatingAnchorMode;\n /** The opening axis. Invariant under the flip, which only swaps the main axis. */\n vertical: boolean;\n /** The click as a proportion of the trigger, so it survives scrolling, resizing and shifting. */\n ratio?: ClickRatio;\n}\n\nexport function createFloatingOverlay() {\n const elementRef = inject(ElementRef);\n const overlay = inject(Overlay);\n const viewContainerRef = inject(ViewContainerRef);\n\n let _overlayRef: OverlayRef | null = null;\n let stopAutoUpdate: (() => void) | null = null;\n let reposition: (() => void) | null = null;\n let anchorState: AnchorState | null = null;\n const isOpen = signal(false);\n\n inject(DestroyRef).onDestroy(() => close());\n\n /**\n * Opens the floating on a `TemplateRef`, attached as is, or on a component whose `ComponentRef`\n * is handed back, typed on the component, so the caller can set its inputs.\n *\n * The position keeps itself current, so inputs set after this returns need no refresh.\n */\n function open<T = unknown>(\n content: TemplateRef<unknown> | Type<T>,\n triggerElement?: HTMLElement,\n config?: FloatingOverlayConfig,\n event?: MouseEvent\n ): ComponentRef<T> | null {\n if (isOpen()) return null;\n\n const target = triggerElement ?? elementRef.nativeElement;\n const mode = config?.anchor ?? 'trigger';\n const placement = config?.placement ?? defaultPlacementFor(mode);\n\n anchorState = captureAnchor(target, mode, placement, event);\n\n disposeOverlay();\n _overlayRef = createOverlay(config);\n const pane = _overlayRef.overlayElement;\n // Floating UI's coordinates are viewport-relative; the CDK's `absolute` would misread them.\n pane.style.position = 'fixed';\n pane.style.left = '0';\n pane.style.top = '0';\n\n const panelRef = attachContent(content);\n isOpen.set(true);\n\n if (config?.arrow === true) {\n // On opening, so the pane carries the single silhouette's shadow before the first frame.\n pane.classList.add(ARROW_CLASS);\n }\n\n watchPosition(pane, placement, config);\n watchDismissal(target, config);\n\n return panelRef;\n }\n\n function captureAnchor(target: HTMLElement, mode: FloatingAnchorMode, placement: FloatingPlacement, event?: MouseEvent): AnchorState {\n return { target, mode, vertical: isVertical(placement), ratio: resolveClickRatio(toRect(target), clickPointOf(event)) };\n }\n\n /**\n * The reference **is** the anchor in all three modes, which is what lets the arrow read\n * `rects.reference` rather than rebuild it. `contextElement` is load-bearing: without it\n * `autoUpdate` cannot find the scrollable ancestors of an anchor that has no DOM node.\n */\n function toReference(state: AnchorState): HTMLElement | VirtualElement {\n if (state.mode === 'trigger' || !state.ratio) {\n return state.target;\n }\n\n return {\n contextElement: state.target,\n getBoundingClientRect: () => {\n const trigger = toRect(state.target);\n const rect = resolveAnchorRect(state.mode, trigger, state.vertical, pointFromRatio(trigger, state.ratio));\n return new DOMRect(rect.x, rect.y, rect.width, rect.height);\n },\n };\n }\n\n function createOverlay(config?: FloatingOverlayConfig): OverlayRef {\n return overlay.create({\n hasBackdrop: config?.showBackdrop ?? false,\n backdropClass: '',\n panelClass: config?.panelClass ?? '',\n // No scroll strategy: `autoUpdate` owns the update cycle, and the CDK's default is a no-op.\n usePopover: config?.topLayer ?? false,\n });\n }\n\n function attachContent<T>(content: TemplateRef<unknown> | Type<T>): ComponentRef<T> | null {\n if (!_overlayRef) return null;\n if (content instanceof TemplateRef) {\n _overlayRef.attach(new TemplatePortal(content, viewContainerRef));\n return null;\n }\n return _overlayRef.attach(new ComponentPortal(content, viewContainerRef));\n }\n\n /**\n * `autoUpdate` is the whole update cycle: scrollable ancestors of both boxes, the viewport,\n * both boxes' own resizing, and layout shifts. Nothing else here watches anything.\n */\n function watchPosition(pane: HTMLElement, placement: FloatingPlacement, config?: FloatingOverlayConfig): void {\n const state = anchorState;\n if (!state) return;\n const reference = toReference(state);\n\n const middleware = [\n offset(config?.arrow === true ? GAP + ARROW_HEIGHT : GAP),\n flip({ crossAxis: false, flipAlignment: false, padding: VIEWPORT_MARGIN }),\n shift({ padding: VIEWPORT_MARGIN, ...(config?.boundary === 'trigger' ? { boundary: state.target } : {}) }),\n // After flip and shift, so what it publishes is the room left on the side they settled on.\n size({\n padding: VIEWPORT_MARGIN,\n apply: ({ availableWidth, availableHeight }) => {\n pane.style.setProperty(AVAILABLE_WIDTH, `${Math.round(availableWidth)}px`);\n pane.style.setProperty(AVAILABLE_HEIGHT, `${Math.round(availableHeight)}px`);\n },\n }),\n ];\n if (config?.arrow === true) {\n middleware.push(apArrow({ targetMode: config.arrowTarget ?? 'anchor', anchorMode: state.mode, clickRatio: state.ratio }));\n }\n\n let invariantsWritten = false;\n\n reposition = () => {\n // A detached trigger measures as a zero rect at the viewport origin: keep the last position instead.\n if (!state.target.isConnected) return;\n void computePosition(reference, pane, { strategy: 'fixed', placement, middleware }).then(position => {\n // Whole pixels: a fractional translate blurs text on a non-retina screen.\n pane.style.transform = `translate(${Math.round(position.x)}px, ${Math.round(position.y)}px)`;\n const arrow: ApArrowData | undefined = position.middlewareData[AP_ARROW];\n if (arrow) {\n invariantsWritten = invariantsWritten || writeArrowInvariants(pane);\n writeArrowStyles(pane, arrow);\n }\n });\n };\n\n stopAutoUpdate = autoUpdate(reference, pane, reposition);\n }\n\n function watchDismissal(target: HTMLElement, config?: FloatingOverlayConfig): void {\n if (!_overlayRef) return;\n\n const closeHandler = config?.onClose ?? (() => close());\n const outsideHandler = config?.onOutsideClick ?? closeHandler;\n const escapeHandler = config?.onEscape ?? closeHandler;\n\n const ownsGesture = (node: Node): boolean =>\n target.contains(node) || (config?.additionalTriggers?.() ?? []).some(element => element.contains(node));\n\n // No `take(1)`: a handler may decline to close, and it must still hear the next gesture. Dispose ends both.\n _overlayRef\n .outsidePointerEvents()\n .pipe(filter(pointerEvent => !(pointerEvent.target instanceof Node && ownsGesture(pointerEvent.target))))\n .subscribe(() => outsideHandler());\n\n _overlayRef\n .keydownEvents()\n .pipe(filter(keyEvent => keyEvent.key === 'Escape'))\n .subscribe(() => escapeHandler());\n }\n\n /** The observers never outlive their overlay: they would reposition it after its destruction. */\n function disposeOverlay(): void {\n stopAutoUpdate?.();\n stopAutoUpdate = null;\n reposition = null;\n _overlayRef?.dispose();\n _overlayRef = null;\n }\n\n function close(): void {\n if (!isOpen()) return;\n\n anchorState = null;\n disposeOverlay();\n isOpen.set(false);\n }\n\n /** Recomputes now. For a caller that knows the geometry changed before any observer can see it. */\n function updatePosition(): void {\n reposition?.();\n }\n\n return {\n get overlayRef() {\n return _overlayRef;\n },\n isOpen: isOpen.asReadonly(),\n open,\n close,\n updatePosition,\n };\n}\n\nexport type FloatingOverlayInstance = ReturnType<typeof createFloatingOverlay>;\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;AAMA;;;;AAIG;AACG,SAAU,mBAAmB,CAAC,MAA0B,EAAA;IAC1D,OAAO,MAAM,KAAK,SAAS,GAAG,cAAc,GAAG,QAAQ;AAC3D;AAEA;;;;;;AAMG;AACG,SAAU,iBAAiB,CAC7B,MAA0B,EAC1B,WAAyB,EACzB,QAAiB,EACjB,UAAqC,EAAA;AAErC,IAAA,IAAI,MAAM,KAAK,SAAS,IAAI,CAAC,UAAU,EAAE;AACrC,QAAA,OAAO,WAAW;IACtB;AAEA,IAAA,IAAI,MAAM,KAAK,cAAc,EAAE;QAC3B,OAAO,EAAE,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AAI,CAAC,MAAM,EAAE,kBAAkB,IAAI,IAAI,EAAE,EAAE,IAAI,CAAC,OAAO,IAAI,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;;QAG3G;AACK,aAAA,oBAAoB;aACpB,IAAI,CAAC,MAAM,CAAC,YAAY,IAAI,EAAE,YAAY,CAAC,MAAM,YAAY,IAAI,IAAI,WAAW,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC;AACvG,aAAA,SAAS,CAAC,MAAM,cAAc,EAAE,CAAC;QAEtC;AACK,aAAA,aAAa;AACb,aAAA,IAAI,CAAC,MAAM,CAAC,QAAQ,IAAI,QAAQ,CAAC,GAAG,KAAK,QAAQ,CAAC;AAClD,aAAA,SAAS,CAAC,MAAM,aAAa,EAAE,CAAC;IACzC;;AAGA,IAAA,SAAS,cAAc,GAAA;QACnB,cAAc,IAAI;QAClB,cAAc,GAAG,IAAI;QACrB,UAAU,GAAG,IAAI;QACjB,WAAW,EAAE,OAAO,EAAE;QACtB,WAAW,GAAG,IAAI;IACtB;AAEA,IAAA,SAAS,KAAK,GAAA;QACV,IAAI,CAAC,MAAM,EAAE;YAAE;QAEf,WAAW,GAAG,IAAI;AAClB,QAAA,cAAc,EAAE;AAChB,QAAA,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC;IACrB;;AAGA,IAAA,SAAS,cAAc,GAAA;QACnB,UAAU,IAAI;IAClB;IAEA,OAAO;AACH,QAAA,IAAI,UAAU,GAAA;AACV,YAAA,OAAO,WAAW;QACtB,CAAC;AACD,QAAA,MAAM,EAAE,MAAM,CAAC,UAAU,EAAE;QAC3B,IAAI;QACJ,KAAK;QACL,cAAc;KACjB;AACL;;ACvRA;;AAEG;;;;"}
@@ -1,18 +1,181 @@
1
1
  import * as i0 from '@angular/core';
2
- import { ViewEncapsulation, ChangeDetectionStrategy, Component } from '@angular/core';
2
+ import { inject, APP_ID, viewChild, signal, computed, afterRenderEffect, untracked, ViewEncapsulation, ChangeDetectionStrategy, Component, input, booleanAttribute, ElementRef, DestroyRef, Directive } from '@angular/core';
3
3
 
4
4
  class FormFieldComponent {
5
+ /**
6
+ * Combines the application id — federated Angular apps can share a page — with a per-instance random suffix.
7
+ * Not `crypto.randomUUID()`, which browsers refuse outside a secure context.
8
+ */
9
+ uid = `${inject(APP_ID)}-form-field-${Math.random().toString(36).slice(2)}${Date.now().toString(36)}`;
10
+ content = viewChild.required('content');
11
+ control = signal(undefined, /* @ts-ignore */
12
+ ...(ngDevMode ? [{ debugName: "control" }] : /* istanbul ignore next */ []));
13
+ descriptions = signal([], /* @ts-ignore */
14
+ ...(ngDevMode ? [{ debugName: "descriptions" }] : /* istanbul ignore next */ []));
15
+ labelledById = signal(undefined, /* @ts-ignore */
16
+ ...(ngDevMode ? [{ debugName: "labelledById" }] : /* istanbul ignore next */ []));
17
+ labelled = signal(false, /* @ts-ignore */
18
+ ...(ngDevMode ? [{ debugName: "labelled" }] : /* istanbul ignore next */ []));
19
+ /**
20
+ * The label's id when `aria-labelledby` has to carry the association — never on the native branch, where `for` suffices.
21
+ * Undefined until the first render, and when the field has no label: a control must not emit a dangling reference.
22
+ */
23
+ labelledBy = this.labelledById.asReadonly();
24
+ /** Whether a label already names the control, by `for` or by `aria-labelledby`. */
25
+ hasLabel = this.labelled.asReadonly();
26
+ /** The ids of everything describing the control, for its `aria-describedby`. */
27
+ describedBy = computed(() => this.descriptions().join(' ') || undefined, /* @ts-ignore */
28
+ ...(ngDevMode ? [{ debugName: "describedBy" }] : /* istanbul ignore next */ []));
29
+ constructor() {
30
+ // After render, so outside change detection: the projected content exists and writing signals
31
+ // here cannot trigger NG0100. Re-runs when the control registers, since it picks the branch.
32
+ afterRenderEffect(() => {
33
+ this.content();
34
+ this.control();
35
+ untracked(() => this.associate());
36
+ });
37
+ }
38
+ /**
39
+ * Links the projected label to the registered control.
40
+ *
41
+ * Public because `detectChanges()` does not run after-render hooks in a zone.js harness, so a spec has to force the pass —
42
+ * as does a consumer whose label only appears after the first render.
43
+ */
44
+ associate() {
45
+ // `:scope >` and not `querySelector('label')`: `ng-content select="label"` only projects direct
46
+ // children, so a deeper label belongs to something else. Among several, the first names the field.
47
+ const label = this.content().nativeElement.querySelector(':scope > label');
48
+ if (!label) {
49
+ this.labelledById.set(undefined);
50
+ this.labelled.set(false);
51
+ return;
52
+ }
53
+ // When the control offers a target `for` can reach, the browser supplies the name and the focusing click, so no ARIA is owed.
54
+ const target = this.control()?.labelTarget(`${this.uid}-control`);
55
+ if (target) {
56
+ if (!label.htmlFor) {
57
+ label.htmlFor = target;
58
+ }
59
+ this.labelledById.set(undefined);
60
+ this.labelled.set(true);
61
+ return;
62
+ }
63
+ this.labelledById.set(this.ensureId(label, 'label'));
64
+ this.labelled.set(true);
65
+ }
66
+ registerControl(control) {
67
+ this.control.set(control);
68
+ }
69
+ unregisterControl(control) {
70
+ // By identity: a destruction racing a new registration must not clear the live control.
71
+ this.control.update(current => (current === control ? undefined : current));
72
+ }
73
+ registerDescription(id) {
74
+ this.descriptions.update(ids => (ids.includes(id) ? ids : [...ids, id]));
75
+ }
76
+ unregisterDescription(id) {
77
+ this.descriptions.update(ids => ids.filter(current => current !== id));
78
+ }
79
+ /** Only stamps what has no id yet: the author's own may already be referenced elsewhere. */
80
+ ensureId(element, suffix) {
81
+ if (!element.id) {
82
+ element.id = `${this.uid}-${suffix}`;
83
+ }
84
+ return element.id;
85
+ }
86
+ onClick(event) {
87
+ const control = this.control();
88
+ if (!control) {
89
+ return;
90
+ }
91
+ const label = event.target?.closest('label');
92
+ if (!label || label.parentElement !== this.content().nativeElement) {
93
+ return;
94
+ }
95
+ // `label.control` is null exactly when the `for` reaches nothing, the case this exists for.
96
+ // `hasAttribute('for')` would instead let an inert `for` through — precisely what is repaired.
97
+ if (label.control) {
98
+ return;
99
+ }
100
+ control.focus();
101
+ }
5
102
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: FormFieldComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
6
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.0.5", type: FormFieldComponent, isStandalone: true, selector: "ap-form-field", ngImport: i0, template: "<div class=\"ap-form-field\">\n <ng-content select=\"label\"></ng-content>\n <ng-content></ng-content>\n <ng-content select=\"ap-form-message\"></ng-content>\n</div>\n", styles: ["ap-form-field{display:block}.ap-form-field{display:inline-flex;flex-direction:column;gap:var(--comp-input-spacing-horizontal);width:100%}.ap-form-field label{display:flex;flex-direction:column;gap:var(--comp-forms-label-spacing-vertical);font-size:var(--comp-forms-label-size);font-weight:var(--comp-forms-label-font-weight);line-height:var(--comp-forms-label-line-height);font-family:var(--comp-forms-label-font-family);color:var(--comp-forms-label-text-color)}.ap-form-field label .description{font-size:var(--comp-forms-label-description-text-size);font-weight:var(--comp-forms-label-description-text-font-weight);line-height:var(--comp-forms-label-description-text-line-height);font-family:var(--comp-forms-label-description-text-font-family);color:var(--comp-forms-label-description-text-color)}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
103
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "22.0.5", type: FormFieldComponent, isStandalone: true, selector: "ap-form-field", host: { listeners: { "click": "onClick($event)" } }, viewQueries: [{ propertyName: "content", first: true, predicate: ["content"], descendants: true, isSignal: true }], ngImport: i0, template: "<div\n #content\n class=\"ap-form-field\">\n <ng-content select=\"label\"></ng-content>\n <ng-content></ng-content>\n <ng-content select=\"ap-form-message\"></ng-content>\n</div>\n", styles: ["ap-form-field{display:block}.ap-form-field{display:inline-flex;flex-direction:column;gap:var(--comp-input-spacing-horizontal);width:100%}.ap-form-field label{display:flex;flex-direction:column;gap:var(--comp-forms-label-spacing-vertical);font-size:var(--comp-forms-label-size);font-weight:var(--comp-forms-label-font-weight);line-height:var(--comp-forms-label-line-height);font-family:var(--comp-forms-label-font-family);color:var(--comp-forms-label-text-color)}.ap-form-field label .description{font-size:var(--comp-forms-label-description-text-size);font-weight:var(--comp-forms-label-description-text-font-weight);line-height:var(--comp-forms-label-description-text-line-height);font-family:var(--comp-forms-label-description-text-font-family);color:var(--comp-forms-label-description-text-color)}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
7
104
  }
8
105
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: FormFieldComponent, decorators: [{
9
106
  type: Component,
10
- args: [{ selector: 'ap-form-field', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, template: "<div class=\"ap-form-field\">\n <ng-content select=\"label\"></ng-content>\n <ng-content></ng-content>\n <ng-content select=\"ap-form-message\"></ng-content>\n</div>\n", styles: ["ap-form-field{display:block}.ap-form-field{display:inline-flex;flex-direction:column;gap:var(--comp-input-spacing-horizontal);width:100%}.ap-form-field label{display:flex;flex-direction:column;gap:var(--comp-forms-label-spacing-vertical);font-size:var(--comp-forms-label-size);font-weight:var(--comp-forms-label-font-weight);line-height:var(--comp-forms-label-line-height);font-family:var(--comp-forms-label-font-family);color:var(--comp-forms-label-text-color)}.ap-form-field label .description{font-size:var(--comp-forms-label-description-text-size);font-weight:var(--comp-forms-label-description-text-font-weight);line-height:var(--comp-forms-label-description-text-line-height);font-family:var(--comp-forms-label-description-text-font-family);color:var(--comp-forms-label-description-text-color)}\n"] }]
11
- }] });
107
+ args: [{ selector: 'ap-form-field', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, host: {
108
+ '(click)': 'onClick($event)',
109
+ }, template: "<div\n #content\n class=\"ap-form-field\">\n <ng-content select=\"label\"></ng-content>\n <ng-content></ng-content>\n <ng-content select=\"ap-form-message\"></ng-content>\n</div>\n", styles: ["ap-form-field{display:block}.ap-form-field{display:inline-flex;flex-direction:column;gap:var(--comp-input-spacing-horizontal);width:100%}.ap-form-field label{display:flex;flex-direction:column;gap:var(--comp-forms-label-spacing-vertical);font-size:var(--comp-forms-label-size);font-weight:var(--comp-forms-label-font-weight);line-height:var(--comp-forms-label-line-height);font-family:var(--comp-forms-label-font-family);color:var(--comp-forms-label-text-color)}.ap-form-field label .description{font-size:var(--comp-forms-label-description-text-size);font-weight:var(--comp-forms-label-description-text-font-weight);line-height:var(--comp-forms-label-description-text-line-height);font-family:var(--comp-forms-label-description-text-font-family);color:var(--comp-forms-label-description-text-color)}\n"] }]
110
+ }], ctorParameters: () => [], propDecorators: { content: [{ type: i0.ViewChild, args: ['content', { isSignal: true }] }] } });
111
+
112
+ /** The elements a `<label for>` can reach. Everything else has to go through `aria-labelledby`. */
113
+ const LABELABLE = ['BUTTON', 'INPUT', 'METER', 'OUTPUT', 'PROGRESS', 'SELECT', 'TEXTAREA'];
114
+ /** Finds the first focusable descendant, for when the designated element is not focusable itself. */
115
+ const FOCUSABLE = 'button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), a[href], [tabindex]:not([tabindex="-1"])';
116
+ /**
117
+ * Points the surrounding `ap-form-field` at a control's focusable element, and carries the naming that follows.
118
+ *
119
+ * Put it on the element the user actually focuses: the component host when that is it (via `hostDirectives`), otherwise the
120
+ * inner element, in the component's template. With no `ap-form-field` around, it falls back to the `aria-label` it is given.
121
+ */
122
+ class FormFieldControlDirective {
123
+ /** Fallback name, for a field with no visible label. */
124
+ ariaLabel = input(undefined, { ...(ngDevMode ? { debugName: "ariaLabel" } : /* istanbul ignore next */ {}), alias: 'apFormFieldControl' });
125
+ /** A disabled control does not take focus from a click on its label. */
126
+ disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
127
+ element = inject(ElementRef).nativeElement;
128
+ formField = inject(FormFieldComponent, { optional: true });
129
+ /** Empty on the native branch, where the label's `for` already carries the association. */
130
+ labelledBy = computed(() => this.formField?.labelledBy(), /* @ts-ignore */
131
+ ...(ngDevMode ? [{ debugName: "labelledBy" }] : /* istanbul ignore next */ []));
132
+ /** The fallback only: an `aria-label` wins over a visible label, so it goes out only when no label names the control. */
133
+ label = computed(() => (this.formField?.hasLabel() ? undefined : this.ariaLabel()), /* @ts-ignore */
134
+ ...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
135
+ describedBy = computed(() => this.formField?.describedBy(), /* @ts-ignore */
136
+ ...(ngDevMode ? [{ debugName: "describedBy" }] : /* istanbul ignore next */ []));
137
+ constructor() {
138
+ this.formField?.registerControl(this);
139
+ inject(DestroyRef).onDestroy(() => this.formField?.unregisterControl(this));
140
+ }
141
+ labelTarget(fallbackId) {
142
+ if (!LABELABLE.includes(this.element.tagName)) {
143
+ return undefined;
144
+ }
145
+ if (!this.element.id) {
146
+ this.element.id = fallbackId;
147
+ }
148
+ return this.element.id;
149
+ }
150
+ focus() {
151
+ if (this.disabled()) {
152
+ return;
153
+ }
154
+ this.element.focus();
155
+ // A named container — `role="group"`, `role="listbox"` — is not always in the tab order; the
156
+ // label should then reach its first focusable element.
157
+ if (document.activeElement !== this.element) {
158
+ this.element.querySelector(FOCUSABLE)?.focus();
159
+ }
160
+ }
161
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: FormFieldControlDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
162
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.5", type: FormFieldControlDirective, isStandalone: true, selector: "[apFormFieldControl]", inputs: { ariaLabel: { classPropertyName: "ariaLabel", publicName: "apFormFieldControl", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "attr.aria-labelledby": "labelledBy()", "attr.aria-label": "label()", "attr.aria-describedby": "describedBy()" } }, ngImport: i0 });
163
+ }
164
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: FormFieldControlDirective, decorators: [{
165
+ type: Directive,
166
+ args: [{
167
+ selector: '[apFormFieldControl]',
168
+ host: {
169
+ '[attr.aria-labelledby]': 'labelledBy()',
170
+ '[attr.aria-label]': 'label()',
171
+ '[attr.aria-describedby]': 'describedBy()',
172
+ },
173
+ }]
174
+ }], ctorParameters: () => [], propDecorators: { ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "apFormFieldControl", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }] } });
12
175
 
13
176
  /**
14
177
  * Generated bundle index. Do not edit.
15
178
  */
16
179
 
17
- export { FormFieldComponent };
180
+ export { FormFieldComponent, FormFieldControlDirective };
18
181
  //# sourceMappingURL=agorapulse-ui-components-form-field.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"agorapulse-ui-components-form-field.mjs","sources":["../../../libs/ui-components/form-field/src/form-field.component.ts","../../../libs/ui-components/form-field/src/form-field.component.html","../../../libs/ui-components/form-field/src/agorapulse-ui-components-form-field.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, ViewEncapsulation } from '@angular/core';\n\n@Component({\n selector: 'ap-form-field',\n templateUrl: './form-field.component.html',\n styleUrls: ['./form-field.component.scss'],\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n})\nexport class FormFieldComponent {}\n","<div class=\"ap-form-field\">\n <ng-content select=\"label\"></ng-content>\n <ng-content></ng-content>\n <ng-content select=\"ap-form-message\"></ng-content>\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;MAUa,kBAAkB,CAAA;uGAAlB,kBAAkB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAlB,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,kBAAkB,yECV/B,kLAKA,EAAA,MAAA,EAAA,CAAA,oyBAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,aAAA,EAAA,EAAA,CAAA,iBAAA,CAAA,IAAA,EAAA,CAAA;;2FDKa,kBAAkB,EAAA,UAAA,EAAA,CAAA;kBAR9B,SAAS;+BACI,eAAe,EAAA,UAAA,EAGb,IAAI,EAAA,eAAA,EACC,uBAAuB,CAAC,MAAM,EAAA,aAAA,EAChC,iBAAiB,CAAC,IAAI,EAAA,QAAA,EAAA,kLAAA,EAAA,MAAA,EAAA,CAAA,oyBAAA,CAAA,EAAA;;;AERzC;;AAEG;;;;"}
1
+ {"version":3,"file":"agorapulse-ui-components-form-field.mjs","sources":["../../../libs/ui-components/form-field/src/form-field.component.ts","../../../libs/ui-components/form-field/src/form-field.component.html","../../../libs/ui-components/form-field/src/form-field-control.directive.ts","../../../libs/ui-components/form-field/src/agorapulse-ui-components-form-field.ts"],"sourcesContent":["import {\n afterRenderEffect,\n APP_ID,\n ChangeDetectionStrategy,\n Component,\n computed,\n ElementRef,\n inject,\n signal,\n untracked,\n viewChild,\n ViewEncapsulation,\n} from '@angular/core';\nimport type { FormFieldControl } from './form-field-control';\n\n@Component({\n selector: 'ap-form-field',\n templateUrl: './form-field.component.html',\n styleUrls: ['./form-field.component.scss'],\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n host: {\n '(click)': 'onClick($event)',\n },\n})\nexport class FormFieldComponent {\n /**\n * Combines the application id — federated Angular apps can share a page — with a per-instance random suffix.\n * Not `crypto.randomUUID()`, which browsers refuse outside a secure context.\n */\n private readonly uid = `${inject(APP_ID)}-form-field-${Math.random().toString(36).slice(2)}${Date.now().toString(36)}`;\n\n private readonly content = viewChild.required<ElementRef<HTMLElement>>('content');\n private readonly control = signal<FormFieldControl | undefined>(undefined);\n private readonly descriptions = signal<readonly string[]>([]);\n\n private readonly labelledById = signal<string | undefined>(undefined);\n private readonly labelled = signal(false);\n\n /**\n * The label's id when `aria-labelledby` has to carry the association — never on the native branch, where `for` suffices.\n * Undefined until the first render, and when the field has no label: a control must not emit a dangling reference.\n */\n readonly labelledBy = this.labelledById.asReadonly();\n\n /** Whether a label already names the control, by `for` or by `aria-labelledby`. */\n readonly hasLabel = this.labelled.asReadonly();\n\n /** The ids of everything describing the control, for its `aria-describedby`. */\n readonly describedBy = computed(() => this.descriptions().join(' ') || undefined);\n\n constructor() {\n // After render, so outside change detection: the projected content exists and writing signals\n // here cannot trigger NG0100. Re-runs when the control registers, since it picks the branch.\n afterRenderEffect(() => {\n this.content();\n this.control();\n untracked(() => this.associate());\n });\n }\n\n /**\n * Links the projected label to the registered control.\n *\n * Public because `detectChanges()` does not run after-render hooks in a zone.js harness, so a spec has to force the pass —\n * as does a consumer whose label only appears after the first render.\n */\n associate(): void {\n // `:scope >` and not `querySelector('label')`: `ng-content select=\"label\"` only projects direct\n // children, so a deeper label belongs to something else. Among several, the first names the field.\n const label = this.content().nativeElement.querySelector<HTMLLabelElement>(':scope > label');\n if (!label) {\n this.labelledById.set(undefined);\n this.labelled.set(false);\n return;\n }\n\n // When the control offers a target `for` can reach, the browser supplies the name and the focusing click, so no ARIA is owed.\n const target = this.control()?.labelTarget(`${this.uid}-control`);\n if (target) {\n if (!label.htmlFor) {\n label.htmlFor = target;\n }\n this.labelledById.set(undefined);\n this.labelled.set(true);\n return;\n }\n\n this.labelledById.set(this.ensureId(label, 'label'));\n this.labelled.set(true);\n }\n\n registerControl(control: FormFieldControl): void {\n this.control.set(control);\n }\n\n unregisterControl(control: FormFieldControl): void {\n // By identity: a destruction racing a new registration must not clear the live control.\n this.control.update(current => (current === control ? undefined : current));\n }\n\n registerDescription(id: string): void {\n this.descriptions.update(ids => (ids.includes(id) ? ids : [...ids, id]));\n }\n\n unregisterDescription(id: string): void {\n this.descriptions.update(ids => ids.filter(current => current !== id));\n }\n\n /** Only stamps what has no id yet: the author's own may already be referenced elsewhere. */\n private ensureId(element: HTMLElement, suffix: string): string {\n if (!element.id) {\n element.id = `${this.uid}-${suffix}`;\n }\n return element.id;\n }\n\n protected onClick(event: MouseEvent): void {\n const control = this.control();\n if (!control) {\n return;\n }\n\n const label = (event.target as HTMLElement | null)?.closest('label');\n if (!label || label.parentElement !== this.content().nativeElement) {\n return;\n }\n\n // `label.control` is null exactly when the `for` reaches nothing, the case this exists for.\n // `hasAttribute('for')` would instead let an inert `for` through — precisely what is repaired.\n if (label.control) {\n return;\n }\n\n control.focus();\n }\n}\n","<div\n #content\n class=\"ap-form-field\">\n <ng-content select=\"label\"></ng-content>\n <ng-content></ng-content>\n <ng-content select=\"ap-form-message\"></ng-content>\n</div>\n","import { booleanAttribute, computed, DestroyRef, Directive, ElementRef, inject, input } from '@angular/core';\nimport type { FormFieldControl } from './form-field-control';\nimport { FormFieldComponent } from './form-field.component';\n\n/** The elements a `<label for>` can reach. Everything else has to go through `aria-labelledby`. */\nconst LABELABLE = ['BUTTON', 'INPUT', 'METER', 'OUTPUT', 'PROGRESS', 'SELECT', 'TEXTAREA'];\n\n/** Finds the first focusable descendant, for when the designated element is not focusable itself. */\nconst FOCUSABLE =\n 'button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), a[href], [tabindex]:not([tabindex=\"-1\"])';\n\n/**\n * Points the surrounding `ap-form-field` at a control's focusable element, and carries the naming that follows.\n *\n * Put it on the element the user actually focuses: the component host when that is it (via `hostDirectives`), otherwise the\n * inner element, in the component's template. With no `ap-form-field` around, it falls back to the `aria-label` it is given.\n */\n@Directive({\n selector: '[apFormFieldControl]',\n host: {\n '[attr.aria-labelledby]': 'labelledBy()',\n '[attr.aria-label]': 'label()',\n '[attr.aria-describedby]': 'describedBy()',\n },\n})\nexport class FormFieldControlDirective implements FormFieldControl {\n /** Fallback name, for a field with no visible label. */\n readonly ariaLabel = input<string | undefined>(undefined, { alias: 'apFormFieldControl' });\n\n /** A disabled control does not take focus from a click on its label. */\n readonly disabled = input(false, { transform: booleanAttribute });\n\n private readonly element: HTMLElement = inject(ElementRef).nativeElement;\n private readonly formField = inject(FormFieldComponent, { optional: true });\n\n /** Empty on the native branch, where the label's `for` already carries the association. */\n protected readonly labelledBy = computed(() => this.formField?.labelledBy());\n\n /** The fallback only: an `aria-label` wins over a visible label, so it goes out only when no label names the control. */\n protected readonly label = computed(() => (this.formField?.hasLabel() ? undefined : this.ariaLabel()));\n\n protected readonly describedBy = computed(() => this.formField?.describedBy());\n\n constructor() {\n this.formField?.registerControl(this);\n inject(DestroyRef).onDestroy(() => this.formField?.unregisterControl(this));\n }\n\n labelTarget(fallbackId: string): string | undefined {\n if (!LABELABLE.includes(this.element.tagName)) {\n return undefined;\n }\n if (!this.element.id) {\n this.element.id = fallbackId;\n }\n return this.element.id;\n }\n\n focus(): void {\n if (this.disabled()) {\n return;\n }\n\n this.element.focus();\n // A named container — `role=\"group\"`, `role=\"listbox\"` — is not always in the tab order; the\n // label should then reach its first focusable element.\n if (document.activeElement !== this.element) {\n this.element.querySelector<HTMLElement>(FOCUSABLE)?.focus();\n }\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;MA0Ba,kBAAkB,CAAA;AAC3B;;;AAGG;AACc,IAAA,GAAG,GAAG,CAAA,EAAG,MAAM,CAAC,MAAM,CAAC,CAAA,YAAA,EAAe,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA,EAAG,IAAI,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,EAAE;AAErG,IAAA,OAAO,GAAG,SAAS,CAAC,QAAQ,CAA0B,SAAS,CAAC;IAChE,OAAO,GAAG,MAAM,CAA+B,SAAS;gFAAC;IACzD,YAAY,GAAG,MAAM,CAAoB,EAAE;qFAAC;IAE5C,YAAY,GAAG,MA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QAAQ,CAAC,aAAa,KAAK,IAAI,CAAC,OAAO,EAAE;YACzC,IAAI,CAAC,OAAO,CAAC,aAAa,CAAc,SAAS,CAAC,EAAE,KAAK,EAAE;QAC/D;IACJ;uGA5CS,yBAAyB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;2FAAzB,yBAAyB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,sBAAA,EAAA,MAAA,EAAA,EAAA,SAAA,EAAA,EAAA,iBAAA,EAAA,WAAA,EAAA,UAAA,EAAA,oBAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,QAAA,EAAA,EAAA,iBAAA,EAAA,UAAA,EAAA,UAAA,EAAA,UAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,IAAA,EAAA,EAAA,UAAA,EAAA,EAAA,sBAAA,EAAA,cAAA,EAAA,iBAAA,EAAA,SAAA,EAAA,uBAAA,EAAA,eAAA,EAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;2FAAzB,yBAAyB,EAAA,UAAA,EAAA,CAAA;kBARrC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACP,oBAAA,QAAQ,EAAE,sBAAsB;AAChC,oBAAA,IAAI,EAAE;AACF,wBAAA,wBAAwB,EAAE,cAAc;AACxC,wBAAA,mBAAmB,EAAE,SAAS;AAC9B,wBAAA,yBAAyB,EAAE,eAAe;AAC7C,qBAAA;AACJ,iBAAA;;;ACxBD;;AAEG;;;;"}
@@ -1,6 +1,7 @@
1
+ import { FormFieldComponent } from '@agorapulse/ui-components/form-field';
1
2
  import { SymbolRegistry, apErrorFill, apRoundedCheckFill, SymbolComponent } from '@agorapulse/ui-symbol';
2
3
  import * as i0 from '@angular/core';
3
- import { signal, computed, inject, Input, ViewEncapsulation, ChangeDetectionStrategy, Component } from '@angular/core';
4
+ import { signal, computed, inject, ElementRef, APP_ID, DestroyRef, Input, ViewEncapsulation, ChangeDetectionStrategy, Component } from '@angular/core';
4
5
 
5
6
  class FormMessageComponent {
6
7
  set messageType(messageType) {
@@ -13,9 +14,21 @@ class FormMessageComponent {
13
14
  return this.messageTypeSignal() === 'error' ? 'error_fill' : 'rounded-check_fill';
14
15
  }, /* @ts-ignore */
15
16
  ...(ngDevMode ? [{ debugName: "symbolIdSignal" }] : /* istanbul ignore next */ []));
17
+ /** The id this message is referenced by. A bound `[id]` would land after construction and leave the reference dangling. */
18
+ messageId;
16
19
  symbolRegistry = inject(SymbolRegistry);
17
20
  constructor() {
18
21
  this.symbolRegistry.registerSymbols([apErrorFill, apRoundedCheckFill]);
22
+ // The field cannot query for this: a message usually sits under `@if`, which a non-recursive
23
+ // query misses, while a recursive one would let an outer field adopt a nested field's message.
24
+ const element = inject(ElementRef).nativeElement;
25
+ if (!element.id) {
26
+ element.id = `${inject(APP_ID)}-form-message-${Math.random().toString(36).slice(2)}${Date.now().toString(36)}`;
27
+ }
28
+ this.messageId = element.id;
29
+ const formField = inject(FormFieldComponent, { optional: true });
30
+ formField?.registerDescription(this.messageId);
31
+ inject(DestroyRef).onDestroy(() => formField?.unregisterDescription(this.messageId));
19
32
  }
20
33
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: FormMessageComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
21
34
  static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.0.5", type: FormMessageComponent, isStandalone: true, selector: "ap-form-message", inputs: { messageType: "messageType", message: "message" }, host: { properties: { "class.error": "messageTypeSignal() === 'error'", "class.success": "messageTypeSignal() === 'success'" }, classAttribute: "ap-form-message" }, ngImport: i0, template: "<ap-symbol\n size=\"sm\"\n [symbolId]=\"symbolIdSignal()\" />\n<span>\n {{ message }}\n</span>\n", styles: [".ap-form-message{font-size:var(--comp-forms-status-text-size);font-weight:var(--comp-forms-status-text-font-weight);line-height:var(--comp-forms-status-text-line-height);font-family:var(--comp-forms-status-text-font-family);margin:0;display:flex;align-items:center;gap:var(--ref-spacing-xxxs)}.ap-form-message.error{color:var(--comp-forms-status-text-error-color)}.ap-form-message.error ap-symbol{color:var(--comp-forms-status-icon-error-color)}.ap-form-message.success{color:var(--comp-forms-status-text-success-color)}.ap-form-message.success ap-symbol{color:var(--ref-color-green-150)}\n"], dependencies: [{ kind: "component", type: SymbolComponent, selector: "ap-symbol", inputs: ["symbolId", "color", "size"], outputs: ["sizeChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
@@ -1 +1 @@
1
- {"version":3,"file":"agorapulse-ui-components-form-message.mjs","sources":["../../../libs/ui-components/form-message/src/form-message.component.ts","../../../libs/ui-components/form-message/src/form-message.component.html","../../../libs/ui-components/form-message/src/agorapulse-ui-components-form-message.ts"],"sourcesContent":["import { SymbolComponent, SymbolRegistry, apErrorFill, apRoundedCheckFill } from '@agorapulse/ui-symbol';\nimport { ChangeDetectionStrategy, Component, Input, ViewEncapsulation, computed, inject, signal } from '@angular/core';\n\nexport type MessageType = 'error' | 'success';\n\n@Component({\n selector: 'ap-form-message',\n templateUrl: './form-message.component.html',\n styleUrls: ['./form-message.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n imports: [SymbolComponent],\n host: {\n class: 'ap-form-message',\n '[class.error]': \"messageTypeSignal() === 'error'\",\n '[class.success]': \"messageTypeSignal() === 'success'\",\n },\n})\nexport class FormMessageComponent {\n @Input({ required: true })\n set messageType(messageType: MessageType) {\n this.messageTypeSignal.set(messageType);\n }\n\n @Input({ required: true })\n message!: string;\n\n messageTypeSignal = signal<MessageType>('error');\n\n symbolIdSignal = computed(() => {\n return this.messageTypeSignal() === 'error' ? 'error_fill' : 'rounded-check_fill';\n });\n\n private symbolRegistry = inject(SymbolRegistry);\n\n constructor() {\n this.symbolRegistry.registerSymbols([apErrorFill, apRoundedCheckFill]);\n }\n}\n","<ap-symbol\n size=\"sm\"\n [symbolId]=\"symbolIdSignal()\" />\n<span>\n {{ message }}\n</span>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;MAkBa,oBAAoB,CAAA;IAC7B,IACI,WAAW,CAAC,WAAwB,EAAA;AACpC,QAAA,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC,WAAW,CAAC;IAC3C;AAGA,IAAA,OAAO;IAEP,iBAAiB,GAAG,MAAM,CAAc,OAAO;0FAAC;AAEhD,IAAA,cAAc,GAAG,QAAQ,CAAC,MAAK;AAC3B,QAAA,OAAO,IAAI,CAAC,iBAAiB,EAAE,KAAK,OAAO,GAAG,YAAY,GAAG,oBAAoB;IACrF,CAAC;uFAAC;AAEM,IAAA,cAAc,GAAG,MAAM,CAAC,cAAc,CAAC;AAE/C,IAAA,WAAA,GAAA;QACI,IAAI,CAAC,cAAc,CAAC,eAAe,CAAC,CAAC,WAAW,EAAE,kBAAkB,CAAC,CAAC;IAC1E;uGAnBS,oBAAoB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;2FAApB,oBAAoB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,iBAAA,EAAA,MAAA,EAAA,EAAA,WAAA,EAAA,aAAA,EAAA,OAAA,EAAA,SAAA,EAAA,EAAA,IAAA,EAAA,EAAA,UAAA,EAAA,EAAA,aAAA,EAAA,iCAAA,EAAA,eAAA,EAAA,mCAAA,EAAA,EAAA,cAAA,EAAA,iBAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EClBjC,2GAMA,EAAA,MAAA,EAAA,CAAA,glBAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EDKc,eAAe,EAAA,QAAA,EAAA,WAAA,EAAA,MAAA,EAAA,CAAA,UAAA,EAAA,OAAA,EAAA,MAAA,CAAA,EAAA,OAAA,EAAA,CAAA,YAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,aAAA,EAAA,EAAA,CAAA,iBAAA,CAAA,IAAA,EAAA,CAAA;;2FAOhB,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBAbhC,SAAS;AACI,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,iBAAiB,EAAA,eAAA,EAGV,uBAAuB,CAAC,MAAM,EAAA,aAAA,EAChC,iBAAiB,CAAC,IAAI,EAAA,OAAA,EAC5B,CAAC,eAAe,CAAC,EAAA,IAAA,EACpB;AACF,wBAAA,KAAK,EAAE,iBAAiB;AACxB,wBAAA,eAAe,EAAE,iCAAiC;AAClD,wBAAA,iBAAiB,EAAE,mCAAmC;AACzD,qBAAA,EAAA,QAAA,EAAA,2GAAA,EAAA,MAAA,EAAA,CAAA,glBAAA,CAAA,EAAA;;sBAGA,KAAK;uBAAC,EAAE,QAAQ,EAAE,IAAI,EAAE;;sBAKxB,KAAK;uBAAC,EAAE,QAAQ,EAAE,IAAI,EAAE;;;AExB7B;;AAEG;;;;"}
1
+ {"version":3,"file":"agorapulse-ui-components-form-message.mjs","sources":["../../../libs/ui-components/form-message/src/form-message.component.ts","../../../libs/ui-components/form-message/src/form-message.component.html","../../../libs/ui-components/form-message/src/agorapulse-ui-components-form-message.ts"],"sourcesContent":["import { FormFieldComponent } from '@agorapulse/ui-components/form-field';\nimport { SymbolComponent, SymbolRegistry, apErrorFill, apRoundedCheckFill } from '@agorapulse/ui-symbol';\nimport {\n APP_ID,\n ChangeDetectionStrategy,\n Component,\n DestroyRef,\n ElementRef,\n Input,\n ViewEncapsulation,\n computed,\n inject,\n signal,\n} from '@angular/core';\n\nexport type MessageType = 'error' | 'success';\n\n@Component({\n selector: 'ap-form-message',\n templateUrl: './form-message.component.html',\n styleUrls: ['./form-message.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n imports: [SymbolComponent],\n host: {\n class: 'ap-form-message',\n '[class.error]': \"messageTypeSignal() === 'error'\",\n '[class.success]': \"messageTypeSignal() === 'success'\",\n },\n})\nexport class FormMessageComponent {\n @Input({ required: true })\n set messageType(messageType: MessageType) {\n this.messageTypeSignal.set(messageType);\n }\n\n @Input({ required: true })\n message!: string;\n\n messageTypeSignal = signal<MessageType>('error');\n\n symbolIdSignal = computed(() => {\n return this.messageTypeSignal() === 'error' ? 'error_fill' : 'rounded-check_fill';\n });\n\n /** The id this message is referenced by. A bound `[id]` would land after construction and leave the reference dangling. */\n readonly messageId: string;\n\n private symbolRegistry = inject(SymbolRegistry);\n\n constructor() {\n this.symbolRegistry.registerSymbols([apErrorFill, apRoundedCheckFill]);\n\n // The field cannot query for this: a message usually sits under `@if`, which a non-recursive\n // query misses, while a recursive one would let an outer field adopt a nested field's message.\n const element: HTMLElement = inject(ElementRef).nativeElement;\n if (!element.id) {\n element.id = `${inject(APP_ID)}-form-message-${Math.random().toString(36).slice(2)}${Date.now().toString(36)}`;\n }\n this.messageId = element.id;\n\n const formField = inject(FormFieldComponent, { optional: true });\n formField?.registerDescription(this.messageId);\n inject(DestroyRef).onDestroy(() => formField?.unregisterDescription(this.messageId));\n }\n}\n","<ap-symbol\n size=\"sm\"\n [symbolId]=\"symbolIdSignal()\" />\n<span>\n {{ message }}\n</span>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;MA8Ba,oBAAoB,CAAA;IAC7B,IACI,WAAW,CAAC,WAAwB,EAAA;AACpC,QAAA,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC,WAAW,CAAC;IAC3C;AAGA,IAAA,OAAO;IAEP,iBAAiB,GAAG,MAAM,CA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  import * as i0 from '@angular/core';
2
4
  import { inject, ElementRef, Directive } from '@angular/core';
3
5
 
@@ -5,13 +7,15 @@ class InputDirective {
5
7
  elementRef = inject(ElementRef);
6
8
  input = this.elementRef.nativeElement;
7
9
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: InputDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
8
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.5", type: InputDirective, isStandalone: true, selector: "[apInput]", host: { classAttribute: "ap-input" }, ngImport: i0 });
10
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.5", type: InputDirective, isStandalone: true, selector: "[apInput]", host: { classAttribute: "ap-input" }, hostDirectives: [{ directive: i1.FormFieldControlDirective }], ngImport: i0 });
9
11
  }
10
12
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: InputDirective, decorators: [{
11
13
  type: Directive,
12
14
  args: [{
13
15
  selector: '[apInput]',
14
16
  standalone: true,
17
+ // The host is the focusable element, and it is labelable: the surrounding field points its label's `for` at it.
18
+ hostDirectives: [FormFieldControlDirective],
15
19
  host: {
16
20
  class: 'ap-input',
17
21
  },
@@ -1 +1 @@
1
- {"version":3,"file":"agorapulse-ui-components-input.mjs","sources":["../../../libs/ui-components/input/src/input.directive.ts","../../../libs/ui-components/input/src/agorapulse-ui-components-input.ts"],"sourcesContent":["import { Directive, ElementRef, inject } from '@angular/core';\n\n@Directive({\n selector: '[apInput]',\n standalone: true,\n host: {\n class: 'ap-input',\n },\n})\nexport class InputDirective {\n private elementRef = inject(ElementRef);\n\n input: HTMLInputElement = this.elementRef.nativeElement;\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;MASa,cAAc,CAAA;AACf,IAAA,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;AAEvC,IAAA,KAAK,GAAqB,IAAI,CAAC,UAAU,CAAC,aAAa;uGAH9C,cAAc,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;2FAAd,cAAc,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,cAAA,EAAA,UAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;2FAAd,cAAc,EAAA,UAAA,EAAA,CAAA;kBAP1B,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACP,oBAAA,QAAQ,EAAE,WAAW;AACrB,oBAAA,UAAU,EAAE,IAAI;AAChB,oBAAA,IAAI,EAAE;AACF,wBAAA,KAAK,EAAE,UAAU;AACpB,qBAAA;AACJ,iBAAA;;;ACRD;;AAEG;;;;"}
1
+ {"version":3,"file":"agorapulse-ui-components-input.mjs","sources":["../../../libs/ui-components/input/src/input.directive.ts","../../../libs/ui-components/input/src/agorapulse-ui-components-input.ts"],"sourcesContent":["import { FormFieldControlDirective } from '@agorapulse/ui-components/form-field';\nimport { Directive, ElementRef, inject } from '@angular/core';\n\n@Directive({\n selector: '[apInput]',\n standalone: true,\n // The host is the focusable element, and it is labelable: the surrounding field points its label's `for` at it.\n hostDirectives: [FormFieldControlDirective],\n host: {\n class: 'ap-input',\n },\n})\nexport class InputDirective {\n private elementRef = inject(ElementRef);\n\n input: HTMLInputElement = this.elementRef.nativeElement;\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;MAYa,cAAc,CAAA;AACf,IAAA,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;AAEvC,IAAA,KAAK,GAAqB,IAAI,CAAC,UAAU,CAAC,aAAa;uGAH9C,cAAc,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;2FAAd,cAAc,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,cAAA,EAAA,UAAA,EAAA,EAAA,cAAA,EAAA,CAAA,EAAA,SAAA,EAAA,EAAA,CAAA,yBAAA,EAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;2FAAd,cAAc,EAAA,UAAA,EAAA,CAAA;kBAT1B,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACP,oBAAA,QAAQ,EAAE,WAAW;AACrB,oBAAA,UAAU,EAAE,IAAI;;oBAEhB,cAAc,EAAE,CAAC,yBAAyB,CAAC;AAC3C,oBAAA,IAAI,EAAE;AACF,wBAAA,KAAK,EAAE,UAAU;AACpB,qBAAA;AACJ,iBAAA;;;ACXD;;AAEG;;;;"}
@@ -36,7 +36,7 @@ class LabelComponent {
36
36
  this.remove.emit({ content: this.content, $event });
37
37
  }
38
38
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: LabelComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
39
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: LabelComponent, isStandalone: true, selector: "ap-label", inputs: { content: "content", selectorWidth: "selectorWidth", removable: ["removable", "removable", booleanAttribute] }, outputs: { remove: "remove" }, ngImport: i0, template: "<div\n class=\"label\"\n [class.removable]=\"removable\"\n [apTooltip]=\"tooltipEnabled ? content : ''\">\n <span class=\"label-content\">{{ content }}</span>\n @if (removable) {\n <ap-close-button (closed)=\"onClearLabel($event)\" />\n }\n</div>\n", styles: ["ap-label{display:flex;max-width:100%;--button-size: calc(var(--comp-label-height) - 4px);--max-width: 180px}ap-label .label{color:var(--comp-label-text-color);align-self:center;background:var(--comp-label-background-color);border-radius:var(--comp-label-border-radius);text-wrap:unset;display:flex;align-items:center;border:none;padding:0 var(--comp-label-padding-right) 0 var(--comp-label-padding-left);height:var(--comp-label-height);box-sizing:border-box;text-overflow:ellipsis;width:100%}ap-label .label.removable{gap:var(--comp-label-closable-spacing);padding:0 var(--comp-label-closable-padding-right) 0 var(--ref-spacing-xxs)}ap-label .label .label-content{max-width:var(--max-width);color:var(--comp-label-text-color);display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-family:var(--comp-label-text-style-font-family);font-size:var(--comp-label-text-style-size);line-height:var(--comp-label-text-style-line-height);font-weight:var(--comp-label-text-style-font-weight)}\n"], dependencies: [{ kind: "directive", type: TooltipDirective, selector: "[apTooltip]", inputs: ["apTooltip", "apTooltipPosition", "apTooltipShowDelay", "apTooltipHideDelay", "apTooltipDuration", "apTooltipDisabled", "apTooltipTruncatedTextOnly", "apTooltipTemplateContext", "apTooltipVirtualScrollElement", "apTooltipTrigger", "apTooltipArrow", "apTooltipType", "apTooltipPresentationContext", "apTooltipListItems", "apTooltipShowAvatarCaption"], exportAs: ["apTooltip"] }, { kind: "component", type: CloseButtonComponent, selector: "ap-close-button", inputs: ["disabled", "ariaLabel", "dataTest"], outputs: ["closed"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
39
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: LabelComponent, isStandalone: true, selector: "ap-label", inputs: { content: "content", selectorWidth: "selectorWidth", removable: ["removable", "removable", booleanAttribute] }, outputs: { remove: "remove" }, ngImport: i0, template: "<div\n class=\"label\"\n [class.removable]=\"removable\"\n [apTooltip]=\"tooltipEnabled ? content : ''\">\n <span class=\"label-content\">{{ content }}</span>\n @if (removable) {\n <ap-close-button (closed)=\"onClearLabel($event)\" />\n }\n</div>\n", styles: ["ap-label{display:flex;max-width:100%;--button-size: calc(var(--comp-label-height) - 4px);--max-width: 180px}ap-label .label{color:var(--comp-label-text-color);align-self:center;background:var(--comp-label-background-color);border-radius:var(--comp-label-border-radius);text-wrap:unset;display:flex;align-items:center;border:none;padding:0 var(--comp-label-padding-right) 0 var(--comp-label-padding-left);height:var(--comp-label-height);box-sizing:border-box;text-overflow:ellipsis;width:100%}ap-label .label.removable{gap:var(--comp-label-closable-spacing);padding:0 var(--comp-label-closable-padding-right) 0 var(--ref-spacing-xxs)}ap-label .label .label-content{max-width:var(--max-width);color:var(--comp-label-text-color);display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-family:var(--comp-label-text-style-font-family);font-size:var(--comp-label-text-style-size);line-height:var(--comp-label-text-style-line-height);font-weight:var(--comp-label-text-style-font-weight)}\n"], dependencies: [{ kind: "directive", type: TooltipDirective, selector: "[apTooltip]", inputs: ["apTooltip", "apTooltipPosition", "apTooltipShowDelay", "apTooltipHideDelay", "apTooltipDuration", "apTooltipDisabled", "apTooltipTruncatedTextOnly", "apTooltipTemplateContext", "apTooltipVirtualScrollElement", "apTooltipTrigger", "apTooltipArrow", "apTooltipAnchor", "apTooltipType", "apTooltipPresentationContext", "apTooltipListItems", "apTooltipShowAvatarCaption"], exportAs: ["apTooltip"] }, { kind: "component", type: CloseButtonComponent, selector: "ap-close-button", inputs: ["disabled", "ariaLabel", "dataTest"], outputs: ["closed"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
40
40
  }
41
41
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: LabelComponent, decorators: [{
42
42
  type: Component,
@@ -1 +1 @@
1
- {"version":3,"file":"agorapulse-ui-components-labels.mjs","sources":["../../../libs/ui-components/labels/src/label.component.ts","../../../libs/ui-components/labels/src/label.component.html","../../../libs/ui-components/labels/src/agorapulse-ui-components-labels.ts"],"sourcesContent":["import { CloseButtonComponent } from '@agorapulse/ui-components/close-button';\nimport { TooltipDirective } from '@agorapulse/ui-components/tooltip';\nimport { apClose, SymbolRegistry } from '@agorapulse/ui-symbol';\nimport {\n AfterViewInit,\n booleanAttribute,\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n EventEmitter,\n inject,\n Input,\n NgZone,\n OnDestroy,\n Output,\n ViewEncapsulation,\n} from '@angular/core';\n@Component({\n changeDetection: ChangeDetectionStrategy.OnPush,\n selector: 'ap-label',\n templateUrl: './label.component.html',\n imports: [TooltipDirective, CloseButtonComponent],\n styleUrls: ['./label.component.scss'],\n encapsulation: ViewEncapsulation.None,\n})\nexport class LabelComponent implements AfterViewInit, OnDestroy {\n private elementRef: ElementRef = inject(ElementRef);\n private symbolRegistry: SymbolRegistry = inject(SymbolRegistry);\n private zone: NgZone = inject(NgZone);\n\n @Input({\n required: true,\n })\n content!: string;\n @Input() selectorWidth: number = 0; //Width of the selector input, if applicable\n @Input({ transform: booleanAttribute }) removable: boolean = false;\n\n @Output() remove = new EventEmitter<{ content: string; $event: MouseEvent }>();\n\n private observer: ResizeObserver | undefined = undefined;\n tooltipEnabled: boolean = false;\n\n constructor() {\n this.symbolRegistry.registerSymbols([apClose]);\n }\n\n ngAfterViewInit(): void {\n this.observer = new ResizeObserver(entries => {\n this.zone.run(() => {\n const containerWidth =\n this.elementRef.nativeElement.clientWidth > 0 ? this.elementRef.nativeElement.clientWidth : this.selectorWidth;\n if (containerWidth > 0) {\n this.tooltipEnabled = entries[0].target.scrollWidth > containerWidth;\n }\n });\n });\n this.observer.observe(this.elementRef.nativeElement.getElementsByClassName('label-content')[0]);\n }\n\n ngOnDestroy() {\n this.observer?.unobserve(this.elementRef.nativeElement.children[0]);\n }\n\n onClearLabel($event: MouseEvent) {\n this.elementRef.nativeElement.remove();\n this.remove.emit({ content: this.content, $event });\n }\n}\n","<div\n class=\"label\"\n [class.removable]=\"removable\"\n [apTooltip]=\"tooltipEnabled ? content : ''\">\n <span class=\"label-content\">{{ content }}</span>\n @if (removable) {\n <ap-close-button (closed)=\"onClearLabel($event)\" />\n }\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;MAyBa,cAAc,CAAA;AACf,IAAA,UAAU,GAAe,MAAM,CAAC,U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,qBAAA;;sBAEA;;sBACA,KAAK;uBAAC,EAAE,SAAS,EAAE,gBAAgB,EAAE;;sBAErC;;;AErCL;;AAEG;;;;"}
1
+ {"version":3,"file":"agorapulse-ui-components-labels.mjs","sources":["../../../libs/ui-components/labels/src/label.component.ts","../../../libs/ui-components/labels/src/label.component.html","../../../libs/ui-components/labels/src/agorapulse-ui-components-labels.ts"],"sourcesContent":["import { CloseButtonComponent } from '@agorapulse/ui-components/close-button';\nimport { TooltipDirective } from '@agorapulse/ui-components/tooltip';\nimport { apClose, SymbolRegistry } from '@agorapulse/ui-symbol';\nimport {\n AfterViewInit,\n booleanAttribute,\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n EventEmitter,\n inject,\n Input,\n NgZone,\n OnDestroy,\n Output,\n ViewEncapsulation,\n} from '@angular/core';\n@Component({\n changeDetection: ChangeDetectionStrategy.OnPush,\n selector: 'ap-label',\n templateUrl: './label.component.html',\n imports: [TooltipDirective, CloseButtonComponent],\n styleUrls: ['./label.component.scss'],\n encapsulation: ViewEncapsulation.None,\n})\nexport class LabelComponent implements AfterViewInit, OnDestroy {\n private elementRef: ElementRef = inject(ElementRef);\n private symbolRegistry: SymbolRegistry = inject(SymbolRegistry);\n private zone: NgZone = inject(NgZone);\n\n @Input({\n required: true,\n })\n content!: string;\n @Input() selectorWidth: number = 0; //Width of the selector input, if applicable\n @Input({ transform: booleanAttribute }) removable: boolean = false;\n\n @Output() remove = new EventEmitter<{ content: string; $event: MouseEvent }>();\n\n private observer: ResizeObserver | undefined = undefined;\n tooltipEnabled: boolean = false;\n\n constructor() {\n this.symbolRegistry.registerSymbols([apClose]);\n }\n\n ngAfterViewInit(): void {\n this.observer = new ResizeObserver(entries => {\n this.zone.run(() => {\n const containerWidth =\n this.elementRef.nativeElement.clientWidth > 0 ? this.elementRef.nativeElement.clientWidth : this.selectorWidth;\n if (containerWidth > 0) {\n this.tooltipEnabled = entries[0].target.scrollWidth > containerWidth;\n }\n });\n });\n this.observer.observe(this.elementRef.nativeElement.getElementsByClassName('label-content')[0]);\n }\n\n ngOnDestroy() {\n this.observer?.unobserve(this.elementRef.nativeElement.children[0]);\n }\n\n onClearLabel($event: MouseEvent) {\n this.elementRef.nativeElement.remove();\n this.remove.emit({ content: this.content, $event });\n }\n}\n","<div\n class=\"label\"\n [class.removable]=\"removable\"\n [apTooltip]=\"tooltipEnabled ? content : ''\">\n <span class=\"label-content\">{{ content }}</span>\n @if (removable) {\n <ap-close-button (closed)=\"onClearLabel($event)\" />\n }\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;MAyBa,cAAc,CAAA;AACf,IAAA,UAAU,GAAe,MAAM,CAAC,UAAU,CAAC;AAC3C,IAAA,cAAc,GAAmB,MAAM,CAAC,cAAc,CAAC;AACvD,IAAA,IAAI,GAAW,MAAM,CAAC,MAAM,CAAC;AAKrC,IAAA,OAAO;AACE,IAAA,aAAa,GAAW,CAAC,CAAC;IACK,SAAS,GAAY,KAAK;AAExD,IAAA,MAAM,GAAG,IAAI,YAAY,EAA2C;IAEtE,QAAQ,GAA+B,SAAS;IACxD,cAAc,GAAY,KAAK;AAE/B,IAAA,WAAA,GAAA;QACI,IAAI,CAAC,cAAc,CAAC,eAAe,CAAC,CAAC,OAAO,CAAC,CAAC;IAClD;IAEA,eAAe,GAAA;QACX,IAAI,CAAC,QAAQ,GAAG,IAAI,cAAc,CAAC,OAAO,IAAG;AACzC,YAAA,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,MAAK;gBACf,MAAM,cAAc,GAChB,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC,WAAW,GAAG,CAAC,GAAG,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC,WAAW,GAAG,IAAI,CAAC,aAAa;AAClH,gBAAA,IAAI,cAAc,GAAG,CAAC,EAAE;AACpB,oBAAA,IAAI,CAAC,cAAc,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,W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