@tectra-ng/ui 0.1.4 → 0.1.5
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/carousel/README.md +53 -0
- package/fesm2022/tectra-ng-ui-carousel.mjs +939 -0
- package/fesm2022/tectra-ng-ui-carousel.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-galleria.mjs +1140 -0
- package/fesm2022/tectra-ng-ui-galleria.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-image.mjs +759 -0
- package/fesm2022/tectra-ng-ui-image.mjs.map +1 -0
- package/galleria/README.md +62 -0
- package/image/README.md +54 -0
- package/package.json +16 -4
- package/types/tectra-ng-ui-carousel.d.ts +263 -0
- package/types/tectra-ng-ui-carousel.d.ts.map +1 -0
- package/types/tectra-ng-ui-galleria.d.ts +407 -0
- package/types/tectra-ng-ui-galleria.d.ts.map +1 -0
- package/types/tectra-ng-ui-image.d.ts +259 -0
- package/types/tectra-ng-ui-image.d.ts.map +1 -0
|
@@ -0,0 +1,759 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import { ChangeDetectionStrategy, Component, DOCUMENT, DestroyRef, Directive, Injector, TemplateRef, ViewContainerRef, booleanAttribute, computed, contentChild, inject, input, numberAttribute, output, signal, viewChild } from "@angular/core";
|
|
3
|
+
import { FocusTrapFactory } from "@angular/cdk/a11y";
|
|
4
|
+
import { createBlockScrollStrategy, createGlobalPositionStrategy, createOverlayRef } from "@angular/cdk/overlay";
|
|
5
|
+
import { TemplatePortal } from "@angular/cdk/portal";
|
|
6
|
+
import { NgTemplateOutlet } from "@angular/common";
|
|
7
|
+
import { injectPassThrough, injectUnstyled } from "@tectra-ng/core/config";
|
|
8
|
+
import { injectTranslations } from "@tectra-ng/core/i18n";
|
|
9
|
+
import { optionalBoolean } from "@tectra-ng/core/utils";
|
|
10
|
+
import { TxIcon } from "@tectra-ng/icons";
|
|
11
|
+
import { toStyleObject } from "@tectra-ng/themes";
|
|
12
|
+
var TxImageIndicatorTemplate = class TxImageIndicatorTemplate {
|
|
13
|
+
template = inject(TemplateRef);
|
|
14
|
+
static ngTemplateContextGuard(_directive, context) {
|
|
15
|
+
return !!context;
|
|
16
|
+
}
|
|
17
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
18
|
+
minVersion: "12.0.0",
|
|
19
|
+
version: "22.2.3",
|
|
20
|
+
ngImport: i0,
|
|
21
|
+
type: TxImageIndicatorTemplate,
|
|
22
|
+
deps: [],
|
|
23
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
24
|
+
});
|
|
25
|
+
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
26
|
+
minVersion: "14.0.0",
|
|
27
|
+
version: "22.2.3",
|
|
28
|
+
type: TxImageIndicatorTemplate,
|
|
29
|
+
isStandalone: true,
|
|
30
|
+
selector: "ng-template[txImageIndicator]",
|
|
31
|
+
ngImport: i0
|
|
32
|
+
});
|
|
33
|
+
};
|
|
34
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
35
|
+
minVersion: "12.0.0",
|
|
36
|
+
version: "22.2.3",
|
|
37
|
+
ngImport: i0,
|
|
38
|
+
type: TxImageIndicatorTemplate,
|
|
39
|
+
decorators: [{
|
|
40
|
+
type: Directive,
|
|
41
|
+
args: [{ selector: "ng-template[txImageIndicator]" }]
|
|
42
|
+
}]
|
|
43
|
+
});
|
|
44
|
+
var TxImagePreviewTemplate = class TxImagePreviewTemplate {
|
|
45
|
+
template = inject(TemplateRef);
|
|
46
|
+
static ngTemplateContextGuard(_directive, context) {
|
|
47
|
+
return !!context;
|
|
48
|
+
}
|
|
49
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
50
|
+
minVersion: "12.0.0",
|
|
51
|
+
version: "22.2.3",
|
|
52
|
+
ngImport: i0,
|
|
53
|
+
type: TxImagePreviewTemplate,
|
|
54
|
+
deps: [],
|
|
55
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
56
|
+
});
|
|
57
|
+
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
58
|
+
minVersion: "14.0.0",
|
|
59
|
+
version: "22.2.3",
|
|
60
|
+
type: TxImagePreviewTemplate,
|
|
61
|
+
isStandalone: true,
|
|
62
|
+
selector: "ng-template[txImagePreview]",
|
|
63
|
+
ngImport: i0
|
|
64
|
+
});
|
|
65
|
+
};
|
|
66
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
67
|
+
minVersion: "12.0.0",
|
|
68
|
+
version: "22.2.3",
|
|
69
|
+
ngImport: i0,
|
|
70
|
+
type: TxImagePreviewTemplate,
|
|
71
|
+
decorators: [{
|
|
72
|
+
type: Directive,
|
|
73
|
+
args: [{ selector: "ng-template[txImagePreview]" }]
|
|
74
|
+
}]
|
|
75
|
+
});
|
|
76
|
+
const LEAVE_LIMIT = 450;
|
|
77
|
+
function animationsOf(element) {
|
|
78
|
+
return typeof element.getAnimations === "function" ? element.getAnimations({ subtree: true }) : [];
|
|
79
|
+
}
|
|
80
|
+
function openImageLayer(template, options) {
|
|
81
|
+
const { injector } = options;
|
|
82
|
+
const previousFocus = injector.get(DOCUMENT).activeElement;
|
|
83
|
+
const overlayRef = createOverlayRef(injector, {
|
|
84
|
+
positionStrategy: createGlobalPositionStrategy(injector).top("0").left("0"),
|
|
85
|
+
scrollStrategy: createBlockScrollStrategy(injector),
|
|
86
|
+
width: "100%",
|
|
87
|
+
height: "100%",
|
|
88
|
+
panelClass: "tx-image-layer",
|
|
89
|
+
usePopover: false,
|
|
90
|
+
disposeOnNavigation: true
|
|
91
|
+
});
|
|
92
|
+
overlayRef.hostElement.style.zIndex = "var(--tx-layer-modal)";
|
|
93
|
+
overlayRef.attach(new TemplatePortal(template, options.viewContainerRef)).detectChanges();
|
|
94
|
+
const element = overlayRef.overlayElement;
|
|
95
|
+
const focusTrap = injector.get(FocusTrapFactory).create(element);
|
|
96
|
+
((options.focus ? element.querySelector(options.focus) : null) ?? element.querySelector("[tabindex], button, a[href]"))?.focus({ preventScroll: true });
|
|
97
|
+
let closing = null;
|
|
98
|
+
overlayRef.keydownEvents().subscribe((event) => {
|
|
99
|
+
if (event.key === "Escape" && !closing) {
|
|
100
|
+
event.preventDefault();
|
|
101
|
+
options.onEscape?.();
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
overlayRef.detachments().subscribe(() => {
|
|
105
|
+
if (!closing) options.onDetach?.();
|
|
106
|
+
});
|
|
107
|
+
return {
|
|
108
|
+
element,
|
|
109
|
+
close() {
|
|
110
|
+
if (closing) return closing;
|
|
111
|
+
Array.from(element.children).forEach((child) => child.classList.add("tx-image-layer--leaving"));
|
|
112
|
+
element.style.pointerEvents = "none";
|
|
113
|
+
const animations = animationsOf(element);
|
|
114
|
+
const finished = Promise.all(animations.map((animation) => animation.finished.catch(() => void 0))).then(() => void 0);
|
|
115
|
+
closing = (animations.length ? Promise.race([finished, new Promise((resolve) => setTimeout(resolve, LEAVE_LIMIT))]) : finished).then(() => {
|
|
116
|
+
focusTrap.destroy();
|
|
117
|
+
overlayRef.dispose();
|
|
118
|
+
if (previousFocus?.isConnected) previousFocus.focus({ preventScroll: true });
|
|
119
|
+
});
|
|
120
|
+
return closing;
|
|
121
|
+
}
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
const PAN_THRESHOLD = 3;
|
|
125
|
+
var TxImage = class TxImage {
|
|
126
|
+
injector = inject(Injector);
|
|
127
|
+
viewContainerRef = inject(ViewContainerRef);
|
|
128
|
+
document = inject(DOCUMENT);
|
|
129
|
+
layer = null;
|
|
130
|
+
pan = null;
|
|
131
|
+
src = input(void 0, ...ngDevMode ? [{ debugName: "src" }] : /* istanbul ignore next */ []);
|
|
132
|
+
srcSet = input(void 0, ...ngDevMode ? [{ debugName: "srcSet" }] : /* istanbul ignore next */ []);
|
|
133
|
+
sizes = input(void 0, ...ngDevMode ? [{ debugName: "sizes" }] : /* istanbul ignore next */ []);
|
|
134
|
+
previewSrc = input(void 0, ...ngDevMode ? [{ debugName: "previewSrc" }] : /* istanbul ignore next */ []);
|
|
135
|
+
previewSrcSet = input(void 0, ...ngDevMode ? [{ debugName: "previewSrcSet" }] : /* istanbul ignore next */ []);
|
|
136
|
+
previewSizes = input(void 0, ...ngDevMode ? [{ debugName: "previewSizes" }] : /* istanbul ignore next */ []);
|
|
137
|
+
alt = input(void 0, ...ngDevMode ? [{ debugName: "alt" }] : /* istanbul ignore next */ []);
|
|
138
|
+
width = input(void 0, ...ngDevMode ? [{ debugName: "width" }] : /* istanbul ignore next */ []);
|
|
139
|
+
height = input(void 0, ...ngDevMode ? [{ debugName: "height" }] : /* istanbul ignore next */ []);
|
|
140
|
+
loading = input(void 0, ...ngDevMode ? [{ debugName: "loading" }] : /* istanbul ignore next */ []);
|
|
141
|
+
preview = input(false, {
|
|
142
|
+
...ngDevMode ? { debugName: "preview" } : /* istanbul ignore next */ {},
|
|
143
|
+
transform: booleanAttribute
|
|
144
|
+
});
|
|
145
|
+
previewIcon = input("eye", ...ngDevMode ? [{ debugName: "previewIcon" }] : /* istanbul ignore next */ []);
|
|
146
|
+
zoomStep = input(.1, {
|
|
147
|
+
...ngDevMode ? { debugName: "zoomStep" } : /* istanbul ignore next */ {},
|
|
148
|
+
transform: numberAttribute
|
|
149
|
+
});
|
|
150
|
+
minZoom = input(.5, {
|
|
151
|
+
...ngDevMode ? { debugName: "minZoom" } : /* istanbul ignore next */ {},
|
|
152
|
+
transform: numberAttribute
|
|
153
|
+
});
|
|
154
|
+
maxZoom = input(1.5, {
|
|
155
|
+
...ngDevMode ? { debugName: "maxZoom" } : /* istanbul ignore next */ {},
|
|
156
|
+
transform: numberAttribute
|
|
157
|
+
});
|
|
158
|
+
ariaLabel = input(void 0, ...ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []);
|
|
159
|
+
dt = input(void 0, ...ngDevMode ? [{ debugName: "dt" }] : /* istanbul ignore next */ []);
|
|
160
|
+
pt = input(void 0, ...ngDevMode ? [{ debugName: "pt" }] : /* istanbul ignore next */ []);
|
|
161
|
+
ptOptions = input(void 0, ...ngDevMode ? [{ debugName: "ptOptions" }] : /* istanbul ignore next */ []);
|
|
162
|
+
unstyled = input(void 0, {
|
|
163
|
+
...ngDevMode ? { debugName: "unstyled" } : /* istanbul ignore next */ {},
|
|
164
|
+
transform: optionalBoolean
|
|
165
|
+
});
|
|
166
|
+
opened = output();
|
|
167
|
+
closed = output();
|
|
168
|
+
imageError = output();
|
|
169
|
+
translations = injectTranslations();
|
|
170
|
+
isUnstyled = injectUnstyled(this.unstyled);
|
|
171
|
+
passThrough = injectPassThrough("image", this, this.pt, this.ptOptions);
|
|
172
|
+
hostStyle = computed(() => ({
|
|
173
|
+
...toStyleObject(this.dt(), "--tx-image"),
|
|
174
|
+
...this.passThrough().root?.style
|
|
175
|
+
}), ...ngDevMode ? [{ debugName: "hostStyle" }] : /* istanbul ignore next */ []);
|
|
176
|
+
layerStyle = computed(() => ({
|
|
177
|
+
...toStyleObject(this.dt(), "--tx-image"),
|
|
178
|
+
...this.passThrough().mask?.style
|
|
179
|
+
}), ...ngDevMode ? [{ debugName: "layerStyle" }] : /* istanbul ignore next */ []);
|
|
180
|
+
indicatorTemplate = contentChild(TxImageIndicatorTemplate, ...ngDevMode ? [{ debugName: "indicatorTemplate" }] : /* istanbul ignore next */ []);
|
|
181
|
+
previewTemplate = contentChild(TxImagePreviewTemplate, ...ngDevMode ? [{ debugName: "previewTemplate" }] : /* istanbul ignore next */ []);
|
|
182
|
+
layerTemplate = viewChild.required("layer", ...ngDevMode ? [{ debugName: "layerTemplate" }] : /* istanbul ignore next */ []);
|
|
183
|
+
visible = signal(false, ...ngDevMode ? [{ debugName: "visible" }] : /* istanbul ignore next */ []);
|
|
184
|
+
rotation = signal(0, ...ngDevMode ? [{ debugName: "rotation" }] : /* istanbul ignore next */ []);
|
|
185
|
+
scale = signal(1, ...ngDevMode ? [{ debugName: "scale" }] : /* istanbul ignore next */ []);
|
|
186
|
+
offset = signal({
|
|
187
|
+
x: 0,
|
|
188
|
+
y: 0
|
|
189
|
+
}, ...ngDevMode ? [{ debugName: "offset" }] : /* istanbul ignore next */ []);
|
|
190
|
+
panning = signal(false, ...ngDevMode ? [{ debugName: "panning" }] : /* istanbul ignore next */ []);
|
|
191
|
+
fullSrc = computed(() => this.previewSrc() ?? this.src() ?? "", ...ngDevMode ? [{ debugName: "fullSrc" }] : /* istanbul ignore next */ []);
|
|
192
|
+
fullSrcSet = computed(() => this.previewSrc() ? this.previewSrcSet() : this.previewSrcSet() ?? this.srcSet(), ...ngDevMode ? [{ debugName: "fullSrcSet" }] : /* istanbul ignore next */ []);
|
|
193
|
+
fullSizes = computed(() => this.previewSrc() ? this.previewSizes() : this.previewSizes() ?? this.sizes(), ...ngDevMode ? [{ debugName: "fullSizes" }] : /* istanbul ignore next */ []);
|
|
194
|
+
previewLabel = computed(() => this.ariaLabel() ?? this.alt() ?? this.translations().imagePreview, ...ngDevMode ? [{ debugName: "previewLabel" }] : /* istanbul ignore next */ []);
|
|
195
|
+
canZoomIn = computed(() => this.scale() < this.maxZoom() - 1e-6, ...ngDevMode ? [{ debugName: "canZoomIn" }] : /* istanbul ignore next */ []);
|
|
196
|
+
canZoomOut = computed(() => this.scale() > this.minZoom() + 1e-6, ...ngDevMode ? [{ debugName: "canZoomOut" }] : /* istanbul ignore next */ []);
|
|
197
|
+
transform = computed(() => {
|
|
198
|
+
const { x, y } = this.offset();
|
|
199
|
+
return `translate(${x}px, ${y}px) rotate(${this.rotation()}deg) scale(${this.scale()})`;
|
|
200
|
+
}, ...ngDevMode ? [{ debugName: "transform" }] : /* istanbul ignore next */ []);
|
|
201
|
+
previewContext = computed(() => ({
|
|
202
|
+
$implicit: this.fullSrc(),
|
|
203
|
+
src: this.fullSrc(),
|
|
204
|
+
alt: this.alt() ?? "",
|
|
205
|
+
style: { transform: this.transform() },
|
|
206
|
+
close: () => this.close()
|
|
207
|
+
}), ...ngDevMode ? [{ debugName: "previewContext" }] : /* istanbul ignore next */ []);
|
|
208
|
+
constructor() {
|
|
209
|
+
inject(DestroyRef).onDestroy(() => {
|
|
210
|
+
const layer = this.layer;
|
|
211
|
+
this.layer = null;
|
|
212
|
+
layer?.close();
|
|
213
|
+
this.stopPan();
|
|
214
|
+
});
|
|
215
|
+
}
|
|
216
|
+
open() {
|
|
217
|
+
if (this.layer) return;
|
|
218
|
+
this.rotation.set(0);
|
|
219
|
+
this.scale.set(1);
|
|
220
|
+
this.offset.set({
|
|
221
|
+
x: 0,
|
|
222
|
+
y: 0
|
|
223
|
+
});
|
|
224
|
+
this.visible.set(true);
|
|
225
|
+
this.layer = openImageLayer(this.layerTemplate(), {
|
|
226
|
+
injector: this.injector,
|
|
227
|
+
viewContainerRef: this.viewContainerRef,
|
|
228
|
+
focus: ".tx-image-preview__close",
|
|
229
|
+
onEscape: () => this.close(),
|
|
230
|
+
onDetach: () => this.close()
|
|
231
|
+
});
|
|
232
|
+
this.opened.emit();
|
|
233
|
+
}
|
|
234
|
+
close() {
|
|
235
|
+
const layer = this.layer;
|
|
236
|
+
if (!layer) return;
|
|
237
|
+
this.layer = null;
|
|
238
|
+
this.stopPan();
|
|
239
|
+
layer.close().then(() => {
|
|
240
|
+
this.visible.set(false);
|
|
241
|
+
this.closed.emit();
|
|
242
|
+
});
|
|
243
|
+
}
|
|
244
|
+
rotateRight() {
|
|
245
|
+
this.rotation.update((value) => value + 90);
|
|
246
|
+
}
|
|
247
|
+
rotateLeft() {
|
|
248
|
+
this.rotation.update((value) => value - 90);
|
|
249
|
+
}
|
|
250
|
+
zoomIn() {
|
|
251
|
+
this.zoomTo(this.scale() + this.zoomStep());
|
|
252
|
+
}
|
|
253
|
+
zoomOut() {
|
|
254
|
+
this.zoomTo(this.scale() - this.zoomStep());
|
|
255
|
+
}
|
|
256
|
+
resetZoom() {
|
|
257
|
+
this.zoomTo(1);
|
|
258
|
+
}
|
|
259
|
+
onMaskClick(event) {
|
|
260
|
+
if (!event.target.closest(".tx-image-preview__toolbar, .tx-image-preview__original, .tx-image-preview__custom")) this.close();
|
|
261
|
+
}
|
|
262
|
+
onKeydown(event) {
|
|
263
|
+
if (event.target.closest("input, textarea, [contenteditable]")) return;
|
|
264
|
+
const action = event.ctrlKey || event.metaKey || event.altKey ? void 0 : {
|
|
265
|
+
"+": () => this.zoomIn(),
|
|
266
|
+
"=": () => this.zoomIn(),
|
|
267
|
+
"-": () => this.zoomOut(),
|
|
268
|
+
"0": () => this.resetZoom()
|
|
269
|
+
}[event.key];
|
|
270
|
+
if (action) {
|
|
271
|
+
event.preventDefault();
|
|
272
|
+
action();
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
onWheel(event) {
|
|
276
|
+
if (!event.deltaY) return;
|
|
277
|
+
event.preventDefault();
|
|
278
|
+
if (event.deltaY < 0) this.zoomIn();
|
|
279
|
+
else this.zoomOut();
|
|
280
|
+
}
|
|
281
|
+
onDoubleClick() {
|
|
282
|
+
this.zoomTo(this.scale() > 1 ? 1 : this.maxZoom());
|
|
283
|
+
}
|
|
284
|
+
startPan(event) {
|
|
285
|
+
if (event.button !== 0 || this.scale() <= 1) return;
|
|
286
|
+
event.preventDefault();
|
|
287
|
+
const { x, y } = this.offset();
|
|
288
|
+
this.pan = {
|
|
289
|
+
pointerId: event.pointerId,
|
|
290
|
+
x: event.clientX,
|
|
291
|
+
y: event.clientY,
|
|
292
|
+
originX: x,
|
|
293
|
+
originY: y,
|
|
294
|
+
moved: false
|
|
295
|
+
};
|
|
296
|
+
this.document.addEventListener("pointermove", this.movePan);
|
|
297
|
+
this.document.addEventListener("pointerup", this.endPan);
|
|
298
|
+
this.document.addEventListener("pointercancel", this.endPan);
|
|
299
|
+
}
|
|
300
|
+
imageFailed(event) {
|
|
301
|
+
this.imageError.emit(event);
|
|
302
|
+
}
|
|
303
|
+
movePan = (event) => {
|
|
304
|
+
const pan = this.pan;
|
|
305
|
+
if (!pan || event.pointerId !== pan.pointerId) return;
|
|
306
|
+
const dx = event.clientX - pan.x;
|
|
307
|
+
const dy = event.clientY - pan.y;
|
|
308
|
+
if (!pan.moved && Math.hypot(dx, dy) < PAN_THRESHOLD) return;
|
|
309
|
+
pan.moved = true;
|
|
310
|
+
this.panning.set(true);
|
|
311
|
+
this.offset.set({
|
|
312
|
+
x: pan.originX + dx,
|
|
313
|
+
y: pan.originY + dy
|
|
314
|
+
});
|
|
315
|
+
};
|
|
316
|
+
endPan = () => {
|
|
317
|
+
this.stopPan();
|
|
318
|
+
};
|
|
319
|
+
stopPan() {
|
|
320
|
+
this.pan = null;
|
|
321
|
+
this.panning.set(false);
|
|
322
|
+
this.document.removeEventListener("pointermove", this.movePan);
|
|
323
|
+
this.document.removeEventListener("pointerup", this.endPan);
|
|
324
|
+
this.document.removeEventListener("pointercancel", this.endPan);
|
|
325
|
+
}
|
|
326
|
+
zoomTo(value) {
|
|
327
|
+
const next = Math.round(Math.min(Math.max(value, this.minZoom()), this.maxZoom()) * 1e3) / 1e3;
|
|
328
|
+
this.scale.set(next);
|
|
329
|
+
if (next <= 1) this.offset.set({
|
|
330
|
+
x: 0,
|
|
331
|
+
y: 0
|
|
332
|
+
});
|
|
333
|
+
}
|
|
334
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
335
|
+
minVersion: "12.0.0",
|
|
336
|
+
version: "22.2.3",
|
|
337
|
+
ngImport: i0,
|
|
338
|
+
type: TxImage,
|
|
339
|
+
deps: [],
|
|
340
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
341
|
+
});
|
|
342
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
343
|
+
minVersion: "17.0.0",
|
|
344
|
+
version: "22.2.3",
|
|
345
|
+
type: TxImage,
|
|
346
|
+
isStandalone: true,
|
|
347
|
+
selector: "tx-image",
|
|
348
|
+
inputs: {
|
|
349
|
+
src: {
|
|
350
|
+
classPropertyName: "src",
|
|
351
|
+
publicName: "src",
|
|
352
|
+
isSignal: true,
|
|
353
|
+
isRequired: false,
|
|
354
|
+
transformFunction: null
|
|
355
|
+
},
|
|
356
|
+
srcSet: {
|
|
357
|
+
classPropertyName: "srcSet",
|
|
358
|
+
publicName: "srcSet",
|
|
359
|
+
isSignal: true,
|
|
360
|
+
isRequired: false,
|
|
361
|
+
transformFunction: null
|
|
362
|
+
},
|
|
363
|
+
sizes: {
|
|
364
|
+
classPropertyName: "sizes",
|
|
365
|
+
publicName: "sizes",
|
|
366
|
+
isSignal: true,
|
|
367
|
+
isRequired: false,
|
|
368
|
+
transformFunction: null
|
|
369
|
+
},
|
|
370
|
+
previewSrc: {
|
|
371
|
+
classPropertyName: "previewSrc",
|
|
372
|
+
publicName: "previewSrc",
|
|
373
|
+
isSignal: true,
|
|
374
|
+
isRequired: false,
|
|
375
|
+
transformFunction: null
|
|
376
|
+
},
|
|
377
|
+
previewSrcSet: {
|
|
378
|
+
classPropertyName: "previewSrcSet",
|
|
379
|
+
publicName: "previewSrcSet",
|
|
380
|
+
isSignal: true,
|
|
381
|
+
isRequired: false,
|
|
382
|
+
transformFunction: null
|
|
383
|
+
},
|
|
384
|
+
previewSizes: {
|
|
385
|
+
classPropertyName: "previewSizes",
|
|
386
|
+
publicName: "previewSizes",
|
|
387
|
+
isSignal: true,
|
|
388
|
+
isRequired: false,
|
|
389
|
+
transformFunction: null
|
|
390
|
+
},
|
|
391
|
+
alt: {
|
|
392
|
+
classPropertyName: "alt",
|
|
393
|
+
publicName: "alt",
|
|
394
|
+
isSignal: true,
|
|
395
|
+
isRequired: false,
|
|
396
|
+
transformFunction: null
|
|
397
|
+
},
|
|
398
|
+
width: {
|
|
399
|
+
classPropertyName: "width",
|
|
400
|
+
publicName: "width",
|
|
401
|
+
isSignal: true,
|
|
402
|
+
isRequired: false,
|
|
403
|
+
transformFunction: null
|
|
404
|
+
},
|
|
405
|
+
height: {
|
|
406
|
+
classPropertyName: "height",
|
|
407
|
+
publicName: "height",
|
|
408
|
+
isSignal: true,
|
|
409
|
+
isRequired: false,
|
|
410
|
+
transformFunction: null
|
|
411
|
+
},
|
|
412
|
+
loading: {
|
|
413
|
+
classPropertyName: "loading",
|
|
414
|
+
publicName: "loading",
|
|
415
|
+
isSignal: true,
|
|
416
|
+
isRequired: false,
|
|
417
|
+
transformFunction: null
|
|
418
|
+
},
|
|
419
|
+
preview: {
|
|
420
|
+
classPropertyName: "preview",
|
|
421
|
+
publicName: "preview",
|
|
422
|
+
isSignal: true,
|
|
423
|
+
isRequired: false,
|
|
424
|
+
transformFunction: null
|
|
425
|
+
},
|
|
426
|
+
previewIcon: {
|
|
427
|
+
classPropertyName: "previewIcon",
|
|
428
|
+
publicName: "previewIcon",
|
|
429
|
+
isSignal: true,
|
|
430
|
+
isRequired: false,
|
|
431
|
+
transformFunction: null
|
|
432
|
+
},
|
|
433
|
+
zoomStep: {
|
|
434
|
+
classPropertyName: "zoomStep",
|
|
435
|
+
publicName: "zoomStep",
|
|
436
|
+
isSignal: true,
|
|
437
|
+
isRequired: false,
|
|
438
|
+
transformFunction: null
|
|
439
|
+
},
|
|
440
|
+
minZoom: {
|
|
441
|
+
classPropertyName: "minZoom",
|
|
442
|
+
publicName: "minZoom",
|
|
443
|
+
isSignal: true,
|
|
444
|
+
isRequired: false,
|
|
445
|
+
transformFunction: null
|
|
446
|
+
},
|
|
447
|
+
maxZoom: {
|
|
448
|
+
classPropertyName: "maxZoom",
|
|
449
|
+
publicName: "maxZoom",
|
|
450
|
+
isSignal: true,
|
|
451
|
+
isRequired: false,
|
|
452
|
+
transformFunction: null
|
|
453
|
+
},
|
|
454
|
+
ariaLabel: {
|
|
455
|
+
classPropertyName: "ariaLabel",
|
|
456
|
+
publicName: "ariaLabel",
|
|
457
|
+
isSignal: true,
|
|
458
|
+
isRequired: false,
|
|
459
|
+
transformFunction: null
|
|
460
|
+
},
|
|
461
|
+
dt: {
|
|
462
|
+
classPropertyName: "dt",
|
|
463
|
+
publicName: "dt",
|
|
464
|
+
isSignal: true,
|
|
465
|
+
isRequired: false,
|
|
466
|
+
transformFunction: null
|
|
467
|
+
},
|
|
468
|
+
pt: {
|
|
469
|
+
classPropertyName: "pt",
|
|
470
|
+
publicName: "pt",
|
|
471
|
+
isSignal: true,
|
|
472
|
+
isRequired: false,
|
|
473
|
+
transformFunction: null
|
|
474
|
+
},
|
|
475
|
+
ptOptions: {
|
|
476
|
+
classPropertyName: "ptOptions",
|
|
477
|
+
publicName: "ptOptions",
|
|
478
|
+
isSignal: true,
|
|
479
|
+
isRequired: false,
|
|
480
|
+
transformFunction: null
|
|
481
|
+
},
|
|
482
|
+
unstyled: {
|
|
483
|
+
classPropertyName: "unstyled",
|
|
484
|
+
publicName: "unstyled",
|
|
485
|
+
isSignal: true,
|
|
486
|
+
isRequired: false,
|
|
487
|
+
transformFunction: null
|
|
488
|
+
}
|
|
489
|
+
},
|
|
490
|
+
outputs: {
|
|
491
|
+
opened: "opened",
|
|
492
|
+
closed: "closed",
|
|
493
|
+
imageError: "imageError"
|
|
494
|
+
},
|
|
495
|
+
host: {
|
|
496
|
+
properties: {
|
|
497
|
+
"class": "passThrough().root?.class",
|
|
498
|
+
"style": "hostStyle()",
|
|
499
|
+
"attr.data-styled": "!isUnstyled() || null",
|
|
500
|
+
"class.tx-image--preview": "preview()",
|
|
501
|
+
"class.tx-image--open": "visible()"
|
|
502
|
+
},
|
|
503
|
+
classAttribute: "tx-image"
|
|
504
|
+
},
|
|
505
|
+
queries: [{
|
|
506
|
+
propertyName: "indicatorTemplate",
|
|
507
|
+
first: true,
|
|
508
|
+
predicate: TxImageIndicatorTemplate,
|
|
509
|
+
descendants: true,
|
|
510
|
+
isSignal: true
|
|
511
|
+
}, {
|
|
512
|
+
propertyName: "previewTemplate",
|
|
513
|
+
first: true,
|
|
514
|
+
predicate: TxImagePreviewTemplate,
|
|
515
|
+
descendants: true,
|
|
516
|
+
isSignal: true
|
|
517
|
+
}],
|
|
518
|
+
viewQueries: [{
|
|
519
|
+
propertyName: "layerTemplate",
|
|
520
|
+
first: true,
|
|
521
|
+
predicate: ["layer"],
|
|
522
|
+
descendants: true,
|
|
523
|
+
isSignal: true
|
|
524
|
+
}],
|
|
525
|
+
ngImport: i0,
|
|
526
|
+
template: "<img\n class=\"tx-image__image\"\n [class]=\"passThrough().image?.class\"\n [style]=\"passThrough().image?.style\"\n [attr.src]=\"src() ?? null\"\n [attr.srcset]=\"srcSet() ?? null\"\n [attr.sizes]=\"sizes() ?? null\"\n [attr.alt]=\"alt() ?? ''\"\n [attr.width]=\"width() ?? null\"\n [attr.height]=\"height() ?? null\"\n [attr.loading]=\"loading() ?? null\"\n (error)=\"imageFailed($event)\"\n/>\n@if (preview()) {\n <button\n type=\"button\"\n class=\"tx-image__preview\"\n [class]=\"passThrough().previewButton?.class\"\n [style]=\"passThrough().previewButton?.style\"\n [attr.aria-label]=\"translations().zoomImage\"\n aria-haspopup=\"dialog\"\n [attr.aria-expanded]=\"visible()\"\n (click)=\"open()\"\n >\n @if (indicatorTemplate(); as indicator) {\n <ng-container [ngTemplateOutlet]=\"indicator.template\" [ngTemplateOutletContext]=\"{ $implicit: fullSrc() }\" />\n } @else {\n <tx-icon class=\"tx-image__preview-icon\" [class]=\"passThrough().previewIcon?.class\" [style]=\"passThrough().previewIcon?.style\" [name]=\"previewIcon()\" />\n }\n </button>\n}\n\n<ng-template #layer>\n <div\n class=\"tx-image-preview\"\n role=\"dialog\"\n aria-modal=\"true\"\n [class]=\"passThrough().mask?.class\"\n [style]=\"layerStyle()\"\n [attr.data-styled]=\"!isUnstyled() || null\"\n [attr.aria-label]=\"previewLabel()\"\n (click)=\"onMaskClick($event)\"\n (keydown)=\"onKeydown($event)\"\n >\n <div class=\"tx-image-preview__backdrop\" aria-hidden=\"true\"></div>\n <div\n class=\"tx-image-preview__toolbar\"\n role=\"toolbar\"\n [class]=\"passThrough().toolbar?.class\"\n [style]=\"passThrough().toolbar?.style\"\n [attr.aria-label]=\"previewLabel()\"\n >\n <button type=\"button\" class=\"tx-image-preview__action\" [class]=\"passThrough().action?.class\" [style]=\"passThrough().action?.style\" [attr.aria-label]=\"translations().rotateRight\" (click)=\"rotateRight()\">\n <tx-icon name=\"refresh\" />\n </button>\n <button type=\"button\" class=\"tx-image-preview__action\" [class]=\"passThrough().action?.class\" [style]=\"passThrough().action?.style\" [attr.aria-label]=\"translations().rotateLeft\" (click)=\"rotateLeft()\">\n <tx-icon name=\"undo\" />\n </button>\n <button\n type=\"button\"\n class=\"tx-image-preview__action\"\n [class]=\"passThrough().action?.class\"\n [style]=\"passThrough().action?.style\"\n [attr.aria-label]=\"translations().zoomOut\"\n [disabled]=\"!canZoomOut()\"\n (click)=\"zoomOut()\"\n >\n <tx-icon name=\"search-minus\" />\n </button>\n <button\n type=\"button\"\n class=\"tx-image-preview__action\"\n [class]=\"passThrough().action?.class\"\n [style]=\"passThrough().action?.style\"\n [attr.aria-label]=\"translations().zoomIn\"\n [disabled]=\"!canZoomIn()\"\n (click)=\"zoomIn()\"\n >\n <tx-icon name=\"search-plus\" />\n </button>\n <button\n type=\"button\"\n class=\"tx-image-preview__action tx-image-preview__close\"\n [class]=\"passThrough().action?.class\"\n [style]=\"passThrough().action?.style\"\n [attr.aria-label]=\"translations().close\"\n (click)=\"close()\"\n >\n <tx-icon name=\"times\" />\n </button>\n </div>\n <div class=\"tx-image-preview__stage\">\n @if (previewTemplate(); as custom) {\n <div class=\"tx-image-preview__custom\">\n <ng-container [ngTemplateOutlet]=\"custom.template\" [ngTemplateOutletContext]=\"previewContext()\" />\n </div>\n } @else {\n <img\n class=\"tx-image-preview__original\"\n draggable=\"false\"\n [class]=\"passThrough().original?.class\"\n [style]=\"passThrough().original?.style\"\n [class.tx-image-preview__original--zoomed]=\"scale() > 1\"\n [class.tx-image-preview__original--panning]=\"panning()\"\n [style.transform]=\"transform()\"\n [attr.src]=\"fullSrc()\"\n [attr.srcset]=\"fullSrcSet() ?? null\"\n [attr.sizes]=\"fullSizes() ?? null\"\n [attr.alt]=\"alt() ?? ''\"\n (wheel)=\"onWheel($event)\"\n (dblclick)=\"onDoubleClick()\"\n (pointerdown)=\"startPan($event)\"\n />\n }\n </div>\n </div>\n</ng-template>\n",
|
|
527
|
+
styles: [":host{position:relative;display:inline-flex;max-width:100%;vertical-align:top}.tx-image__image{display:block;max-width:100%;height:auto}.tx-image__preview{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;margin:0;padding:0;border:0;font:inherit;cursor:zoom-in}:host([data-styled]) .tx-image__preview{border-radius:inherit;background:var(--tx-image-preview-mask-background);color:var(--tx-image-preview-mask-color);opacity:0;transition:opacity var(--tx-image-transition-duration) var(--tx-image-easing)}:host([data-styled]) .tx-image__preview:hover,:host([data-styled]) .tx-image__preview:focus-visible{opacity:1}:host([data-styled]) .tx-image__preview:focus-visible{outline:var(--tx-image-action-focus-ring-width) solid var(--tx-image-action-focus-ring-color);outline-offset:var(--tx-image-action-focus-ring-offset)}:host([data-styled]) .tx-image__preview-icon{font-size:var(--tx-image-preview-icon-size)}.tx-image-preview{position:relative;width:100%;height:100%}.tx-image-preview__toolbar{position:absolute;z-index:1;display:flex;align-items:center}.tx-image-preview__action{display:inline-flex;align-items:center;justify-content:center;margin:0;padding:0;border:0;font:inherit;cursor:pointer}.tx-image-preview__action:disabled{cursor:default}.tx-image-preview__backdrop{position:absolute;inset:0}.tx-image-preview__stage{position:relative;display:flex;align-items:center;justify-content:center;width:100%;height:100%;overflow:hidden}.tx-image-preview__original{display:block;max-width:100%;max-height:100%;-webkit-user-select:none;user-select:none;touch-action:none}.tx-image-preview__original--zoomed{cursor:grab}.tx-image-preview__original--panning{cursor:grabbing}.tx-image-preview[data-styled] .tx-image-preview__backdrop{background:var(--tx-image-preview-background);animation:tx-image-fade-in calc(var(--tx-image-transition-duration) * 1.5) var(--tx-image-easing)}.tx-image-preview[data-styled].tx-image-layer--leaving .tx-image-preview__backdrop,.tx-image-preview[data-styled].tx-image-layer--leaving .tx-image-preview__toolbar{animation:tx-image-fade-out var(--tx-image-transition-duration) ease-in forwards}.tx-image-preview[data-styled] .tx-image-preview__toolbar{top:var(--tx-image-toolbar-top);right:var(--tx-image-toolbar-right);gap:var(--tx-image-toolbar-gap);padding:var(--tx-image-toolbar-padding);border:var(--tx-image-toolbar-border-width) solid var(--tx-image-toolbar-border-color);border-radius:var(--tx-image-toolbar-border-radius);background:var(--tx-image-toolbar-background);-webkit-backdrop-filter:blur(var(--tx-image-toolbar-blur));backdrop-filter:blur(var(--tx-image-toolbar-blur));animation:tx-image-toolbar-in calc(var(--tx-image-transition-duration) * 2) var(--tx-image-easing)}.tx-image-preview[data-styled] .tx-image-preview__action{width:var(--tx-image-action-size);height:var(--tx-image-action-size);border-radius:var(--tx-image-action-border-radius);background:transparent;color:var(--tx-image-action-color);font-size:var(--tx-image-action-icon-size);transition:background-color var(--tx-image-transition-duration) var(--tx-image-easing),color var(--tx-image-transition-duration) var(--tx-image-easing)}.tx-image-preview[data-styled] .tx-image-preview__action:not(:disabled):hover{background:var(--tx-image-action-hover-background);color:var(--tx-image-action-hover-color)}.tx-image-preview[data-styled] .tx-image-preview__action:disabled{opacity:var(--tx-image-action-disabled-opacity)}.tx-image-preview[data-styled] .tx-image-preview__action:focus-visible{outline:var(--tx-image-action-focus-ring-width) solid var(--tx-image-action-focus-ring-color);outline-offset:var(--tx-image-action-focus-ring-offset)}.tx-image-preview[data-styled] .tx-image-preview__stage{box-sizing:border-box;padding:calc(var(--tx-image-toolbar-top) * 2 + var(--tx-image-action-size) + var(--tx-image-toolbar-padding) * 2) var(--tx-image-toolbar-right)}.tx-image-preview[data-styled] .tx-image-preview__custom{animation:tx-image-zoom-in calc(var(--tx-image-transition-duration) * 2) cubic-bezier(.16,1,.3,1)}.tx-image-preview[data-styled].tx-image-layer--leaving .tx-image-preview__custom{animation:tx-image-zoom-out var(--tx-image-transition-duration) ease-in forwards}.tx-image-preview[data-styled] .tx-image-preview__original{transition:transform var(--tx-image-transition-duration) var(--tx-image-easing);animation:tx-image-zoom-in calc(var(--tx-image-transition-duration) * 2) cubic-bezier(.16,1,.3,1)}.tx-image-preview[data-styled] .tx-image-preview__original--panning{transition:none}.tx-image-preview[data-styled].tx-image-layer--leaving .tx-image-preview__original{animation:tx-image-zoom-out var(--tx-image-transition-duration) ease-in forwards}@keyframes tx-image-fade-in{0%{opacity:0}}@keyframes tx-image-fade-out{to{opacity:0}}@keyframes tx-image-toolbar-in{0%{opacity:0;translate:0 -6px}}@keyframes tx-image-zoom-in{0%{opacity:0;scale:.7}}@keyframes tx-image-zoom-out{to{opacity:0;scale:.7}}@media(prefers-reduced-motion:reduce){:host([data-styled]) .tx-image__preview,.tx-image-preview[data-styled] .tx-image-preview__backdrop,.tx-image-preview[data-styled] .tx-image-preview__toolbar,.tx-image-preview[data-styled].tx-image-layer--leaving .tx-image-preview__backdrop,.tx-image-preview[data-styled].tx-image-layer--leaving .tx-image-preview__toolbar,.tx-image-preview[data-styled] .tx-image-preview__action,.tx-image-preview[data-styled] .tx-image-preview__original,.tx-image-preview[data-styled] .tx-image-preview__custom,.tx-image-preview[data-styled].tx-image-layer--leaving .tx-image-preview__custom,.tx-image-preview[data-styled].tx-image-layer--leaving,.tx-image-preview[data-styled].tx-image-layer--leaving .tx-image-preview__original{transition:none;animation:none}}\n"],
|
|
528
|
+
dependencies: [{
|
|
529
|
+
kind: "directive",
|
|
530
|
+
type: NgTemplateOutlet,
|
|
531
|
+
selector: "[ngTemplateOutlet]",
|
|
532
|
+
inputs: [
|
|
533
|
+
"ngTemplateOutletContext",
|
|
534
|
+
"ngTemplateOutlet",
|
|
535
|
+
"ngTemplateOutletInjector"
|
|
536
|
+
]
|
|
537
|
+
}, {
|
|
538
|
+
kind: "component",
|
|
539
|
+
type: TxIcon,
|
|
540
|
+
selector: "tx-icon",
|
|
541
|
+
inputs: ["name"]
|
|
542
|
+
}],
|
|
543
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
544
|
+
});
|
|
545
|
+
};
|
|
546
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
547
|
+
minVersion: "12.0.0",
|
|
548
|
+
version: "22.2.3",
|
|
549
|
+
ngImport: i0,
|
|
550
|
+
type: TxImage,
|
|
551
|
+
decorators: [{
|
|
552
|
+
type: Component,
|
|
553
|
+
args: [{
|
|
554
|
+
selector: "tx-image",
|
|
555
|
+
imports: [NgTemplateOutlet, TxIcon],
|
|
556
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
557
|
+
host: {
|
|
558
|
+
class: "tx-image",
|
|
559
|
+
"[class]": "passThrough().root?.class",
|
|
560
|
+
"[style]": "hostStyle()",
|
|
561
|
+
"[attr.data-styled]": "!isUnstyled() || null",
|
|
562
|
+
"[class.tx-image--preview]": "preview()",
|
|
563
|
+
"[class.tx-image--open]": "visible()"
|
|
564
|
+
},
|
|
565
|
+
template: "<img\n class=\"tx-image__image\"\n [class]=\"passThrough().image?.class\"\n [style]=\"passThrough().image?.style\"\n [attr.src]=\"src() ?? null\"\n [attr.srcset]=\"srcSet() ?? null\"\n [attr.sizes]=\"sizes() ?? null\"\n [attr.alt]=\"alt() ?? ''\"\n [attr.width]=\"width() ?? null\"\n [attr.height]=\"height() ?? null\"\n [attr.loading]=\"loading() ?? null\"\n (error)=\"imageFailed($event)\"\n/>\n@if (preview()) {\n <button\n type=\"button\"\n class=\"tx-image__preview\"\n [class]=\"passThrough().previewButton?.class\"\n [style]=\"passThrough().previewButton?.style\"\n [attr.aria-label]=\"translations().zoomImage\"\n aria-haspopup=\"dialog\"\n [attr.aria-expanded]=\"visible()\"\n (click)=\"open()\"\n >\n @if (indicatorTemplate(); as indicator) {\n <ng-container [ngTemplateOutlet]=\"indicator.template\" [ngTemplateOutletContext]=\"{ $implicit: fullSrc() }\" />\n } @else {\n <tx-icon class=\"tx-image__preview-icon\" [class]=\"passThrough().previewIcon?.class\" [style]=\"passThrough().previewIcon?.style\" [name]=\"previewIcon()\" />\n }\n </button>\n}\n\n<ng-template #layer>\n <div\n class=\"tx-image-preview\"\n role=\"dialog\"\n aria-modal=\"true\"\n [class]=\"passThrough().mask?.class\"\n [style]=\"layerStyle()\"\n [attr.data-styled]=\"!isUnstyled() || null\"\n [attr.aria-label]=\"previewLabel()\"\n (click)=\"onMaskClick($event)\"\n (keydown)=\"onKeydown($event)\"\n >\n <div class=\"tx-image-preview__backdrop\" aria-hidden=\"true\"></div>\n <div\n class=\"tx-image-preview__toolbar\"\n role=\"toolbar\"\n [class]=\"passThrough().toolbar?.class\"\n [style]=\"passThrough().toolbar?.style\"\n [attr.aria-label]=\"previewLabel()\"\n >\n <button type=\"button\" class=\"tx-image-preview__action\" [class]=\"passThrough().action?.class\" [style]=\"passThrough().action?.style\" [attr.aria-label]=\"translations().rotateRight\" (click)=\"rotateRight()\">\n <tx-icon name=\"refresh\" />\n </button>\n <button type=\"button\" class=\"tx-image-preview__action\" [class]=\"passThrough().action?.class\" [style]=\"passThrough().action?.style\" [attr.aria-label]=\"translations().rotateLeft\" (click)=\"rotateLeft()\">\n <tx-icon name=\"undo\" />\n </button>\n <button\n type=\"button\"\n class=\"tx-image-preview__action\"\n [class]=\"passThrough().action?.class\"\n [style]=\"passThrough().action?.style\"\n [attr.aria-label]=\"translations().zoomOut\"\n [disabled]=\"!canZoomOut()\"\n (click)=\"zoomOut()\"\n >\n <tx-icon name=\"search-minus\" />\n </button>\n <button\n type=\"button\"\n class=\"tx-image-preview__action\"\n [class]=\"passThrough().action?.class\"\n [style]=\"passThrough().action?.style\"\n [attr.aria-label]=\"translations().zoomIn\"\n [disabled]=\"!canZoomIn()\"\n (click)=\"zoomIn()\"\n >\n <tx-icon name=\"search-plus\" />\n </button>\n <button\n type=\"button\"\n class=\"tx-image-preview__action tx-image-preview__close\"\n [class]=\"passThrough().action?.class\"\n [style]=\"passThrough().action?.style\"\n [attr.aria-label]=\"translations().close\"\n (click)=\"close()\"\n >\n <tx-icon name=\"times\" />\n </button>\n </div>\n <div class=\"tx-image-preview__stage\">\n @if (previewTemplate(); as custom) {\n <div class=\"tx-image-preview__custom\">\n <ng-container [ngTemplateOutlet]=\"custom.template\" [ngTemplateOutletContext]=\"previewContext()\" />\n </div>\n } @else {\n <img\n class=\"tx-image-preview__original\"\n draggable=\"false\"\n [class]=\"passThrough().original?.class\"\n [style]=\"passThrough().original?.style\"\n [class.tx-image-preview__original--zoomed]=\"scale() > 1\"\n [class.tx-image-preview__original--panning]=\"panning()\"\n [style.transform]=\"transform()\"\n [attr.src]=\"fullSrc()\"\n [attr.srcset]=\"fullSrcSet() ?? null\"\n [attr.sizes]=\"fullSizes() ?? null\"\n [attr.alt]=\"alt() ?? ''\"\n (wheel)=\"onWheel($event)\"\n (dblclick)=\"onDoubleClick()\"\n (pointerdown)=\"startPan($event)\"\n />\n }\n </div>\n </div>\n</ng-template>\n",
|
|
566
|
+
styles: [":host{position:relative;display:inline-flex;max-width:100%;vertical-align:top}.tx-image__image{display:block;max-width:100%;height:auto}.tx-image__preview{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;margin:0;padding:0;border:0;font:inherit;cursor:zoom-in}:host([data-styled]) .tx-image__preview{border-radius:inherit;background:var(--tx-image-preview-mask-background);color:var(--tx-image-preview-mask-color);opacity:0;transition:opacity var(--tx-image-transition-duration) var(--tx-image-easing)}:host([data-styled]) .tx-image__preview:hover,:host([data-styled]) .tx-image__preview:focus-visible{opacity:1}:host([data-styled]) .tx-image__preview:focus-visible{outline:var(--tx-image-action-focus-ring-width) solid var(--tx-image-action-focus-ring-color);outline-offset:var(--tx-image-action-focus-ring-offset)}:host([data-styled]) .tx-image__preview-icon{font-size:var(--tx-image-preview-icon-size)}.tx-image-preview{position:relative;width:100%;height:100%}.tx-image-preview__toolbar{position:absolute;z-index:1;display:flex;align-items:center}.tx-image-preview__action{display:inline-flex;align-items:center;justify-content:center;margin:0;padding:0;border:0;font:inherit;cursor:pointer}.tx-image-preview__action:disabled{cursor:default}.tx-image-preview__backdrop{position:absolute;inset:0}.tx-image-preview__stage{position:relative;display:flex;align-items:center;justify-content:center;width:100%;height:100%;overflow:hidden}.tx-image-preview__original{display:block;max-width:100%;max-height:100%;-webkit-user-select:none;user-select:none;touch-action:none}.tx-image-preview__original--zoomed{cursor:grab}.tx-image-preview__original--panning{cursor:grabbing}.tx-image-preview[data-styled] .tx-image-preview__backdrop{background:var(--tx-image-preview-background);animation:tx-image-fade-in calc(var(--tx-image-transition-duration) * 1.5) var(--tx-image-easing)}.tx-image-preview[data-styled].tx-image-layer--leaving .tx-image-preview__backdrop,.tx-image-preview[data-styled].tx-image-layer--leaving .tx-image-preview__toolbar{animation:tx-image-fade-out var(--tx-image-transition-duration) ease-in forwards}.tx-image-preview[data-styled] .tx-image-preview__toolbar{top:var(--tx-image-toolbar-top);right:var(--tx-image-toolbar-right);gap:var(--tx-image-toolbar-gap);padding:var(--tx-image-toolbar-padding);border:var(--tx-image-toolbar-border-width) solid var(--tx-image-toolbar-border-color);border-radius:var(--tx-image-toolbar-border-radius);background:var(--tx-image-toolbar-background);-webkit-backdrop-filter:blur(var(--tx-image-toolbar-blur));backdrop-filter:blur(var(--tx-image-toolbar-blur));animation:tx-image-toolbar-in calc(var(--tx-image-transition-duration) * 2) var(--tx-image-easing)}.tx-image-preview[data-styled] .tx-image-preview__action{width:var(--tx-image-action-size);height:var(--tx-image-action-size);border-radius:var(--tx-image-action-border-radius);background:transparent;color:var(--tx-image-action-color);font-size:var(--tx-image-action-icon-size);transition:background-color var(--tx-image-transition-duration) var(--tx-image-easing),color var(--tx-image-transition-duration) var(--tx-image-easing)}.tx-image-preview[data-styled] .tx-image-preview__action:not(:disabled):hover{background:var(--tx-image-action-hover-background);color:var(--tx-image-action-hover-color)}.tx-image-preview[data-styled] .tx-image-preview__action:disabled{opacity:var(--tx-image-action-disabled-opacity)}.tx-image-preview[data-styled] .tx-image-preview__action:focus-visible{outline:var(--tx-image-action-focus-ring-width) solid var(--tx-image-action-focus-ring-color);outline-offset:var(--tx-image-action-focus-ring-offset)}.tx-image-preview[data-styled] .tx-image-preview__stage{box-sizing:border-box;padding:calc(var(--tx-image-toolbar-top) * 2 + var(--tx-image-action-size) + var(--tx-image-toolbar-padding) * 2) var(--tx-image-toolbar-right)}.tx-image-preview[data-styled] .tx-image-preview__custom{animation:tx-image-zoom-in calc(var(--tx-image-transition-duration) * 2) cubic-bezier(.16,1,.3,1)}.tx-image-preview[data-styled].tx-image-layer--leaving .tx-image-preview__custom{animation:tx-image-zoom-out var(--tx-image-transition-duration) ease-in forwards}.tx-image-preview[data-styled] .tx-image-preview__original{transition:transform var(--tx-image-transition-duration) var(--tx-image-easing);animation:tx-image-zoom-in calc(var(--tx-image-transition-duration) * 2) cubic-bezier(.16,1,.3,1)}.tx-image-preview[data-styled] .tx-image-preview__original--panning{transition:none}.tx-image-preview[data-styled].tx-image-layer--leaving .tx-image-preview__original{animation:tx-image-zoom-out var(--tx-image-transition-duration) ease-in forwards}@keyframes tx-image-fade-in{0%{opacity:0}}@keyframes tx-image-fade-out{to{opacity:0}}@keyframes tx-image-toolbar-in{0%{opacity:0;translate:0 -6px}}@keyframes tx-image-zoom-in{0%{opacity:0;scale:.7}}@keyframes tx-image-zoom-out{to{opacity:0;scale:.7}}@media(prefers-reduced-motion:reduce){:host([data-styled]) .tx-image__preview,.tx-image-preview[data-styled] .tx-image-preview__backdrop,.tx-image-preview[data-styled] .tx-image-preview__toolbar,.tx-image-preview[data-styled].tx-image-layer--leaving .tx-image-preview__backdrop,.tx-image-preview[data-styled].tx-image-layer--leaving .tx-image-preview__toolbar,.tx-image-preview[data-styled] .tx-image-preview__action,.tx-image-preview[data-styled] .tx-image-preview__original,.tx-image-preview[data-styled] .tx-image-preview__custom,.tx-image-preview[data-styled].tx-image-layer--leaving .tx-image-preview__custom,.tx-image-preview[data-styled].tx-image-layer--leaving,.tx-image-preview[data-styled].tx-image-layer--leaving .tx-image-preview__original{transition:none;animation:none}}\n"]
|
|
567
|
+
}]
|
|
568
|
+
}],
|
|
569
|
+
ctorParameters: () => [],
|
|
570
|
+
propDecorators: {
|
|
571
|
+
src: [{
|
|
572
|
+
type: i0.Input,
|
|
573
|
+
args: [{
|
|
574
|
+
isSignal: true,
|
|
575
|
+
alias: "src",
|
|
576
|
+
required: false
|
|
577
|
+
}]
|
|
578
|
+
}],
|
|
579
|
+
srcSet: [{
|
|
580
|
+
type: i0.Input,
|
|
581
|
+
args: [{
|
|
582
|
+
isSignal: true,
|
|
583
|
+
alias: "srcSet",
|
|
584
|
+
required: false
|
|
585
|
+
}]
|
|
586
|
+
}],
|
|
587
|
+
sizes: [{
|
|
588
|
+
type: i0.Input,
|
|
589
|
+
args: [{
|
|
590
|
+
isSignal: true,
|
|
591
|
+
alias: "sizes",
|
|
592
|
+
required: false
|
|
593
|
+
}]
|
|
594
|
+
}],
|
|
595
|
+
previewSrc: [{
|
|
596
|
+
type: i0.Input,
|
|
597
|
+
args: [{
|
|
598
|
+
isSignal: true,
|
|
599
|
+
alias: "previewSrc",
|
|
600
|
+
required: false
|
|
601
|
+
}]
|
|
602
|
+
}],
|
|
603
|
+
previewSrcSet: [{
|
|
604
|
+
type: i0.Input,
|
|
605
|
+
args: [{
|
|
606
|
+
isSignal: true,
|
|
607
|
+
alias: "previewSrcSet",
|
|
608
|
+
required: false
|
|
609
|
+
}]
|
|
610
|
+
}],
|
|
611
|
+
previewSizes: [{
|
|
612
|
+
type: i0.Input,
|
|
613
|
+
args: [{
|
|
614
|
+
isSignal: true,
|
|
615
|
+
alias: "previewSizes",
|
|
616
|
+
required: false
|
|
617
|
+
}]
|
|
618
|
+
}],
|
|
619
|
+
alt: [{
|
|
620
|
+
type: i0.Input,
|
|
621
|
+
args: [{
|
|
622
|
+
isSignal: true,
|
|
623
|
+
alias: "alt",
|
|
624
|
+
required: false
|
|
625
|
+
}]
|
|
626
|
+
}],
|
|
627
|
+
width: [{
|
|
628
|
+
type: i0.Input,
|
|
629
|
+
args: [{
|
|
630
|
+
isSignal: true,
|
|
631
|
+
alias: "width",
|
|
632
|
+
required: false
|
|
633
|
+
}]
|
|
634
|
+
}],
|
|
635
|
+
height: [{
|
|
636
|
+
type: i0.Input,
|
|
637
|
+
args: [{
|
|
638
|
+
isSignal: true,
|
|
639
|
+
alias: "height",
|
|
640
|
+
required: false
|
|
641
|
+
}]
|
|
642
|
+
}],
|
|
643
|
+
loading: [{
|
|
644
|
+
type: i0.Input,
|
|
645
|
+
args: [{
|
|
646
|
+
isSignal: true,
|
|
647
|
+
alias: "loading",
|
|
648
|
+
required: false
|
|
649
|
+
}]
|
|
650
|
+
}],
|
|
651
|
+
preview: [{
|
|
652
|
+
type: i0.Input,
|
|
653
|
+
args: [{
|
|
654
|
+
isSignal: true,
|
|
655
|
+
alias: "preview",
|
|
656
|
+
required: false
|
|
657
|
+
}]
|
|
658
|
+
}],
|
|
659
|
+
previewIcon: [{
|
|
660
|
+
type: i0.Input,
|
|
661
|
+
args: [{
|
|
662
|
+
isSignal: true,
|
|
663
|
+
alias: "previewIcon",
|
|
664
|
+
required: false
|
|
665
|
+
}]
|
|
666
|
+
}],
|
|
667
|
+
zoomStep: [{
|
|
668
|
+
type: i0.Input,
|
|
669
|
+
args: [{
|
|
670
|
+
isSignal: true,
|
|
671
|
+
alias: "zoomStep",
|
|
672
|
+
required: false
|
|
673
|
+
}]
|
|
674
|
+
}],
|
|
675
|
+
minZoom: [{
|
|
676
|
+
type: i0.Input,
|
|
677
|
+
args: [{
|
|
678
|
+
isSignal: true,
|
|
679
|
+
alias: "minZoom",
|
|
680
|
+
required: false
|
|
681
|
+
}]
|
|
682
|
+
}],
|
|
683
|
+
maxZoom: [{
|
|
684
|
+
type: i0.Input,
|
|
685
|
+
args: [{
|
|
686
|
+
isSignal: true,
|
|
687
|
+
alias: "maxZoom",
|
|
688
|
+
required: false
|
|
689
|
+
}]
|
|
690
|
+
}],
|
|
691
|
+
ariaLabel: [{
|
|
692
|
+
type: i0.Input,
|
|
693
|
+
args: [{
|
|
694
|
+
isSignal: true,
|
|
695
|
+
alias: "ariaLabel",
|
|
696
|
+
required: false
|
|
697
|
+
}]
|
|
698
|
+
}],
|
|
699
|
+
dt: [{
|
|
700
|
+
type: i0.Input,
|
|
701
|
+
args: [{
|
|
702
|
+
isSignal: true,
|
|
703
|
+
alias: "dt",
|
|
704
|
+
required: false
|
|
705
|
+
}]
|
|
706
|
+
}],
|
|
707
|
+
pt: [{
|
|
708
|
+
type: i0.Input,
|
|
709
|
+
args: [{
|
|
710
|
+
isSignal: true,
|
|
711
|
+
alias: "pt",
|
|
712
|
+
required: false
|
|
713
|
+
}]
|
|
714
|
+
}],
|
|
715
|
+
ptOptions: [{
|
|
716
|
+
type: i0.Input,
|
|
717
|
+
args: [{
|
|
718
|
+
isSignal: true,
|
|
719
|
+
alias: "ptOptions",
|
|
720
|
+
required: false
|
|
721
|
+
}]
|
|
722
|
+
}],
|
|
723
|
+
unstyled: [{
|
|
724
|
+
type: i0.Input,
|
|
725
|
+
args: [{
|
|
726
|
+
isSignal: true,
|
|
727
|
+
alias: "unstyled",
|
|
728
|
+
required: false
|
|
729
|
+
}]
|
|
730
|
+
}],
|
|
731
|
+
opened: [{
|
|
732
|
+
type: i0.Output,
|
|
733
|
+
args: ["opened"]
|
|
734
|
+
}],
|
|
735
|
+
closed: [{
|
|
736
|
+
type: i0.Output,
|
|
737
|
+
args: ["closed"]
|
|
738
|
+
}],
|
|
739
|
+
imageError: [{
|
|
740
|
+
type: i0.Output,
|
|
741
|
+
args: ["imageError"]
|
|
742
|
+
}],
|
|
743
|
+
indicatorTemplate: [{
|
|
744
|
+
type: i0.ContentChild,
|
|
745
|
+
args: [i0.forwardRef(() => TxImageIndicatorTemplate), { isSignal: true }]
|
|
746
|
+
}],
|
|
747
|
+
previewTemplate: [{
|
|
748
|
+
type: i0.ContentChild,
|
|
749
|
+
args: [i0.forwardRef(() => TxImagePreviewTemplate), { isSignal: true }]
|
|
750
|
+
}],
|
|
751
|
+
layerTemplate: [{
|
|
752
|
+
type: i0.ViewChild,
|
|
753
|
+
args: ["layer", { isSignal: true }]
|
|
754
|
+
}]
|
|
755
|
+
}
|
|
756
|
+
});
|
|
757
|
+
export { TxImage, TxImageIndicatorTemplate, TxImagePreviewTemplate, openImageLayer };
|
|
758
|
+
|
|
759
|
+
//# sourceMappingURL=tectra-ng-ui-image.mjs.map
|