@wirekyt/angular 0.0.33 → 0.0.35
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/dist/fesm2022/wirekyt-angular-json-tree-view.mjs +0 -5
- package/dist/fesm2022/wirekyt-angular-json-tree-view.mjs.map +1 -1
- package/dist/fesm2022/wirekyt-angular-listbox.mjs +627 -0
- package/dist/fesm2022/wirekyt-angular-listbox.mjs.map +1 -0
- package/dist/fesm2022/wirekyt-angular-marquee.mjs +296 -0
- package/dist/fesm2022/wirekyt-angular-marquee.mjs.map +1 -0
- package/dist/fesm2022/wirekyt-angular-menu.mjs +0 -6
- package/dist/fesm2022/wirekyt-angular-menu.mjs.map +1 -1
- package/dist/fesm2022/wirekyt-angular-navigation-menu.mjs +777 -0
- package/dist/fesm2022/wirekyt-angular-navigation-menu.mjs.map +1 -0
- package/dist/fesm2022/wirekyt-angular-number-input.mjs +467 -0
- package/dist/fesm2022/wirekyt-angular-number-input.mjs.map +1 -0
- package/dist/fesm2022/wirekyt-angular-pagination.mjs +321 -0
- package/dist/fesm2022/wirekyt-angular-pagination.mjs.map +1 -0
- package/dist/fesm2022/wirekyt-angular-password-input.mjs +437 -0
- package/dist/fesm2022/wirekyt-angular-password-input.mjs.map +1 -0
- package/dist/fesm2022/wirekyt-angular-pin-input.mjs +485 -0
- package/dist/fesm2022/wirekyt-angular-pin-input.mjs.map +1 -0
- package/dist/fesm2022/wirekyt-angular-portal.mjs +98 -0
- package/dist/fesm2022/wirekyt-angular-portal.mjs.map +1 -0
- package/dist/fesm2022/wirekyt-angular-progress.mjs +337 -0
- package/dist/fesm2022/wirekyt-angular-progress.mjs.map +1 -0
- package/dist/fesm2022/wirekyt-angular-qr-code.mjs +297 -0
- package/dist/fesm2022/wirekyt-angular-qr-code.mjs.map +1 -0
- package/dist/fesm2022/wirekyt-angular-radio-group.mjs +461 -0
- package/dist/fesm2022/wirekyt-angular-radio-group.mjs.map +1 -0
- package/dist/fesm2022/wirekyt-angular-rating-group.mjs +435 -0
- package/dist/fesm2022/wirekyt-angular-rating-group.mjs.map +1 -0
- package/dist/fesm2022/wirekyt-angular-scroll-area.mjs +276 -0
- package/dist/fesm2022/wirekyt-angular-scroll-area.mjs.map +1 -0
- package/dist/fesm2022/wirekyt-angular-segment-group.mjs +506 -0
- package/dist/fesm2022/wirekyt-angular-segment-group.mjs.map +1 -0
- package/dist/fesm2022/wirekyt-angular-signature-pad.mjs +382 -0
- package/dist/fesm2022/wirekyt-angular-signature-pad.mjs.map +1 -0
- package/dist/fesm2022/wirekyt-angular-slider.mjs +574 -0
- package/dist/fesm2022/wirekyt-angular-slider.mjs.map +1 -0
- package/dist/fesm2022/wirekyt-angular-splitter.mjs +303 -0
- package/dist/fesm2022/wirekyt-angular-splitter.mjs.map +1 -0
- package/dist/fesm2022/wirekyt-angular-steps.mjs +465 -0
- package/dist/fesm2022/wirekyt-angular-steps.mjs.map +1 -0
- package/dist/fesm2022/wirekyt-angular-swap.mjs +192 -0
- package/dist/fesm2022/wirekyt-angular-swap.mjs.map +1 -0
- package/dist/fesm2022/wirekyt-angular-switch.mjs +340 -0
- package/dist/fesm2022/wirekyt-angular-switch.mjs.map +1 -0
- package/dist/fesm2022/wirekyt-angular-tags-input.mjs +645 -0
- package/dist/fesm2022/wirekyt-angular-tags-input.mjs.map +1 -0
- package/dist/fesm2022/wirekyt-angular-timer.mjs +294 -0
- package/dist/fesm2022/wirekyt-angular-timer.mjs.map +1 -0
- package/dist/fesm2022/wirekyt-angular-toggle-group.mjs +194 -0
- package/dist/fesm2022/wirekyt-angular-toggle-group.mjs.map +1 -0
- package/dist/fesm2022/wirekyt-angular-toggle.mjs +170 -0
- package/dist/fesm2022/wirekyt-angular-toggle.mjs.map +1 -0
- package/dist/fesm2022/wirekyt-angular-tour.mjs +806 -0
- package/dist/fesm2022/wirekyt-angular-tour.mjs.map +1 -0
- package/dist/fesm2022/wirekyt-angular.mjs +12 -4
- package/dist/fesm2022/wirekyt-angular.mjs.map +1 -1
- package/dist/package.json +101 -1
- package/dist/types/wirekyt-angular-checkbox.d.ts +1 -1
- package/dist/types/wirekyt-angular-color-picker.d.ts +1 -1
- package/dist/types/wirekyt-angular-combobox.d.ts +1 -1
- package/dist/types/wirekyt-angular-date-picker.d.ts +1 -1
- package/dist/types/wirekyt-angular-json-tree-view.d.ts +0 -5
- package/dist/types/wirekyt-angular-json-tree-view.d.ts.map +1 -1
- package/dist/types/wirekyt-angular-listbox.d.ts +206 -0
- package/dist/types/wirekyt-angular-listbox.d.ts.map +1 -0
- package/dist/types/wirekyt-angular-marquee.d.ts +111 -0
- package/dist/types/wirekyt-angular-marquee.d.ts.map +1 -0
- package/dist/types/wirekyt-angular-menu.d.ts +0 -23
- package/dist/types/wirekyt-angular-menu.d.ts.map +1 -1
- package/dist/types/wirekyt-angular-navigation-menu.d.ts +187 -0
- package/dist/types/wirekyt-angular-navigation-menu.d.ts.map +1 -0
- package/dist/types/wirekyt-angular-number-input.d.ts +143 -0
- package/dist/types/wirekyt-angular-number-input.d.ts.map +1 -0
- package/dist/types/wirekyt-angular-pagination.d.ts +114 -0
- package/dist/types/wirekyt-angular-pagination.d.ts.map +1 -0
- package/dist/types/wirekyt-angular-password-input.d.ts +124 -0
- package/dist/types/wirekyt-angular-password-input.d.ts.map +1 -0
- package/dist/types/wirekyt-angular-pin-input.d.ts +131 -0
- package/dist/types/wirekyt-angular-pin-input.d.ts.map +1 -0
- package/dist/types/wirekyt-angular-portal.d.ts +30 -0
- package/dist/types/wirekyt-angular-portal.d.ts.map +1 -0
- package/dist/types/wirekyt-angular-progress.d.ts +129 -0
- package/dist/types/wirekyt-angular-progress.d.ts.map +1 -0
- package/dist/types/wirekyt-angular-qr-code.d.ts +98 -0
- package/dist/types/wirekyt-angular-qr-code.d.ts.map +1 -0
- package/dist/types/wirekyt-angular-radio-group.d.ts +149 -0
- package/dist/types/wirekyt-angular-radio-group.d.ts.map +1 -0
- package/dist/types/wirekyt-angular-rating-group.d.ts +136 -0
- package/dist/types/wirekyt-angular-rating-group.d.ts.map +1 -0
- package/dist/types/wirekyt-angular-scroll-area.d.ts +106 -0
- package/dist/types/wirekyt-angular-scroll-area.d.ts.map +1 -0
- package/dist/types/wirekyt-angular-segment-group.d.ts +152 -0
- package/dist/types/wirekyt-angular-segment-group.d.ts.map +1 -0
- package/dist/types/wirekyt-angular-signature-pad.d.ts +120 -0
- package/dist/types/wirekyt-angular-signature-pad.d.ts.map +1 -0
- package/dist/types/wirekyt-angular-slider.d.ts +176 -0
- package/dist/types/wirekyt-angular-slider.d.ts.map +1 -0
- package/dist/types/wirekyt-angular-splitter.d.ts +116 -0
- package/dist/types/wirekyt-angular-splitter.d.ts.map +1 -0
- package/dist/types/wirekyt-angular-steps.d.ts +160 -0
- package/dist/types/wirekyt-angular-steps.d.ts.map +1 -0
- package/dist/types/wirekyt-angular-swap.d.ts +86 -0
- package/dist/types/wirekyt-angular-swap.d.ts.map +1 -0
- package/dist/types/wirekyt-angular-switch.d.ts +110 -0
- package/dist/types/wirekyt-angular-switch.d.ts.map +1 -0
- package/dist/types/wirekyt-angular-tags-input.d.ts +193 -0
- package/dist/types/wirekyt-angular-tags-input.d.ts.map +1 -0
- package/dist/types/wirekyt-angular-timer.d.ts +109 -0
- package/dist/types/wirekyt-angular-timer.d.ts.map +1 -0
- package/dist/types/wirekyt-angular-toggle-group.d.ts +81 -0
- package/dist/types/wirekyt-angular-toggle-group.d.ts.map +1 -0
- package/dist/types/wirekyt-angular-toggle.d.ts +69 -0
- package/dist/types/wirekyt-angular-toggle.d.ts.map +1 -0
- package/dist/types/wirekyt-angular-tour.d.ts +209 -0
- package/dist/types/wirekyt-angular-tour.d.ts.map +1 -0
- package/dist/types/wirekyt-angular.d.ts +1 -1
- package/package.json +102 -3
|
@@ -0,0 +1,806 @@
|
|
|
1
|
+
import * as tour from '@wirekyt/dom/machines/tour';
|
|
2
|
+
import { anatomy } from '@wirekyt/dom/machines/tour';
|
|
3
|
+
export { waitForElement, waitForElementValue, waitForPromise } from '@wirekyt/dom/machines/tour';
|
|
4
|
+
import * as i0 from '@angular/core';
|
|
5
|
+
import { InjectionToken, inject, input, model, booleanAttribute, output, EnvironmentInjector, Injector, forwardRef, Directive, computed, TemplateRef, ViewContainerRef, ElementRef, effect, DestroyRef, Renderer2, untracked, signal } from '@angular/core';
|
|
6
|
+
import { injectLocale, injectEnvironment, createId, useMachine, buildRootCarrier, bindProps } from '@wirekyt/angular';
|
|
7
|
+
import { PresenceBase, PRESENCE_CONTEXT, injectPresenceContext, usePresence } from '@wirekyt/angular/presence';
|
|
8
|
+
|
|
9
|
+
const tourAnatomy = anatomy.extendWith("control");
|
|
10
|
+
|
|
11
|
+
const TOUR_CONTEXT = new InjectionToken("WIREKYT.TOUR_CONTEXT");
|
|
12
|
+
function injectTourContext() {
|
|
13
|
+
return inject(TOUR_CONTEXT);
|
|
14
|
+
}
|
|
15
|
+
const TOUR_CONTEXT_CARRIER = new InjectionToken("WIREKYT.TOUR_CONTEXT_CARRIER");
|
|
16
|
+
function injectTourContextCarrier() {
|
|
17
|
+
return inject(TOUR_CONTEXT_CARRIER);
|
|
18
|
+
}
|
|
19
|
+
const TOUR_RENDER_STRATEGY_CONTEXT = new InjectionToken("WIREKYT.TOUR_RENDER_STRATEGY_CONTEXT");
|
|
20
|
+
function injectTourRenderStrategyContext() {
|
|
21
|
+
return inject(TOUR_RENDER_STRATEGY_CONTEXT);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
function useTour(options) {
|
|
25
|
+
const locale = injectLocale();
|
|
26
|
+
const environment = injectEnvironment();
|
|
27
|
+
const fallbackId = createId();
|
|
28
|
+
ensureVisualViewportGlobal();
|
|
29
|
+
return useMachine({
|
|
30
|
+
machine: tour.machine,
|
|
31
|
+
context: () => {
|
|
32
|
+
const props = options.context();
|
|
33
|
+
return {
|
|
34
|
+
...props,
|
|
35
|
+
dir: locale.dir,
|
|
36
|
+
getRootNode: environment.getRootNode,
|
|
37
|
+
id: props.id ?? fallbackId,
|
|
38
|
+
};
|
|
39
|
+
},
|
|
40
|
+
connect: (service, normalize) => tour.connect(service, normalize),
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
function ensureVisualViewportGlobal() {
|
|
44
|
+
if (typeof globalThis.visualViewport !== "undefined")
|
|
45
|
+
return;
|
|
46
|
+
Object.defineProperty(globalThis, "visualViewport", {
|
|
47
|
+
configurable: true,
|
|
48
|
+
writable: true,
|
|
49
|
+
value: null,
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
function waitForEvent(target, event, options) {
|
|
54
|
+
let cleanup;
|
|
55
|
+
let retry;
|
|
56
|
+
let cancelled = false;
|
|
57
|
+
const { predicate, ...listenerOptions } = options ?? {};
|
|
58
|
+
const promise = new Promise((resolve) => {
|
|
59
|
+
const attach = () => {
|
|
60
|
+
if (cancelled)
|
|
61
|
+
return;
|
|
62
|
+
const element = target?.();
|
|
63
|
+
if (!element) {
|
|
64
|
+
retry = setTimeout(attach, 16);
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
const handler = (e) => {
|
|
68
|
+
if (!predicate || predicate(element)) {
|
|
69
|
+
resolve(e);
|
|
70
|
+
cleanup?.();
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
element.addEventListener(event, handler, listenerOptions);
|
|
74
|
+
cleanup = () => {
|
|
75
|
+
element.removeEventListener(event, handler, listenerOptions);
|
|
76
|
+
if (retry !== undefined)
|
|
77
|
+
clearTimeout(retry);
|
|
78
|
+
};
|
|
79
|
+
};
|
|
80
|
+
attach();
|
|
81
|
+
});
|
|
82
|
+
return [
|
|
83
|
+
promise,
|
|
84
|
+
() => {
|
|
85
|
+
cancelled = true;
|
|
86
|
+
cleanup?.();
|
|
87
|
+
if (retry !== undefined)
|
|
88
|
+
clearTimeout(retry);
|
|
89
|
+
},
|
|
90
|
+
];
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
class TourRoot extends PresenceBase {
|
|
94
|
+
id = input(undefined, /* @ts-ignore */
|
|
95
|
+
...(ngDevMode ? [{ debugName: "id" }] : /* istanbul ignore next */ []));
|
|
96
|
+
ids = input(undefined, /* @ts-ignore */
|
|
97
|
+
...(ngDevMode ? [{ debugName: "ids" }] : /* istanbul ignore next */ []));
|
|
98
|
+
steps = input(undefined, /* @ts-ignore */
|
|
99
|
+
...(ngDevMode ? [{ debugName: "steps" }] : /* istanbul ignore next */ []));
|
|
100
|
+
stepId = model(undefined, /* @ts-ignore */
|
|
101
|
+
...(ngDevMode ? [{ debugName: "stepId" }] : /* istanbul ignore next */ []));
|
|
102
|
+
closeOnInteractOutside = input(true, { ...(ngDevMode ? { debugName: "closeOnInteractOutside" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
103
|
+
closeOnEscape = input(true, { ...(ngDevMode ? { debugName: "closeOnEscape" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
104
|
+
keyboardNavigation = input(true, { ...(ngDevMode ? { debugName: "keyboardNavigation" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
105
|
+
preventInteraction = input(false, { ...(ngDevMode ? { debugName: "preventInteraction" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
106
|
+
spotlightOffset = input(undefined, /* @ts-ignore */
|
|
107
|
+
...(ngDevMode ? [{ debugName: "spotlightOffset" }] : /* istanbul ignore next */ []));
|
|
108
|
+
spotlightRadius = input(undefined, /* @ts-ignore */
|
|
109
|
+
...(ngDevMode ? [{ debugName: "spotlightRadius" }] : /* istanbul ignore next */ []));
|
|
110
|
+
translations = input(undefined, /* @ts-ignore */
|
|
111
|
+
...(ngDevMode ? [{ debugName: "translations" }] : /* istanbul ignore next */ []));
|
|
112
|
+
focusOutside = output();
|
|
113
|
+
interactOutside = output();
|
|
114
|
+
pointerDownOutside = output();
|
|
115
|
+
statusChange = output();
|
|
116
|
+
stepChange = output();
|
|
117
|
+
stepsChange = output();
|
|
118
|
+
machine = useTour({
|
|
119
|
+
context: () => ({
|
|
120
|
+
id: this.id(),
|
|
121
|
+
ids: this.ids(),
|
|
122
|
+
steps: this.steps(),
|
|
123
|
+
stepId: this.stepId(),
|
|
124
|
+
closeOnInteractOutside: this.closeOnInteractOutside(),
|
|
125
|
+
closeOnEscape: this.closeOnEscape(),
|
|
126
|
+
keyboardNavigation: this.keyboardNavigation(),
|
|
127
|
+
preventInteraction: this.preventInteraction(),
|
|
128
|
+
spotlightOffset: this.spotlightOffset(),
|
|
129
|
+
spotlightRadius: this.spotlightRadius(),
|
|
130
|
+
translations: this.translations(),
|
|
131
|
+
onFocusOutside: (event) => this.focusOutside.emit(event),
|
|
132
|
+
onInteractOutside: (event) => this.interactOutside.emit(event),
|
|
133
|
+
onPointerDownOutside: (event) => this.pointerDownOutside.emit(event),
|
|
134
|
+
onStatusChange: (details) => this.statusChange.emit(details),
|
|
135
|
+
onStepChange: (details) => {
|
|
136
|
+
const currentStepId = this.stepId();
|
|
137
|
+
if (currentStepId !== details.stepId) {
|
|
138
|
+
this.stepId.set(details.stepId);
|
|
139
|
+
}
|
|
140
|
+
this.stepChange.emit(details);
|
|
141
|
+
},
|
|
142
|
+
onStepsChange: (details) => this.stepsChange.emit(details),
|
|
143
|
+
}),
|
|
144
|
+
});
|
|
145
|
+
state = this.machine.state;
|
|
146
|
+
api = this.machine.api;
|
|
147
|
+
service = this.machine.service;
|
|
148
|
+
send = this.machine.send;
|
|
149
|
+
presence = this.createPresence(() => this.api().open);
|
|
150
|
+
contextCarrier = buildRootCarrier({
|
|
151
|
+
providers: [
|
|
152
|
+
{ provide: PRESENCE_CONTEXT, useValue: this.presence },
|
|
153
|
+
{ provide: TOUR_RENDER_STRATEGY_CONTEXT, useValue: this },
|
|
154
|
+
],
|
|
155
|
+
root: this,
|
|
156
|
+
rootToken: TOUR_CONTEXT,
|
|
157
|
+
originInjector: inject(Injector),
|
|
158
|
+
environmentInjector: inject(EnvironmentInjector),
|
|
159
|
+
});
|
|
160
|
+
getContextCarrier() {
|
|
161
|
+
return this.contextCarrier;
|
|
162
|
+
}
|
|
163
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: TourRoot, deps: null, target: i0.ɵɵFactoryTarget.Directive });
|
|
164
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.1.3", type: TourRoot, isStandalone: true, selector: "[tour-root]", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, ids: { classPropertyName: "ids", publicName: "ids", isSignal: true, isRequired: false, transformFunction: null }, steps: { classPropertyName: "steps", publicName: "steps", isSignal: true, isRequired: false, transformFunction: null }, stepId: { classPropertyName: "stepId", publicName: "stepId", isSignal: true, isRequired: false, transformFunction: null }, closeOnInteractOutside: { classPropertyName: "closeOnInteractOutside", publicName: "closeOnInteractOutside", isSignal: true, isRequired: false, transformFunction: null }, closeOnEscape: { classPropertyName: "closeOnEscape", publicName: "closeOnEscape", isSignal: true, isRequired: false, transformFunction: null }, keyboardNavigation: { classPropertyName: "keyboardNavigation", publicName: "keyboardNavigation", isSignal: true, isRequired: false, transformFunction: null }, preventInteraction: { classPropertyName: "preventInteraction", publicName: "preventInteraction", isSignal: true, isRequired: false, transformFunction: null }, spotlightOffset: { classPropertyName: "spotlightOffset", publicName: "spotlightOffset", isSignal: true, isRequired: false, transformFunction: null }, spotlightRadius: { classPropertyName: "spotlightRadius", publicName: "spotlightRadius", isSignal: true, isRequired: false, transformFunction: null }, translations: { classPropertyName: "translations", publicName: "translations", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { stepId: "stepIdChange", focusOutside: "focusOutside", interactOutside: "interactOutside", pointerDownOutside: "pointerDownOutside", statusChange: "statusChange", stepChange: "stepChange", stepsChange: "stepsChange" }, providers: [
|
|
165
|
+
{
|
|
166
|
+
provide: PRESENCE_CONTEXT,
|
|
167
|
+
useFactory: (root) => root.presence,
|
|
168
|
+
deps: [forwardRef(() => TourRoot)],
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
provide: TOUR_RENDER_STRATEGY_CONTEXT,
|
|
172
|
+
useExisting: forwardRef(() => TourRoot),
|
|
173
|
+
},
|
|
174
|
+
{ provide: TOUR_CONTEXT, useExisting: forwardRef(() => TourRoot) },
|
|
175
|
+
{
|
|
176
|
+
provide: TOUR_CONTEXT_CARRIER,
|
|
177
|
+
useFactory: (root) => root.getContextCarrier(),
|
|
178
|
+
deps: [forwardRef(() => TourRoot)],
|
|
179
|
+
},
|
|
180
|
+
], exportAs: ["tourRoot"], usesInheritance: true, ngImport: i0 });
|
|
181
|
+
}
|
|
182
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: TourRoot, decorators: [{
|
|
183
|
+
type: Directive,
|
|
184
|
+
args: [{
|
|
185
|
+
selector: "[tour-root]",
|
|
186
|
+
standalone: true,
|
|
187
|
+
exportAs: "tourRoot",
|
|
188
|
+
providers: [
|
|
189
|
+
{
|
|
190
|
+
provide: PRESENCE_CONTEXT,
|
|
191
|
+
useFactory: (root) => root.presence,
|
|
192
|
+
deps: [forwardRef(() => TourRoot)],
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
provide: TOUR_RENDER_STRATEGY_CONTEXT,
|
|
196
|
+
useExisting: forwardRef(() => TourRoot),
|
|
197
|
+
},
|
|
198
|
+
{ provide: TOUR_CONTEXT, useExisting: forwardRef(() => TourRoot) },
|
|
199
|
+
{
|
|
200
|
+
provide: TOUR_CONTEXT_CARRIER,
|
|
201
|
+
useFactory: (root) => root.getContextCarrier(),
|
|
202
|
+
deps: [forwardRef(() => TourRoot)],
|
|
203
|
+
},
|
|
204
|
+
],
|
|
205
|
+
}]
|
|
206
|
+
}], propDecorators: { id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }], ids: [{ type: i0.Input, args: [{ isSignal: true, alias: "ids", required: false }] }], steps: [{ type: i0.Input, args: [{ isSignal: true, alias: "steps", required: false }] }], stepId: [{ type: i0.Input, args: [{ isSignal: true, alias: "stepId", required: false }] }, { type: i0.Output, args: ["stepIdChange"] }], closeOnInteractOutside: [{ type: i0.Input, args: [{ isSignal: true, alias: "closeOnInteractOutside", required: false }] }], closeOnEscape: [{ type: i0.Input, args: [{ isSignal: true, alias: "closeOnEscape", required: false }] }], keyboardNavigation: [{ type: i0.Input, args: [{ isSignal: true, alias: "keyboardNavigation", required: false }] }], preventInteraction: [{ type: i0.Input, args: [{ isSignal: true, alias: "preventInteraction", required: false }] }], spotlightOffset: [{ type: i0.Input, args: [{ isSignal: true, alias: "spotlightOffset", required: false }] }], spotlightRadius: [{ type: i0.Input, args: [{ isSignal: true, alias: "spotlightRadius", required: false }] }], translations: [{ type: i0.Input, args: [{ isSignal: true, alias: "translations", required: false }] }], focusOutside: [{ type: i0.Output, args: ["focusOutside"] }], interactOutside: [{ type: i0.Output, args: ["interactOutside"] }], pointerDownOutside: [{ type: i0.Output, args: ["pointerDownOutside"] }], statusChange: [{ type: i0.Output, args: ["statusChange"] }], stepChange: [{ type: i0.Output, args: ["stepChange"] }], stepsChange: [{ type: i0.Output, args: ["stepsChange"] }] } });
|
|
207
|
+
|
|
208
|
+
class TourRootProvider extends PresenceBase {
|
|
209
|
+
value = input.required(/* @ts-ignore */
|
|
210
|
+
...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
211
|
+
state = computed(() => this.value().state(), /* @ts-ignore */
|
|
212
|
+
...(ngDevMode ? [{ debugName: "state" }] : /* istanbul ignore next */ []));
|
|
213
|
+
api = computed(() => this.value().api(), /* @ts-ignore */
|
|
214
|
+
...(ngDevMode ? [{ debugName: "api" }] : /* istanbul ignore next */ []));
|
|
215
|
+
send = (event) => this.value().send(event);
|
|
216
|
+
get service() {
|
|
217
|
+
return this.value().service;
|
|
218
|
+
}
|
|
219
|
+
presence = this.createPresence(() => {
|
|
220
|
+
try {
|
|
221
|
+
return this.api().open;
|
|
222
|
+
}
|
|
223
|
+
catch {
|
|
224
|
+
return false;
|
|
225
|
+
}
|
|
226
|
+
});
|
|
227
|
+
contextCarrier = buildRootCarrier({
|
|
228
|
+
providers: [
|
|
229
|
+
{ provide: PRESENCE_CONTEXT, useValue: this.presence },
|
|
230
|
+
{ provide: TOUR_RENDER_STRATEGY_CONTEXT, useValue: this },
|
|
231
|
+
],
|
|
232
|
+
root: this,
|
|
233
|
+
rootToken: TOUR_CONTEXT,
|
|
234
|
+
originInjector: inject(Injector),
|
|
235
|
+
environmentInjector: inject(EnvironmentInjector),
|
|
236
|
+
});
|
|
237
|
+
getContextCarrier() {
|
|
238
|
+
return this.contextCarrier;
|
|
239
|
+
}
|
|
240
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: TourRootProvider, deps: null, target: i0.ɵɵFactoryTarget.Directive });
|
|
241
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.1.3", type: TourRootProvider, isStandalone: true, selector: "[tour-root-provider]", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: true, transformFunction: null } }, providers: [
|
|
242
|
+
{
|
|
243
|
+
provide: PRESENCE_CONTEXT,
|
|
244
|
+
useFactory: (provider) => provider.presence,
|
|
245
|
+
deps: [forwardRef(() => TourRootProvider)],
|
|
246
|
+
},
|
|
247
|
+
{
|
|
248
|
+
provide: TOUR_RENDER_STRATEGY_CONTEXT,
|
|
249
|
+
useExisting: forwardRef(() => TourRootProvider),
|
|
250
|
+
},
|
|
251
|
+
{ provide: TOUR_CONTEXT, useExisting: forwardRef(() => TourRootProvider) },
|
|
252
|
+
{
|
|
253
|
+
provide: TOUR_CONTEXT_CARRIER,
|
|
254
|
+
useFactory: (provider) => provider.getContextCarrier(),
|
|
255
|
+
deps: [forwardRef(() => TourRootProvider)],
|
|
256
|
+
},
|
|
257
|
+
], exportAs: ["tourRootProvider"], usesInheritance: true, ngImport: i0 });
|
|
258
|
+
}
|
|
259
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: TourRootProvider, decorators: [{
|
|
260
|
+
type: Directive,
|
|
261
|
+
args: [{
|
|
262
|
+
selector: "[tour-root-provider]",
|
|
263
|
+
standalone: true,
|
|
264
|
+
exportAs: "tourRootProvider",
|
|
265
|
+
providers: [
|
|
266
|
+
{
|
|
267
|
+
provide: PRESENCE_CONTEXT,
|
|
268
|
+
useFactory: (provider) => provider.presence,
|
|
269
|
+
deps: [forwardRef(() => TourRootProvider)],
|
|
270
|
+
},
|
|
271
|
+
{
|
|
272
|
+
provide: TOUR_RENDER_STRATEGY_CONTEXT,
|
|
273
|
+
useExisting: forwardRef(() => TourRootProvider),
|
|
274
|
+
},
|
|
275
|
+
{ provide: TOUR_CONTEXT, useExisting: forwardRef(() => TourRootProvider) },
|
|
276
|
+
{
|
|
277
|
+
provide: TOUR_CONTEXT_CARRIER,
|
|
278
|
+
useFactory: (provider) => provider.getContextCarrier(),
|
|
279
|
+
deps: [forwardRef(() => TourRootProvider)],
|
|
280
|
+
},
|
|
281
|
+
],
|
|
282
|
+
}]
|
|
283
|
+
}], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: true }] }] } });
|
|
284
|
+
|
|
285
|
+
class TourPositioner {
|
|
286
|
+
constructor() {
|
|
287
|
+
const context = injectTourContext();
|
|
288
|
+
const presence = injectPresenceContext();
|
|
289
|
+
const template = inject((TemplateRef), { optional: true });
|
|
290
|
+
const container = inject(ViewContainerRef);
|
|
291
|
+
const host = inject(ElementRef);
|
|
292
|
+
const elementRef = template ? { nativeElement: null } : host;
|
|
293
|
+
let view;
|
|
294
|
+
effect(() => {
|
|
295
|
+
const unmounted = presence.unmounted();
|
|
296
|
+
if (template) {
|
|
297
|
+
if (unmounted) {
|
|
298
|
+
elementRef.nativeElement = null;
|
|
299
|
+
container.clear();
|
|
300
|
+
view = undefined;
|
|
301
|
+
}
|
|
302
|
+
else if (!view) {
|
|
303
|
+
view = container.createEmbeddedView(template);
|
|
304
|
+
elementRef.nativeElement =
|
|
305
|
+
view.rootNodes.find((node) => node.nodeType === 1) ?? null;
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
});
|
|
309
|
+
bindProps({
|
|
310
|
+
elementRef,
|
|
311
|
+
renderer: inject(Renderer2),
|
|
312
|
+
destroyRef: inject(DestroyRef),
|
|
313
|
+
props: () => {
|
|
314
|
+
const unmounted = presence.unmounted();
|
|
315
|
+
return { ...context.api().getPositionerProps(), hidden: unmounted };
|
|
316
|
+
},
|
|
317
|
+
});
|
|
318
|
+
}
|
|
319
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: TourPositioner, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
320
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.3", type: TourPositioner, isStandalone: true, selector: "[tour-positioner]", exportAs: ["tourPositioner"], ngImport: i0 });
|
|
321
|
+
}
|
|
322
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: TourPositioner, decorators: [{
|
|
323
|
+
type: Directive,
|
|
324
|
+
args: [{
|
|
325
|
+
selector: "[tour-positioner]",
|
|
326
|
+
standalone: true,
|
|
327
|
+
exportAs: "tourPositioner",
|
|
328
|
+
}]
|
|
329
|
+
}], ctorParameters: () => [] });
|
|
330
|
+
|
|
331
|
+
class TourContent {
|
|
332
|
+
constructor() {
|
|
333
|
+
const context = injectTourContext();
|
|
334
|
+
const presence = injectPresenceContext();
|
|
335
|
+
const template = inject((TemplateRef), { optional: true });
|
|
336
|
+
const container = inject(ViewContainerRef);
|
|
337
|
+
const host = inject(ElementRef);
|
|
338
|
+
const elementRef = template ? { nativeElement: null } : host;
|
|
339
|
+
let view;
|
|
340
|
+
effect(() => {
|
|
341
|
+
const unmounted = presence.unmounted();
|
|
342
|
+
if (template) {
|
|
343
|
+
if (unmounted) {
|
|
344
|
+
elementRef.nativeElement = null;
|
|
345
|
+
container.clear();
|
|
346
|
+
view = undefined;
|
|
347
|
+
}
|
|
348
|
+
else if (!view) {
|
|
349
|
+
view = container.createEmbeddedView(template);
|
|
350
|
+
elementRef.nativeElement =
|
|
351
|
+
view.rootNodes.find((node) => node.nodeType === 1) ?? null;
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
untracked(() => presence.setNode(elementRef.nativeElement));
|
|
355
|
+
});
|
|
356
|
+
bindProps({
|
|
357
|
+
elementRef,
|
|
358
|
+
renderer: inject(Renderer2),
|
|
359
|
+
destroyRef: inject(DestroyRef),
|
|
360
|
+
props: () => {
|
|
361
|
+
presence.unmounted();
|
|
362
|
+
return { ...context.api().getContentProps(), ...presence.getPresenceProps() };
|
|
363
|
+
},
|
|
364
|
+
});
|
|
365
|
+
}
|
|
366
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: TourContent, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
367
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.3", type: TourContent, isStandalone: true, selector: "[tour-content]", exportAs: ["tourContent"], ngImport: i0 });
|
|
368
|
+
}
|
|
369
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: TourContent, decorators: [{
|
|
370
|
+
type: Directive,
|
|
371
|
+
args: [{
|
|
372
|
+
selector: "[tour-content]",
|
|
373
|
+
standalone: true,
|
|
374
|
+
exportAs: "tourContent",
|
|
375
|
+
}]
|
|
376
|
+
}], ctorParameters: () => [] });
|
|
377
|
+
|
|
378
|
+
class TourTitle {
|
|
379
|
+
elementRef = inject(ElementRef);
|
|
380
|
+
renderer = inject(Renderer2);
|
|
381
|
+
ownsTextContent = signal(false, /* @ts-ignore */
|
|
382
|
+
...(ngDevMode ? [{ debugName: "ownsTextContent" }] : /* istanbul ignore next */ []));
|
|
383
|
+
constructor() {
|
|
384
|
+
const tour = injectTourContext();
|
|
385
|
+
bindProps({
|
|
386
|
+
elementRef: this.elementRef,
|
|
387
|
+
renderer: this.renderer,
|
|
388
|
+
destroyRef: inject(DestroyRef),
|
|
389
|
+
props: () => tour.api().getTitleProps(),
|
|
390
|
+
});
|
|
391
|
+
effect(() => {
|
|
392
|
+
if (!this.ownsTextContent())
|
|
393
|
+
return;
|
|
394
|
+
this.renderer.setProperty(this.elementRef.nativeElement, "textContent", tour.api().step?.title ?? "");
|
|
395
|
+
});
|
|
396
|
+
}
|
|
397
|
+
ngAfterContentInit() {
|
|
398
|
+
this.ownsTextContent.set(hasOnlyWhitespaceContent$3(this.elementRef.nativeElement));
|
|
399
|
+
}
|
|
400
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: TourTitle, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
401
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.3", type: TourTitle, isStandalone: true, selector: "[tour-title]", exportAs: ["tourTitle"], ngImport: i0 });
|
|
402
|
+
}
|
|
403
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: TourTitle, decorators: [{
|
|
404
|
+
type: Directive,
|
|
405
|
+
args: [{
|
|
406
|
+
selector: "[tour-title]",
|
|
407
|
+
standalone: true,
|
|
408
|
+
exportAs: "tourTitle",
|
|
409
|
+
}]
|
|
410
|
+
}], ctorParameters: () => [] });
|
|
411
|
+
function hasOnlyWhitespaceContent$3(element) {
|
|
412
|
+
return element.firstElementChild === null && (element.textContent?.trim() ?? "") === "";
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
class TourDescription {
|
|
416
|
+
elementRef = inject(ElementRef);
|
|
417
|
+
renderer = inject(Renderer2);
|
|
418
|
+
ownsTextContent = signal(false, /* @ts-ignore */
|
|
419
|
+
...(ngDevMode ? [{ debugName: "ownsTextContent" }] : /* istanbul ignore next */ []));
|
|
420
|
+
constructor() {
|
|
421
|
+
const tour = injectTourContext();
|
|
422
|
+
bindProps({
|
|
423
|
+
elementRef: this.elementRef,
|
|
424
|
+
renderer: this.renderer,
|
|
425
|
+
destroyRef: inject(DestroyRef),
|
|
426
|
+
props: () => tour.api().getDescriptionProps(),
|
|
427
|
+
});
|
|
428
|
+
effect(() => {
|
|
429
|
+
if (!this.ownsTextContent())
|
|
430
|
+
return;
|
|
431
|
+
this.renderer.setProperty(this.elementRef.nativeElement, "textContent", tour.api().step?.description ?? "");
|
|
432
|
+
});
|
|
433
|
+
}
|
|
434
|
+
ngAfterContentInit() {
|
|
435
|
+
this.ownsTextContent.set(hasOnlyWhitespaceContent$2(this.elementRef.nativeElement));
|
|
436
|
+
}
|
|
437
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: TourDescription, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
438
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.3", type: TourDescription, isStandalone: true, selector: "[tour-description]", exportAs: ["tourDescription"], ngImport: i0 });
|
|
439
|
+
}
|
|
440
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: TourDescription, decorators: [{
|
|
441
|
+
type: Directive,
|
|
442
|
+
args: [{
|
|
443
|
+
selector: "[tour-description]",
|
|
444
|
+
standalone: true,
|
|
445
|
+
exportAs: "tourDescription",
|
|
446
|
+
}]
|
|
447
|
+
}], ctorParameters: () => [] });
|
|
448
|
+
function hasOnlyWhitespaceContent$2(element) {
|
|
449
|
+
return element.firstElementChild === null && (element.textContent?.trim() ?? "") === "";
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
class TourCloseTrigger {
|
|
453
|
+
constructor() {
|
|
454
|
+
const tour = injectTourContext();
|
|
455
|
+
bindProps({
|
|
456
|
+
elementRef: inject(ElementRef),
|
|
457
|
+
renderer: inject(Renderer2),
|
|
458
|
+
destroyRef: inject(DestroyRef),
|
|
459
|
+
props: () => tour.api().getCloseTriggerProps(),
|
|
460
|
+
});
|
|
461
|
+
}
|
|
462
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: TourCloseTrigger, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
463
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.3", type: TourCloseTrigger, isStandalone: true, selector: "[tour-close-trigger]", exportAs: ["tourCloseTrigger"], ngImport: i0 });
|
|
464
|
+
}
|
|
465
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: TourCloseTrigger, decorators: [{
|
|
466
|
+
type: Directive,
|
|
467
|
+
args: [{
|
|
468
|
+
selector: "[tour-close-trigger]",
|
|
469
|
+
standalone: true,
|
|
470
|
+
exportAs: "tourCloseTrigger",
|
|
471
|
+
}]
|
|
472
|
+
}], ctorParameters: () => [] });
|
|
473
|
+
|
|
474
|
+
class TourActionTrigger {
|
|
475
|
+
action = input.required(/* @ts-ignore */
|
|
476
|
+
...(ngDevMode ? [{ debugName: "action" }] : /* istanbul ignore next */ []));
|
|
477
|
+
elementRef = inject(ElementRef);
|
|
478
|
+
renderer = inject(Renderer2);
|
|
479
|
+
ownsTextContent = signal(false, /* @ts-ignore */
|
|
480
|
+
...(ngDevMode ? [{ debugName: "ownsTextContent" }] : /* istanbul ignore next */ []));
|
|
481
|
+
constructor() {
|
|
482
|
+
const tour = injectTourContext();
|
|
483
|
+
bindProps({
|
|
484
|
+
elementRef: this.elementRef,
|
|
485
|
+
renderer: this.renderer,
|
|
486
|
+
destroyRef: inject(DestroyRef),
|
|
487
|
+
props: () => tour.api().getActionTriggerProps({ action: this.action() }),
|
|
488
|
+
});
|
|
489
|
+
effect(() => {
|
|
490
|
+
if (!this.ownsTextContent())
|
|
491
|
+
return;
|
|
492
|
+
this.renderer.setProperty(this.elementRef.nativeElement, "textContent", this.action().label);
|
|
493
|
+
});
|
|
494
|
+
}
|
|
495
|
+
ngAfterContentInit() {
|
|
496
|
+
this.ownsTextContent.set(hasOnlyWhitespaceContent$1(this.elementRef.nativeElement));
|
|
497
|
+
}
|
|
498
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: TourActionTrigger, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
499
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.1.3", type: TourActionTrigger, isStandalone: true, selector: "[tour-action-trigger]", inputs: { action: { classPropertyName: "action", publicName: "action", isSignal: true, isRequired: true, transformFunction: null } }, exportAs: ["tourActionTrigger"], ngImport: i0 });
|
|
500
|
+
}
|
|
501
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: TourActionTrigger, decorators: [{
|
|
502
|
+
type: Directive,
|
|
503
|
+
args: [{
|
|
504
|
+
selector: "[tour-action-trigger]",
|
|
505
|
+
standalone: true,
|
|
506
|
+
exportAs: "tourActionTrigger",
|
|
507
|
+
}]
|
|
508
|
+
}], ctorParameters: () => [], propDecorators: { action: [{ type: i0.Input, args: [{ isSignal: true, alias: "action", required: true }] }] } });
|
|
509
|
+
function hasOnlyWhitespaceContent$1(element) {
|
|
510
|
+
return element.firstElementChild === null && (element.textContent?.trim() ?? "") === "";
|
|
511
|
+
}
|
|
512
|
+
|
|
513
|
+
class TourActions {
|
|
514
|
+
static ngTemplateContextGuard(_directive, context) {
|
|
515
|
+
void context;
|
|
516
|
+
return true;
|
|
517
|
+
}
|
|
518
|
+
tour = injectTourContext();
|
|
519
|
+
templateRef = inject(TemplateRef);
|
|
520
|
+
viewContainer = inject(ViewContainerRef);
|
|
521
|
+
constructor() {
|
|
522
|
+
const view = this.viewContainer.createEmbeddedView(this.templateRef, this.createContext());
|
|
523
|
+
effect(() => {
|
|
524
|
+
const context = this.createContext();
|
|
525
|
+
view.context.$implicit = context.$implicit;
|
|
526
|
+
view.context.actions = context.actions;
|
|
527
|
+
view.detectChanges();
|
|
528
|
+
});
|
|
529
|
+
inject(DestroyRef).onDestroy(() => view.destroy());
|
|
530
|
+
}
|
|
531
|
+
createContext() {
|
|
532
|
+
const actions = this.tour.api().step?.actions ?? [];
|
|
533
|
+
return { $implicit: actions, actions };
|
|
534
|
+
}
|
|
535
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: TourActions, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
536
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.3", type: TourActions, isStandalone: true, selector: "[tour-actions]", exportAs: ["tourActions"], ngImport: i0 });
|
|
537
|
+
}
|
|
538
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: TourActions, decorators: [{
|
|
539
|
+
type: Directive,
|
|
540
|
+
args: [{
|
|
541
|
+
selector: "[tour-actions]",
|
|
542
|
+
standalone: true,
|
|
543
|
+
exportAs: "tourActions",
|
|
544
|
+
}]
|
|
545
|
+
}], ctorParameters: () => [] });
|
|
546
|
+
|
|
547
|
+
class TourControl {
|
|
548
|
+
constructor() {
|
|
549
|
+
bindProps({
|
|
550
|
+
elementRef: inject(ElementRef),
|
|
551
|
+
renderer: inject(Renderer2),
|
|
552
|
+
destroyRef: inject(DestroyRef),
|
|
553
|
+
props: () => tourAnatomy.build().control.attrs,
|
|
554
|
+
});
|
|
555
|
+
}
|
|
556
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: TourControl, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
557
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.3", type: TourControl, isStandalone: true, selector: "[tour-control]", exportAs: ["tourControl"], ngImport: i0 });
|
|
558
|
+
}
|
|
559
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: TourControl, decorators: [{
|
|
560
|
+
type: Directive,
|
|
561
|
+
args: [{
|
|
562
|
+
selector: "[tour-control]",
|
|
563
|
+
standalone: true,
|
|
564
|
+
exportAs: "tourControl",
|
|
565
|
+
}]
|
|
566
|
+
}], ctorParameters: () => [] });
|
|
567
|
+
|
|
568
|
+
class TourProgressText {
|
|
569
|
+
elementRef = inject(ElementRef);
|
|
570
|
+
renderer = inject(Renderer2);
|
|
571
|
+
ownsTextContent = signal(false, /* @ts-ignore */
|
|
572
|
+
...(ngDevMode ? [{ debugName: "ownsTextContent" }] : /* istanbul ignore next */ []));
|
|
573
|
+
constructor() {
|
|
574
|
+
const tour = injectTourContext();
|
|
575
|
+
bindProps({
|
|
576
|
+
elementRef: this.elementRef,
|
|
577
|
+
renderer: this.renderer,
|
|
578
|
+
destroyRef: inject(DestroyRef),
|
|
579
|
+
props: () => tour.api().getProgressTextProps(),
|
|
580
|
+
});
|
|
581
|
+
effect(() => {
|
|
582
|
+
if (!this.ownsTextContent())
|
|
583
|
+
return;
|
|
584
|
+
this.renderer.setProperty(this.elementRef.nativeElement, "textContent", tour.api().getProgressText());
|
|
585
|
+
});
|
|
586
|
+
}
|
|
587
|
+
ngAfterContentInit() {
|
|
588
|
+
this.ownsTextContent.set(hasOnlyWhitespaceContent(this.elementRef.nativeElement));
|
|
589
|
+
}
|
|
590
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: TourProgressText, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
591
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.3", type: TourProgressText, isStandalone: true, selector: "[tour-progress-text]", exportAs: ["tourProgressText"], ngImport: i0 });
|
|
592
|
+
}
|
|
593
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: TourProgressText, decorators: [{
|
|
594
|
+
type: Directive,
|
|
595
|
+
args: [{
|
|
596
|
+
selector: "[tour-progress-text]",
|
|
597
|
+
standalone: true,
|
|
598
|
+
exportAs: "tourProgressText",
|
|
599
|
+
}]
|
|
600
|
+
}], ctorParameters: () => [] });
|
|
601
|
+
function hasOnlyWhitespaceContent(element) {
|
|
602
|
+
return element.firstElementChild === null && (element.textContent?.trim() ?? "") === "";
|
|
603
|
+
}
|
|
604
|
+
|
|
605
|
+
class TourBackdrop {
|
|
606
|
+
constructor() {
|
|
607
|
+
const context = injectTourContext();
|
|
608
|
+
const renderStrategy = injectTourRenderStrategyContext();
|
|
609
|
+
const presence = usePresence({
|
|
610
|
+
context: () => ({
|
|
611
|
+
present: context.api().open,
|
|
612
|
+
lazyMount: renderStrategy.lazyMount(),
|
|
613
|
+
unmountOnExit: renderStrategy.unmountOnExit(),
|
|
614
|
+
}),
|
|
615
|
+
});
|
|
616
|
+
const template = inject((TemplateRef), { optional: true });
|
|
617
|
+
const container = inject(ViewContainerRef);
|
|
618
|
+
const host = inject(ElementRef);
|
|
619
|
+
const elementRef = template ? { nativeElement: null } : host;
|
|
620
|
+
let view;
|
|
621
|
+
effect(() => {
|
|
622
|
+
const unmounted = presence.unmounted();
|
|
623
|
+
if (template) {
|
|
624
|
+
if (unmounted) {
|
|
625
|
+
elementRef.nativeElement = null;
|
|
626
|
+
container.clear();
|
|
627
|
+
view = undefined;
|
|
628
|
+
}
|
|
629
|
+
else if (!view) {
|
|
630
|
+
view = container.createEmbeddedView(template);
|
|
631
|
+
elementRef.nativeElement =
|
|
632
|
+
view.rootNodes.find((node) => node.nodeType === 1) ?? null;
|
|
633
|
+
}
|
|
634
|
+
}
|
|
635
|
+
untracked(() => presence.setNode(elementRef.nativeElement));
|
|
636
|
+
});
|
|
637
|
+
bindProps({
|
|
638
|
+
elementRef,
|
|
639
|
+
renderer: inject(Renderer2),
|
|
640
|
+
destroyRef: inject(DestroyRef),
|
|
641
|
+
props: () => {
|
|
642
|
+
const api = context.api();
|
|
643
|
+
const presenceProps = presence.getPresenceProps();
|
|
644
|
+
return {
|
|
645
|
+
...api.getBackdropProps(),
|
|
646
|
+
...presenceProps,
|
|
647
|
+
hidden: presenceProps.hidden || !api.step?.backdrop,
|
|
648
|
+
};
|
|
649
|
+
},
|
|
650
|
+
});
|
|
651
|
+
}
|
|
652
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: TourBackdrop, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
653
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.3", type: TourBackdrop, isStandalone: true, selector: "[tour-backdrop]", exportAs: ["tourBackdrop"], ngImport: i0 });
|
|
654
|
+
}
|
|
655
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: TourBackdrop, decorators: [{
|
|
656
|
+
type: Directive,
|
|
657
|
+
args: [{
|
|
658
|
+
selector: "[tour-backdrop]",
|
|
659
|
+
standalone: true,
|
|
660
|
+
exportAs: "tourBackdrop",
|
|
661
|
+
}]
|
|
662
|
+
}], ctorParameters: () => [] });
|
|
663
|
+
|
|
664
|
+
class TourSpotlight {
|
|
665
|
+
constructor() {
|
|
666
|
+
const context = injectTourContext();
|
|
667
|
+
const renderStrategy = injectTourRenderStrategyContext();
|
|
668
|
+
const presence = usePresence({
|
|
669
|
+
context: () => ({
|
|
670
|
+
present: context.api().open,
|
|
671
|
+
lazyMount: renderStrategy.lazyMount(),
|
|
672
|
+
unmountOnExit: renderStrategy.unmountOnExit(),
|
|
673
|
+
}),
|
|
674
|
+
});
|
|
675
|
+
const template = inject((TemplateRef), { optional: true });
|
|
676
|
+
const container = inject(ViewContainerRef);
|
|
677
|
+
const host = inject(ElementRef);
|
|
678
|
+
const elementRef = template ? { nativeElement: null } : host;
|
|
679
|
+
let view;
|
|
680
|
+
effect(() => {
|
|
681
|
+
const unmounted = presence.unmounted();
|
|
682
|
+
if (template) {
|
|
683
|
+
if (unmounted) {
|
|
684
|
+
elementRef.nativeElement = null;
|
|
685
|
+
container.clear();
|
|
686
|
+
view = undefined;
|
|
687
|
+
}
|
|
688
|
+
else if (!view) {
|
|
689
|
+
view = container.createEmbeddedView(template);
|
|
690
|
+
elementRef.nativeElement =
|
|
691
|
+
view.rootNodes.find((node) => node.nodeType === 1) ?? null;
|
|
692
|
+
}
|
|
693
|
+
}
|
|
694
|
+
untracked(() => presence.setNode(elementRef.nativeElement));
|
|
695
|
+
});
|
|
696
|
+
bindProps({
|
|
697
|
+
elementRef,
|
|
698
|
+
renderer: inject(Renderer2),
|
|
699
|
+
destroyRef: inject(DestroyRef),
|
|
700
|
+
props: () => {
|
|
701
|
+
const api = context.api();
|
|
702
|
+
const presenceProps = presence.getPresenceProps();
|
|
703
|
+
return {
|
|
704
|
+
...api.getSpotlightProps(),
|
|
705
|
+
...presenceProps,
|
|
706
|
+
hidden: presenceProps.hidden || !api.step?.target?.(),
|
|
707
|
+
};
|
|
708
|
+
},
|
|
709
|
+
});
|
|
710
|
+
}
|
|
711
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: TourSpotlight, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
712
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.3", type: TourSpotlight, isStandalone: true, selector: "[tour-spotlight]", exportAs: ["tourSpotlight"], ngImport: i0 });
|
|
713
|
+
}
|
|
714
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: TourSpotlight, decorators: [{
|
|
715
|
+
type: Directive,
|
|
716
|
+
args: [{
|
|
717
|
+
selector: "[tour-spotlight]",
|
|
718
|
+
standalone: true,
|
|
719
|
+
exportAs: "tourSpotlight",
|
|
720
|
+
}]
|
|
721
|
+
}], ctorParameters: () => [] });
|
|
722
|
+
|
|
723
|
+
class TourArrow {
|
|
724
|
+
constructor() {
|
|
725
|
+
const tour = injectTourContext();
|
|
726
|
+
bindProps({
|
|
727
|
+
elementRef: inject(ElementRef),
|
|
728
|
+
renderer: inject(Renderer2),
|
|
729
|
+
destroyRef: inject(DestroyRef),
|
|
730
|
+
props: () => {
|
|
731
|
+
const api = tour.api();
|
|
732
|
+
return { ...api.getArrowProps(), hidden: !api.step?.arrow };
|
|
733
|
+
},
|
|
734
|
+
});
|
|
735
|
+
}
|
|
736
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: TourArrow, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
737
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.3", type: TourArrow, isStandalone: true, selector: "[tour-arrow]", exportAs: ["tourArrow"], ngImport: i0 });
|
|
738
|
+
}
|
|
739
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: TourArrow, decorators: [{
|
|
740
|
+
type: Directive,
|
|
741
|
+
args: [{
|
|
742
|
+
selector: "[tour-arrow]",
|
|
743
|
+
standalone: true,
|
|
744
|
+
exportAs: "tourArrow",
|
|
745
|
+
}]
|
|
746
|
+
}], ctorParameters: () => [] });
|
|
747
|
+
|
|
748
|
+
class TourArrowTip {
|
|
749
|
+
constructor() {
|
|
750
|
+
const tour = injectTourContext();
|
|
751
|
+
bindProps({
|
|
752
|
+
elementRef: inject(ElementRef),
|
|
753
|
+
renderer: inject(Renderer2),
|
|
754
|
+
destroyRef: inject(DestroyRef),
|
|
755
|
+
props: () => tour.api().getArrowTipProps(),
|
|
756
|
+
});
|
|
757
|
+
}
|
|
758
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: TourArrowTip, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
759
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.3", type: TourArrowTip, isStandalone: true, selector: "[tour-arrow-tip]", exportAs: ["tourArrowTip"], ngImport: i0 });
|
|
760
|
+
}
|
|
761
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: TourArrowTip, decorators: [{
|
|
762
|
+
type: Directive,
|
|
763
|
+
args: [{
|
|
764
|
+
selector: "[tour-arrow-tip]",
|
|
765
|
+
standalone: true,
|
|
766
|
+
exportAs: "tourArrowTip",
|
|
767
|
+
}]
|
|
768
|
+
}], ctorParameters: () => [] });
|
|
769
|
+
|
|
770
|
+
class TourContext {
|
|
771
|
+
static ngTemplateContextGuard(_directive, context) {
|
|
772
|
+
void context;
|
|
773
|
+
return true;
|
|
774
|
+
}
|
|
775
|
+
tour = injectTourContext();
|
|
776
|
+
templateRef = inject(TemplateRef);
|
|
777
|
+
viewContainer = inject(ViewContainerRef);
|
|
778
|
+
constructor() {
|
|
779
|
+
const view = this.viewContainer.createEmbeddedView(this.templateRef, {
|
|
780
|
+
$implicit: this.tour.api,
|
|
781
|
+
api: this.tour.api,
|
|
782
|
+
});
|
|
783
|
+
effect(() => {
|
|
784
|
+
this.tour.api();
|
|
785
|
+
view.detectChanges();
|
|
786
|
+
});
|
|
787
|
+
inject(DestroyRef).onDestroy(() => view.destroy());
|
|
788
|
+
}
|
|
789
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: TourContext, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
790
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.3", type: TourContext, isStandalone: true, selector: "[tour-context]", exportAs: ["tourContext"], ngImport: i0 });
|
|
791
|
+
}
|
|
792
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: TourContext, decorators: [{
|
|
793
|
+
type: Directive,
|
|
794
|
+
args: [{
|
|
795
|
+
selector: "[tour-context]",
|
|
796
|
+
standalone: true,
|
|
797
|
+
exportAs: "tourContext",
|
|
798
|
+
}]
|
|
799
|
+
}], ctorParameters: () => [] });
|
|
800
|
+
|
|
801
|
+
/**
|
|
802
|
+
* Generated bundle index. Do not edit.
|
|
803
|
+
*/
|
|
804
|
+
|
|
805
|
+
export { TOUR_CONTEXT, TOUR_CONTEXT_CARRIER, TOUR_RENDER_STRATEGY_CONTEXT, TourActionTrigger, TourActions, TourArrow, TourArrowTip, TourBackdrop, TourCloseTrigger, TourContent, TourContext, TourControl, TourDescription, TourPositioner, TourProgressText, TourRoot, TourRootProvider, TourSpotlight, TourTitle, injectTourContext, injectTourContextCarrier, injectTourRenderStrategyContext, tourAnatomy, useTour, waitForEvent };
|
|
806
|
+
//# sourceMappingURL=wirekyt-angular-tour.mjs.map
|