ng-hub-ui-utils 22.13.0 → 22.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -384,13 +384,14 @@ export class ExampleComponent {}
384
384
  Inputs: `hubTooltip` (text), `hubTooltipPlacement` (`top` | `bottom` | `left` | `right`,
385
385
  default `top`), `hubTooltipDelay` (fade ms, default `150`), `hubTooltipOffset` (px, default `8`).
386
386
 
387
- > **`TooltipDirective` (`[tooltip]`) is deprecated since 22.9.0.** It still works,
388
- > unchanged — both directives are thin shells over the same `HubTooltipController` — but its
389
- > bare input names (`tooltip`, `placement`, `delay`, `offset`) belong to every directive on
390
- > the element that declares them, which is how it collided with `[hubDropdown]`'s own
391
- > `placement` and with the `tooltip` input of `<hub-badge>`. Migration is attribute for
387
+ > **`TooltipDirective` (`[tooltip]`) was removed in 22.14.0**, having been deprecated since
388
+ > 22.9.0. Its bare input names (`tooltip`, `placement`, `delay`, `offset`) belonged to every
389
+ > directive on the element that declared them, which is how it collided with `[hubDropdown]`'s
390
+ > own `placement` and with the `tooltip` input of `<hub-badge>`. Migration is attribute for
392
391
  > attribute: `tooltip` → `hubTooltip`, `placement` → `hubTooltipPlacement`,
393
- > `delay` → `hubTooltipDelay`, `offset` → `hubTooltipOffset`.
392
+ > `delay` → `hubTooltipDelay`, `offset` → `hubTooltipOffset`. A template left writing
393
+ > `tooltip="…"` still compiles and shows nothing at all, so check the markup as well as the
394
+ > imports.
394
395
 
395
396
  Show the label **only while the host is truncated** with `HubOverflowTooltipDirective`
396
397
  (`[hubOverflowTooltip]`), which tracks truncation live with a `ResizeObserver` and a
@@ -727,7 +728,6 @@ library, because their selectors and data models differ.
727
728
 
728
729
  - `HubTooltipDirective` (`[hubTooltip]`) - Tooltip on hover/focus. Inputs: `hubTooltip`, `hubTooltipPlacement`, `hubTooltipDelay`, `hubTooltipOffset`
729
730
  - `HubOverflowTooltipDirective` (`[hubOverflowTooltip]`) - Tooltip shown only while the label is truncated. Inputs: `hubOverflowTooltip`, `placement`, `hubOverflowTooltipMeasure` (CSS selector, resolved inside the host, naming the box whose truncation decides it; defaults to the host)
730
- - `TooltipDirective` (`[tooltip]`) - **Deprecated since 22.9.0**, kept working. Inputs: `tooltip`, `placement`, `delay`, `offset`
731
731
  - `provideHubTooltip(adapter: HubTooltipAdapter)` and `HUB_TOOLTIP_ADAPTER` - Swap the implementation behind `[hubOverflowTooltip]`, app-wide or per subtree; defaults to `hubTooltipAdapter`
732
732
 
733
733
  ### Pipes
@@ -2792,7 +2792,7 @@ let nextTooltipId = 0;
2792
2792
  *
2793
2793
  * Binds hover/focus listeners to a host element and renders a body-portaled,
2794
2794
  * `--hub-tooltip-*`-themeable label on demand. It owns no Angular dependency, so
2795
- * it can be reused both by the `[tooltip]` directive and by other primitives
2795
+ * it can be reused both by the `[hubTooltip]` directive and by other primitives
2796
2796
  * (e.g. a badge overflow tooltip) that want the exact same visual contract
2797
2797
  * without re-implementing the DOM logic.
2798
2798
  *
@@ -3125,65 +3125,6 @@ function provideHubTooltip(adapter) {
3125
3125
  ]);
3126
3126
  }
3127
3127
 
