@flexzap/overlay 1.0.0 → 1.1.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.
|
@@ -5,20 +5,20 @@ class ZapTooltip {
|
|
|
5
5
|
position = input.required(...(ngDevMode ? [{ debugName: "position" }] : []));
|
|
6
6
|
visible = input(false, ...(ngDevMode ? [{ debugName: "visible" }] : []));
|
|
7
7
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: ZapTooltip, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
8
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.0.8", type: ZapTooltip, isStandalone: true, selector: "zap-tooltip", inputs: { position: { classPropertyName: "position", publicName: "position", isSignal: true, isRequired: true, transformFunction: null }, visible: { classPropertyName: "visible", publicName: "visible", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "attr.position": "position()", "attr.visible": "visible()" } }, ngImport: i0, template: "<div class=\"zap-tooltip\">\n <ng-content></ng-content>\n</div>\n", styles: [":host{width:max-content;display:none}:host[visible=true]{display:table}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
8
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.0.8", type: ZapTooltip, isStandalone: true, selector: "zap-tooltip", inputs: { position: { classPropertyName: "position", publicName: "position", isSignal: true, isRequired: true, transformFunction: null }, visible: { classPropertyName: "visible", publicName: "visible", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "attr.zap-position": "position()", "attr.zap-visible": "visible()" } }, ngImport: i0, template: "<div class=\"zap-tooltip\">\n <ng-content></ng-content>\n</div>\n", styles: [":host{width:max-content;display:none}:host[zap-visible=true]{display:table}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
9
9
|
}
|
|
10
10
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: ZapTooltip, decorators: [{
|
|
11
11
|
type: Component,
|
|
12
12
|
args: [{ selector: 'zap-tooltip', changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
13
|
-
'[attr.position]': 'position()',
|
|
14
|
-
'[attr.visible]': 'visible()'
|
|
15
|
-
}, template: "<div class=\"zap-tooltip\">\n <ng-content></ng-content>\n</div>\n", styles: [":host{width:max-content;display:none}:host[visible=true]{display:table}\n"] }]
|
|
13
|
+
'[attr.zap-position]': 'position()',
|
|
14
|
+
'[attr.zap-visible]': 'visible()'
|
|
15
|
+
}, template: "<div class=\"zap-tooltip\">\n <ng-content></ng-content>\n</div>\n", styles: [":host{width:max-content;display:none}:host[zap-visible=true]{display:table}\n"] }]
|
|
16
16
|
}], propDecorators: { position: [{ type: i0.Input, args: [{ isSignal: true, alias: "position", required: true }] }], visible: [{ type: i0.Input, args: [{ isSignal: true, alias: "visible", required: false }] }] } });
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
19
|
* Directive that binds the visibility of a sibling `zap-tooltip` to the host element's hover events.
|
|
20
20
|
*
|
|
21
|
-
* It listens for `mouseenter` and `mouseleave` events on the host element and toggles the `visible`
|
|
21
|
+
* It listens for `mouseenter` and `mouseleave` events on the host element and toggles the `zap-visible`
|
|
22
22
|
* attribute of the immediate previous or next sibling if it matches the `zap-tooltip` tag.
|
|
23
23
|
*
|
|
24
24
|
* @usageNotes
|
|
@@ -50,7 +50,7 @@ class ZapTooltipBind {
|
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
52
|
updateSibling(sibling, show) {
|
|
53
|
-
this.renderer.setAttribute(sibling, 'visible', String(show));
|
|
53
|
+
this.renderer.setAttribute(sibling, 'zap-visible', String(show));
|
|
54
54
|
}
|
|
55
55
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: ZapTooltipBind, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
56
56
|
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.0.8", type: ZapTooltipBind, isStandalone: true, selector: "[ZapTooltipBind]", host: { listeners: { "mouseenter": "onMouseEnter()", "mouseleave": "onMouseLeave()" } }, ngImport: i0 });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flexzap-overlay.mjs","sources":["../../../../projects/flexzap/overlay/src/lib/tooltip/tooltip.ts","../../../../projects/flexzap/overlay/src/lib/tooltip/tooltip.html","../../../../projects/flexzap/overlay/src/lib/tooltip-bind/tooltip-bind.ts","../../../../projects/flexzap/overlay/src/public-api.ts","../../../../projects/flexzap/overlay/src/flexzap-overlay.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, input } from '@angular/core';\n\n@Component({\n selector: 'zap-tooltip',\n templateUrl: './tooltip.html',\n styleUrl: './tooltip.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '[attr.position]': 'position()',\n '[attr.visible]': 'visible()'\n }\n})\nexport class ZapTooltip {\n position = input.required<'top' | 'right' | 'bottom' | 'left'>();\n visible = input(false);\n}\n","<div class=\"zap-tooltip\">\n <ng-content></ng-content>\n</div>\n","import { Directive, ElementRef, Renderer2, inject } from '@angular/core';\n\n@Directive({\n selector: '[ZapTooltipBind]',\n host: {\n '(mouseenter)': 'onMouseEnter()',\n '(mouseleave)': 'onMouseLeave()'\n }\n})\n/**\n * Directive that binds the visibility of a sibling `zap-tooltip` to the host element's hover events.\n *\n * It listens for `mouseenter` and `mouseleave` events on the host element and toggles the `visible`\n * attribute of the immediate previous or next sibling if it matches the `zap-tooltip` tag.\n *\n * @usageNotes\n * Apply this directive to any element that has a `zap-tooltip` sibling.\n *\n * ```html\n * <button ZapTooltipBind>Hover me</button>\n * <zap-tooltip [position]=\"'top'\">I'm a tooltip</zap-tooltip>\n * ```\n */\nexport class ZapTooltipBind {\n private elementRef = inject(ElementRef);\n private renderer = inject(Renderer2);\n\n onMouseEnter() {\n this.toggleTooltip(true);\n }\n\n onMouseLeave() {\n this.toggleTooltip(false);\n }\n\n private toggleTooltip(show: boolean) {\n const element = this.elementRef.nativeElement;\n const nextSibling = element.nextElementSibling;\n const prevSibling = element.previousElementSibling;\n\n if (nextSibling && nextSibling.tagName.toLowerCase() === 'zap-tooltip') {\n this.updateSibling(nextSibling, show);\n }\n\n if (prevSibling && prevSibling.tagName.toLowerCase() === 'zap-tooltip') {\n this.updateSibling(prevSibling, show);\n }\n }\n\n private updateSibling(sibling: Element, show: boolean) {\n this.renderer.setAttribute(sibling, 'visible', String(show));\n }\n}\n","/*\n * Public API Surface of overlay\n */\n\nexport * from './lib/tooltip/tooltip';\nexport * from './lib/tooltip-bind/tooltip-bind';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;MAYa,UAAU,CAAA;AACrB,IAAA,QAAQ,GAAG,KAAK,CAAC,QAAQ,mDAAuC;AAChE,IAAA,OAAO,GAAG,KAAK,CAAC,KAAK,mDAAC;uGAFX,UAAU,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAV,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAU,
|
|
1
|
+
{"version":3,"file":"flexzap-overlay.mjs","sources":["../../../../projects/flexzap/overlay/src/lib/tooltip/tooltip.ts","../../../../projects/flexzap/overlay/src/lib/tooltip/tooltip.html","../../../../projects/flexzap/overlay/src/lib/tooltip-bind/tooltip-bind.ts","../../../../projects/flexzap/overlay/src/public-api.ts","../../../../projects/flexzap/overlay/src/flexzap-overlay.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, input } from '@angular/core';\n\n@Component({\n selector: 'zap-tooltip',\n templateUrl: './tooltip.html',\n styleUrl: './tooltip.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '[attr.zap-position]': 'position()',\n '[attr.zap-visible]': 'visible()'\n }\n})\nexport class ZapTooltip {\n position = input.required<'top' | 'right' | 'bottom' | 'left'>();\n visible = input(false);\n}\n","<div class=\"zap-tooltip\">\n <ng-content></ng-content>\n</div>\n","import { Directive, ElementRef, Renderer2, inject } from '@angular/core';\n\n@Directive({\n selector: '[ZapTooltipBind]',\n host: {\n '(mouseenter)': 'onMouseEnter()',\n '(mouseleave)': 'onMouseLeave()'\n }\n})\n/**\n * Directive that binds the visibility of a sibling `zap-tooltip` to the host element's hover events.\n *\n * It listens for `mouseenter` and `mouseleave` events on the host element and toggles the `zap-visible`\n * attribute of the immediate previous or next sibling if it matches the `zap-tooltip` tag.\n *\n * @usageNotes\n * Apply this directive to any element that has a `zap-tooltip` sibling.\n *\n * ```html\n * <button ZapTooltipBind>Hover me</button>\n * <zap-tooltip [position]=\"'top'\">I'm a tooltip</zap-tooltip>\n * ```\n */\nexport class ZapTooltipBind {\n private elementRef = inject(ElementRef);\n private renderer = inject(Renderer2);\n\n onMouseEnter() {\n this.toggleTooltip(true);\n }\n\n onMouseLeave() {\n this.toggleTooltip(false);\n }\n\n private toggleTooltip(show: boolean) {\n const element = this.elementRef.nativeElement;\n const nextSibling = element.nextElementSibling;\n const prevSibling = element.previousElementSibling;\n\n if (nextSibling && nextSibling.tagName.toLowerCase() === 'zap-tooltip') {\n this.updateSibling(nextSibling, show);\n }\n\n if (prevSibling && prevSibling.tagName.toLowerCase() === 'zap-tooltip') {\n this.updateSibling(prevSibling, show);\n }\n }\n\n private updateSibling(sibling: Element, show: boolean) {\n this.renderer.setAttribute(sibling, 'zap-visible', String(show));\n }\n}\n","/*\n * Public API Surface of overlay\n */\n\nexport * from './lib/tooltip/tooltip';\nexport * from './lib/tooltip-bind/tooltip-bind';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;MAYa,UAAU,CAAA;AACrB,IAAA,QAAQ,GAAG,KAA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