forty-cdk 0.44.0 → 0.45.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4314,8 +4314,34 @@ function hostLabelledBy(fallback) {
4314
4314
  return computed(() => claim.consumer ?? fallback());
4315
4315
  }
4316
4316
  function hostAriaLabel(fallback) {
4317
- const consumer = staticHostAttribute("aria-label");
4318
- return computed(() => consumer ?? fallback());
4317
+ const host = inject(ElementRef).nativeElement;
4318
+ const consumer = host.getAttribute("aria-label") || null;
4319
+ const resolved = computed(() => consumer ?? fallback(), ...ngDevMode ? [{ debugName: "resolved" }] : /* istanbul ignore next */ []);
4320
+ if (typeof ngDevMode === "undefined" || ngDevMode) return warnOnRemovedBoundLabel(host, resolved);
4321
+ return resolved;
4322
+ }
4323
+ function warnOnRemovedBoundLabel(host, resolved) {
4324
+ let written = null;
4325
+ let warned = false;
4326
+ return computed(() => {
4327
+ const value = resolved();
4328
+ const current = host.getAttribute("aria-label");
4329
+ if (value === null && !warned && current && current !== written) {
4330
+ warned = true;
4331
+ fortyWarn({
4332
+ code: "FORCDK-CORE-015",
4333
+ message: `The bound \`aria-label\` of <${describeHost(host)}> is removed by the library's \`aria-label\` host binding.`,
4334
+ cause: "Only a static `aria-label` attribute is adopted. An `[attr.aria-label]` binding is written before the host binding, which resolves no name and removes the attribute.",
4335
+ fix: "Bind the name through the `[ariaLabel]` input, or write a static `aria-label` attribute."
4336
+ });
4337
+ }
4338
+ written = value;
4339
+ return value;
4340
+ });
4341
+ }
4342
+ function describeHost(host) {
4343
+ const role = host.getAttribute("role");
4344
+ return role ? `${host.localName} role="${role}"` : host.localName;
4319
4345
  }