3128
- /**
3129
- * Lightweight tooltip directive.
3130
- *
3131
- * @deprecated Use {@link HubTooltipDirective} (`[hubTooltip]`) instead. The bare
3132
- * attribute and the bare input names `placement`, `delay` and `offset` are not this
3133
- * directive's to hold: Angular feeds one attribute to every directive on the element
3134
- * that declares an input of that name, so `[hubDropdown] placement` fails to compile
3135
- * beside a tooltip, and `[tooltip]` on a `<hub-badge>` — which owns an input of that
3136
- * name — renders two. Kept working, unchanged, until the next major.
3137
- *
3138
- * Apply `[tooltip]` to any element to show a positioned label on hover/focus.
3139
- * The tooltip element is appended to `<body>` so it is never clipped by an
3140
- * overflow container, and every visual aspect is themeable through
3141
- * `--hub-tooltip-*` CSS variables.
3142
- *
3143
- * All DOM work is delegated to {@link HubTooltipController}, so the directive and
3144
- * any imperative consumer (e.g. a badge overflow tooltip) share the exact same
3145
- * behaviour and styling.
3146
- *
3147
- * Styles ship in `styles/tooltip.scss` (mirroring `styles/overlay.scss`). Import
3148
- * it once in your app: `@use 'ng-hub-ui-utils/styles/tooltip';`.
3149
- */
3150
- class TooltipDirective {
3151
- /** Tooltip text content. */
3152
- tooltipTitle = input.required({ ...(ngDevMode ? { debugName: "tooltipTitle" } : /* istanbul ignore next */ {}), alias: 'tooltip' });
3153
- /** Placement of the tooltip relative to the host. */
3154
- placement = input('top', /* @ts-ignore */
3155
- ...(ngDevMode ? [{ debugName: "placement" }] : /* istanbul ignore next */ []));
3156
- /** Fade duration in milliseconds, also used as the removal delay on hide. */
3157
- delay = input(150, /* @ts-ignore */
3158
- ...(ngDevMode ? [{ debugName: "delay" }] : /* istanbul ignore next */ []));
3159
- /** Gap in pixels between the host and the tooltip. */
3160
- offset = input(8, /* @ts-ignore */
3161
- ...(ngDevMode ? [{ debugName: "offset" }] : /* istanbul ignore next */ []));
3162
- host = inject(ElementRef);
3163
- controller = new HubTooltipController(this.host.nativeElement);
3164
- constructor() {
3165
- effect(() => {
3166
- this.controller.setOptions({
3167
- placement: this.placement(),
3168
- delay: this.delay(),
3169
- offset: this.offset()
3170
- });
3171
- this.controller.setText(this.tooltipTitle());
3172
- });
3173
- }
3174
- ngOnDestroy() {
3175
- this.controller.destroy();
3176
- }
3177
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: TooltipDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
3178
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.8", type: TooltipDirective, isStandalone: true, selector: "[tooltip]", inputs: { tooltipTitle: { classPropertyName: "tooltipTitle", publicName: "tooltip", isSignal: true, isRequired: true, transformFunction: null }, placement: { classPropertyName: "placement", publicName: "placement", isSignal: true, isRequired: false, transformFunction: null }, delay: { classPropertyName: "delay", publicName: "delay", isSignal: true, isRequired: false, transformFunction: null }, offset: { classPropertyName: "offset", publicName: "offset", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0 });
3179
- }
3180
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: TooltipDirective, decorators: [{
3181
- type: Directive,
3182
- args: [{
3183
- selector: '[tooltip]'
3184
- }]
3185
- }], ctorParameters: () => [], propDecorators: { tooltipTitle: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltip", required: true }] }], placement: [{ type: i0.Input, args: [{ isSignal: true, alias: "placement", required: false }] }], delay: [{ type: i0.Input, args: [{ isSignal: true, alias: "delay", required: false }] }], offset: [{ type: i0.Input, args: [{ isSignal: true, alias: "offset", required: false }] }] } });
3186
-
3187
3128
  /**
3188
3129
  * Tooltip directive, named the way the rest of the family names itself.
3189
3130
  *
@@ -3192,12 +3133,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImpor
3192
3133
  * container, and every visual aspect is themeable through `--hub-tooltip-*` CSS
3193
3134
  * variables.
3194
3135
  *
3195
- * ## Why this exists beside {@link TooltipDirective}
3136
+ * ## Why every attribute here carries the prefix
3196
3137
  *
3197
- * The older directive claims the bare attribute `[tooltip]` and the bare input names
3198
- * `placement`, `delay` and `offset`. Angular feeds one attribute to **every** directive
3199
- * on the element that declares an input of that name, so those bare names are not this
3200
- * directive's to hold:
3138
+ * This replaced an earlier directive that claimed the bare attribute `[tooltip]` and the
3139
+ * bare input names `placement`, `delay` and `offset`. Angular feeds one attribute to
3140
+ * **every** directive on the element that declares an input of that name, so those bare
3141
+ * names were never a library's to hold:
3201
3142
  *
3202
3143
  * - `[hubDropdown]` declares its own `placement`, typed over eight values where a
3203
3144
  * tooltip understands four. A menu trigger that also wanted a tooltip did not merely
@@ -3257,7 +3198,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImpor
3257
3198
  * Shows a tooltip with the given text **only while the host element is truncated**
3258
3199
  * (its content is wider than its box).
3259
3200
  *
3260
- * Unlike `[tooltip]`, which always shows on hover, this directive is meant for
3201
+ * Unlike `[hubTooltip]`, which always shows on hover, this directive is meant for
3261
3202
  * ellipsised labels: the tooltip appears solely when the text doesn't fit, so it
3262
3203
  * never duplicates already-visible content. Truncation is tracked live with a
3263
3204
  * `ResizeObserver` (host/container resizes) and a `MutationObserver` (text
@@ -3405,5 +3346,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImpor
3405
3346
  * Generated bundle index. Do not edit.
3406
3347
  */
3407
3348
 
3408
- export { ContentRef, FOCUSABLE_ELEMENTS_SELECTOR, GetPipe, HUB_DROPDOWN_POSITIONS, HUB_INK_LIGHTNESS_THRESHOLD, HUB_NAMED_COLORS, HUB_TOOLTIP_ADAPTER, HUB_TRANSLATION_CONFIG, HUB_TRANSLATION_PREFIX, HUB_TRANSLATION_SOURCE, HubDragDropService, HubOverflowTooltipDirective, HubTooltipController, HubTooltipDirective, HubTranslationService, IsObjectPipe, IsObservablePipe, IsStringPipe, OverlayPosition, OverlayRef, OverlayService, PopupService, ScrollBar, TooltipDirective, TranslatePipe, UcfirstPipe, UnwrapAsyncPipe, clamp, clampToSrgbGamut, closest, compositeOver, computeTargetIndex, containsNode, contrastAPCA, contrastRatio, copyArrayItem, createNativeDragImage, createPointerDragSession, debouncedSignal, equals, generateUniqueId, getActiveElement, getFocusableBoundaryElements, getValue, getValueInRange, hubCompleteTransition, hubFocusTrap, hubRunTransition, hubTooltipAdapter, interpolateString, isDefined, isInSrgbGamut, isInteger, isNumber, isObject, isPromise, isString, isValidColor, maxSrgbChroma, mergeDeep, moveItemInArray, oklchToRgb, padNumber, parseColor, provideHubTooltip, provideHubTranslation, provideHubTranslationAdapter, readableOn, reflow, regExpEscape, registerOverlayKeydown, relativeLuminance, removeAccents, resolveDropPosition, resolveHubAccent, rgbToOklch, runInZone, toAbsoluteIndex, toHex, toInteger, toRgb, toString, transferArrayItem };
3349
+ export { ContentRef, FOCUSABLE_ELEMENTS_SELECTOR, GetPipe, HUB_DROPDOWN_POSITIONS, HUB_INK_LIGHTNESS_THRESHOLD, HUB_NAMED_COLORS, HUB_TOOLTIP_ADAPTER, HUB_TRANSLATION_CONFIG, HUB_TRANSLATION_PREFIX, HUB_TRANSLATION_SOURCE, HubDragDropService, HubOverflowTooltipDirective, HubTooltipController, HubTooltipDirective, HubTranslationService, IsObjectPipe, IsObservablePipe, IsStringPipe, OverlayPosition, OverlayRef, OverlayService, PopupService, ScrollBar, TranslatePipe, UcfirstPipe, UnwrapAsyncPipe, clamp, clampToSrgbGamut, closest, compositeOver, computeTargetIndex, containsNode, contrastAPCA, contrastRatio, copyArrayItem, createNativeDragImage, createPointerDragSession, debouncedSignal, equals, generateUniqueId, getActiveElement, getFocusableBoundaryElements, getValue, getValueInRange, hubCompleteTransition, hubFocusTrap, hubRunTransition, hubTooltipAdapter, interpolateString, isDefined, isInSrgbGamut, isInteger, isNumber, isObject, isPromise, isString, isValidColor, maxSrgbChroma, mergeDeep, moveItemInArray, oklchToRgb, padNumber, parseColor, provideHubTooltip, provideHubTranslation, provideHubTranslationAdapter, readableOn, reflow, regExpEscape, registerOverlayKeydown, relativeLuminance, removeAccents, resolveDropPosition, resolveHubAccent, rgbToOklch, runInZone, toAbsoluteIndex, toHex, toInteger, toRgb, toString, transferArrayItem };
3409
3350
  //# sourceMappingURL=ng-hub-ui-utils.mjs.map