@frame-ui-ng/components 0.2.0-beta.0 → 0.4.0-beta.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/button/src/styles/button.css +20 -4
- package/button-group/src/styles/button-group.css +6 -0
- package/dropdown-menu/src/styles/_vars.css +1 -1
- package/dropdown-menu/src/styles/dropdown-menu-item.css +87 -87
- package/fesm2022/frame-ui-ng-components-calendar.mjs +369 -263
- package/fesm2022/frame-ui-ng-components-calendar.mjs.map +1 -1
- package/fesm2022/frame-ui-ng-components-combobox.mjs +48 -51
- package/fesm2022/frame-ui-ng-components-combobox.mjs.map +1 -1
- package/fesm2022/frame-ui-ng-components-command.mjs +1 -1
- package/fesm2022/frame-ui-ng-components-command.mjs.map +1 -1
- package/fesm2022/frame-ui-ng-components-confirm-modal.mjs +162 -0
- package/fesm2022/frame-ui-ng-components-confirm-modal.mjs.map +1 -0
- package/fesm2022/frame-ui-ng-components-date-picker.mjs +232 -226
- package/fesm2022/frame-ui-ng-components-date-picker.mjs.map +1 -1
- package/fesm2022/frame-ui-ng-components-dropdown-menu.mjs +45 -22
- package/fesm2022/frame-ui-ng-components-dropdown-menu.mjs.map +1 -1
- package/fesm2022/frame-ui-ng-components-input-otp.mjs +64 -69
- package/fesm2022/frame-ui-ng-components-input-otp.mjs.map +1 -1
- package/fesm2022/frame-ui-ng-components-input.mjs +6 -3
- package/fesm2022/frame-ui-ng-components-input.mjs.map +1 -1
- package/fesm2022/frame-ui-ng-components-modal.mjs +93 -15
- package/fesm2022/frame-ui-ng-components-modal.mjs.map +1 -1
- package/fesm2022/frame-ui-ng-components-pagination.mjs +37 -36
- package/fesm2022/frame-ui-ng-components-pagination.mjs.map +1 -1
- package/fesm2022/frame-ui-ng-components-progress.mjs +2 -1
- package/fesm2022/frame-ui-ng-components-progress.mjs.map +1 -1
- package/fesm2022/frame-ui-ng-components-resizable.mjs +16 -26
- package/fesm2022/frame-ui-ng-components-resizable.mjs.map +1 -1
- package/fesm2022/frame-ui-ng-components-select.mjs +6 -3
- package/fesm2022/frame-ui-ng-components-select.mjs.map +1 -1
- package/fesm2022/frame-ui-ng-components-sheet.mjs +19 -16
- package/fesm2022/frame-ui-ng-components-sheet.mjs.map +1 -1
- package/fesm2022/frame-ui-ng-components-sidebar.mjs +59 -10
- package/fesm2022/frame-ui-ng-components-sidebar.mjs.map +1 -1
- package/fesm2022/frame-ui-ng-components-slider.mjs +53 -59
- package/fesm2022/frame-ui-ng-components-slider.mjs.map +1 -1
- package/fesm2022/frame-ui-ng-components-tooltip.mjs +307 -254
- package/fesm2022/frame-ui-ng-components-tooltip.mjs.map +1 -1
- package/fesm2022/frame-ui-ng-components-utils.mjs +20 -0
- package/fesm2022/frame-ui-ng-components-utils.mjs.map +1 -0
- package/fesm2022/frame-ui-ng-components-virtual-scroll.mjs +10 -12
- package/fesm2022/frame-ui-ng-components-virtual-scroll.mjs.map +1 -1
- package/fesm2022/frame-ui-ng-components.mjs +1047 -806
- package/fesm2022/frame-ui-ng-components.mjs.map +1 -1
- package/input/src/styles/input-group.css +50 -0
- package/item/src/styles/item.css +188 -187
- package/modal/src/styles/modal.css +10 -1
- package/package.json +10 -2
- package/select/src/styles/select-trigger.css +7 -36
- package/sidebar/src/styles/sidebar.css +10 -4
- package/src/styles/blueprint.css +102 -11
- package/src/styles/components.css +4 -4
- package/styles/blueprint.css +102 -11
- package/styles/components.css +4 -4
- package/styles.css +4 -4
- package/tooltip/src/styles/tooltip.css +7 -13
- package/types/frame-ui-ng-components-calendar.d.ts +14 -0
- package/types/frame-ui-ng-components-combobox.d.ts +1 -1
- package/types/frame-ui-ng-components-confirm-modal.d.ts +48 -0
- package/types/frame-ui-ng-components-context-menu.d.ts +2 -2
- package/types/frame-ui-ng-components-date-picker.d.ts +3 -1
- package/types/frame-ui-ng-components-dropdown-menu.d.ts +3 -3
- package/types/frame-ui-ng-components-input-otp.d.ts +1 -1
- package/types/frame-ui-ng-components-input.d.ts +6 -3
- package/types/frame-ui-ng-components-modal.d.ts +18 -7
- package/types/frame-ui-ng-components-select.d.ts +6 -3
- package/types/frame-ui-ng-components-sheet.d.ts +2 -0
- package/types/frame-ui-ng-components-sidebar.d.ts +8 -1
- package/types/frame-ui-ng-components-tooltip.d.ts +48 -73
- package/types/frame-ui-ng-components-utils.d.ts +5 -0
- package/types/frame-ui-ng-components.d.ts +87 -45
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
import { Overlay } from '@angular/cdk/overlay';
|
|
2
|
+
import { ComponentPortal } from '@angular/cdk/portal';
|
|
3
|
+
import { DOCUMENT, isPlatformBrowser, NgTemplateOutlet } from '@angular/common';
|
|
1
4
|
import * as i0 from '@angular/core';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { NgTemplateOutlet } from '@angular/common';
|
|
5
|
+
import { inject, DestroyRef, ElementRef, PLATFORM_ID, input, booleanAttribute, numberAttribute, signal, effect, Directive, TemplateRef, ChangeDetectionStrategy, Component, NgModule } from '@angular/core';
|
|
6
|
+
import { parseCssPixelValue, clampNumber } from '@frame-ui-ng/components/utils';
|
|
5
7
|
|
|
6
8
|
function buildTooltipPositions(options) {
|
|
7
9
|
const primary = buildPosition(options.side, options);
|
|
@@ -54,76 +56,7 @@ function oppositeSide(side) {
|
|
|
54
56
|
return 'left';
|
|
55
57
|
}
|
|
56
58
|
|
|
57
|
-
const
|
|
58
|
-
|
|
59
|
-
let nextTooltipId = 0;
|
|
60
|
-
class FrTooltipContent {
|
|
61
|
-
templateRef = inject((TemplateRef));
|
|
62
|
-
id = `frame-tooltip-${nextTooltipId++}`;
|
|
63
|
-
align = input('center', ...(ngDevMode ? [{ debugName: "align" }] : /* istanbul ignore next */ []));
|
|
64
|
-
alignOffset = input(0, ...(ngDevMode ? [{ debugName: "alignOffset" }] : /* istanbul ignore next */ []));
|
|
65
|
-
arrow = input(false, { ...(ngDevMode ? { debugName: "arrow" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
66
|
-
debugVisible = input(false, { ...(ngDevMode ? { debugName: "debugVisible" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
67
|
-
side = input('top', ...(ngDevMode ? [{ debugName: "side" }] : /* istanbul ignore next */ []));
|
|
68
|
-
sideOffset = input(8, ...(ngDevMode ? [{ debugName: "sideOffset" }] : /* istanbul ignore next */ []));
|
|
69
|
-
getPositions() {
|
|
70
|
-
return buildTooltipPositions({
|
|
71
|
-
align: this.align(),
|
|
72
|
-
alignOffset: this.alignOffset(),
|
|
73
|
-
side: this.side(),
|
|
74
|
-
sideOffset: this.sideOffset(),
|
|
75
|
-
});
|
|
76
|
-
}
|
|
77
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: FrTooltipContent, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
78
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.16", type: FrTooltipContent, isStandalone: true, selector: "ng-template[frTooltipContent]", inputs: { align: { classPropertyName: "align", publicName: "align", isSignal: true, isRequired: false, transformFunction: null }, alignOffset: { classPropertyName: "alignOffset", publicName: "alignOffset", isSignal: true, isRequired: false, transformFunction: null }, arrow: { classPropertyName: "arrow", publicName: "arrow", isSignal: true, isRequired: false, transformFunction: null }, debugVisible: { classPropertyName: "debugVisible", publicName: "debugVisible", isSignal: true, isRequired: false, transformFunction: null }, side: { classPropertyName: "side", publicName: "side", isSignal: true, isRequired: false, transformFunction: null }, sideOffset: { classPropertyName: "sideOffset", publicName: "sideOffset", isSignal: true, isRequired: false, transformFunction: null } }, exportAs: ["frTooltipContent"], ngImport: i0 });
|
|
79
|
-
}
|
|
80
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: FrTooltipContent, decorators: [{
|
|
81
|
-
type: Directive,
|
|
82
|
-
args: [{
|
|
83
|
-
selector: 'ng-template[frTooltipContent]',
|
|
84
|
-
exportAs: 'frTooltipContent',
|
|
85
|
-
}]
|
|
86
|
-
}], propDecorators: { align: [{ type: i0.Input, args: [{ isSignal: true, alias: "align", required: false }] }], alignOffset: [{ type: i0.Input, args: [{ isSignal: true, alias: "alignOffset", required: false }] }], arrow: [{ type: i0.Input, args: [{ isSignal: true, alias: "arrow", required: false }] }], debugVisible: [{ type: i0.Input, args: [{ isSignal: true, alias: "debugVisible", required: false }] }], side: [{ type: i0.Input, args: [{ isSignal: true, alias: "side", required: false }] }], sideOffset: [{ type: i0.Input, args: [{ isSignal: true, alias: "sideOffset", required: false }] }] } });
|
|
87
|
-
class FrTooltipPanel {
|
|
88
|
-
content = inject(FrTooltipContent);
|
|
89
|
-
root = inject(FR_TOOLTIP_CONTROLLER);
|
|
90
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: FrTooltipPanel, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
91
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.16", type: FrTooltipPanel, isStandalone: true, selector: "[frTooltipPanel]", host: { attributes: { "role": "tooltip" }, properties: { "id": "content.id", "attr.data-side": "root.overlaySide()", "attr.data-arrow": "content.arrow() ? \"\" : null" }, classAttribute: "frame-tooltip__content" }, ngImport: i0 });
|
|
92
|
-
}
|
|
93
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: FrTooltipPanel, decorators: [{
|
|
94
|
-
type: Directive,
|
|
95
|
-
args: [{
|
|
96
|
-
selector: '[frTooltipPanel]',
|
|
97
|
-
host: {
|
|
98
|
-
class: 'frame-tooltip__content',
|
|
99
|
-
role: 'tooltip',
|
|
100
|
-
'[id]': 'content.id',
|
|
101
|
-
'[attr.data-side]': 'root.overlaySide()',
|
|
102
|
-
'[attr.data-arrow]': 'content.arrow() ? "" : null',
|
|
103
|
-
},
|
|
104
|
-
}]
|
|
105
|
-
}] });
|
|
106
|
-
class FrTooltipShortcut {
|
|
107
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: FrTooltipShortcut, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
108
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.16", type: FrTooltipShortcut, isStandalone: true, selector: "[frTooltipShortcut]", host: { classAttribute: "frame-tooltip__shortcut" }, ngImport: i0 });
|
|
109
|
-
}
|
|
110
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: FrTooltipShortcut, decorators: [{
|
|
111
|
-
type: Directive,
|
|
112
|
-
args: [{
|
|
113
|
-
selector: '[frTooltipShortcut]',
|
|
114
|
-
host: {
|
|
115
|
-
class: 'frame-tooltip__shortcut',
|
|
116
|
-
},
|
|
117
|
-
}]
|
|
118
|
-
}] });
|
|
119
|
-
|
|
120
|
-
const DEFAULT_POSITIONS = buildTooltipPositions({
|
|
121
|
-
align: 'center',
|
|
122
|
-
alignOffset: 0,
|
|
123
|
-
side: 'top',
|
|
124
|
-
sideOffset: 8,
|
|
125
|
-
});
|
|
126
|
-
const TOOLTIP_TOKEN_NAMES = [
|
|
59
|
+
const FR_TOOLTIP_TOKEN_NAMES = [
|
|
127
60
|
'--frame-tooltip-content-bg',
|
|
128
61
|
'--frame-tooltip-content-color',
|
|
129
62
|
'--frame-tooltip-content-border',
|
|
@@ -140,34 +73,107 @@ const TOOLTIP_TOKEN_NAMES = [
|
|
|
140
73
|
'--frame-tooltip-motion-scale',
|
|
141
74
|
'--frame-tooltip-motion-easing',
|
|
142
75
|
];
|
|
143
|
-
|
|
76
|
+
|
|
77
|
+
let nextInlineTooltipId = 0;
|
|
78
|
+
class FrTooltipDirective {
|
|
79
|
+
destroyRef = inject(DestroyRef);
|
|
80
|
+
document = inject(DOCUMENT);
|
|
144
81
|
elementRef = inject(ElementRef);
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
82
|
+
overlay = inject(Overlay);
|
|
83
|
+
platformId = inject(PLATFORM_ID);
|
|
84
|
+
content = input(null, { ...(ngDevMode ? { debugName: "content" } : /* istanbul ignore next */ {}), alias: 'frTooltip' });
|
|
85
|
+
align = input('center', { ...(ngDevMode ? { debugName: "align" } : /* istanbul ignore next */ {}), alias: 'frTooltipAlign' });
|
|
86
|
+
alignOffset = input(0, { ...(ngDevMode ? { debugName: "alignOffset" } : /* istanbul ignore next */ {}), alias: 'frTooltipAlignOffset' });
|
|
87
|
+
arrow = input(false, { ...(ngDevMode ? { debugName: "arrow" } : /* istanbul ignore next */ {}), alias: 'frTooltipArrow', transform: booleanAttribute });
|
|
88
|
+
closeDelay = input(0, { ...(ngDevMode ? { debugName: "closeDelay" } : /* istanbul ignore next */ {}), alias: 'frTooltipCloseDelay' });
|
|
89
|
+
openDelay = input(0, { ...(ngDevMode ? { debugName: "openDelay" } : /* istanbul ignore next */ {}), alias: 'frTooltipOpenDelay', transform: numberAttribute });
|
|
90
|
+
side = input('top', { ...(ngDevMode ? { debugName: "side" } : /* istanbul ignore next */ {}), alias: 'frTooltipSide' });
|
|
91
|
+
sideOffset = input(8, { ...(ngDevMode ? { debugName: "sideOffset" } : /* istanbul ignore next */ {}), alias: 'frTooltipSideOffset' });
|
|
150
92
|
isOpen = signal(false, ...(ngDevMode ? [{ debugName: "isOpen" }] : /* istanbul ignore next */ []));
|
|
151
|
-
|
|
152
|
-
overlaySide = signal('top', ...(ngDevMode ? [{ debugName: "overlaySide" }] : /* istanbul ignore next */ []));
|
|
153
|
-
openTimer = null;
|
|
93
|
+
tooltipId = `frame-tooltip-inline-${nextInlineTooltipId++}`;
|
|
154
94
|
closeTimer = null;
|
|
155
|
-
|
|
156
|
-
|
|
95
|
+
disabledObserver = null;
|
|
96
|
+
openTimer = null;
|
|
97
|
+
overlayRef = null;
|
|
98
|
+
panelRef = null;
|
|
99
|
+
arrowFrameId = -1;
|
|
100
|
+
currentSide = this.side();
|
|
101
|
+
pendingArrowSide = this.side();
|
|
102
|
+
triggerElement = this.elementRef.nativeElement;
|
|
103
|
+
wrapped = false;
|
|
104
|
+
wrapper = null;
|
|
105
|
+
teardownListeners = [];
|
|
157
106
|
constructor() {
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
107
|
+
this.destroyRef.onDestroy(() => this.destroy());
|
|
108
|
+
effect(() => {
|
|
109
|
+
const content = this.content();
|
|
110
|
+
if (this.panelRef && content) {
|
|
111
|
+
this.updatePanelInputs();
|
|
112
|
+
}
|
|
113
|
+
if (!content) {
|
|
114
|
+
this.close();
|
|
161
115
|
}
|
|
162
116
|
});
|
|
163
117
|
}
|
|
164
|
-
|
|
165
|
-
this.
|
|
118
|
+
ngAfterViewInit() {
|
|
119
|
+
if (!isPlatformBrowser(this.platformId)) {
|
|
120
|
+
return;
|
|
121
|
+
}
|
|
122
|
+
this.ensureDisabledHostWrapper();
|
|
123
|
+
this.bindTriggerEvents();
|
|
124
|
+
this.observeDisabledState();
|
|
166
125
|
}
|
|
167
|
-
|
|
168
|
-
|
|
126
|
+
bindTriggerEvents() {
|
|
127
|
+
const target = this.triggerElement;
|
|
128
|
+
this.teardownListeners.push(this.listen(target, 'mouseenter', () => this.openWithDelay()));
|
|
129
|
+
this.teardownListeners.push(this.listen(target, 'mouseleave', () => this.closeWithDelay()));
|
|
130
|
+
this.teardownListeners.push(this.listen(target, 'focusin', () => this.openWithDelay()));
|
|
131
|
+
this.teardownListeners.push(this.listen(target, 'focusout', () => this.closeWithDelay()));
|
|
132
|
+
this.teardownListeners.push(this.listen(target, 'keydown', (event) => {
|
|
133
|
+
const keyboardEvent = event;
|
|
134
|
+
if (keyboardEvent.key === 'Escape') {
|
|
135
|
+
keyboardEvent.preventDefault();
|
|
136
|
+
this.close();
|
|
137
|
+
}
|
|
138
|
+
}));
|
|
139
|
+
}
|
|
140
|
+
ensureDisabledHostWrapper() {
|
|
141
|
+
const element = this.elementRef.nativeElement;
|
|
142
|
+
if (!('disabled' in element) || !element.hasAttribute('disabled') || this.wrapped) {
|
|
143
|
+
return;
|
|
144
|
+
}
|
|
145
|
+
const parent = element.parentNode;
|
|
146
|
+
if (!parent) {
|
|
147
|
+
return;
|
|
148
|
+
}
|
|
149
|
+
const wrapper = this.document.createElement('span');
|
|
150
|
+
wrapper.className = 'frame-tooltip__disabled-trigger';
|
|
151
|
+
wrapper.tabIndex = 0;
|
|
152
|
+
parent.insertBefore(wrapper, element);
|
|
153
|
+
wrapper.appendChild(element);
|
|
154
|
+
this.triggerElement = wrapper;
|
|
155
|
+
this.wrapper = wrapper;
|
|
156
|
+
this.wrapped = true;
|
|
157
|
+
}
|
|
158
|
+
observeDisabledState() {
|
|
159
|
+
const element = this.elementRef.nativeElement;
|
|
160
|
+
if (!('disabled' in element)) {
|
|
161
|
+
return;
|
|
162
|
+
}
|
|
163
|
+
this.disabledObserver = new MutationObserver(() => {
|
|
164
|
+
if (!element.hasAttribute('disabled') || this.wrapped) {
|
|
165
|
+
return;
|
|
166
|
+
}
|
|
167
|
+
this.teardownTriggerListeners();
|
|
168
|
+
this.ensureDisabledHostWrapper();
|
|
169
|
+
this.bindTriggerEvents();
|
|
170
|
+
});
|
|
171
|
+
this.disabledObserver.observe(element, { attributes: true, attributeFilter: ['disabled'] });
|
|
169
172
|
}
|
|
170
173
|
openWithDelay() {
|
|
174
|
+
if (!this.content()) {
|
|
175
|
+
return;
|
|
176
|
+
}
|
|
171
177
|
this.cancelClose();
|
|
172
178
|
this.cancelOpen();
|
|
173
179
|
const delay = Math.max(0, this.openDelay());
|
|
@@ -178,9 +184,6 @@ class FrTooltipRoot {
|
|
|
178
184
|
this.openTimer = setTimeout(() => this.open(), delay);
|
|
179
185
|
}
|
|
180
186
|
closeWithDelay() {
|
|
181
|
-
if (this.debugVisible()) {
|
|
182
|
-
return;
|
|
183
|
-
}
|
|
184
187
|
this.cancelOpen();
|
|
185
188
|
this.cancelClose();
|
|
186
189
|
const delay = Math.max(0, this.closeDelay());
|
|
@@ -191,80 +194,97 @@ class FrTooltipRoot {
|
|
|
191
194
|
this.closeTimer = setTimeout(() => this.close(), delay);
|
|
192
195
|
}
|
|
193
196
|
open() {
|
|
194
|
-
|
|
197
|
+
const content = this.content();
|
|
198
|
+
if (!content) {
|
|
195
199
|
return;
|
|
196
200
|
}
|
|
197
|
-
if (!this.
|
|
198
|
-
this.
|
|
199
|
-
|
|
200
|
-
|
|
201
|
+
if (!this.overlayRef) {
|
|
202
|
+
this.overlayRef = this.createOverlay();
|
|
203
|
+
}
|
|
204
|
+
if (!this.overlayRef.hasAttached()) {
|
|
205
|
+
this.panelRef = this.overlayRef.attach(new ComponentPortal(FrTooltipInlinePanel));
|
|
206
|
+
this.updatePanelInputs();
|
|
207
|
+
this.syncCustomPropertiesToOverlay();
|
|
208
|
+
this.scheduleArrowPosition();
|
|
201
209
|
}
|
|
210
|
+
this.isOpen.set(true);
|
|
202
211
|
}
|
|
203
212
|
close() {
|
|
204
|
-
if (this.debugVisible()) {
|
|
205
|
-
return;
|
|
206
|
-
}
|
|
207
213
|
this.cancelOpen();
|
|
208
214
|
this.cancelClose();
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
}
|
|
215
|
+
this.overlayRef?.detach();
|
|
216
|
+
this.panelRef = null;
|
|
217
|
+
this.isOpen.set(false);
|
|
213
218
|
}
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
this.
|
|
218
|
-
|
|
219
|
+
createOverlay() {
|
|
220
|
+
const positionStrategy = this.overlay
|
|
221
|
+
.position()
|
|
222
|
+
.flexibleConnectedTo(this.triggerElement)
|
|
223
|
+
.withPositions(this.positions())
|
|
224
|
+
.withPush(true)
|
|
225
|
+
.withViewportMargin(8);
|
|
226
|
+
positionStrategy.positionChanges.subscribe((event) => this.handlePositionChange(event));
|
|
227
|
+
const overlayRef = this.overlay.create({
|
|
228
|
+
panelClass: ['frame-tooltip-overlay', `frame-tooltip-overlay--${this.side()}`],
|
|
229
|
+
positionStrategy,
|
|
230
|
+
scrollStrategy: this.overlay.scrollStrategies.reposition(),
|
|
231
|
+
});
|
|
232
|
+
overlayRef.keydownEvents().subscribe((event) => {
|
|
233
|
+
if (event.key === 'Escape') {
|
|
234
|
+
event.preventDefault();
|
|
235
|
+
this.close();
|
|
236
|
+
}
|
|
237
|
+
});
|
|
238
|
+
return overlayRef;
|
|
239
|
+
}
|
|
240
|
+
positions() {
|
|
241
|
+
return buildTooltipPositions({
|
|
242
|
+
align: this.align(),
|
|
243
|
+
alignOffset: this.alignOffset(),
|
|
244
|
+
side: this.side(),
|
|
245
|
+
sideOffset: this.sideOffset(),
|
|
246
|
+
});
|
|
219
247
|
}
|
|
220
248
|
handlePositionChange(event) {
|
|
221
249
|
const pair = event.connectionPair;
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
this.
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
250
|
+
const side = pair.overlayY === 'top'
|
|
251
|
+
? 'bottom'
|
|
252
|
+
: pair.overlayY === 'bottom'
|
|
253
|
+
? 'top'
|
|
254
|
+
: pair.overlayX === 'start'
|
|
255
|
+
? 'right'
|
|
256
|
+
: 'left';
|
|
257
|
+
this.panelRef?.setInput('side', side);
|
|
258
|
+
this.currentSide = side;
|
|
259
|
+
this.overlayRef?.removePanelClass(['frame-tooltip-overlay--top', 'frame-tooltip-overlay--right', 'frame-tooltip-overlay--bottom', 'frame-tooltip-overlay--left']);
|
|
260
|
+
this.overlayRef?.addPanelClass(`frame-tooltip-overlay--${side}`);
|
|
261
|
+
this.scheduleArrowPosition(side);
|
|
234
262
|
}
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
}
|
|
240
|
-
}
|
|
241
|
-
cancelClose() {
|
|
242
|
-
if (this.closeTimer) {
|
|
243
|
-
clearTimeout(this.closeTimer);
|
|
244
|
-
this.closeTimer = null;
|
|
263
|
+
updatePanelInputs() {
|
|
264
|
+
const panelRef = this.panelRef;
|
|
265
|
+
if (!panelRef) {
|
|
266
|
+
return;
|
|
245
267
|
}
|
|
268
|
+
panelRef.setInput('arrow', this.arrow());
|
|
269
|
+
panelRef.setInput('content', this.content() ?? '');
|
|
270
|
+
panelRef.setInput('id', this.tooltipId);
|
|
271
|
+
panelRef.setInput('side', this.side());
|
|
272
|
+
this.currentSide = this.side();
|
|
246
273
|
}
|
|
247
274
|
syncCustomPropertiesToOverlay() {
|
|
248
|
-
const
|
|
249
|
-
const overlayPane = document.querySelector('.cdk-overlay-pane.frame-tooltip-overlay');
|
|
275
|
+
const overlayPane = this.overlayRef?.overlayElement;
|
|
250
276
|
const panel = overlayPane?.querySelector('.frame-tooltip__content');
|
|
251
|
-
if (!
|
|
277
|
+
if (!overlayPane || !panel) {
|
|
252
278
|
return;
|
|
253
279
|
}
|
|
254
280
|
this.copyCustomProperties(this.elementRef.nativeElement, overlayPane, panel);
|
|
255
|
-
this.
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
queueMicrotask(() => {
|
|
259
|
-
this.syncCustomPropertiesToOverlay();
|
|
260
|
-
if (typeof requestAnimationFrame === 'function') {
|
|
261
|
-
requestAnimationFrame(() => this.syncCustomPropertiesToOverlay());
|
|
262
|
-
}
|
|
263
|
-
});
|
|
281
|
+
if (this.wrapper) {
|
|
282
|
+
this.copyCustomProperties(this.wrapper, overlayPane, panel);
|
|
283
|
+
}
|
|
264
284
|
}
|
|
265
285
|
copyCustomProperties(source, overlayPane, panel) {
|
|
266
286
|
const sourceStyles = getComputedStyle(source);
|
|
267
|
-
for (const propertyName of
|
|
287
|
+
for (const propertyName of FR_TOOLTIP_TOKEN_NAMES) {
|
|
268
288
|
const propertyValue = sourceStyles.getPropertyValue(propertyName);
|
|
269
289
|
if (propertyValue.trim()) {
|
|
270
290
|
overlayPane.style.setProperty(propertyName, propertyValue);
|
|
@@ -281,139 +301,172 @@ class FrTooltipRoot {
|
|
|
281
301
|
panel.style.setProperty(propertyName, propertyValue);
|
|
282
302
|
}
|
|
283
303
|
}
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
<ng-content />
|
|
293
|
-
</span>
|
|
294
|
-
|
|
295
|
-
<ng-template
|
|
296
|
-
cdkConnectedOverlay
|
|
297
|
-
[cdkConnectedOverlayOrigin]="origin"
|
|
298
|
-
[cdkConnectedOverlayOpen]="isOpen()"
|
|
299
|
-
[cdkConnectedOverlayPositions]="positions()"
|
|
300
|
-
[cdkConnectedOverlayPanelClass]="overlayPanelClasses()"
|
|
301
|
-
[cdkConnectedOverlayPush]="true"
|
|
302
|
-
[cdkConnectedOverlayViewportMargin]="8"
|
|
303
|
-
(detach)="close()"
|
|
304
|
-
(overlayKeydown)="handleOverlayKeydown($event)"
|
|
305
|
-
(positionChange)="handlePositionChange($event)"
|
|
306
|
-
>
|
|
307
|
-
<ng-container [ngTemplateOutlet]="content()?.templateRef ?? null" />
|
|
308
|
-
</ng-template>
|
|
309
|
-
`, isInline: true, dependencies: [{ kind: "directive", type: CdkConnectedOverlay, selector: "[cdk-connected-overlay], [connected-overlay], [cdkConnectedOverlay]", inputs: ["cdkConnectedOverlayOrigin", "cdkConnectedOverlayPositions", "cdkConnectedOverlayPositionStrategy", "cdkConnectedOverlayOffsetX", "cdkConnectedOverlayOffsetY", "cdkConnectedOverlayWidth", "cdkConnectedOverlayHeight", "cdkConnectedOverlayMinWidth", "cdkConnectedOverlayMinHeight", "cdkConnectedOverlayBackdropClass", "cdkConnectedOverlayPanelClass", "cdkConnectedOverlayViewportMargin", "cdkConnectedOverlayScrollStrategy", "cdkConnectedOverlayOpen", "cdkConnectedOverlayDisableClose", "cdkConnectedOverlayTransformOriginOn", "cdkConnectedOverlayHasBackdrop", "cdkConnectedOverlayLockPosition", "cdkConnectedOverlayFlexibleDimensions", "cdkConnectedOverlayGrowAfterOpen", "cdkConnectedOverlayPush", "cdkConnectedOverlayDisposeOnNavigation", "cdkConnectedOverlayUsePopover", "cdkConnectedOverlayMatchWidth", "cdkConnectedOverlay"], outputs: ["backdropClick", "positionChange", "attach", "detach", "overlayKeydown", "overlayOutsideClick"], exportAs: ["cdkConnectedOverlay"] }, { kind: "directive", type: CdkOverlayOrigin, selector: "[cdk-overlay-origin], [overlay-origin], [cdkOverlayOrigin]", exportAs: ["cdkOverlayOrigin"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
310
|
-
}
|
|
311
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: FrTooltipRoot, decorators: [{
|
|
312
|
-
type: Component,
|
|
313
|
-
args: [{
|
|
314
|
-
selector: 'frame-tooltip',
|
|
315
|
-
exportAs: 'frTooltip',
|
|
316
|
-
imports: [CdkConnectedOverlay, CdkOverlayOrigin, NgTemplateOutlet],
|
|
317
|
-
providers: [
|
|
318
|
-
{
|
|
319
|
-
provide: FR_TOOLTIP_CONTROLLER,
|
|
320
|
-
useExisting: FrTooltipRoot,
|
|
321
|
-
},
|
|
322
|
-
],
|
|
323
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
324
|
-
host: {
|
|
325
|
-
class: 'frame-tooltip',
|
|
326
|
-
'[attr.data-state]': 'isOpen() ? "open" : "closed"',
|
|
327
|
-
},
|
|
328
|
-
template: `
|
|
329
|
-
<span cdkOverlayOrigin #origin="cdkOverlayOrigin" class="frame-tooltip__anchor">
|
|
330
|
-
<ng-content />
|
|
331
|
-
</span>
|
|
332
|
-
|
|
333
|
-
<ng-template
|
|
334
|
-
cdkConnectedOverlay
|
|
335
|
-
[cdkConnectedOverlayOrigin]="origin"
|
|
336
|
-
[cdkConnectedOverlayOpen]="isOpen()"
|
|
337
|
-
[cdkConnectedOverlayPositions]="positions()"
|
|
338
|
-
[cdkConnectedOverlayPanelClass]="overlayPanelClasses()"
|
|
339
|
-
[cdkConnectedOverlayPush]="true"
|
|
340
|
-
[cdkConnectedOverlayViewportMargin]="8"
|
|
341
|
-
(detach)="close()"
|
|
342
|
-
(overlayKeydown)="handleOverlayKeydown($event)"
|
|
343
|
-
(positionChange)="handlePositionChange($event)"
|
|
344
|
-
>
|
|
345
|
-
<ng-container [ngTemplateOutlet]="content()?.templateRef ?? null" />
|
|
346
|
-
</ng-template>
|
|
347
|
-
`,
|
|
348
|
-
}]
|
|
349
|
-
}], ctorParameters: () => [], propDecorators: { openDelay: [{ type: i0.Input, args: [{ isSignal: true, alias: "openDelay", required: false }] }], closeDelay: [{ type: i0.Input, args: [{ isSignal: true, alias: "closeDelay", required: false }] }], defaultOpen: [{ type: i0.Input, args: [{ isSignal: true, alias: "defaultOpen", required: false }] }], debugVisible: [{ type: i0.Input, args: [{ isSignal: true, alias: "debugVisible", required: false }] }], openChange: [{ type: i0.Output, args: ["openChange"] }] } });
|
|
350
|
-
|
|
351
|
-
class FrTooltipTrigger {
|
|
352
|
-
content = input(null, { ...(ngDevMode ? { debugName: "content" } : /* istanbul ignore next */ {}), alias: 'frTooltipTrigger' });
|
|
353
|
-
root = inject(FR_TOOLTIP_CONTROLLER);
|
|
354
|
-
elementRef = inject(ElementRef);
|
|
355
|
-
constructor() {
|
|
356
|
-
this.root.registerTrigger(this.elementRef.nativeElement);
|
|
357
|
-
effect(() => {
|
|
358
|
-
const content = this.content();
|
|
359
|
-
if (content) {
|
|
360
|
-
this.root.setContent(content);
|
|
361
|
-
}
|
|
304
|
+
scheduleArrowPosition(side = this.currentSide) {
|
|
305
|
+
this.pendingArrowSide = side;
|
|
306
|
+
if (!this.arrow() || this.arrowFrameId !== -1) {
|
|
307
|
+
return;
|
|
308
|
+
}
|
|
309
|
+
this.arrowFrameId = requestAnimationFrame(() => {
|
|
310
|
+
this.arrowFrameId = -1;
|
|
311
|
+
this.syncArrowPosition(this.pendingArrowSide);
|
|
362
312
|
});
|
|
363
313
|
}
|
|
364
|
-
|
|
365
|
-
this.
|
|
366
|
-
|
|
314
|
+
syncArrowPosition(side) {
|
|
315
|
+
const panel = this.overlayRef?.overlayElement.querySelector('.frame-tooltip__content');
|
|
316
|
+
if (!panel) {
|
|
317
|
+
return;
|
|
318
|
+
}
|
|
319
|
+
const panelRect = panel.getBoundingClientRect();
|
|
320
|
+
const triggerRect = this.triggerElement.getBoundingClientRect();
|
|
321
|
+
if (!panelRect.width || !panelRect.height || !triggerRect.width || !triggerRect.height) {
|
|
322
|
+
return;
|
|
323
|
+
}
|
|
324
|
+
const arrowSize = parseCssPixelValue(getComputedStyle(panel).getPropertyValue('--frame-tooltip-arrow-size'), 8);
|
|
325
|
+
const edgeInset = arrowSize / 2;
|
|
326
|
+
if (side === 'top' || side === 'bottom') {
|
|
327
|
+
const triggerCenter = triggerRect.left + triggerRect.width / 2 - panelRect.left;
|
|
328
|
+
const arrowX = clampNumber(triggerCenter - arrowSize / 2, edgeInset, panelRect.width - arrowSize - edgeInset);
|
|
329
|
+
panel.style.setProperty('--frame-tooltip-arrow-x', `${Math.round(arrowX * 100) / 100}px`);
|
|
330
|
+
return;
|
|
331
|
+
}
|
|
332
|
+
const triggerCenter = triggerRect.top + triggerRect.height / 2 - panelRect.top;
|
|
333
|
+
const arrowY = clampNumber(triggerCenter - arrowSize / 2, edgeInset, panelRect.height - arrowSize - edgeInset);
|
|
334
|
+
panel.style.setProperty('--frame-tooltip-arrow-y', `${Math.round(arrowY * 100) / 100}px`);
|
|
367
335
|
}
|
|
368
|
-
|
|
369
|
-
|
|
336
|
+
listen(target, eventName, listener) {
|
|
337
|
+
target.addEventListener(eventName, listener);
|
|
338
|
+
return () => target.removeEventListener(eventName, listener);
|
|
370
339
|
}
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
340
|
+
cancelOpen() {
|
|
341
|
+
if (this.openTimer) {
|
|
342
|
+
clearTimeout(this.openTimer);
|
|
343
|
+
this.openTimer = null;
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
cancelClose() {
|
|
347
|
+
if (this.closeTimer) {
|
|
348
|
+
clearTimeout(this.closeTimer);
|
|
349
|
+
this.closeTimer = null;
|
|
350
|
+
}
|
|
374
351
|
}
|
|
375
|
-
|
|
376
|
-
this.
|
|
352
|
+
destroy() {
|
|
353
|
+
this.close();
|
|
354
|
+
if (this.arrowFrameId !== -1) {
|
|
355
|
+
cancelAnimationFrame(this.arrowFrameId);
|
|
356
|
+
this.arrowFrameId = -1;
|
|
357
|
+
}
|
|
358
|
+
this.overlayRef?.dispose();
|
|
359
|
+
this.overlayRef = null;
|
|
360
|
+
this.disabledObserver?.disconnect();
|
|
361
|
+
this.disabledObserver = null;
|
|
362
|
+
this.teardownTriggerListeners();
|
|
377
363
|
}
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
this.root.close();
|
|
364
|
+
teardownTriggerListeners() {
|
|
365
|
+
for (const teardown of this.teardownListeners) {
|
|
366
|
+
teardown();
|
|
382
367
|
}
|
|
368
|
+
this.teardownListeners = [];
|
|
383
369
|
}
|
|
384
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type:
|
|
385
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.16", type:
|
|
370
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: FrTooltipDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
371
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.16", type: FrTooltipDirective, isStandalone: true, selector: "[frTooltip]", inputs: { content: { classPropertyName: "content", publicName: "frTooltip", isSignal: true, isRequired: false, transformFunction: null }, align: { classPropertyName: "align", publicName: "frTooltipAlign", isSignal: true, isRequired: false, transformFunction: null }, alignOffset: { classPropertyName: "alignOffset", publicName: "frTooltipAlignOffset", isSignal: true, isRequired: false, transformFunction: null }, arrow: { classPropertyName: "arrow", publicName: "frTooltipArrow", isSignal: true, isRequired: false, transformFunction: null }, closeDelay: { classPropertyName: "closeDelay", publicName: "frTooltipCloseDelay", isSignal: true, isRequired: false, transformFunction: null }, openDelay: { classPropertyName: "openDelay", publicName: "frTooltipOpenDelay", isSignal: true, isRequired: false, transformFunction: null }, side: { classPropertyName: "side", publicName: "frTooltipSide", isSignal: true, isRequired: false, transformFunction: null }, sideOffset: { classPropertyName: "sideOffset", publicName: "frTooltipSideOffset", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "attr.aria-describedby": "isOpen() ? tooltipId : null", "attr.data-state": "isOpen() ? \"open\" : \"closed\"" }, classAttribute: "frame-tooltip__trigger" }, ngImport: i0 });
|
|
386
372
|
}
|
|
387
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type:
|
|
373
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: FrTooltipDirective, decorators: [{
|
|
388
374
|
type: Directive,
|
|
389
375
|
args: [{
|
|
390
|
-
selector: '[
|
|
376
|
+
selector: '[frTooltip]',
|
|
391
377
|
host: {
|
|
392
378
|
class: 'frame-tooltip__trigger',
|
|
393
|
-
'[attr.aria-describedby]': '
|
|
394
|
-
'[attr.data-state]': '
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
379
|
+
'[attr.aria-describedby]': 'isOpen() ? tooltipId : null',
|
|
380
|
+
'[attr.data-state]': 'isOpen() ? "open" : "closed"',
|
|
381
|
+
},
|
|
382
|
+
}]
|
|
383
|
+
}], ctorParameters: () => [], propDecorators: { content: [{ type: i0.Input, args: [{ isSignal: true, alias: "frTooltip", required: false }] }], align: [{ type: i0.Input, args: [{ isSignal: true, alias: "frTooltipAlign", required: false }] }], alignOffset: [{ type: i0.Input, args: [{ isSignal: true, alias: "frTooltipAlignOffset", required: false }] }], arrow: [{ type: i0.Input, args: [{ isSignal: true, alias: "frTooltipArrow", required: false }] }], closeDelay: [{ type: i0.Input, args: [{ isSignal: true, alias: "frTooltipCloseDelay", required: false }] }], openDelay: [{ type: i0.Input, args: [{ isSignal: true, alias: "frTooltipOpenDelay", required: false }] }], side: [{ type: i0.Input, args: [{ isSignal: true, alias: "frTooltipSide", required: false }] }], sideOffset: [{ type: i0.Input, args: [{ isSignal: true, alias: "frTooltipSideOffset", required: false }] }] } });
|
|
384
|
+
class FrTooltipShortcut {
|
|
385
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: FrTooltipShortcut, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
386
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.16", type: FrTooltipShortcut, isStandalone: true, selector: "[frTooltipShortcut]", host: { classAttribute: "frame-tooltip__shortcut" }, ngImport: i0 });
|
|
387
|
+
}
|
|
388
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: FrTooltipShortcut, decorators: [{
|
|
389
|
+
type: Directive,
|
|
390
|
+
args: [{
|
|
391
|
+
selector: '[frTooltipShortcut]',
|
|
392
|
+
host: {
|
|
393
|
+
class: 'frame-tooltip__shortcut',
|
|
400
394
|
},
|
|
401
395
|
}]
|
|
402
|
-
}]
|
|
396
|
+
}] });
|
|
397
|
+
class FrTooltipInlinePanel {
|
|
398
|
+
arrow = input(false, { ...(ngDevMode ? { debugName: "arrow" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
399
|
+
content = input('', ...(ngDevMode ? [{ debugName: "content" }] : /* istanbul ignore next */ []));
|
|
400
|
+
id = input.required(...(ngDevMode ? [{ debugName: "id" }] : /* istanbul ignore next */ []));
|
|
401
|
+
side = input('top', ...(ngDevMode ? [{ debugName: "side" }] : /* istanbul ignore next */ []));
|
|
402
|
+
templateContent = signal(null, ...(ngDevMode ? [{ debugName: "templateContent" }] : /* istanbul ignore next */ []));
|
|
403
|
+
textContent = signal('', ...(ngDevMode ? [{ debugName: "textContent" }] : /* istanbul ignore next */ []));
|
|
404
|
+
constructor() {
|
|
405
|
+
effect(() => {
|
|
406
|
+
const content = this.content();
|
|
407
|
+
if (content instanceof TemplateRef) {
|
|
408
|
+
this.templateContent.set(content);
|
|
409
|
+
this.textContent.set('');
|
|
410
|
+
return;
|
|
411
|
+
}
|
|
412
|
+
this.templateContent.set(null);
|
|
413
|
+
this.textContent.set(content ?? '');
|
|
414
|
+
});
|
|
415
|
+
}
|
|
416
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: FrTooltipInlinePanel, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
417
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.16", type: FrTooltipInlinePanel, isStandalone: true, selector: "frame-tooltip-inline-panel", inputs: { arrow: { classPropertyName: "arrow", publicName: "arrow", isSignal: true, isRequired: false, transformFunction: null }, content: { classPropertyName: "content", publicName: "content", isSignal: true, isRequired: false, transformFunction: null }, id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: true, transformFunction: null }, side: { classPropertyName: "side", publicName: "side", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
|
|
418
|
+
<div
|
|
419
|
+
class="frame-tooltip__content"
|
|
420
|
+
role="tooltip"
|
|
421
|
+
[id]="id()"
|
|
422
|
+
[attr.data-side]="side()"
|
|
423
|
+
[attr.data-arrow]="arrow() ? '' : null"
|
|
424
|
+
>
|
|
425
|
+
@if (templateContent(); as template) {
|
|
426
|
+
<ng-container [ngTemplateOutlet]="template" />
|
|
427
|
+
} @else {
|
|
428
|
+
{{ textContent() }}
|
|
429
|
+
}
|
|
430
|
+
</div>
|
|
431
|
+
`, isInline: true, dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
432
|
+
}
|
|
433
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: FrTooltipInlinePanel, decorators: [{
|
|
434
|
+
type: Component,
|
|
435
|
+
args: [{
|
|
436
|
+
selector: 'frame-tooltip-inline-panel',
|
|
437
|
+
imports: [NgTemplateOutlet],
|
|
438
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
439
|
+
template: `
|
|
440
|
+
<div
|
|
441
|
+
class="frame-tooltip__content"
|
|
442
|
+
role="tooltip"
|
|
443
|
+
[id]="id()"
|
|
444
|
+
[attr.data-side]="side()"
|
|
445
|
+
[attr.data-arrow]="arrow() ? '' : null"
|
|
446
|
+
>
|
|
447
|
+
@if (templateContent(); as template) {
|
|
448
|
+
<ng-container [ngTemplateOutlet]="template" />
|
|
449
|
+
} @else {
|
|
450
|
+
{{ textContent() }}
|
|
451
|
+
}
|
|
452
|
+
</div>
|
|
453
|
+
`,
|
|
454
|
+
}]
|
|
455
|
+
}], ctorParameters: () => [], propDecorators: { arrow: [{ type: i0.Input, args: [{ isSignal: true, alias: "arrow", required: false }] }], content: [{ type: i0.Input, args: [{ isSignal: true, alias: "content", required: false }] }], id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: true }] }], side: [{ type: i0.Input, args: [{ isSignal: true, alias: "side", required: false }] }] } });
|
|
403
456
|
|
|
404
457
|
const FR_TOOLTIP_SIDES = ['top', 'right', 'bottom', 'left'];
|
|
405
458
|
const FR_TOOLTIP_ALIGNMENTS = ['start', 'center', 'end'];
|
|
406
459
|
|
|
407
460
|
class FrTooltipModule {
|
|
408
461
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: FrTooltipModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
409
|
-
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.16", ngImport: i0, type: FrTooltipModule, imports: [
|
|
462
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.16", ngImport: i0, type: FrTooltipModule, imports: [FrTooltipDirective, FrTooltipShortcut], exports: [FrTooltipDirective, FrTooltipShortcut] });
|
|
410
463
|
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: FrTooltipModule });
|
|
411
464
|
}
|
|
412
465
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: FrTooltipModule, decorators: [{
|
|
413
466
|
type: NgModule,
|
|
414
467
|
args: [{
|
|
415
|
-
imports: [
|
|
416
|
-
exports: [
|
|
468
|
+
imports: [FrTooltipDirective, FrTooltipShortcut],
|
|
469
|
+
exports: [FrTooltipDirective, FrTooltipShortcut],
|
|
417
470
|
}]
|
|
418
471
|
}] });
|
|
419
472
|
|
|
@@ -421,5 +474,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImpo
|
|
|
421
474
|
* Generated bundle index. Do not edit.
|
|
422
475
|
*/
|
|
423
476
|
|
|
424
|
-
export { FR_TOOLTIP_ALIGNMENTS, FR_TOOLTIP_SIDES,
|
|
477
|
+
export { FR_TOOLTIP_ALIGNMENTS, FR_TOOLTIP_SIDES, FrTooltipDirective, FrTooltipModule, FrTooltipShortcut };
|
|
425
478
|
//# sourceMappingURL=frame-ui-ng-components-tooltip.mjs.map
|