@firestitch/popover 18.0.1 → 18.0.2
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/app/class/popover-ref.d.ts +2 -0
- package/app/components/popover/popover.component.d.ts +1 -1
- package/app/components/popover-wrapper/popover-wrapper.component.d.ts +4 -3
- package/app/directives/popover.directive.d.ts +10 -11
- package/app/fs-popover.module.d.ts +2 -5
- package/app/interfaces/popover-config.interface.d.ts +1 -0
- package/app/services/popover.service.d.ts +1 -3
- package/esm2022/app/class/popover-ref.mjs +6 -1
- package/esm2022/app/components/popover/popover.component.mjs +4 -4
- package/esm2022/app/components/popover-wrapper/popover-wrapper.component.mjs +20 -18
- package/esm2022/app/directives/popover.directive.mjs +17 -20
- package/esm2022/app/fs-popover.module.mjs +4 -15
- package/esm2022/app/helpers/create-position-strategy.mjs +49 -45
- package/esm2022/app/interfaces/popover-config.interface.mjs +1 -1
- package/esm2022/app/services/popover.service.mjs +6 -11
- package/esm2022/public_api.mjs +1 -1
- package/fesm2022/firestitch-popover.mjs +98 -102
- package/fesm2022/firestitch-popover.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -1,16 +1,12 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Component, ChangeDetectionStrategy, ViewChild, Injector, TemplateRef, Injectable, Directive,
|
|
3
|
-
import
|
|
4
|
-
import { CommonModule } from '@angular/common';
|
|
5
|
-
import * as i3 from '@angular/cdk/portal';
|
|
6
|
-
import { BasePortalOutlet, CdkPortalOutlet, TemplatePortal, ComponentPortal, PortalModule } from '@angular/cdk/portal';
|
|
7
|
-
import * as i2$1 from '@angular/router';
|
|
8
|
-
import { NavigationEnd } from '@angular/router';
|
|
2
|
+
import { inject, ElementRef, NgZone, Renderer2, Component, ChangeDetectionStrategy, ViewChild, Injector, TemplateRef, Injectable, Directive, Input, HostBinding, NgModule } from '@angular/core';
|
|
3
|
+
import { Router, NavigationEnd } from '@angular/router';
|
|
9
4
|
import { guid } from '@firestitch/common';
|
|
10
5
|
import { BehaviorSubject, combineLatest, Subject, fromEvent, timer, pipe, merge } from 'rxjs';
|
|
11
6
|
import { map, filter, takeUntil, debounceTime, delay, tap, switchMap, mapTo, startWith, distinctUntilChanged, withLatestFrom, finalize } from 'rxjs/operators';
|
|
12
|
-
import
|
|
13
|
-
import {
|
|
7
|
+
import { OverlayConfig, Overlay } from '@angular/cdk/overlay';
|
|
8
|
+
import { BasePortalOutlet, CdkPortalOutlet, TemplatePortal, ComponentPortal } from '@angular/cdk/portal';
|
|
9
|
+
import { NgClass, AsyncPipe } from '@angular/common';
|
|
14
10
|
|
|
15
11
|
class FsPopoverRef {
|
|
16
12
|
overlayRef;
|
|
@@ -18,6 +14,7 @@ class FsPopoverRef {
|
|
|
18
14
|
_autoClose$ = new BehaviorSubject(true);
|
|
19
15
|
_componentLoading$ = new BehaviorSubject(true);
|
|
20
16
|
_maxWidth;
|
|
17
|
+
_maxHeight;
|
|
21
18
|
_wrapperClass;
|
|
22
19
|
_loadingDiameter;
|
|
23
20
|
_loading;
|
|
@@ -76,6 +73,9 @@ class FsPopoverRef {
|
|
|
76
73
|
get maxWidth() {
|
|
77
74
|
return this._maxWidth;
|
|
78
75
|
}
|
|
76
|
+
get maxHeight() {
|
|
77
|
+
return this._maxHeight;
|
|
78
|
+
}
|
|
79
79
|
show() {
|
|
80
80
|
setTimeout(() => {
|
|
81
81
|
this._componentLoading$.next(false);
|
|
@@ -94,6 +94,7 @@ class FsPopoverRef {
|
|
|
94
94
|
_init(config) {
|
|
95
95
|
this._wrapperClass = config.wrapperClass;
|
|
96
96
|
this._maxWidth = config.maxWidth;
|
|
97
|
+
this._maxHeight = config.maxHeight;
|
|
97
98
|
this._loading = config.loading;
|
|
98
99
|
this._loadingDiameter = config.loadingDiameter;
|
|
99
100
|
this._size = config.size;
|
|
@@ -116,10 +117,10 @@ function pointInRect(x1, y1, x2, y2, px, py) {
|
|
|
116
117
|
}
|
|
117
118
|
|
|
118
119
|
class FsPopoverWrapperComponent extends BasePortalOutlet {
|
|
119
|
-
popoverRef;
|
|
120
|
-
_el;
|
|
121
|
-
_zone;
|
|
122
|
-
_renderer;
|
|
120
|
+
popoverRef = inject(FsPopoverRef);
|
|
121
|
+
_el = inject(ElementRef);
|
|
122
|
+
_zone = inject(NgZone);
|
|
123
|
+
_renderer = inject(Renderer2);
|
|
123
124
|
_portalOutlet;
|
|
124
125
|
spinner;
|
|
125
126
|
content;
|
|
@@ -127,19 +128,19 @@ class FsPopoverWrapperComponent extends BasePortalOutlet {
|
|
|
127
128
|
_contentChangesObserver;
|
|
128
129
|
_updatePosition = new Subject();
|
|
129
130
|
_destroy$ = new Subject();
|
|
130
|
-
constructor(
|
|
131
|
+
constructor() {
|
|
131
132
|
super();
|
|
132
|
-
this.popoverRef = popoverRef;
|
|
133
|
-
this._el = _el;
|
|
134
|
-
this._zone = _zone;
|
|
135
|
-
this._renderer = _renderer;
|
|
136
133
|
this._updateClass();
|
|
137
134
|
this.wrapperClass = this.popoverRef.wrapperClass;
|
|
138
135
|
this.maxWidth = this.popoverRef.maxWidth;
|
|
136
|
+
this.maxHeight = this.popoverRef.maxHeight;
|
|
139
137
|
}
|
|
140
138
|
set maxWidth(value) {
|
|
141
139
|
this._el.nativeElement.style.maxWidth = value ? `${value}px` : void 0;
|
|
142
140
|
}
|
|
141
|
+
set maxHeight(value) {
|
|
142
|
+
this._el.nativeElement.style.setProperty('--fs-popover-max-height', value ? `${value}px` : null);
|
|
143
|
+
}
|
|
143
144
|
set wrapperClass(value) {
|
|
144
145
|
this._wrapperClass = value;
|
|
145
146
|
this._updateClass();
|
|
@@ -216,15 +217,19 @@ class FsPopoverWrapperComponent extends BasePortalOutlet {
|
|
|
216
217
|
this.popoverRef.updatePosition();
|
|
217
218
|
});
|
|
218
219
|
}
|
|
219
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: FsPopoverWrapperComponent, deps: [
|
|
220
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
220
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: FsPopoverWrapperComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
221
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.7", type: FsPopoverWrapperComponent, isStandalone: true, selector: "fs-popover-wrapper", host: { classAttribute: "fs-popover-wrapper" }, viewQueries: [{ propertyName: "_portalOutlet", first: true, predicate: CdkPortalOutlet, descendants: true, static: true }, { propertyName: "spinner", first: true, predicate: ["spinner"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<div class=\"wrapper\" [ngClass]=\"{\n 'theme-dark' : popoverRef.theme === 'dark',\n 'size-tiny': popoverRef.size === 'tiny',\n 'size-small': popoverRef.size === 'small',\n 'hidden': !(popoverRef.componentVisible$ | async)\n }\">\n <div class=\"mat-elevation-z4 popover-content\">\n @if (content) {\n {{content}}\n }\n\n <ng-template cdkPortalOutlet></ng-template>\n </div>\n\n <div class=\"fs-popover-arrow light\"></div>\n <div class=\"fs-popover-arrow dark\"></div>\n</div>\n\n@if (popoverRef.loading && !(popoverRef.componentVisible$ | async)) {\n <div class=\"loading-spinner\"\n #spinner\n >\n <svg xmlns=\"http://www.w3.org/2000/svg\" [attr.width]=\"popoverRef.loadingDiameter\" [attr.height]=\"popoverRef.loadingDiameter\" viewBox=\"0 0 42 42\" stroke=\"grey\">\n <g fill=\"none\" fill-rule=\"evenodd\">\n <g transform=\"translate(1 1)\" stroke-width=\"3\">\n <circle stroke-opacity=\".5\" cx=\"18\" cy=\"18\" r=\"18\"/>\n <path d=\"M36 18c0-9.94-8.06-18-18-18\">\n <animateTransform attributeName=\"transform\" type=\"rotate\" from=\"0 18 18\" to=\"360 18 18\" dur=\"1s\" repeatCount=\"indefinite\"/>\n </path>\n </g>\n </g>\n </svg>\n </div>\n}\n", styles: [".wrapper{padding:6px;animation:fadeIn ease .2s}.wrapper.hidden{display:none}.wrapper .popover-content{background:#fff;border-radius:4px;padding:8px;color:#1b1b1b;box-sizing:border-box;overflow:auto;max-height:var(--fs-popover-max-height, calc(100vh - 100px) )}.wrapper.theme-dark .popover-content{background-color:#707070;color:#fff}.wrapper.size-small .popover-content{font-size:80%}.wrapper.size-tiny .popover-content{font-size:70%}.wrapper .fs-popover-arrow{width:0;height:0;font-size:0;line-height:0;position:absolute;z-index:200;z-index:1}.wrapper .fs-popover-arrow.dark{z-index:0}::ng-deep .fs-popover-top .fs-popover-arrow,::ng-deep .fs-popover-bottom .fs-popover-arrow{border-left:10px solid transparent;border-right:10px solid transparent}::ng-deep .fs-popover-left .fs-popover-arrow,::ng-deep .fs-popover-right .fs-popover-arrow{border-top:10px solid transparent;border-bottom:10px solid transparent}::ng-deep .fs-popover-top .fs-popover-arrow{bottom:-3px;left:calc(50% - 10px);border-top:10px solid #fff}::ng-deep .fs-popover-top .fs-popover-arrow.dark{border-top-color:#dfdfdf40;bottom:-4px}::ng-deep .fs-popover-bottom .fs-popover-arrow{top:-3px;left:calc(50% - 10px);border-bottom:10px solid #fff}::ng-deep .fs-popover-bottom .fs-popover-arrow.dark{border-bottom-color:#dfdfdf40;top:-4px}::ng-deep .fs-popover-left .fs-popover-arrow{left:-3px;top:calc(50% - 10px);border-right:10px solid #fff}::ng-deep .fs-popover-left .fs-popover-arrow.dark{border-right-color:#dfdfdf40;left:-4px}::ng-deep .fs-popover-right .fs-popover-arrow{right:-3px;top:calc(50% - 10px);border-left:10px solid #fff}::ng-deep .fs-popover-right .fs-popover-arrow.dark{border-left-color:#dfdfdf40;right:-4px}::ng-deep .fs-popover-bottom .wrapper.theme-dark .fs-popover-arrow{border-bottom-color:#707070}::ng-deep .fs-popover-left .wrapper.theme-dark .fs-popover-arrow{border-right-color:#707070}::ng-deep .fs-popover-right .wrapper.theme-dark .fs-popover-arrow{border-left-color:#707070}::ng-deep .fs-popover-top .wrapper.theme-dark .fs-popover-arrow{border-top-color:#707070}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}\n"], dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: CdkPortalOutlet, selector: "[cdkPortalOutlet]", inputs: ["cdkPortalOutlet"], outputs: ["attached"], exportAs: ["cdkPortalOutlet"] }, { kind: "pipe", type: AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
221
222
|
}
|
|
222
223
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: FsPopoverWrapperComponent, decorators: [{
|
|
223
224
|
type: Component,
|
|
224
225
|
args: [{ selector: 'fs-popover-wrapper', changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
225
226
|
'class': 'fs-popover-wrapper',
|
|
226
|
-
},
|
|
227
|
-
|
|
227
|
+
}, standalone: true, imports: [
|
|
228
|
+
NgClass,
|
|
229
|
+
CdkPortalOutlet,
|
|
230
|
+
AsyncPipe,
|
|
231
|
+
], template: "<div class=\"wrapper\" [ngClass]=\"{\n 'theme-dark' : popoverRef.theme === 'dark',\n 'size-tiny': popoverRef.size === 'tiny',\n 'size-small': popoverRef.size === 'small',\n 'hidden': !(popoverRef.componentVisible$ | async)\n }\">\n <div class=\"mat-elevation-z4 popover-content\">\n @if (content) {\n {{content}}\n }\n\n <ng-template cdkPortalOutlet></ng-template>\n </div>\n\n <div class=\"fs-popover-arrow light\"></div>\n <div class=\"fs-popover-arrow dark\"></div>\n</div>\n\n@if (popoverRef.loading && !(popoverRef.componentVisible$ | async)) {\n <div class=\"loading-spinner\"\n #spinner\n >\n <svg xmlns=\"http://www.w3.org/2000/svg\" [attr.width]=\"popoverRef.loadingDiameter\" [attr.height]=\"popoverRef.loadingDiameter\" viewBox=\"0 0 42 42\" stroke=\"grey\">\n <g fill=\"none\" fill-rule=\"evenodd\">\n <g transform=\"translate(1 1)\" stroke-width=\"3\">\n <circle stroke-opacity=\".5\" cx=\"18\" cy=\"18\" r=\"18\"/>\n <path d=\"M36 18c0-9.94-8.06-18-18-18\">\n <animateTransform attributeName=\"transform\" type=\"rotate\" from=\"0 18 18\" to=\"360 18 18\" dur=\"1s\" repeatCount=\"indefinite\"/>\n </path>\n </g>\n </g>\n </svg>\n </div>\n}\n", styles: [".wrapper{padding:6px;animation:fadeIn ease .2s}.wrapper.hidden{display:none}.wrapper .popover-content{background:#fff;border-radius:4px;padding:8px;color:#1b1b1b;box-sizing:border-box;overflow:auto;max-height:var(--fs-popover-max-height, calc(100vh - 100px) )}.wrapper.theme-dark .popover-content{background-color:#707070;color:#fff}.wrapper.size-small .popover-content{font-size:80%}.wrapper.size-tiny .popover-content{font-size:70%}.wrapper .fs-popover-arrow{width:0;height:0;font-size:0;line-height:0;position:absolute;z-index:200;z-index:1}.wrapper .fs-popover-arrow.dark{z-index:0}::ng-deep .fs-popover-top .fs-popover-arrow,::ng-deep .fs-popover-bottom .fs-popover-arrow{border-left:10px solid transparent;border-right:10px solid transparent}::ng-deep .fs-popover-left .fs-popover-arrow,::ng-deep .fs-popover-right .fs-popover-arrow{border-top:10px solid transparent;border-bottom:10px solid transparent}::ng-deep .fs-popover-top .fs-popover-arrow{bottom:-3px;left:calc(50% - 10px);border-top:10px solid #fff}::ng-deep .fs-popover-top .fs-popover-arrow.dark{border-top-color:#dfdfdf40;bottom:-4px}::ng-deep .fs-popover-bottom .fs-popover-arrow{top:-3px;left:calc(50% - 10px);border-bottom:10px solid #fff}::ng-deep .fs-popover-bottom .fs-popover-arrow.dark{border-bottom-color:#dfdfdf40;top:-4px}::ng-deep .fs-popover-left .fs-popover-arrow{left:-3px;top:calc(50% - 10px);border-right:10px solid #fff}::ng-deep .fs-popover-left .fs-popover-arrow.dark{border-right-color:#dfdfdf40;left:-4px}::ng-deep .fs-popover-right .fs-popover-arrow{right:-3px;top:calc(50% - 10px);border-left:10px solid #fff}::ng-deep .fs-popover-right .fs-popover-arrow.dark{border-left-color:#dfdfdf40;right:-4px}::ng-deep .fs-popover-bottom .wrapper.theme-dark .fs-popover-arrow{border-bottom-color:#707070}::ng-deep .fs-popover-left .wrapper.theme-dark .fs-popover-arrow{border-right-color:#707070}::ng-deep .fs-popover-right .wrapper.theme-dark .fs-popover-arrow{border-left-color:#707070}::ng-deep .fs-popover-top .wrapper.theme-dark .fs-popover-arrow{border-top-color:#707070}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}\n"] }]
|
|
232
|
+
}], ctorParameters: () => [], propDecorators: { _portalOutlet: [{
|
|
228
233
|
type: ViewChild,
|
|
229
234
|
args: [CdkPortalOutlet, { static: true }]
|
|
230
235
|
}], spinner: [{
|
|
@@ -232,57 +237,61 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImpor
|
|
|
232
237
|
args: ['spinner']
|
|
233
238
|
}] } });
|
|
234
239
|
|
|
240
|
+
const POSITIONS = {
|
|
241
|
+
[Position.North]: {
|
|
242
|
+
originX: 'center',
|
|
243
|
+
originY: 'top',
|
|
244
|
+
overlayX: 'center',
|
|
245
|
+
overlayY: 'bottom',
|
|
246
|
+
offsetX: 0,
|
|
247
|
+
offsetY: -8,
|
|
248
|
+
panelClass: ['fs-popover-top'],
|
|
249
|
+
},
|
|
250
|
+
[Position.South]: {
|
|
251
|
+
originX: 'center',
|
|
252
|
+
originY: 'bottom',
|
|
253
|
+
overlayX: 'center',
|
|
254
|
+
overlayY: 'top',
|
|
255
|
+
offsetX: 0,
|
|
256
|
+
offsetY: 8,
|
|
257
|
+
panelClass: ['fs-popover-bottom'],
|
|
258
|
+
},
|
|
259
|
+
[Position.East]: {
|
|
260
|
+
originX: 'end',
|
|
261
|
+
originY: 'center',
|
|
262
|
+
overlayX: 'start',
|
|
263
|
+
overlayY: 'center',
|
|
264
|
+
offsetX: 8,
|
|
265
|
+
offsetY: 0,
|
|
266
|
+
panelClass: ['fs-popover-left'],
|
|
267
|
+
},
|
|
268
|
+
[Position.West]: {
|
|
269
|
+
originX: 'start',
|
|
270
|
+
originY: 'center',
|
|
271
|
+
overlayX: 'end',
|
|
272
|
+
overlayY: 'center',
|
|
273
|
+
offsetX: -8,
|
|
274
|
+
offsetY: 0,
|
|
275
|
+
panelClass: ['fs-popover-right'],
|
|
276
|
+
},
|
|
277
|
+
};
|
|
278
|
+
const FALLBACKS = {
|
|
279
|
+
[Position.South]: Position.North,
|
|
280
|
+
[Position.North]: Position.South,
|
|
281
|
+
[Position.East]: Position.West,
|
|
282
|
+
[Position.West]: Position.East,
|
|
283
|
+
};
|
|
235
284
|
function createPopupPositionStrategy(el, overlay, position) {
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
let originX = 'center';
|
|
239
|
-
let originY = 'center';
|
|
240
|
-
let offsetX = 0;
|
|
241
|
-
let offsetY = 0;
|
|
242
|
-
let panelClass = [];
|
|
243
|
-
switch (position) {
|
|
244
|
-
case Position.North:
|
|
245
|
-
originY = 'top';
|
|
246
|
-
overlayY = 'bottom';
|
|
247
|
-
panelClass = ['fs-popover-top'];
|
|
248
|
-
offsetY = -8;
|
|
249
|
-
break;
|
|
250
|
-
case Position.South:
|
|
251
|
-
originY = 'bottom';
|
|
252
|
-
overlayY = 'top';
|
|
253
|
-
panelClass = ['fs-popover-bottom'];
|
|
254
|
-
offsetY = 8;
|
|
255
|
-
break;
|
|
256
|
-
case Position.East:
|
|
257
|
-
overlayX = 'start';
|
|
258
|
-
originX = 'end';
|
|
259
|
-
panelClass = ['fs-popover-left'];
|
|
260
|
-
offsetX = 8;
|
|
261
|
-
break;
|
|
262
|
-
case Position.West:
|
|
263
|
-
overlayX = 'end';
|
|
264
|
-
originX = 'start';
|
|
265
|
-
panelClass = ['fs-popover-right'];
|
|
266
|
-
offsetX = -8;
|
|
267
|
-
break;
|
|
268
|
-
}
|
|
285
|
+
const primary = POSITIONS[position];
|
|
286
|
+
const fallback = POSITIONS[FALLBACKS[position]];
|
|
269
287
|
return createBasePopupPositionStrategy(el, overlay)
|
|
270
|
-
.withPositions([
|
|
271
|
-
{
|
|
272
|
-
originX: originX,
|
|
273
|
-
originY: originY,
|
|
274
|
-
overlayX: overlayX,
|
|
275
|
-
overlayY: overlayY,
|
|
276
|
-
offsetX: offsetX,
|
|
277
|
-
offsetY: offsetY,
|
|
278
|
-
panelClass: panelClass,
|
|
279
|
-
}
|
|
280
|
-
]);
|
|
288
|
+
.withPositions([primary, fallback]);
|
|
281
289
|
}
|
|
282
290
|
function createBasePopupPositionStrategy(el, overlay) {
|
|
283
291
|
return overlay.position()
|
|
284
292
|
.flexibleConnectedTo(el)
|
|
285
293
|
.withGrowAfterOpen(true)
|
|
294
|
+
.withPush(true)
|
|
286
295
|
.withFlexibleDimensions(false)
|
|
287
296
|
.withViewportMargin(4);
|
|
288
297
|
}
|
|
@@ -312,14 +321,10 @@ function createTempatePortal(template, popoverRef, data) {
|
|
|
312
321
|
}
|
|
313
322
|
|
|
314
323
|
class FsPopoverService {
|
|
315
|
-
_injector;
|
|
316
|
-
_overlay;
|
|
324
|
+
_injector = inject(Injector);
|
|
325
|
+
_overlay = inject(Overlay);
|
|
317
326
|
_activeElement;
|
|
318
327
|
_activeElementGUID;
|
|
319
|
-
constructor(_injector, _overlay) {
|
|
320
|
-
this._injector = _injector;
|
|
321
|
-
this._overlay = _overlay;
|
|
322
|
-
}
|
|
323
328
|
get hasActivePopover() {
|
|
324
329
|
return !!this._activeElement;
|
|
325
330
|
}
|
|
@@ -360,7 +365,7 @@ class FsPopoverService {
|
|
|
360
365
|
const containerPortal = new ComponentPortal(component, void 0, createInjector(popoverRef, this._injector));
|
|
361
366
|
return overlayRef.attach(containerPortal);
|
|
362
367
|
}
|
|
363
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: FsPopoverService, deps: [
|
|
368
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: FsPopoverService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
364
369
|
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: FsPopoverService, providedIn: 'root' });
|
|
365
370
|
}
|
|
366
371
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: FsPopoverService, decorators: [{
|
|
@@ -368,20 +373,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImpor
|
|
|
368
373
|
args: [{
|
|
369
374
|
providedIn: 'root',
|
|
370
375
|
}]
|
|
371
|
-
}]
|
|
376
|
+
}] });
|
|
372
377
|
|
|
373
378
|
class FsPopoverDirective {
|
|
374
|
-
_elRef;
|
|
375
|
-
_popoverService;
|
|
376
|
-
_ngZone;
|
|
377
|
-
_router;
|
|
378
|
-
_guid = guid('xxxxxxx');
|
|
379
379
|
text;
|
|
380
380
|
template;
|
|
381
381
|
data;
|
|
382
382
|
leaveDelay = 100;
|
|
383
383
|
showDelay = 0;
|
|
384
384
|
maxWidth = 250;
|
|
385
|
+
maxHeight;
|
|
385
386
|
wrapperClass;
|
|
386
387
|
autoShow = true;
|
|
387
388
|
autoClose = true;
|
|
@@ -402,11 +403,12 @@ class FsPopoverDirective {
|
|
|
402
403
|
_mouseLeave$;
|
|
403
404
|
_popoverClosed$ = new Subject();
|
|
404
405
|
_destroy$ = new Subject();
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
406
|
+
_elRef = inject(ElementRef);
|
|
407
|
+
_popoverService = inject(FsPopoverService);
|
|
408
|
+
_ngZone = inject(NgZone);
|
|
409
|
+
_router = inject(Router, { optional: true });
|
|
410
|
+
_guid = guid('xxxxxxx');
|
|
411
|
+
constructor() {
|
|
410
412
|
this._mouseEnter$ = fromEvent(this._elRef.nativeElement, 'mouseenter');
|
|
411
413
|
this._mouseMove$ = fromEvent(document, 'mousemove', { passive: true });
|
|
412
414
|
this._mouseLeave$ = fromEvent(this._elRef.nativeElement, 'mouseleave');
|
|
@@ -448,6 +450,7 @@ class FsPopoverDirective {
|
|
|
448
450
|
}
|
|
449
451
|
this._popoverRef = new FsPopoverRef({
|
|
450
452
|
maxWidth: this.maxWidth,
|
|
453
|
+
maxHeight: this.maxHeight,
|
|
451
454
|
wrapperClass: this.wrapperClass,
|
|
452
455
|
autoShow: this.autoShow,
|
|
453
456
|
autoClose: this.autoClose,
|
|
@@ -533,8 +536,8 @@ class FsPopoverDirective {
|
|
|
533
536
|
const pointInPopoverRect = pointInRect(popoverBounds.x, popoverBounds.y, popoverBounds.x + popoverBounds.width, popoverBounds.y + popoverBounds.height, event.x, event.y);
|
|
534
537
|
return !pointInHostRect && !pointInPopoverRect;
|
|
535
538
|
}
|
|
536
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: FsPopoverDirective, deps: [
|
|
537
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.7", type: FsPopoverDirective, selector: "[fsPopover]", inputs: { text: "text", template: "template", data: "data", leaveDelay: "leaveDelay", showDelay: "showDelay", maxWidth: "maxWidth", wrapperClass: "wrapperClass", autoShow: "autoShow", autoClose: "autoClose", loadingDiameter: "loadingDiameter", loading: "loading", indication: "indication", position: "position", theme: "theme", size: "size", trigger: "trigger", enabled: "enabled" }, host: { properties: { "class.indication": "this.indication", "class.fs-popover-enabled": "this.enabled" }, classAttribute: "fs-popover" }, usesOnChanges: true, ngImport: i0 });
|
|
539
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: FsPopoverDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
540
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.7", type: FsPopoverDirective, isStandalone: true, selector: "[fsPopover]", inputs: { text: "text", template: "template", data: "data", leaveDelay: "leaveDelay", showDelay: "showDelay", maxWidth: "maxWidth", maxHeight: "maxHeight", wrapperClass: "wrapperClass", autoShow: "autoShow", autoClose: "autoClose", loadingDiameter: "loadingDiameter", loading: "loading", indication: "indication", position: "position", theme: "theme", size: "size", trigger: "trigger", enabled: "enabled" }, host: { properties: { "class.indication": "this.indication", "class.fs-popover-enabled": "this.enabled" }, classAttribute: "fs-popover" }, usesOnChanges: true, ngImport: i0 });
|
|
538
541
|
}
|
|
539
542
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: FsPopoverDirective, decorators: [{
|
|
540
543
|
type: Directive,
|
|
@@ -543,10 +546,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImpor
|
|
|
543
546
|
host: {
|
|
544
547
|
'class': 'fs-popover',
|
|
545
548
|
},
|
|
549
|
+
standalone: true,
|
|
546
550
|
}]
|
|
547
|
-
}], ctorParameters: () => [
|
|
548
|
-
type: Optional
|
|
549
|
-
}] }], propDecorators: { text: [{
|
|
551
|
+
}], ctorParameters: () => [], propDecorators: { text: [{
|
|
550
552
|
type: Input
|
|
551
553
|
}], template: [{
|
|
552
554
|
type: Input
|
|
@@ -558,6 +560,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImpor
|
|
|
558
560
|
type: Input
|
|
559
561
|
}], maxWidth: [{
|
|
560
562
|
type: Input
|
|
563
|
+
}], maxHeight: [{
|
|
564
|
+
type: Input
|
|
561
565
|
}], wrapperClass: [{
|
|
562
566
|
type: Input
|
|
563
567
|
}], autoShow: [{
|
|
@@ -590,35 +594,27 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImpor
|
|
|
590
594
|
|
|
591
595
|
class FsPopoverComponent extends FsPopoverDirective {
|
|
592
596
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: FsPopoverComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
593
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.7", type: FsPopoverComponent, selector: "fs-popover", host: { classAttribute: "fs-popover-component" }, usesInheritance: true, ngImport: i0, template: "<span [ngClass]=\"{'popover-container': enabled}\">\n <ng-content></ng-content>\n</span>\n", dependencies: [{ kind: "directive", type:
|
|
597
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.7", type: FsPopoverComponent, isStandalone: true, selector: "fs-popover", host: { classAttribute: "fs-popover-component" }, usesInheritance: true, ngImport: i0, template: "<span [ngClass]=\"{'popover-container': enabled}\">\n <ng-content></ng-content>\n</span>\n", dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
594
598
|
}
|
|
595
599
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: FsPopoverComponent, decorators: [{
|
|
596
600
|
type: Component,
|
|
597
601
|
args: [{ selector: 'fs-popover', changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
598
602
|
'class': 'fs-popover-component',
|
|
599
|
-
}, template: "<span [ngClass]=\"{'popover-container': enabled}\">\n <ng-content></ng-content>\n</span>\n" }]
|
|
603
|
+
}, standalone: true, imports: [NgClass], template: "<span [ngClass]=\"{'popover-container': enabled}\">\n <ng-content></ng-content>\n</span>\n" }]
|
|
600
604
|
}] });
|
|
601
605
|
|
|
602
606
|
class FsPopoverModule {
|
|
603
607
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: FsPopoverModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
604
|
-
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.7", ngImport: i0, type: FsPopoverModule,
|
|
605
|
-
|
|
606
|
-
FsPopoverDirective], imports: [CommonModule,
|
|
607
|
-
PortalModule], exports: [FsPopoverComponent,
|
|
608
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.7", ngImport: i0, type: FsPopoverModule, imports: [FsPopoverComponent,
|
|
609
|
+
FsPopoverDirective], exports: [FsPopoverComponent,
|
|
608
610
|
FsPopoverDirective] });
|
|
609
|
-
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: FsPopoverModule
|
|
610
|
-
PortalModule] });
|
|
611
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: FsPopoverModule });
|
|
611
612
|
}
|
|
612
613
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: FsPopoverModule, decorators: [{
|
|
613
614
|
type: NgModule,
|
|
614
615
|
args: [{
|
|
615
616
|
imports: [
|
|
616
|
-
CommonModule,
|
|
617
|
-
PortalModule,
|
|
618
|
-
],
|
|
619
|
-
declarations: [
|
|
620
617
|
FsPopoverComponent,
|
|
621
|
-
FsPopoverWrapperComponent,
|
|
622
618
|
FsPopoverDirective,
|
|
623
619
|
],
|
|
624
620
|
exports: [
|