@wirekyt/angular 0.0.18 → 0.0.20

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.
@@ -0,0 +1,679 @@
1
+ import * as floatingPanel from '@wirekyt/dom/machines/floating-panel';
2
+ export { anatomy as floatingPanelAnatomy, resizeTriggerAxes } from '@wirekyt/dom/machines/floating-panel';
3
+ import * as i0 from '@angular/core';
4
+ import { InjectionToken, inject, input, model, booleanAttribute, output, EnvironmentInjector, Injector, forwardRef, Directive, computed, DestroyRef, Renderer2, ElementRef, TemplateRef, ViewContainerRef, effect, untracked } from '@angular/core';
5
+ import { injectLocale, injectEnvironment, createId, useMachine, buildRootCarrier, bindProps } from '@wirekyt/angular';
6
+ import { PresenceBase, PRESENCE_CONTEXT, injectPresenceContext } from '@wirekyt/angular/presence';
7
+
8
+ const FLOATING_PANEL_CONTEXT = new InjectionToken("WIREKYT.FLOATING_PANEL_CONTEXT");
9
+ function injectFloatingPanelContext() {
10
+ return inject(FLOATING_PANEL_CONTEXT);
11
+ }
12
+ const FLOATING_PANEL_CONTEXT_CARRIER = new InjectionToken("WIREKYT.FLOATING_PANEL_CONTEXT_CARRIER");
13
+ function injectFloatingPanelContextCarrier() {
14
+ return inject(FLOATING_PANEL_CONTEXT_CARRIER);
15
+ }
16
+ const FLOATING_PANEL_RENDER_STRATEGY_CONTEXT = new InjectionToken("WIREKYT.FLOATING_PANEL_RENDER_STRATEGY_CONTEXT");
17
+ function injectFloatingPanelRenderStrategyContext() {
18
+ return inject(FLOATING_PANEL_RENDER_STRATEGY_CONTEXT);
19
+ }
20
+
21
+ function useFloatingPanel(options) {
22
+ const locale = injectLocale();
23
+ const environment = injectEnvironment();
24
+ const fallbackId = createId();
25
+ return useMachine({
26
+ machine: floatingPanel.machine,
27
+ context: () => {
28
+ const props = options.context();
29
+ return {
30
+ ...props,
31
+ dir: locale.dir,
32
+ getRootNode: environment.getRootNode,
33
+ id: props.id ?? fallbackId,
34
+ };
35
+ },
36
+ connect: (service, normalize) => floatingPanel.connect(service, normalize),
37
+ });
38
+ }
39
+
40
+ const arePointsEqual = (left, right) => left !== undefined && Object.is(left.x, right.x) && Object.is(left.y, right.y);
41
+ const areSizesEqual = (left, right) => left !== undefined && Object.is(left.width, right.width) && Object.is(left.height, right.height);
42
+ const areDetailsEqual = (left, right) => JSON.stringify(left) === JSON.stringify(right);
43
+ class FloatingPanelRoot extends PresenceBase {
44
+ /** The unique identifier of the floating panel. */
45
+ id = input(undefined, /* @ts-ignore */
46
+ ...(ngDevMode ? [{ debugName: "id" }] : /* istanbul ignore next */ []));
47
+ /** The ids of the floating panel elements. Useful for composition. */
48
+ ids = input(undefined, /* @ts-ignore */
49
+ ...(ngDevMode ? [{ debugName: "ids" }] : /* istanbul ignore next */ []));
50
+ /** The controlled open state of the floating panel. */
51
+ open = model(undefined, /* @ts-ignore */
52
+ ...(ngDevMode ? [{ debugName: "open" }] : /* istanbul ignore next */ []));
53
+ /** The initial open state of the floating panel when uncontrolled. */
54
+ defaultOpen = input(false, { ...(ngDevMode ? { debugName: "defaultOpen" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
55
+ /** The controlled position of the floating panel. */
56
+ position = model(undefined, /* @ts-ignore */
57
+ ...(ngDevMode ? [{ debugName: "position" }] : /* istanbul ignore next */ []));
58
+ /** The initial position of the floating panel when uncontrolled. */
59
+ defaultPosition = input(undefined, /* @ts-ignore */
60
+ ...(ngDevMode ? [{ debugName: "defaultPosition" }] : /* istanbul ignore next */ []));
61
+ /** The controlled size of the floating panel. */
62
+ size = model(undefined, /* @ts-ignore */
63
+ ...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
64
+ /** The initial size of the floating panel when uncontrolled. */
65
+ defaultSize = input(undefined, /* @ts-ignore */
66
+ ...(ngDevMode ? [{ debugName: "defaultSize" }] : /* istanbul ignore next */ []));
67
+ /** The minimum size of the floating panel. */
68
+ minSize = input(undefined, /* @ts-ignore */
69
+ ...(ngDevMode ? [{ debugName: "minSize" }] : /* istanbul ignore next */ []));
70
+ /** The maximum size of the floating panel. */
71
+ maxSize = input(undefined, /* @ts-ignore */
72
+ ...(ngDevMode ? [{ debugName: "maxSize" }] : /* istanbul ignore next */ []));
73
+ /** The positioning strategy to use. */
74
+ strategy = input("fixed", /* @ts-ignore */
75
+ ...(ngDevMode ? [{ debugName: "strategy" }] : /* istanbul ignore next */ []));
76
+ /** Whether the panel may overflow the boundary while dragging. */
77
+ allowOverflow = input(true, { ...(ngDevMode ? { debugName: "allowOverflow" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
78
+ /** Whether the floating panel is draggable. */
79
+ draggable = input(true, { ...(ngDevMode ? { debugName: "draggable" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
80
+ /** Whether the floating panel is resizable. */
81
+ resizable = input(true, { ...(ngDevMode ? { debugName: "resizable" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
82
+ /** Whether resizing locks the panel to its aspect ratio. */
83
+ lockAspectRatio = input(false, { ...(ngDevMode ? { debugName: "lockAspectRatio" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
84
+ /** Whether the floating panel closes when the escape key is pressed. */
85
+ closeOnEscape = input(false, { ...(ngDevMode ? { debugName: "closeOnEscape" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
86
+ /** Whether focus should be restored when the floating panel closes. */
87
+ restoreFocus = input(true, { ...(ngDevMode ? { debugName: "restoreFocus" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
88
+ /** Whether the floating panel is disabled. */
89
+ disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
90
+ /** Whether size and position should be preserved when the floating panel closes. */
91
+ persistRect = input(false, { ...(ngDevMode ? { debugName: "persistRect" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
92
+ /** The snap grid for dragging and keyboard movement. */
93
+ gridSize = input(1, /* @ts-ignore */
94
+ ...(ngDevMode ? [{ debugName: "gridSize" }] : /* istanbul ignore next */ []));
95
+ /** Localized strings for control labels. */
96
+ translations = input(undefined, /* @ts-ignore */
97
+ ...(ngDevMode ? [{ debugName: "translations" }] : /* istanbul ignore next */ []));
98
+ /** Function that returns the initial panel position when opened. */
99
+ getAnchorPosition = input(undefined, /* @ts-ignore */
100
+ ...(ngDevMode ? [{ debugName: "getAnchorPosition" }] : /* istanbul ignore next */ []));
101
+ /** Function that returns the boundary element for dragging and resizing. */
102
+ getBoundaryEl = input(undefined, /* @ts-ignore */
103
+ ...(ngDevMode ? [{ debugName: "getBoundaryEl" }] : /* istanbul ignore next */ []));
104
+ /** Element to receive focus when the floating panel opens. */
105
+ initialFocusEl = input(undefined, /* @ts-ignore */
106
+ ...(ngDevMode ? [{ debugName: "initialFocusEl" }] : /* istanbul ignore next */ []));
107
+ /** Element to receive focus when the floating panel closes. */
108
+ finalFocusEl = input(undefined, /* @ts-ignore */
109
+ ...(ngDevMode ? [{ debugName: "finalFocusEl" }] : /* istanbul ignore next */ []));
110
+ /** Emits details when the panel open state changes. */
111
+ openChangeDetails = output();
112
+ /** Emits details when the panel position changes via dragging or API calls. */
113
+ positionDetailsChange = output();
114
+ /** Emits details when a position-changing drag interaction ends. */
115
+ positionChangeEnd = output();
116
+ /** Emits details when the panel size changes via resizing or API calls. */
117
+ sizeDetailsChange = output();
118
+ /** Emits details when a size-changing resize interaction ends. */
119
+ sizeChangeEnd = output();
120
+ /** Emits details when the panel stage changes. */
121
+ stageChange = output();
122
+ lastPositionDetails;
123
+ lastPositionEndDetails;
124
+ lastSizeDetails;
125
+ lastSizeEndDetails;
126
+ lastStageDetails;
127
+ machine = useFloatingPanel({
128
+ context: () => ({
129
+ id: this.id(),
130
+ ids: this.ids(),
131
+ open: this.open(),
132
+ defaultOpen: this.defaultOpen(),
133
+ position: this.position(),
134
+ defaultPosition: this.defaultPosition(),
135
+ size: this.size(),
136
+ defaultSize: this.defaultSize(),
137
+ minSize: this.minSize(),
138
+ maxSize: this.maxSize(),
139
+ strategy: this.strategy(),
140
+ allowOverflow: this.allowOverflow(),
141
+ draggable: this.draggable(),
142
+ resizable: this.resizable(),
143
+ lockAspectRatio: this.lockAspectRatio(),
144
+ closeOnEscape: this.closeOnEscape(),
145
+ restoreFocus: this.restoreFocus(),
146
+ disabled: this.disabled(),
147
+ persistRect: this.persistRect(),
148
+ gridSize: this.gridSize(),
149
+ translations: this.translations(),
150
+ getAnchorPosition: this.getAnchorPosition(),
151
+ getBoundaryEl: this.getBoundaryEl(),
152
+ initialFocusEl: this.initialFocusEl(),
153
+ finalFocusEl: this.finalFocusEl(),
154
+ onOpenChange: (details) => {
155
+ if (this.open() !== details.open) {
156
+ this.open.set(details.open);
157
+ }
158
+ this.openChangeDetails.emit(details);
159
+ },
160
+ onPositionChange: (details) => {
161
+ if (areDetailsEqual(this.lastPositionDetails, details))
162
+ return;
163
+ this.lastPositionDetails = details;
164
+ if (!arePointsEqual(this.position(), details.position)) {
165
+ this.position.set({ ...details.position });
166
+ }
167
+ this.positionDetailsChange.emit(details);
168
+ },
169
+ onPositionChangeEnd: (details) => {
170
+ if (areDetailsEqual(this.lastPositionEndDetails, details))
171
+ return;
172
+ this.lastPositionEndDetails = details;
173
+ this.positionChangeEnd.emit(details);
174
+ },
175
+ onSizeChange: (details) => {
176
+ if (areDetailsEqual(this.lastSizeDetails, details))
177
+ return;
178
+ this.lastSizeDetails = details;
179
+ if (!areSizesEqual(this.size(), details.size)) {
180
+ this.size.set({ ...details.size });
181
+ }
182
+ this.sizeDetailsChange.emit(details);
183
+ },
184
+ onSizeChangeEnd: (details) => {
185
+ if (areDetailsEqual(this.lastSizeEndDetails, details))
186
+ return;
187
+ this.lastSizeEndDetails = details;
188
+ this.sizeChangeEnd.emit(details);
189
+ },
190
+ onStageChange: (details) => {
191
+ if (areDetailsEqual(this.lastStageDetails, details))
192
+ return;
193
+ this.lastStageDetails = details;
194
+ this.stageChange.emit(details);
195
+ },
196
+ }),
197
+ });
198
+ state = this.machine.state;
199
+ api = this.machine.api;
200
+ service = this.machine.service;
201
+ send = this.machine.send;
202
+ presence = this.createPresence(() => this.api().open);
203
+ contextCarrier = buildRootCarrier({
204
+ providers: [
205
+ { provide: PRESENCE_CONTEXT, useValue: this.presence },
206
+ { provide: FLOATING_PANEL_RENDER_STRATEGY_CONTEXT, useValue: this },
207
+ ],
208
+ root: this,
209
+ rootToken: FLOATING_PANEL_CONTEXT,
210
+ originInjector: inject(Injector),
211
+ environmentInjector: inject(EnvironmentInjector),
212
+ });
213
+ /** @internal Exposed for floating panel part directives to consume through portals. */
214
+ getContextCarrier() {
215
+ return this.contextCarrier;
216
+ }
217
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: FloatingPanelRoot, deps: null, target: i0.ɵɵFactoryTarget.Directive });
218
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.1.3", type: FloatingPanelRoot, isStandalone: true, selector: "[floating-panel-root]", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, ids: { classPropertyName: "ids", publicName: "ids", isSignal: true, isRequired: false, transformFunction: null }, open: { classPropertyName: "open", publicName: "open", isSignal: true, isRequired: false, transformFunction: null }, defaultOpen: { classPropertyName: "defaultOpen", publicName: "defaultOpen", isSignal: true, isRequired: false, transformFunction: null }, position: { classPropertyName: "position", publicName: "position", isSignal: true, isRequired: false, transformFunction: null }, defaultPosition: { classPropertyName: "defaultPosition", publicName: "defaultPosition", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, defaultSize: { classPropertyName: "defaultSize", publicName: "defaultSize", isSignal: true, isRequired: false, transformFunction: null }, minSize: { classPropertyName: "minSize", publicName: "minSize", isSignal: true, isRequired: false, transformFunction: null }, maxSize: { classPropertyName: "maxSize", publicName: "maxSize", isSignal: true, isRequired: false, transformFunction: null }, strategy: { classPropertyName: "strategy", publicName: "strategy", isSignal: true, isRequired: false, transformFunction: null }, allowOverflow: { classPropertyName: "allowOverflow", publicName: "allowOverflow", isSignal: true, isRequired: false, transformFunction: null }, draggable: { classPropertyName: "draggable", publicName: "draggable", isSignal: true, isRequired: false, transformFunction: null }, resizable: { classPropertyName: "resizable", publicName: "resizable", isSignal: true, isRequired: false, transformFunction: null }, lockAspectRatio: { classPropertyName: "lockAspectRatio", publicName: "lockAspectRatio", isSignal: true, isRequired: false, transformFunction: null }, closeOnEscape: { classPropertyName: "closeOnEscape", publicName: "closeOnEscape", isSignal: true, isRequired: false, transformFunction: null }, restoreFocus: { classPropertyName: "restoreFocus", publicName: "restoreFocus", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, persistRect: { classPropertyName: "persistRect", publicName: "persistRect", isSignal: true, isRequired: false, transformFunction: null }, gridSize: { classPropertyName: "gridSize", publicName: "gridSize", isSignal: true, isRequired: false, transformFunction: null }, translations: { classPropertyName: "translations", publicName: "translations", isSignal: true, isRequired: false, transformFunction: null }, getAnchorPosition: { classPropertyName: "getAnchorPosition", publicName: "getAnchorPosition", isSignal: true, isRequired: false, transformFunction: null }, getBoundaryEl: { classPropertyName: "getBoundaryEl", publicName: "getBoundaryEl", isSignal: true, isRequired: false, transformFunction: null }, initialFocusEl: { classPropertyName: "initialFocusEl", publicName: "initialFocusEl", isSignal: true, isRequired: false, transformFunction: null }, finalFocusEl: { classPropertyName: "finalFocusEl", publicName: "finalFocusEl", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { open: "openChange", position: "positionChange", size: "sizeChange", openChangeDetails: "openChangeDetails", positionDetailsChange: "positionDetailsChange", positionChangeEnd: "positionChangeEnd", sizeDetailsChange: "sizeDetailsChange", sizeChangeEnd: "sizeChangeEnd", stageChange: "stageChange" }, providers: [
219
+ {
220
+ provide: PRESENCE_CONTEXT,
221
+ useFactory: (root) => root.presence,
222
+ deps: [forwardRef(() => FloatingPanelRoot)],
223
+ },
224
+ {
225
+ provide: FLOATING_PANEL_RENDER_STRATEGY_CONTEXT,
226
+ useExisting: forwardRef(() => FloatingPanelRoot),
227
+ },
228
+ { provide: FLOATING_PANEL_CONTEXT, useExisting: forwardRef(() => FloatingPanelRoot) },
229
+ {
230
+ provide: FLOATING_PANEL_CONTEXT_CARRIER,
231
+ useFactory: (root) => root.getContextCarrier(),
232
+ deps: [forwardRef(() => FloatingPanelRoot)],
233
+ },
234
+ ], exportAs: ["floatingPanelRoot"], usesInheritance: true, ngImport: i0 });
235
+ }
236
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: FloatingPanelRoot, decorators: [{
237
+ type: Directive,
238
+ args: [{
239
+ selector: "[floating-panel-root]",
240
+ standalone: true,
241
+ exportAs: "floatingPanelRoot",
242
+ providers: [
243
+ {
244
+ provide: PRESENCE_CONTEXT,
245
+ useFactory: (root) => root.presence,
246
+ deps: [forwardRef(() => FloatingPanelRoot)],
247
+ },
248
+ {
249
+ provide: FLOATING_PANEL_RENDER_STRATEGY_CONTEXT,
250
+ useExisting: forwardRef(() => FloatingPanelRoot),
251
+ },
252
+ { provide: FLOATING_PANEL_CONTEXT, useExisting: forwardRef(() => FloatingPanelRoot) },
253
+ {
254
+ provide: FLOATING_PANEL_CONTEXT_CARRIER,
255
+ useFactory: (root) => root.getContextCarrier(),
256
+ deps: [forwardRef(() => FloatingPanelRoot)],
257
+ },
258
+ ],
259
+ }]
260
+ }], propDecorators: { id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }], ids: [{ type: i0.Input, args: [{ isSignal: true, alias: "ids", required: false }] }], open: [{ type: i0.Input, args: [{ isSignal: true, alias: "open", required: false }] }, { type: i0.Output, args: ["openChange"] }], defaultOpen: [{ type: i0.Input, args: [{ isSignal: true, alias: "defaultOpen", required: false }] }], position: [{ type: i0.Input, args: [{ isSignal: true, alias: "position", required: false }] }, { type: i0.Output, args: ["positionChange"] }], defaultPosition: [{ type: i0.Input, args: [{ isSignal: true, alias: "defaultPosition", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }, { type: i0.Output, args: ["sizeChange"] }], defaultSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "defaultSize", required: false }] }], minSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "minSize", required: false }] }], maxSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxSize", required: false }] }], strategy: [{ type: i0.Input, args: [{ isSignal: true, alias: "strategy", required: false }] }], allowOverflow: [{ type: i0.Input, args: [{ isSignal: true, alias: "allowOverflow", required: false }] }], draggable: [{ type: i0.Input, args: [{ isSignal: true, alias: "draggable", required: false }] }], resizable: [{ type: i0.Input, args: [{ isSignal: true, alias: "resizable", required: false }] }], lockAspectRatio: [{ type: i0.Input, args: [{ isSignal: true, alias: "lockAspectRatio", required: false }] }], closeOnEscape: [{ type: i0.Input, args: [{ isSignal: true, alias: "closeOnEscape", required: false }] }], restoreFocus: [{ type: i0.Input, args: [{ isSignal: true, alias: "restoreFocus", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], persistRect: [{ type: i0.Input, args: [{ isSignal: true, alias: "persistRect", required: false }] }], gridSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "gridSize", required: false }] }], translations: [{ type: i0.Input, args: [{ isSignal: true, alias: "translations", required: false }] }], getAnchorPosition: [{ type: i0.Input, args: [{ isSignal: true, alias: "getAnchorPosition", required: false }] }], getBoundaryEl: [{ type: i0.Input, args: [{ isSignal: true, alias: "getBoundaryEl", required: false }] }], initialFocusEl: [{ type: i0.Input, args: [{ isSignal: true, alias: "initialFocusEl", required: false }] }], finalFocusEl: [{ type: i0.Input, args: [{ isSignal: true, alias: "finalFocusEl", required: false }] }], openChangeDetails: [{ type: i0.Output, args: ["openChangeDetails"] }], positionDetailsChange: [{ type: i0.Output, args: ["positionDetailsChange"] }], positionChangeEnd: [{ type: i0.Output, args: ["positionChangeEnd"] }], sizeDetailsChange: [{ type: i0.Output, args: ["sizeDetailsChange"] }], sizeChangeEnd: [{ type: i0.Output, args: ["sizeChangeEnd"] }], stageChange: [{ type: i0.Output, args: ["stageChange"] }] } });
261
+
262
+ class FloatingPanelRootProvider extends PresenceBase {
263
+ /** The floating panel machine returned by useFloatingPanel(). */
264
+ value = input.required(/* @ts-ignore */
265
+ ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
266
+ state = computed(() => this.value().state(), /* @ts-ignore */
267
+ ...(ngDevMode ? [{ debugName: "state" }] : /* istanbul ignore next */ []));
268
+ api = computed(() => this.value().api(), /* @ts-ignore */
269
+ ...(ngDevMode ? [{ debugName: "api" }] : /* istanbul ignore next */ []));
270
+ send = (event) => this.value().send(event);
271
+ get service() {
272
+ return this.value().service;
273
+ }
274
+ presence = this.createPresence(() => {
275
+ try {
276
+ return this.api().open;
277
+ }
278
+ catch {
279
+ return false;
280
+ }
281
+ });
282
+ contextCarrier = buildRootCarrier({
283
+ providers: [
284
+ { provide: PRESENCE_CONTEXT, useValue: this.presence },
285
+ { provide: FLOATING_PANEL_RENDER_STRATEGY_CONTEXT, useValue: this },
286
+ ],
287
+ root: this,
288
+ rootToken: FLOATING_PANEL_CONTEXT,
289
+ originInjector: inject(Injector),
290
+ environmentInjector: inject(EnvironmentInjector),
291
+ });
292
+ /** @internal Exposed for floating panel part directives to consume through portals. */
293
+ getContextCarrier() {
294
+ return this.contextCarrier;
295
+ }
296
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: FloatingPanelRootProvider, deps: null, target: i0.ɵɵFactoryTarget.Directive });
297
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.1.3", type: FloatingPanelRootProvider, isStandalone: true, selector: "[floating-panel-root-provider]", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: true, transformFunction: null } }, providers: [
298
+ {
299
+ provide: PRESENCE_CONTEXT,
300
+ useFactory: (provider) => provider.presence,
301
+ deps: [forwardRef(() => FloatingPanelRootProvider)],
302
+ },
303
+ {
304
+ provide: FLOATING_PANEL_RENDER_STRATEGY_CONTEXT,
305
+ useExisting: forwardRef(() => FloatingPanelRootProvider),
306
+ },
307
+ {
308
+ provide: FLOATING_PANEL_CONTEXT,
309
+ useExisting: forwardRef(() => FloatingPanelRootProvider),
310
+ },
311
+ {
312
+ provide: FLOATING_PANEL_CONTEXT_CARRIER,
313
+ useFactory: (provider) => provider.getContextCarrier(),
314
+ deps: [forwardRef(() => FloatingPanelRootProvider)],
315
+ },
316
+ ], exportAs: ["floatingPanelRootProvider"], usesInheritance: true, ngImport: i0 });
317
+ }
318
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: FloatingPanelRootProvider, decorators: [{
319
+ type: Directive,
320
+ args: [{
321
+ selector: "[floating-panel-root-provider]",
322
+ standalone: true,
323
+ exportAs: "floatingPanelRootProvider",
324
+ providers: [
325
+ {
326
+ provide: PRESENCE_CONTEXT,
327
+ useFactory: (provider) => provider.presence,
328
+ deps: [forwardRef(() => FloatingPanelRootProvider)],
329
+ },
330
+ {
331
+ provide: FLOATING_PANEL_RENDER_STRATEGY_CONTEXT,
332
+ useExisting: forwardRef(() => FloatingPanelRootProvider),
333
+ },
334
+ {
335
+ provide: FLOATING_PANEL_CONTEXT,
336
+ useExisting: forwardRef(() => FloatingPanelRootProvider),
337
+ },
338
+ {
339
+ provide: FLOATING_PANEL_CONTEXT_CARRIER,
340
+ useFactory: (provider) => provider.getContextCarrier(),
341
+ deps: [forwardRef(() => FloatingPanelRootProvider)],
342
+ },
343
+ ],
344
+ }]
345
+ }], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: true }] }] } });
346
+
347
+ class FloatingPanelTrigger {
348
+ constructor() {
349
+ const context = injectFloatingPanelContext();
350
+ bindProps({
351
+ elementRef: inject(ElementRef),
352
+ renderer: inject(Renderer2),
353
+ destroyRef: inject(DestroyRef),
354
+ props: () => context.api().getTriggerProps(),
355
+ });
356
+ }
357
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: FloatingPanelTrigger, deps: [], target: i0.ɵɵFactoryTarget.Directive });
358
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.3", type: FloatingPanelTrigger, isStandalone: true, selector: "[floating-panel-trigger]", exportAs: ["floatingPanelTrigger"], ngImport: i0 });
359
+ }
360
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: FloatingPanelTrigger, decorators: [{
361
+ type: Directive,
362
+ args: [{
363
+ selector: "[floating-panel-trigger]",
364
+ standalone: true,
365
+ exportAs: "floatingPanelTrigger",
366
+ }]
367
+ }], ctorParameters: () => [] });
368
+
369
+ class FloatingPanelPositioner {
370
+ constructor() {
371
+ const context = injectFloatingPanelContext();
372
+ const presence = injectPresenceContext();
373
+ const template = inject((TemplateRef), { optional: true });
374
+ const container = inject(ViewContainerRef);
375
+ const host = inject(ElementRef);
376
+ const elementRef = template ? { nativeElement: null } : host;
377
+ let view;
378
+ effect(() => {
379
+ const unmounted = presence.unmounted();
380
+ if (template) {
381
+ if (unmounted) {
382
+ elementRef.nativeElement = null;
383
+ container.clear();
384
+ view = undefined;
385
+ }
386
+ else if (!view) {
387
+ view = container.createEmbeddedView(template);
388
+ elementRef.nativeElement =
389
+ view.rootNodes.find((node) => node.nodeType === 1) ?? null;
390
+ }
391
+ }
392
+ });
393
+ bindProps({
394
+ elementRef,
395
+ renderer: inject(Renderer2),
396
+ destroyRef: inject(DestroyRef),
397
+ props: () => {
398
+ const unmounted = presence.unmounted();
399
+ return { ...context.api().getPositionerProps(), hidden: unmounted };
400
+ },
401
+ });
402
+ }
403
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: FloatingPanelPositioner, deps: [], target: i0.ɵɵFactoryTarget.Directive });
404
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.3", type: FloatingPanelPositioner, isStandalone: true, selector: "[floating-panel-positioner]", exportAs: ["floatingPanelPositioner"], ngImport: i0 });
405
+ }
406
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: FloatingPanelPositioner, decorators: [{
407
+ type: Directive,
408
+ args: [{
409
+ selector: "[floating-panel-positioner]",
410
+ standalone: true,
411
+ exportAs: "floatingPanelPositioner",
412
+ }]
413
+ }], ctorParameters: () => [] });
414
+
415
+ class FloatingPanelContent {
416
+ constructor() {
417
+ const context = injectFloatingPanelContext();
418
+ const presence = injectPresenceContext();
419
+ const template = inject((TemplateRef), { optional: true });
420
+ const container = inject(ViewContainerRef);
421
+ const host = inject(ElementRef);
422
+ const elementRef = template ? { nativeElement: null } : host;
423
+ let view;
424
+ effect(() => {
425
+ const unmounted = presence.unmounted();
426
+ if (template) {
427
+ if (unmounted) {
428
+ elementRef.nativeElement = null;
429
+ container.clear();
430
+ view = undefined;
431
+ }
432
+ else if (!view) {
433
+ view = container.createEmbeddedView(template);
434
+ elementRef.nativeElement =
435
+ view.rootNodes.find((node) => node.nodeType === 1) ?? null;
436
+ }
437
+ }
438
+ untracked(() => presence.setNode(elementRef.nativeElement));
439
+ });
440
+ bindProps({
441
+ elementRef,
442
+ renderer: inject(Renderer2),
443
+ destroyRef: inject(DestroyRef),
444
+ props: () => {
445
+ presence.unmounted();
446
+ return { ...context.api().getContentProps(), ...presence.getPresenceProps() };
447
+ },
448
+ });
449
+ }
450
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: FloatingPanelContent, deps: [], target: i0.ɵɵFactoryTarget.Directive });
451
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.3", type: FloatingPanelContent, isStandalone: true, selector: "[floating-panel-content]", exportAs: ["floatingPanelContent"], ngImport: i0 });
452
+ }
453
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: FloatingPanelContent, decorators: [{
454
+ type: Directive,
455
+ args: [{
456
+ selector: "[floating-panel-content]",
457
+ standalone: true,
458
+ exportAs: "floatingPanelContent",
459
+ }]
460
+ }], ctorParameters: () => [] });
461
+
462
+ class FloatingPanelControl {
463
+ constructor() {
464
+ const context = injectFloatingPanelContext();
465
+ bindProps({
466
+ elementRef: inject(ElementRef),
467
+ renderer: inject(Renderer2),
468
+ destroyRef: inject(DestroyRef),
469
+ props: () => context.api().getControlProps(),
470
+ });
471
+ }
472
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: FloatingPanelControl, deps: [], target: i0.ɵɵFactoryTarget.Directive });
473
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.3", type: FloatingPanelControl, isStandalone: true, selector: "[floating-panel-control]", exportAs: ["floatingPanelControl"], ngImport: i0 });
474
+ }
475
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: FloatingPanelControl, decorators: [{
476
+ type: Directive,
477
+ args: [{
478
+ selector: "[floating-panel-control]",
479
+ standalone: true,
480
+ exportAs: "floatingPanelControl",
481
+ }]
482
+ }], ctorParameters: () => [] });
483
+
484
+ class FloatingPanelHeader {
485
+ constructor() {
486
+ const context = injectFloatingPanelContext();
487
+ bindProps({
488
+ elementRef: inject(ElementRef),
489
+ renderer: inject(Renderer2),
490
+ destroyRef: inject(DestroyRef),
491
+ props: () => context.api().getHeaderProps(),
492
+ });
493
+ }
494
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: FloatingPanelHeader, deps: [], target: i0.ɵɵFactoryTarget.Directive });
495
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.3", type: FloatingPanelHeader, isStandalone: true, selector: "[floating-panel-header]", exportAs: ["floatingPanelHeader"], ngImport: i0 });
496
+ }
497
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: FloatingPanelHeader, decorators: [{
498
+ type: Directive,
499
+ args: [{
500
+ selector: "[floating-panel-header]",
501
+ standalone: true,
502
+ exportAs: "floatingPanelHeader",
503
+ }]
504
+ }], ctorParameters: () => [] });
505
+
506
+ class FloatingPanelBody {
507
+ constructor() {
508
+ const context = injectFloatingPanelContext();
509
+ bindProps({
510
+ elementRef: inject(ElementRef),
511
+ renderer: inject(Renderer2),
512
+ destroyRef: inject(DestroyRef),
513
+ props: () => context.api().getBodyProps(),
514
+ });
515
+ }
516
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: FloatingPanelBody, deps: [], target: i0.ɵɵFactoryTarget.Directive });
517
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.3", type: FloatingPanelBody, isStandalone: true, selector: "[floating-panel-body]", exportAs: ["floatingPanelBody"], ngImport: i0 });
518
+ }
519
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: FloatingPanelBody, decorators: [{
520
+ type: Directive,
521
+ args: [{
522
+ selector: "[floating-panel-body]",
523
+ standalone: true,
524
+ exportAs: "floatingPanelBody",
525
+ }]
526
+ }], ctorParameters: () => [] });
527
+
528
+ class FloatingPanelTitle {
529
+ constructor() {
530
+ const context = injectFloatingPanelContext();
531
+ bindProps({
532
+ elementRef: inject(ElementRef),
533
+ renderer: inject(Renderer2),
534
+ destroyRef: inject(DestroyRef),
535
+ props: () => context.api().getTitleProps(),
536
+ });
537
+ }
538
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: FloatingPanelTitle, deps: [], target: i0.ɵɵFactoryTarget.Directive });
539
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.3", type: FloatingPanelTitle, isStandalone: true, selector: "[floating-panel-title]", exportAs: ["floatingPanelTitle"], ngImport: i0 });
540
+ }
541
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: FloatingPanelTitle, decorators: [{
542
+ type: Directive,
543
+ args: [{
544
+ selector: "[floating-panel-title]",
545
+ standalone: true,
546
+ exportAs: "floatingPanelTitle",
547
+ }]
548
+ }], ctorParameters: () => [] });
549
+
550
+ class FloatingPanelCloseTrigger {
551
+ constructor() {
552
+ const context = injectFloatingPanelContext();
553
+ bindProps({
554
+ elementRef: inject(ElementRef),
555
+ renderer: inject(Renderer2),
556
+ destroyRef: inject(DestroyRef),
557
+ props: () => context.api().getCloseTriggerProps(),
558
+ });
559
+ }
560
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: FloatingPanelCloseTrigger, deps: [], target: i0.ɵɵFactoryTarget.Directive });
561
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.3", type: FloatingPanelCloseTrigger, isStandalone: true, selector: "[floating-panel-close-trigger]", exportAs: ["floatingPanelCloseTrigger"], ngImport: i0 });
562
+ }
563
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: FloatingPanelCloseTrigger, decorators: [{
564
+ type: Directive,
565
+ args: [{
566
+ selector: "[floating-panel-close-trigger]",
567
+ standalone: true,
568
+ exportAs: "floatingPanelCloseTrigger",
569
+ }]
570
+ }], ctorParameters: () => [] });
571
+
572
+ class FloatingPanelDragTrigger {
573
+ constructor() {
574
+ const context = injectFloatingPanelContext();
575
+ bindProps({
576
+ elementRef: inject(ElementRef),
577
+ renderer: inject(Renderer2),
578
+ destroyRef: inject(DestroyRef),
579
+ props: () => context.api().getDragTriggerProps(),
580
+ });
581
+ }
582
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: FloatingPanelDragTrigger, deps: [], target: i0.ɵɵFactoryTarget.Directive });
583
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.3", type: FloatingPanelDragTrigger, isStandalone: true, selector: "[floating-panel-drag-trigger]", exportAs: ["floatingPanelDragTrigger"], ngImport: i0 });
584
+ }
585
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: FloatingPanelDragTrigger, decorators: [{
586
+ type: Directive,
587
+ args: [{
588
+ selector: "[floating-panel-drag-trigger]",
589
+ standalone: true,
590
+ exportAs: "floatingPanelDragTrigger",
591
+ }]
592
+ }], ctorParameters: () => [] });
593
+
594
+ class FloatingPanelResizeTrigger {
595
+ /** The axis of the resize handle. */
596
+ axis = input.required(/* @ts-ignore */
597
+ ...(ngDevMode ? [{ debugName: "axis" }] : /* istanbul ignore next */ []));
598
+ constructor() {
599
+ const context = injectFloatingPanelContext();
600
+ bindProps({
601
+ elementRef: inject(ElementRef),
602
+ renderer: inject(Renderer2),
603
+ destroyRef: inject(DestroyRef),
604
+ props: () => context.api().getResizeTriggerProps({ axis: this.axis() }),
605
+ });
606
+ }
607
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: FloatingPanelResizeTrigger, deps: [], target: i0.ɵɵFactoryTarget.Directive });
608
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.1.3", type: FloatingPanelResizeTrigger, isStandalone: true, selector: "[floating-panel-resize-trigger]", inputs: { axis: { classPropertyName: "axis", publicName: "axis", isSignal: true, isRequired: true, transformFunction: null } }, exportAs: ["floatingPanelResizeTrigger"], ngImport: i0 });
609
+ }
610
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: FloatingPanelResizeTrigger, decorators: [{
611
+ type: Directive,
612
+ args: [{
613
+ selector: "[floating-panel-resize-trigger]",
614
+ standalone: true,
615
+ exportAs: "floatingPanelResizeTrigger",
616
+ }]
617
+ }], ctorParameters: () => [], propDecorators: { axis: [{ type: i0.Input, args: [{ isSignal: true, alias: "axis", required: true }] }] } });
618
+
619
+ class FloatingPanelStageTrigger {
620
+ /** The stage to apply when the trigger is clicked. */
621
+ stage = input.required(/* @ts-ignore */
622
+ ...(ngDevMode ? [{ debugName: "stage" }] : /* istanbul ignore next */ []));
623
+ constructor() {
624
+ const context = injectFloatingPanelContext();
625
+ bindProps({
626
+ elementRef: inject(ElementRef),
627
+ renderer: inject(Renderer2),
628
+ destroyRef: inject(DestroyRef),
629
+ props: () => context.api().getStageTriggerProps({ stage: this.stage() }),
630
+ });
631
+ }
632
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: FloatingPanelStageTrigger, deps: [], target: i0.ɵɵFactoryTarget.Directive });
633
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.1.3", type: FloatingPanelStageTrigger, isStandalone: true, selector: "[floating-panel-stage-trigger]", inputs: { stage: { classPropertyName: "stage", publicName: "stage", isSignal: true, isRequired: true, transformFunction: null } }, exportAs: ["floatingPanelStageTrigger"], ngImport: i0 });
634
+ }
635
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: FloatingPanelStageTrigger, decorators: [{
636
+ type: Directive,
637
+ args: [{
638
+ selector: "[floating-panel-stage-trigger]",
639
+ standalone: true,
640
+ exportAs: "floatingPanelStageTrigger",
641
+ }]
642
+ }], ctorParameters: () => [], propDecorators: { stage: [{ type: i0.Input, args: [{ isSignal: true, alias: "stage", required: true }] }] } });
643
+
644
+ class FloatingPanelContext {
645
+ static ngTemplateContextGuard(_directive, context) {
646
+ void context;
647
+ return true;
648
+ }
649
+ floatingPanel = injectFloatingPanelContext();
650
+ templateRef = inject(TemplateRef);
651
+ viewContainer = inject(ViewContainerRef);
652
+ constructor() {
653
+ const view = this.viewContainer.createEmbeddedView(this.templateRef, {
654
+ $implicit: this.floatingPanel.api,
655
+ api: this.floatingPanel.api,
656
+ });
657
+ effect(() => {
658
+ this.floatingPanel.api();
659
+ view.detectChanges();
660
+ });
661
+ }
662
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: FloatingPanelContext, deps: [], target: i0.ɵɵFactoryTarget.Directive });
663
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.3", type: FloatingPanelContext, isStandalone: true, selector: "[floating-panel-context]", exportAs: ["floatingPanelContext"], ngImport: i0 });
664
+ }
665
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: FloatingPanelContext, decorators: [{
666
+ type: Directive,
667
+ args: [{
668
+ selector: "[floating-panel-context]",
669
+ standalone: true,
670
+ exportAs: "floatingPanelContext",
671
+ }]
672
+ }], ctorParameters: () => [] });
673
+
674
+ /**
675
+ * Generated bundle index. Do not edit.
676
+ */
677
+
678
+ export { FLOATING_PANEL_CONTEXT, FLOATING_PANEL_CONTEXT_CARRIER, FLOATING_PANEL_RENDER_STRATEGY_CONTEXT, FloatingPanelBody, FloatingPanelCloseTrigger, FloatingPanelContent, FloatingPanelContext, FloatingPanelControl, FloatingPanelDragTrigger, FloatingPanelHeader, FloatingPanelPositioner, FloatingPanelResizeTrigger, FloatingPanelRoot, FloatingPanelRootProvider, FloatingPanelStageTrigger, FloatingPanelTitle, FloatingPanelTrigger, injectFloatingPanelContext, injectFloatingPanelContextCarrier, injectFloatingPanelRenderStrategyContext, useFloatingPanel };
679
+ //# sourceMappingURL=wirekyt-angular-floating-panel.mjs.map