4320
4346
  function hostDescribedBy(fallback) {
4321
4347
  const host = inject(ElementRef).nativeElement;
@@ -4324,13 +4350,20 @@ function hostDescribedBy(fallback) {
4324
4350
  inject(DestroyRef).onDestroy(() => contribution.release());
4325
4351
  return computed(() => composeIds(contribution.consumer, fallback()));
4326
4352
  }
4327
- function staticHostAttribute(name) {
4328
- return inject(ElementRef).nativeElement.getAttribute(name) || null;
4329
- }
4330
4353
  function hostStaticAttribute(name, fallback) {
4331
4354
  const consumer = inject(ElementRef).nativeElement.getAttribute(name);
4332
4355
  return computed(() => fallback() ?? (consumer || null));
4333
4356
  }
4357
+ const HIDDEN_UNTIL_FOUND = "until-found";
4358
+ function keepHiddenUntilFound(host, stillHidden) {
4359
+ if (typeof MutationObserver === "undefined") return;
4360
+ const observer = new MutationObserver((records) => {
4361
+ if (!records.some((record) => record.attributeName === "hidden")) return;
4362
+ observer.disconnect();
4363
+ if (stillHidden() && host.getAttribute("hidden") !== "until-found") host.setAttribute("hidden", HIDDEN_UNTIL_FOUND);
4364
+ });
4365
+ observer.observe(host, { attributes: true });
4366
+ }
4334
4367
  function hostButtonType() {
4335
4368
  const host = inject(ElementRef).nativeElement;
4336
4369
  return signal(host.tagName === "BUTTON" ? "button" : null).asReadonly();
@@ -5728,6 +5761,6 @@ var VirtualizedResume = class {
5728
5761
  return this.resolve()?.pos ?? null;
5729
5762
  }
5730
5763
  };
5731
- export { BOTH_DRAG_AXES, Collection, DRAG_DEAD_ZONE_PX, DateFieldEngine, DragAnnouncer, DragItemHosts, EscapeArbiter, FLICK_STALE_VELOCITY_MS, FLICK_VELOCITY_PX_PER_MS, FOR_DATE_FIELD_HOST, FOR_FIELDSET_CONTEXT, FOR_FIELD_ANCHOR_CONTEXT, FOR_FIELD_CONTEXT, FOR_HOST_ROVING_CONTEXT, FOR_PICKER_SOURCE_HOST, FOR_TIME_FIELD_HOST, FOR_TIME_VALUE_SOURCE, ForDateTimeLiteralBase, ForDateTimeSegmentBase, ForVisuallyHidden, FormUiControlBase, IdGenerator, LabelCache, LiveAnnouncer, MODAL_EXEMPT_ATTRIBUTE, MODAL_PEER_ATTRIBUTE, MediaQueryRegistry, ModalOwnedRegions, NO_DRAG_AXES, PreviewController, RangeFieldComposer, RangeSelectionEngine, ReturnFocusResolver, RootedRegistry, RovingFocusYield, RovingTabindex, TABLE_REGISTRATION_CONTEXT, TABLE_ROW_REGISTRATION_CONTEXT, TextValueControlBase, TimeFieldEngine, VirtualizedNavigator, VirtualizedResume, accessibleTextContent, adoptHostId, adoptedSegmentContext, afterNextRenderCancellable, appendMissing, arbitrateLiftPress, assertInputBound, assertRootContext, assertTimeCapable, assertVirtualizedSelectionFollowsFocusSupported, attachSwipeDismiss, awaitTransformTransition, boundEntries, clamp, clampDragIndex, clampPreviewPosition, clampToBounds, compareDateOf, composeWithTime, composedClosest, composedContains, composedParentElement, consumeUnmappedLiftedKey, createDragPreview, createKeyboardDragMediator, createPointerDragSession, createPointerHighlight, createPointerSuppression, createPressFocus, createSingleSlot, createTemplatePreview, createVetoableEvent, createVetoableNativeEvent, crossesInteractiveContent, decimalPlaces, dedupeValues, defaultCompareWith, defaultItemToFormValue, dismissMarksTouched, dragAnnouncementLabel, dragHandleTouchAction, dragSurfaceTouchAction, emitVetoableEvent, emitVetoableNativeEvent, findFirstFocusable, findPressedDragItem, findRelocatedTabStop, findTabbableEdges, findTypeaheadMatch, firstEnabledHandle, firstEnabledHost, flickVelocity, focusAfterPress, focusWhenMounted, foldTypeaheadText, formatLocaleDigits, fortyError, fortyWarn, handleDisabledRovingItemKey, hostAriaLabel, hostButtonType, hostDescribedBy, hostId, hostLabelledBy, hostStaticAttribute, injectAmbientDirection, injectDateAdapter, injectDisabledClickGuard, injectElementSize, injectFieldAnchor, injectFieldLabelExemption, injectFieldWiring, injectFocusTrap, injectHasFocusableContent, injectHiddenInput, injectHostCarriesDragItem, injectHostScrollAxes, injectNativeFormReset, injectNativeFormResetToInitial, injectPauseController, injectPointerMove, injectPortal, injectPrefersReducedMotion, injectReflectedDirection, injectRovingFocusRestore, injectSwipeMotion, injectSyntheticActivation, injectTextDirection, injectTypeahead, injectVetoableEmitter, isDragLiftKey, isHistoryChord, isHoverCapablePointer, isImeComposing, isInArray, isInitialFocusTarget, isLiftedPassthroughKey, isNonTouchPointer, isRangeSelectShortcut, isScrollableAtEdge, isShortcutChord, isUnset, lastEnabledHandle, lastEnabledHost, layoutPlaceholderInSlot, leavesControl, leavesTabSequence, lookupByValue, markDragItemHost, membership, mirrorExternalValue, mirrorValue, mouseFocusTarget, moveGridIndex, moveIndex, navigateFromRovingItem, nextEnabledHandle, orphanContextError, pressFocusesDescendant, preventPointerFocus, reflectDisabled, reflectRequired, registerA11yDescription, registerA11yName, registerHandle, resolveActiveElement, resolveBoundaryElement, resolveCommittedPosition, resolveConfigClass, resolveDropTarget, resolveEventTarget, resolveGridNavigation, resolveHostId, resolveLiftedDragControl, resolveListNavigation, resolveListTypeahead, resolvePressedDragItem, resolveText, resolveTextInput, resolveTextRecord, resolveTreeExpandCollapse, resolveTreegridExpandCollapse, resolveWindowedReorder, roundToDecimals, roundToStepPrecision, rovingListTarget, rovingTabStop, runVirtualizedNavigatorBridge, secondsOfDay, selectionMembership, selectionTabStop, serializeISODate, serializeISOTime, singleSelected, snapToStep, staticHostId, stepDragTarget, stepFocusableCycle, stepOnGrid, swipeTouchAction, throwUnsupportedVirtualizedRangeSelect, timeGraftBaseDay, timeSentinel, toggleInArray, translateWindowReorder, unresolvedRootError, unsetInput, warnOnDuplicateRegistration };
5764
+ export { BOTH_DRAG_AXES, Collection, DRAG_DEAD_ZONE_PX, DateFieldEngine, DragAnnouncer, DragItemHosts, EscapeArbiter, FLICK_STALE_VELOCITY_MS, FLICK_VELOCITY_PX_PER_MS, FOR_DATE_FIELD_HOST, FOR_FIELDSET_CONTEXT, FOR_FIELD_ANCHOR_CONTEXT, FOR_FIELD_CONTEXT, FOR_HOST_ROVING_CONTEXT, FOR_PICKER_SOURCE_HOST, FOR_TIME_FIELD_HOST, FOR_TIME_VALUE_SOURCE, ForDateTimeLiteralBase, ForDateTimeSegmentBase, ForVisuallyHidden, FormUiControlBase, HIDDEN_UNTIL_FOUND, IdGenerator, LabelCache, LiveAnnouncer, MODAL_EXEMPT_ATTRIBUTE, MODAL_PEER_ATTRIBUTE, MediaQueryRegistry, ModalOwnedRegions, NO_DRAG_AXES, PreviewController, RangeFieldComposer, RangeSelectionEngine, ReturnFocusResolver, RootedRegistry, RovingFocusYield, RovingTabindex, TABLE_REGISTRATION_CONTEXT, TABLE_ROW_REGISTRATION_CONTEXT, TextValueControlBase, TimeFieldEngine, VirtualizedNavigator, VirtualizedResume, accessibleTextContent, adoptHostId, adoptedSegmentContext, afterNextRenderCancellable, appendMissing, arbitrateLiftPress, assertInputBound, assertRootContext, assertTimeCapable, assertVirtualizedSelectionFollowsFocusSupported, attachSwipeDismiss, awaitTransformTransition, boundEntries, clamp, clampDragIndex, clampPreviewPosition, clampToBounds, compareDateOf, composeWithTime, composedClosest, composedContains, composedParentElement, consumeUnmappedLiftedKey, createDragPreview, createKeyboardDragMediator, createPointerDragSession, createPointerHighlight, createPointerSuppression, createPressFocus, createSingleSlot, createTemplatePreview, createVetoableEvent, createVetoableNativeEvent, crossesInteractiveContent, decimalPlaces, dedupeValues, defaultCompareWith, defaultItemToFormValue, dismissMarksTouched, dragAnnouncementLabel, dragHandleTouchAction, dragSurfaceTouchAction, emitVetoableEvent, emitVetoableNativeEvent, findFirstFocusable, findPressedDragItem, findRelocatedTabStop, findTabbableEdges, findTypeaheadMatch, firstEnabledHandle, firstEnabledHost, flickVelocity, focusAfterPress, focusWhenMounted, foldTypeaheadText, formatLocaleDigits, fortyError, fortyWarn, handleDisabledRovingItemKey, hostAriaLabel, hostButtonType, hostDescribedBy, hostId, hostLabelledBy, hostStaticAttribute, injectAmbientDirection, injectDateAdapter, injectDisabledClickGuard, injectElementSize, injectFieldAnchor, injectFieldLabelExemption, injectFieldWiring, injectFocusTrap, injectHasFocusableContent, injectHiddenInput, injectHostCarriesDragItem, injectHostScrollAxes, injectNativeFormReset, injectNativeFormResetToInitial, injectPauseController, injectPointerMove, injectPortal, injectPrefersReducedMotion, injectReflectedDirection, injectRovingFocusRestore, injectSwipeMotion, injectSyntheticActivation, injectTextDirection, injectTypeahead, injectVetoableEmitter, isDragLiftKey, isHistoryChord, isHoverCapablePointer, isImeComposing, isInArray, isInitialFocusTarget, isLiftedPassthroughKey, isNonTouchPointer, isRangeSelectShortcut, isScrollableAtEdge, isShortcutChord, isUnset, keepHiddenUntilFound, lastEnabledHandle, lastEnabledHost, layoutPlaceholderInSlot, leavesControl, leavesTabSequence, lookupByValue, markDragItemHost, membership, mirrorExternalValue, mirrorValue, mouseFocusTarget, moveGridIndex, moveIndex, navigateFromRovingItem, nextEnabledHandle, orphanContextError, pressFocusesDescendant, preventPointerFocus, reflectDisabled, reflectRequired, registerA11yDescription, registerA11yName, registerHandle, resolveActiveElement, resolveBoundaryElement, resolveCommittedPosition, resolveConfigClass, resolveDropTarget, resolveEventTarget, resolveGridNavigation, resolveHostId, resolveLiftedDragControl, resolveListNavigation, resolveListTypeahead, resolvePressedDragItem, resolveText, resolveTextInput, resolveTextRecord, resolveTreeExpandCollapse, resolveTreegridExpandCollapse, resolveWindowedReorder, roundToDecimals, roundToStepPrecision, rovingListTarget, rovingTabStop, runVirtualizedNavigatorBridge, secondsOfDay, selectionMembership, selectionTabStop, serializeISODate, serializeISOTime, singleSelected, snapToStep, staticHostId, stepDragTarget, stepFocusableCycle, stepOnGrid, swipeTouchAction, throwUnsupportedVirtualizedRangeSelect, timeGraftBaseDay, timeSentinel, toggleInArray, translateWindowReorder, unresolvedRootError, unsetInput, warnOnDuplicateRegistration };
5732
5765
 
5733
5766
  //# sourceMappingURL=forty-cdk-core.mjs.map