@split-window/angular 0.0.0-stage → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +241 -2
- package/fesm2022/split-window-angular.mjs +2180 -0
- package/fesm2022/split-window-angular.mjs.map +1 -0
- package/package.json +41 -4
- package/types/split-window-angular.d.ts +813 -0
|
@@ -0,0 +1,2180 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import { ApplicationRef, ChangeDetectionStrategy, ChangeDetectorRef, Component, DOCUMENT, DestroyRef, Directive, ElementRef, EnvironmentInjector, Injectable, InjectionToken, Injector, PLATFORM_ID, RendererFactory2, RendererStyleFlags2, TemplateRef, ViewEncapsulation, afterNextRender, booleanAttribute, computed as computed$1, createComponent, inject, input, makeEnvironmentProviders, reflectComponentType, signal, viewChild } from "@angular/core";
|
|
3
|
+
import { BaseSplitWindowEngine, DEFAULT_SPLIT_WINDOW_CONFIG, DIRECT_DOM_WRITER, NoopSplitAnimationEngine, SPLIT_BODY_SIDES, SPLIT_CONTAINER_LAYOUTS, SPLIT_CONTAINER_LAYOUTS as SPLIT_CONTAINER_LAYOUTS$1, SPLIT_DEFAULT_EASING, SPLIT_NOOP_ANIMATION_ENGINE, SplitAnimationEngine, SplitAnimationEngineRegistry as SplitAnimationEngineRegistry$1, SplitContainerFullError, SplitContainerNotFoundError, SplitContainerRegistry as SplitContainerRegistry$1, SplitDuplicateContainerError, SplitFunctionAnimationEngine, SplitInvalidOptionError, SplitInvalidOptionError as SplitInvalidOptionError$1, SplitNoDefaultContainerError, SplitReservedContainerKeyError, SplitStyleStash, SplitStyleStash as SplitStyleStash$1, SplitWindowController as SplitWindowController$1, SplitWindowError, SplitWindowRef, computeClosedDropZoneRect, computeExpandedRect, defaultAnimationPreset, mergeAnimation, mergeSplitWindowConfig, normalizeAnimation, rectsMatch, resolveLength, toClassList, toClassList as toClassList$1 } from "@split-window/core";
|
|
4
|
+
import { isPlatformBrowser } from "@angular/common";
|
|
5
|
+
import { CdkDrag, CdkDragHandle, CdkDragPlaceholder, CdkDropList } from "@angular/cdk/drag-drop";
|
|
6
|
+
import { filter } from "rxjs";
|
|
7
|
+
const SPLIT_WINDOW_CONFIG = new InjectionToken("SPLIT_WINDOW_CONFIG", { factory: () => mergeSplitWindowConfig() });
|
|
8
|
+
const SPLIT_WINDOW_MODES = new InjectionToken("SPLIT_WINDOW_MODES");
|
|
9
|
+
const SPLIT_CONTAINER_DEFAULTS = new InjectionToken("SPLIT_CONTAINER_DEFAULTS", { factory: () => ({}) });
|
|
10
|
+
const SPLIT_ANIMATION_ENGINES = new InjectionToken("SPLIT_ANIMATION_ENGINES");
|
|
11
|
+
var SplitAnimationEngineRegistry = class SplitAnimationEngineRegistry extends SplitAnimationEngineRegistry$1 {
|
|
12
|
+
constructor() {
|
|
13
|
+
const injector = inject(EnvironmentInjector);
|
|
14
|
+
super((type) => Injector.create({
|
|
15
|
+
providers: [{
|
|
16
|
+
provide: type,
|
|
17
|
+
useClass: type
|
|
18
|
+
}],
|
|
19
|
+
parent: injector
|
|
20
|
+
}).get(type));
|
|
21
|
+
for (const record of inject(SPLIT_ANIMATION_ENGINES, { optional: true }) ?? []) for (const [name, engine] of Object.entries(record)) this.register(name, engine);
|
|
22
|
+
}
|
|
23
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
24
|
+
minVersion: "12.0.0",
|
|
25
|
+
version: "22.3.0",
|
|
26
|
+
ngImport: i0,
|
|
27
|
+
type: SplitAnimationEngineRegistry,
|
|
28
|
+
deps: [],
|
|
29
|
+
target: i0.ɵɵFactoryTarget.Injectable
|
|
30
|
+
});
|
|
31
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({
|
|
32
|
+
minVersion: "12.0.0",
|
|
33
|
+
version: "22.3.0",
|
|
34
|
+
ngImport: i0,
|
|
35
|
+
type: SplitAnimationEngineRegistry
|
|
36
|
+
});
|
|
37
|
+
};
|
|
38
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
39
|
+
minVersion: "12.0.0",
|
|
40
|
+
version: "22.3.0",
|
|
41
|
+
ngImport: i0,
|
|
42
|
+
type: SplitAnimationEngineRegistry,
|
|
43
|
+
decorators: [{ type: Injectable }],
|
|
44
|
+
ctorParameters: () => []
|
|
45
|
+
});
|
|
46
|
+
var SplitActiveWindow = class {
|
|
47
|
+
ref;
|
|
48
|
+
_containerKey = signal(null, ...ngDevMode ? [{ debugName: "_containerKey" }] : /* istanbul ignore next */ []);
|
|
49
|
+
_title = signal("", ...ngDevMode ? [{ debugName: "_title" }] : /* istanbul ignore next */ []);
|
|
50
|
+
_label = signal("", ...ngDevMode ? [{ debugName: "_label" }] : /* istanbul ignore next */ []);
|
|
51
|
+
_active = signal(false, ...ngDevMode ? [{ debugName: "_active" }] : /* istanbul ignore next */ []);
|
|
52
|
+
containerKey = this._containerKey.asReadonly();
|
|
53
|
+
title = this._title.asReadonly();
|
|
54
|
+
label = this._label.asReadonly();
|
|
55
|
+
isActive = this._active.asReadonly();
|
|
56
|
+
constructor(ref) {
|
|
57
|
+
this.ref = ref;
|
|
58
|
+
this.sync();
|
|
59
|
+
ref.containerChanged.subscribe(() => this.sync());
|
|
60
|
+
ref.titleChanged.subscribe(() => this.sync());
|
|
61
|
+
ref.activated.subscribe(() => this._active.set(true));
|
|
62
|
+
ref.deactivated.subscribe(() => this._active.set(false));
|
|
63
|
+
ref.hidden.subscribe(() => this.sync());
|
|
64
|
+
}
|
|
65
|
+
close(result, options) {
|
|
66
|
+
return this.ref.close(result, options);
|
|
67
|
+
}
|
|
68
|
+
dismiss(reason, options) {
|
|
69
|
+
return this.ref.dismiss(reason, options);
|
|
70
|
+
}
|
|
71
|
+
setTitle(title) {
|
|
72
|
+
this.ref.setTitle(title);
|
|
73
|
+
}
|
|
74
|
+
setClosable(closable) {
|
|
75
|
+
this.ref.setClosable(closable);
|
|
76
|
+
}
|
|
77
|
+
setCanClose(guard) {
|
|
78
|
+
this.ref.setCanClose(guard);
|
|
79
|
+
}
|
|
80
|
+
sync() {
|
|
81
|
+
this._containerKey.set(this.ref.containerKey);
|
|
82
|
+
this._title.set(this.ref.title);
|
|
83
|
+
this._label.set(this.ref.label);
|
|
84
|
+
this._active.set(this.ref.isActive);
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
var SplitContainerMode = class {
|
|
88
|
+
settings() {
|
|
89
|
+
return {};
|
|
90
|
+
}
|
|
91
|
+
open(ctx) {}
|
|
92
|
+
close(ctx) {}
|
|
93
|
+
shown(ctx) {}
|
|
94
|
+
hidden(ctx) {}
|
|
95
|
+
frames(ctx, phase) {
|
|
96
|
+
const open = this.openFrame(ctx);
|
|
97
|
+
const closed = this.closedFrame(ctx, open);
|
|
98
|
+
return phase === "show" ? {
|
|
99
|
+
from: closed,
|
|
100
|
+
to: open
|
|
101
|
+
} : {
|
|
102
|
+
from: open,
|
|
103
|
+
to: closed
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
openFrame(ctx) {
|
|
107
|
+
const r = ctx.elements.shell.getBoundingClientRect();
|
|
108
|
+
return {
|
|
109
|
+
rect: {
|
|
110
|
+
x: r.x,
|
|
111
|
+
y: r.y,
|
|
112
|
+
width: r.width,
|
|
113
|
+
height: r.height
|
|
114
|
+
},
|
|
115
|
+
opacity: 1,
|
|
116
|
+
hostSize: null,
|
|
117
|
+
push: null
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
closedFrame(ctx, open) {
|
|
121
|
+
if (this.layout === "inline") return {
|
|
122
|
+
...open,
|
|
123
|
+
opacity: 0
|
|
124
|
+
};
|
|
125
|
+
return {
|
|
126
|
+
...open,
|
|
127
|
+
rect: offsetRect(open.rect, ctx.side)
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
};
|
|
131
|
+
function offsetRect(rect, side) {
|
|
132
|
+
switch (side) {
|
|
133
|
+
case "left": return {
|
|
134
|
+
...rect,
|
|
135
|
+
x: rect.x - rect.width
|
|
136
|
+
};
|
|
137
|
+
case "right": return {
|
|
138
|
+
...rect,
|
|
139
|
+
x: rect.x + rect.width
|
|
140
|
+
};
|
|
141
|
+
case "top": return {
|
|
142
|
+
...rect,
|
|
143
|
+
y: rect.y - rect.height
|
|
144
|
+
};
|
|
145
|
+
case "bottom": return {
|
|
146
|
+
...rect,
|
|
147
|
+
y: rect.y + rect.height
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
function axisOf(side) {
|
|
152
|
+
return side === "left" || side === "right" ? "width" : "height";
|
|
153
|
+
}
|
|
154
|
+
var SplitInlineMode = class extends SplitContainerMode {
|
|
155
|
+
layout = "inline";
|
|
156
|
+
};
|
|
157
|
+
var SplitOverlayMode = class extends SplitContainerMode {
|
|
158
|
+
layout = "overlay";
|
|
159
|
+
};
|
|
160
|
+
var SplitPushMode = class extends SplitContainerMode {
|
|
161
|
+
layout = "push";
|
|
162
|
+
open(ctx) {
|
|
163
|
+
const { elements, side, styles, document } = ctx;
|
|
164
|
+
if (ctx.kind === "body") {
|
|
165
|
+
const target = elements.pushTarget ?? document.body;
|
|
166
|
+
const property = `padding-${side}`;
|
|
167
|
+
const base = computed(target, property) || "0px";
|
|
168
|
+
const size = ctx.size ?? "0px";
|
|
169
|
+
ctx.data["pushFrom"] = base;
|
|
170
|
+
styles.set(target, property, `calc(${base} + ${size})`);
|
|
171
|
+
styles.set(document.documentElement, `--split-body-offset-${side}`, size);
|
|
172
|
+
return;
|
|
173
|
+
}
|
|
174
|
+
const { host, shell } = elements;
|
|
175
|
+
const axis = axisOf(side);
|
|
176
|
+
let size = ctx.size;
|
|
177
|
+
if (!size) {
|
|
178
|
+
const { writer } = styles;
|
|
179
|
+
const saved = [
|
|
180
|
+
axis,
|
|
181
|
+
`min-${axis}`,
|
|
182
|
+
"flex"
|
|
183
|
+
].map((prop) => ({
|
|
184
|
+
prop,
|
|
185
|
+
value: host.style.getPropertyValue(prop),
|
|
186
|
+
priority: host.style.getPropertyPriority(prop)
|
|
187
|
+
}));
|
|
188
|
+
for (const { prop } of saved) writer.removeStyle(host, prop);
|
|
189
|
+
const r = host.getBoundingClientRect();
|
|
190
|
+
for (const { prop, value, priority } of saved) if (value) writer.setStyle(host, prop, value, priority);
|
|
191
|
+
size = `${axis === "width" ? r.width : r.height}px`;
|
|
192
|
+
}
|
|
193
|
+
ctx.data["hostSize"] = size;
|
|
194
|
+
styles.set(host, axis, size);
|
|
195
|
+
styles.set(shell, "--split-size", size);
|
|
196
|
+
}
|
|
197
|
+
openFrame(ctx) {
|
|
198
|
+
const frame = super.openFrame(ctx);
|
|
199
|
+
if (ctx.kind === "body") {
|
|
200
|
+
const target = ctx.elements.pushTarget ?? ctx.document.body;
|
|
201
|
+
const property = `padding-${ctx.side}`;
|
|
202
|
+
const value = computed(target, property) || target.style.getPropertyValue(property);
|
|
203
|
+
return {
|
|
204
|
+
...frame,
|
|
205
|
+
push: value || null
|
|
206
|
+
};
|
|
207
|
+
}
|
|
208
|
+
return {
|
|
209
|
+
...frame,
|
|
210
|
+
hostSize: ctx.data["hostSize"] ?? null
|
|
211
|
+
};
|
|
212
|
+
}
|
|
213
|
+
closedFrame(ctx, open) {
|
|
214
|
+
const frame = super.closedFrame(ctx, open);
|
|
215
|
+
if (ctx.kind === "body") return {
|
|
216
|
+
...frame,
|
|
217
|
+
push: ctx.data["pushFrom"] ?? "0px"
|
|
218
|
+
};
|
|
219
|
+
return {
|
|
220
|
+
...frame,
|
|
221
|
+
hostSize: "0px"
|
|
222
|
+
};
|
|
223
|
+
}
|
|
224
|
+
};
|
|
225
|
+
function computed(el, property) {
|
|
226
|
+
const view = el.ownerDocument.defaultView;
|
|
227
|
+
return view ? view.getComputedStyle(el).getPropertyValue(property).trim() : "";
|
|
228
|
+
}
|
|
229
|
+
var SplitDefinedMode = class extends SplitContainerMode {
|
|
230
|
+
base;
|
|
231
|
+
delegate;
|
|
232
|
+
definition;
|
|
233
|
+
constructor(base, delegate, definition) {
|
|
234
|
+
super();
|
|
235
|
+
this.base = base;
|
|
236
|
+
this.delegate = delegate;
|
|
237
|
+
this.definition = definition;
|
|
238
|
+
}
|
|
239
|
+
get layout() {
|
|
240
|
+
return this.delegate.layout;
|
|
241
|
+
}
|
|
242
|
+
settings() {
|
|
243
|
+
return mergeModeSettings(this.base.settings(), pickModeSettings(this.definition));
|
|
244
|
+
}
|
|
245
|
+
open(ctx) {
|
|
246
|
+
this.delegate.open(ctx);
|
|
247
|
+
this.definition.onOpen?.(ctx);
|
|
248
|
+
}
|
|
249
|
+
close(ctx) {
|
|
250
|
+
this.definition.onClose?.(ctx);
|
|
251
|
+
this.delegate.close(ctx);
|
|
252
|
+
}
|
|
253
|
+
shown(ctx) {
|
|
254
|
+
this.delegate.shown(ctx);
|
|
255
|
+
this.definition.onShown?.(ctx);
|
|
256
|
+
}
|
|
257
|
+
hidden(ctx) {
|
|
258
|
+
this.delegate.hidden(ctx);
|
|
259
|
+
this.definition.onHidden?.(ctx);
|
|
260
|
+
}
|
|
261
|
+
frames(ctx, phase) {
|
|
262
|
+
return this.delegate.frames(ctx, phase);
|
|
263
|
+
}
|
|
264
|
+
};
|
|
265
|
+
const SETTING_KEYS = [
|
|
266
|
+
"side",
|
|
267
|
+
"size",
|
|
268
|
+
"pushTarget",
|
|
269
|
+
"animation",
|
|
270
|
+
"hostClass",
|
|
271
|
+
"panelClass",
|
|
272
|
+
"backdropClass"
|
|
273
|
+
];
|
|
274
|
+
function pickModeSettings(source) {
|
|
275
|
+
const result = {};
|
|
276
|
+
if (!source) return result;
|
|
277
|
+
for (const key of SETTING_KEYS) {
|
|
278
|
+
const value = source[key];
|
|
279
|
+
if (value !== void 0) result[key] = value;
|
|
280
|
+
}
|
|
281
|
+
return result;
|
|
282
|
+
}
|
|
283
|
+
function mergeModeSettings(...layers) {
|
|
284
|
+
const result = {};
|
|
285
|
+
for (const layer of layers) {
|
|
286
|
+
if (layer.side !== void 0) result.side = layer.side;
|
|
287
|
+
if (layer.size !== void 0) result.size = layer.size;
|
|
288
|
+
if (layer.pushTarget !== void 0) result.pushTarget = layer.pushTarget;
|
|
289
|
+
for (const key of [
|
|
290
|
+
"hostClass",
|
|
291
|
+
"panelClass",
|
|
292
|
+
"backdropClass"
|
|
293
|
+
]) {
|
|
294
|
+
const value = layer[key];
|
|
295
|
+
if (value === void 0) continue;
|
|
296
|
+
const previous = result[key];
|
|
297
|
+
const list = (v) => v === void 0 ? [] : typeof v === "string" ? [v] : [...v];
|
|
298
|
+
result[key] = [...list(previous), ...list(value)];
|
|
299
|
+
}
|
|
300
|
+
if (layer.animation !== void 0) result.animation = mergeAnimation(result.animation, layer.animation);
|
|
301
|
+
}
|
|
302
|
+
return result;
|
|
303
|
+
}
|
|
304
|
+
const isLayout = (value) => SPLIT_CONTAINER_LAYOUTS$1.includes(value);
|
|
305
|
+
var SplitModeResolver = class SplitModeResolver {
|
|
306
|
+
injector = inject(EnvironmentInjector);
|
|
307
|
+
config = inject(SPLIT_WINDOW_CONFIG);
|
|
308
|
+
defaults = inject(SPLIT_CONTAINER_DEFAULTS);
|
|
309
|
+
named = new Map((inject(SPLIT_WINDOW_MODES, { optional: true }) ?? []).flatMap((record) => Object.entries(record)));
|
|
310
|
+
instances = /* @__PURE__ */ new Map();
|
|
311
|
+
builtins = {
|
|
312
|
+
inline: new SplitInlineMode(),
|
|
313
|
+
push: new SplitPushMode(),
|
|
314
|
+
overlay: new SplitOverlayMode()
|
|
315
|
+
};
|
|
316
|
+
modeNames() {
|
|
317
|
+
return [...SPLIT_CONTAINER_LAYOUTS$1, ...this.named.keys()];
|
|
318
|
+
}
|
|
319
|
+
validate(mode, kind, option) {
|
|
320
|
+
if (mode === void 0) return;
|
|
321
|
+
if (typeof mode === "string") {
|
|
322
|
+
if (!isLayout(mode) && !this.named.has(mode)) this.unknown(option, mode);
|
|
323
|
+
if (kind === "body" && mode === "inline") this.inlineOnBody(option);
|
|
324
|
+
} else if (typeof mode === "object" && mode !== null && !(mode instanceof SplitContainerMode)) {
|
|
325
|
+
const layout = mode.layout;
|
|
326
|
+
if (layout !== void 0 && !isLayout(layout)) throw new SplitInvalidOptionError$1(`${option}.layout`, layout, SPLIT_CONTAINER_LAYOUTS$1.join(" | "));
|
|
327
|
+
if (kind === "body" && layout === "inline") this.inlineOnBody(option);
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
resolve(container) {
|
|
331
|
+
const options = container.options;
|
|
332
|
+
const kind = container.kind;
|
|
333
|
+
const ctx = {
|
|
334
|
+
key: container.key,
|
|
335
|
+
kind,
|
|
336
|
+
side: container.side,
|
|
337
|
+
options
|
|
338
|
+
};
|
|
339
|
+
const defaults = mergeDefaults(this.defaults, this.defaults[kind]);
|
|
340
|
+
const input = options["mode"] ?? defaults.mode ?? (kind === "body" ? "overlay" : "inline");
|
|
341
|
+
const mode = this.resolveMode(input, ctx, /* @__PURE__ */ new Set());
|
|
342
|
+
const layout = mode.layout;
|
|
343
|
+
if (kind === "body" && layout === "inline") this.inlineOnBody(`${container.key}.mode`);
|
|
344
|
+
const settings = mergeModeSettings(pickModeSettings(defaults), mode.settings(), pickModeSettings(options));
|
|
345
|
+
const side = kind === "body" ? container.side : settings.side ?? "right";
|
|
346
|
+
let size = settings.size ?? null;
|
|
347
|
+
if (kind === "body" || layout === "overlay") size ??= this.config.bodySize;
|
|
348
|
+
if (layout === "inline" && kind === "custom") size = null;
|
|
349
|
+
const animation = normalizeAnimation(settings.animation);
|
|
350
|
+
const settingsOut = {
|
|
351
|
+
preset: animation.preset ?? defaultAnimationPreset(layout, kind),
|
|
352
|
+
duration: animation.duration,
|
|
353
|
+
easing: animation.easing,
|
|
354
|
+
delay: animation.delay,
|
|
355
|
+
respectReducedMotion: animation.respectReducedMotion ?? true
|
|
356
|
+
};
|
|
357
|
+
return {
|
|
358
|
+
mode,
|
|
359
|
+
kind,
|
|
360
|
+
layout,
|
|
361
|
+
side,
|
|
362
|
+
size,
|
|
363
|
+
pushTarget: settings.pushTarget ?? null,
|
|
364
|
+
hostClass: toClassList$1(settings.hostClass),
|
|
365
|
+
panelClass: toClassList$1(settings.panelClass),
|
|
366
|
+
backdropClass: toClassList$1(settings.backdropClass),
|
|
367
|
+
animated: animation.enabled === true,
|
|
368
|
+
engine: animation.engine,
|
|
369
|
+
animation: settingsOut
|
|
370
|
+
};
|
|
371
|
+
}
|
|
372
|
+
resolveMode(input, ctx, seen) {
|
|
373
|
+
if (seen.has(input)) throw new SplitInvalidOptionError$1("mode", input, "um modo sem referência circular");
|
|
374
|
+
seen.add(input);
|
|
375
|
+
if (typeof input === "string") {
|
|
376
|
+
if (isLayout(input)) return this.builtins[input];
|
|
377
|
+
const named = this.named.get(input);
|
|
378
|
+
if (named === void 0) this.unknown("mode", input);
|
|
379
|
+
return this.resolveMode(named, ctx, seen);
|
|
380
|
+
}
|
|
381
|
+
if (input instanceof SplitContainerMode) return input;
|
|
382
|
+
if (typeof input === "function") {
|
|
383
|
+
if (input.prototype instanceof SplitContainerMode) return this.instantiate(input);
|
|
384
|
+
return this.resolveMode(input(ctx), ctx, seen);
|
|
385
|
+
}
|
|
386
|
+
if (typeof input === "object" && input !== null) {
|
|
387
|
+
const definition = input;
|
|
388
|
+
if (definition.layout !== void 0 && !isLayout(definition.layout)) throw new SplitInvalidOptionError$1("mode.layout", definition.layout, SPLIT_CONTAINER_LAYOUTS$1.join(" | "));
|
|
389
|
+
const base = definition.extends !== void 0 ? this.resolveMode(definition.extends, ctx, seen) : this.builtins[definition.layout ?? (ctx.kind === "body" ? "overlay" : "inline")];
|
|
390
|
+
return new SplitDefinedMode(base, definition.layout && definition.layout !== base.layout ? this.builtins[definition.layout] : base, definition);
|
|
391
|
+
}
|
|
392
|
+
throw new SplitInvalidOptionError$1("mode", input, "nome de modo, objeto, classe ou função");
|
|
393
|
+
}
|
|
394
|
+
instantiate(type) {
|
|
395
|
+
let instance = this.instances.get(type);
|
|
396
|
+
if (!instance) {
|
|
397
|
+
instance = Injector.create({
|
|
398
|
+
providers: [{
|
|
399
|
+
provide: type,
|
|
400
|
+
useClass: type
|
|
401
|
+
}],
|
|
402
|
+
parent: this.injector
|
|
403
|
+
}).get(type);
|
|
404
|
+
this.instances.set(type, instance);
|
|
405
|
+
}
|
|
406
|
+
return instance;
|
|
407
|
+
}
|
|
408
|
+
unknown(option, name) {
|
|
409
|
+
throw new SplitInvalidOptionError$1(option, name, this.modeNames().join(" | "));
|
|
410
|
+
}
|
|
411
|
+
inlineOnBody(option) {
|
|
412
|
+
throw new SplitInvalidOptionError$1(option, "inline", "'push' ou 'overlay' (inline não vale no body)");
|
|
413
|
+
}
|
|
414
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
415
|
+
minVersion: "12.0.0",
|
|
416
|
+
version: "22.3.0",
|
|
417
|
+
ngImport: i0,
|
|
418
|
+
type: SplitModeResolver,
|
|
419
|
+
deps: [],
|
|
420
|
+
target: i0.ɵɵFactoryTarget.Injectable
|
|
421
|
+
});
|
|
422
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({
|
|
423
|
+
minVersion: "12.0.0",
|
|
424
|
+
version: "22.3.0",
|
|
425
|
+
ngImport: i0,
|
|
426
|
+
type: SplitModeResolver
|
|
427
|
+
});
|
|
428
|
+
};
|
|
429
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
430
|
+
minVersion: "12.0.0",
|
|
431
|
+
version: "22.3.0",
|
|
432
|
+
ngImport: i0,
|
|
433
|
+
type: SplitModeResolver,
|
|
434
|
+
decorators: [{ type: Injectable }]
|
|
435
|
+
});
|
|
436
|
+
function mergeDefaults(base, own) {
|
|
437
|
+
if (!own) return base;
|
|
438
|
+
return {
|
|
439
|
+
...mergeModeSettings(pickModeSettings(base), pickModeSettings(own)),
|
|
440
|
+
mode: own.mode ?? base.mode
|
|
441
|
+
};
|
|
442
|
+
}
|
|
443
|
+
var SplitTabStripComponent = class SplitTabStripComponent {
|
|
444
|
+
controller = inject(SplitWindowController);
|
|
445
|
+
engine = inject(AngularSplitEngine);
|
|
446
|
+
element = inject(ElementRef);
|
|
447
|
+
injector = inject(Injector);
|
|
448
|
+
labels = inject(SPLIT_WINDOW_CONFIG).labels;
|
|
449
|
+
view = input.required(...ngDevMode ? [{ debugName: "view" }] : /* istanbul ignore next */ []);
|
|
450
|
+
dropList = viewChild.required(CdkDropList, ...ngDevMode ? [{ debugName: "dropList" }] : /* istanbul ignore next */ []);
|
|
451
|
+
listId = computed$1(() => stripListId(this.view().key), ...ngDevMode ? [{ debugName: "listId" }] : /* istanbul ignore next */ []);
|
|
452
|
+
listData = computed$1(() => ({
|
|
453
|
+
key: this.view().key,
|
|
454
|
+
kind: "strip"
|
|
455
|
+
}), ...ngDevMode ? [{ debugName: "listData" }] : /* istanbul ignore next */ []);
|
|
456
|
+
expanded = computed$1(() => this.view().container.expanded, ...ngDevMode ? [{ debugName: "expanded" }] : /* istanbul ignore next */ []);
|
|
457
|
+
hasClosableTabs = computed$1(() => this.view().tabs.some((t) => t.closable), ...ngDevMode ? [{ debugName: "hasClosableTabs" }] : /* istanbul ignore next */ []);
|
|
458
|
+
enterPredicate = (drag) => this.controller.canDrop(drag.data, this.view().key);
|
|
459
|
+
activate(tab) {
|
|
460
|
+
tab.ref.activate();
|
|
461
|
+
}
|
|
462
|
+
closeTab(event, tab) {
|
|
463
|
+
event.stopPropagation();
|
|
464
|
+
this.controller.requestTabClose(tab.ref);
|
|
465
|
+
}
|
|
466
|
+
toggleExpand() {
|
|
467
|
+
const { controller } = this;
|
|
468
|
+
const key = this.view().key;
|
|
469
|
+
if (controller.isContainerExpanded(key)) controller.restoreContainer(key);
|
|
470
|
+
else controller.expandContainer(key);
|
|
471
|
+
}
|
|
472
|
+
closeAll() {
|
|
473
|
+
this.controller.dismissAll({
|
|
474
|
+
containerKey: this.view().key,
|
|
475
|
+
reason: "close-all"
|
|
476
|
+
});
|
|
477
|
+
}
|
|
478
|
+
onDragStarted(ref) {
|
|
479
|
+
this.engine.startDrag(ref, this.dropList());
|
|
480
|
+
}
|
|
481
|
+
onDrop(event) {
|
|
482
|
+
this.engine.handleDrop(event);
|
|
483
|
+
}
|
|
484
|
+
onTabKeydown(event, tab) {
|
|
485
|
+
const tabs = this.view().tabs;
|
|
486
|
+
const index = tabs.findIndex((t) => t.id === tab.id);
|
|
487
|
+
let target = null;
|
|
488
|
+
switch (event.key) {
|
|
489
|
+
case "ArrowRight":
|
|
490
|
+
case "ArrowLeft": {
|
|
491
|
+
const step = event.key === "ArrowRight" ? 1 : -1;
|
|
492
|
+
if (event.ctrlKey && event.shiftKey) {
|
|
493
|
+
tab.ref.moveTo(this.view().key, Math.max(0, index + step));
|
|
494
|
+
this.focusTab(tab.id);
|
|
495
|
+
event.preventDefault();
|
|
496
|
+
return;
|
|
497
|
+
}
|
|
498
|
+
target = (index + step + tabs.length) % tabs.length;
|
|
499
|
+
break;
|
|
500
|
+
}
|
|
501
|
+
case "Home":
|
|
502
|
+
target = 0;
|
|
503
|
+
break;
|
|
504
|
+
case "End":
|
|
505
|
+
target = tabs.length - 1;
|
|
506
|
+
break;
|
|
507
|
+
case "Delete":
|
|
508
|
+
if (tab.closable) this.controller.requestTabClose(tab.ref);
|
|
509
|
+
event.preventDefault();
|
|
510
|
+
return;
|
|
511
|
+
case "Enter":
|
|
512
|
+
case " ":
|
|
513
|
+
tab.ref.activate();
|
|
514
|
+
event.preventDefault();
|
|
515
|
+
return;
|
|
516
|
+
default: return;
|
|
517
|
+
}
|
|
518
|
+
event.preventDefault();
|
|
519
|
+
const next = tabs[target];
|
|
520
|
+
if (next) {
|
|
521
|
+
next.ref.activate();
|
|
522
|
+
this.focusTab(next.id);
|
|
523
|
+
}
|
|
524
|
+
}
|
|
525
|
+
focusTab(id) {
|
|
526
|
+
const focus = () => this.element.nativeElement.querySelector(`[data-tab-id="${id}"] [role="tab"]`)?.focus();
|
|
527
|
+
focus();
|
|
528
|
+
afterNextRender(focus, { injector: this.injector });
|
|
529
|
+
}
|
|
530
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
531
|
+
minVersion: "12.0.0",
|
|
532
|
+
version: "22.3.0",
|
|
533
|
+
ngImport: i0,
|
|
534
|
+
type: SplitTabStripComponent,
|
|
535
|
+
deps: [],
|
|
536
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
537
|
+
});
|
|
538
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
539
|
+
minVersion: "17.0.0",
|
|
540
|
+
version: "22.3.0",
|
|
541
|
+
type: SplitTabStripComponent,
|
|
542
|
+
isStandalone: true,
|
|
543
|
+
selector: "split-tab-strip",
|
|
544
|
+
inputs: { view: {
|
|
545
|
+
classPropertyName: "view",
|
|
546
|
+
publicName: "view",
|
|
547
|
+
isSignal: true,
|
|
548
|
+
isRequired: true,
|
|
549
|
+
transformFunction: null
|
|
550
|
+
} },
|
|
551
|
+
host: { classAttribute: "split-strip-row" },
|
|
552
|
+
viewQueries: [{
|
|
553
|
+
propertyName: "dropList",
|
|
554
|
+
first: true,
|
|
555
|
+
predicate: CdkDropList,
|
|
556
|
+
descendants: true,
|
|
557
|
+
isSignal: true
|
|
558
|
+
}],
|
|
559
|
+
ngImport: i0,
|
|
560
|
+
template: `
|
|
561
|
+
<div
|
|
562
|
+
class="split-strip"
|
|
563
|
+
role="tablist"
|
|
564
|
+
[attr.aria-label]="labels.tabList + ': ' + view().container.label"
|
|
565
|
+
cdkDropList
|
|
566
|
+
cdkDropListOrientation="horizontal"
|
|
567
|
+
[id]="listId()"
|
|
568
|
+
[cdkDropListData]="listData()"
|
|
569
|
+
[cdkDropListEnterPredicate]="enterPredicate"
|
|
570
|
+
(cdkDropListDropped)="onDrop($event)"
|
|
571
|
+
>
|
|
572
|
+
@for (tab of view().tabs; track tab.id) {
|
|
573
|
+
<div
|
|
574
|
+
class="split-tab"
|
|
575
|
+
cdkDrag
|
|
576
|
+
[cdkDragData]="tab.ref"
|
|
577
|
+
cdkDragPreviewClass="split-drag-preview"
|
|
578
|
+
(cdkDragStarted)="onDragStarted(tab.ref)"
|
|
579
|
+
[attr.data-tab-id]="tab.id"
|
|
580
|
+
[class.split-tab--active]="tab.active"
|
|
581
|
+
>
|
|
582
|
+
<div
|
|
583
|
+
class="split-tab__label"
|
|
584
|
+
role="tab"
|
|
585
|
+
cdkDragHandle
|
|
586
|
+
[id]="tab.id + '-tab'"
|
|
587
|
+
[attr.aria-selected]="tab.active"
|
|
588
|
+
[attr.aria-controls]="tab.id + '-panel'"
|
|
589
|
+
[attr.aria-keyshortcuts]="tab.closable ? 'Delete' : null"
|
|
590
|
+
[attr.tabindex]="tab.active ? 0 : -1"
|
|
591
|
+
[attr.title]="tab.label"
|
|
592
|
+
(click)="activate(tab)"
|
|
593
|
+
(keydown)="onTabKeydown($event, tab)"
|
|
594
|
+
>
|
|
595
|
+
{{ tab.label }}
|
|
596
|
+
</div>
|
|
597
|
+
@if (tab.closable) {
|
|
598
|
+
<!-- Not a nested control of the tab: hidden from assistive technology, which closes with Delete. -->
|
|
599
|
+
<button
|
|
600
|
+
type="button"
|
|
601
|
+
class="split-icon-button split-tab__close"
|
|
602
|
+
tabindex="-1"
|
|
603
|
+
aria-hidden="true"
|
|
604
|
+
[attr.title]="labels.closeTab + ': ' + tab.label"
|
|
605
|
+
(pointerdown)="$event.stopPropagation()"
|
|
606
|
+
(mousedown)="$event.stopPropagation()"
|
|
607
|
+
(click)="closeTab($event, tab)"
|
|
608
|
+
>
|
|
609
|
+
×
|
|
610
|
+
</button>
|
|
611
|
+
}
|
|
612
|
+
<div *cdkDragPlaceholder class="split-tab cdk-drag-placeholder">
|
|
613
|
+
<span class="split-tab__label">{{ tab.label }}</span>
|
|
614
|
+
</div>
|
|
615
|
+
</div>
|
|
616
|
+
}
|
|
617
|
+
</div>
|
|
618
|
+
<div class="split-actions">
|
|
619
|
+
@if (view().canExpand) {
|
|
620
|
+
<button
|
|
621
|
+
type="button"
|
|
622
|
+
class="split-icon-button split-expand-button"
|
|
623
|
+
[attr.aria-label]="expanded() ? labels.restore : labels.expand"
|
|
624
|
+
[attr.aria-pressed]="expanded()"
|
|
625
|
+
[attr.title]="expanded() ? labels.restore : labels.expand"
|
|
626
|
+
[disabled]="view().dragging"
|
|
627
|
+
(click)="toggleExpand()"
|
|
628
|
+
>
|
|
629
|
+
{{ expanded() ? '⤡' : '⤢' }}
|
|
630
|
+
</button>
|
|
631
|
+
}
|
|
632
|
+
<button
|
|
633
|
+
type="button"
|
|
634
|
+
class="split-icon-button split-close-all-button"
|
|
635
|
+
[attr.aria-label]="labels.closeAll"
|
|
636
|
+
[attr.title]="labels.closeAll"
|
|
637
|
+
[disabled]="view().closingAll || !hasClosableTabs()"
|
|
638
|
+
(click)="closeAll()"
|
|
639
|
+
>
|
|
640
|
+
⨯
|
|
641
|
+
</button>
|
|
642
|
+
</div>
|
|
643
|
+
`,
|
|
644
|
+
isInline: true,
|
|
645
|
+
styles: [":where(:root){--split-bg: #ffffff;--split-fg: #1f2328;--split-muted-fg: #59636e;--split-border: #d1d9e0;--split-strip-bg: #f6f8fa;--split-tab-bg: transparent;--split-tab-hover-bg: #eaeef2;--split-tab-active-bg: #ffffff;--split-tab-active-indicator: #0969da;--split-focus-ring: #0969da;--split-drop-highlight: #0969da;--split-drop-zone-bg: rgba(9, 105, 218, .08);--split-backdrop-bg: rgba(0, 0, 0, .32);--split-radius: 6px;--split-tab-height: 36px;--split-tab-max-width: 220px;--split-font: inherit;--split-body-z-index: 1040;--split-expanded-z-index: 1050;--split-drop-zone-z-index: 1060;--split-drag-preview-z-index: 1070;--split-overlay-z-index: 1030;--split-shadow: 0 8px 24px rgba(31, 35, 40, .18)}split-container{display:flex;flex-direction:column;height:100%;min-height:0;box-sizing:border-box;background:var(--split-bg);color:var(--split-fg);font:var(--split-font);border:1px solid var(--split-border);border-radius:var(--split-radius);overflow:hidden;outline:none}split-container[hidden]{display:none}split-container.split-container--expanded{z-index:var(--split-expanded-z-index);box-shadow:var(--split-shadow)}.split-strip-row{display:flex;align-items:stretch;background:var(--split-strip-bg);border-bottom:1px solid var(--split-border);min-height:var(--split-tab-height)}.split-strip{display:flex;flex:1 1 auto;min-width:0;overflow-x:auto;scrollbar-width:thin}.split-tab{display:flex;align-items:center;gap:4px;max-width:var(--split-tab-max-width);padding:0 4px 0 0;background:var(--split-tab-bg);border-right:1px solid var(--split-border);color:var(--split-muted-fg);cursor:pointer;-webkit-user-select:none;user-select:none;box-sizing:border-box;height:var(--split-tab-height);position:relative}.split-tab:hover{background:var(--split-tab-hover-bg)}.split-tab__label:focus-visible{outline:2px solid var(--split-focus-ring);outline-offset:-2px;border-radius:4px}.split-tab--active{background:var(--split-tab-active-bg);color:var(--split-fg);box-shadow:inset 0 -2px 0 var(--split-tab-active-indicator)}.split-tab__label{flex:1 1 auto;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding:0 8px 0 12px;line-height:var(--split-tab-height)}.split-icon-button{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;padding:0;border:0;border-radius:4px;background:transparent;color:inherit;font:inherit;font-size:16px;line-height:1;cursor:pointer;flex:none}.split-icon-button:hover:not(:disabled){background:var(--split-tab-hover-bg);color:var(--split-fg)}.split-icon-button:focus-visible{outline:2px solid var(--split-focus-ring)}.split-icon-button:disabled{opacity:.4;cursor:default}.split-actions{display:flex;align-items:center;gap:2px;padding:0 6px;border-left:1px solid var(--split-border);color:var(--split-muted-fg)}.split-content{position:relative;flex:1 1 auto;min-height:0;overflow:auto}.split-content:empty:before{content:attr(data-empty-label);position:absolute;inset:0;display:flex;align-items:center;justify-content:center;color:var(--split-muted-fg)}.split-content .cdk-drag-placeholder{display:none}.split-tab-panel{height:100%;box-sizing:border-box}.split-tab-panel[hidden]{display:none}.split-strip.cdk-drop-list-dragging .split-tab:not(.cdk-drag-placeholder){transition:transform .2s cubic-bezier(0,0,.2,1)}.split-tab.cdk-drag-placeholder{opacity:.35}.split-tab.cdk-drag-animating{transition:transform .2s cubic-bezier(0,0,.2,1)}.split-drag-preview{z-index:var(--split-drag-preview-z-index)!important;background:var(--split-tab-active-bg);color:var(--split-fg);border:1px solid var(--split-border);border-radius:var(--split-radius);box-shadow:var(--split-shadow);font:var(--split-font)}split-container.split-drop-target{outline:2px solid var(--split-drop-highlight);outline-offset:-2px}.split-body-host{position:fixed;z-index:var(--split-body-z-index);box-sizing:border-box;--split-body-size: 420px}.split-body-host[hidden]{display:none}.split-body-host--left{top:0;bottom:0;left:0;width:var(--split-body-size)}.split-body-host--right{top:0;bottom:0;right:0;width:var(--split-body-size)}.split-body-host--top{top:0;left:0;right:0;height:var(--split-body-size)}.split-body-host--bottom{bottom:0;left:0;right:0;height:var(--split-body-size)}.split-body-host split-container{border-radius:0;box-shadow:var(--split-shadow)}.split-body-backdrop{position:fixed;inset:0;z-index:calc(var(--split-body-z-index) - 1);background:var(--split-backdrop-bg)}.split-body-backdrop[hidden]{display:none}.split-drop-zone{position:fixed;z-index:var(--split-drop-zone-z-index);display:flex;align-items:center;justify-content:center;box-sizing:border-box;padding:8px;border:2px dashed var(--split-drop-highlight);border-radius:var(--split-radius);background:var(--split-bg);background-image:linear-gradient(var(--split-drop-zone-bg),var(--split-drop-zone-bg));color:var(--split-fg);box-shadow:var(--split-shadow);font:var(--split-font);text-align:center}.split-drop-zone.cdk-drop-list-dragging{border-style:solid}.split-drop-zone .cdk-drag-placeholder{display:none}.split-expand-layer{position:static}split-container.split-container--custom:not(.split-layout--inline){position:absolute;inset:var(--split-inset);width:var(--split-w);height:var(--split-h)}split-container.split-container--custom.split-layout--overlay{z-index:var(--split-overlay-z-index);box-shadow:var(--split-shadow)}split-container.split-container--leaving .split-content:empty:before{content:none}@media(prefers-reduced-motion:reduce){.split-strip.cdk-drop-list-dragging .split-tab,.split-tab.cdk-drag-animating{transition:none}}\n"],
|
|
646
|
+
dependencies: [
|
|
647
|
+
{
|
|
648
|
+
kind: "directive",
|
|
649
|
+
type: CdkDropList,
|
|
650
|
+
selector: "[cdkDropList], cdk-drop-list",
|
|
651
|
+
inputs: [
|
|
652
|
+
"cdkDropListConnectedTo",
|
|
653
|
+
"cdkDropListData",
|
|
654
|
+
"cdkDropListOrientation",
|
|
655
|
+
"id",
|
|
656
|
+
"cdkDropListLockAxis",
|
|
657
|
+
"cdkDropListDisabled",
|
|
658
|
+
"cdkDropListSortingDisabled",
|
|
659
|
+
"cdkDropListEnterPredicate",
|
|
660
|
+
"cdkDropListSortPredicate",
|
|
661
|
+
"cdkDropListAutoScrollDisabled",
|
|
662
|
+
"cdkDropListAutoScrollStep",
|
|
663
|
+
"cdkDropListElementContainer",
|
|
664
|
+
"cdkDropListHasAnchor"
|
|
665
|
+
],
|
|
666
|
+
outputs: [
|
|
667
|
+
"cdkDropListDropped",
|
|
668
|
+
"cdkDropListEntered",
|
|
669
|
+
"cdkDropListExited",
|
|
670
|
+
"cdkDropListSorted"
|
|
671
|
+
],
|
|
672
|
+
exportAs: ["cdkDropList"]
|
|
673
|
+
},
|
|
674
|
+
{
|
|
675
|
+
kind: "directive",
|
|
676
|
+
type: CdkDrag,
|
|
677
|
+
selector: "[cdkDrag]",
|
|
678
|
+
inputs: [
|
|
679
|
+
"cdkDragData",
|
|
680
|
+
"cdkDragLockAxis",
|
|
681
|
+
"cdkDragRootElement",
|
|
682
|
+
"cdkDragBoundary",
|
|
683
|
+
"cdkDragStartDelay",
|
|
684
|
+
"cdkDragFreeDragPosition",
|
|
685
|
+
"cdkDragDisabled",
|
|
686
|
+
"cdkDragConstrainPosition",
|
|
687
|
+
"cdkDragPreviewClass",
|
|
688
|
+
"cdkDragPreviewContainer",
|
|
689
|
+
"cdkDragScale"
|
|
690
|
+
],
|
|
691
|
+
outputs: [
|
|
692
|
+
"cdkDragStarted",
|
|
693
|
+
"cdkDragReleased",
|
|
694
|
+
"cdkDragEnded",
|
|
695
|
+
"cdkDragEntered",
|
|
696
|
+
"cdkDragExited",
|
|
697
|
+
"cdkDragDropped",
|
|
698
|
+
"cdkDragMoved"
|
|
699
|
+
],
|
|
700
|
+
exportAs: ["cdkDrag"]
|
|
701
|
+
},
|
|
702
|
+
{
|
|
703
|
+
kind: "directive",
|
|
704
|
+
type: CdkDragHandle,
|
|
705
|
+
selector: "[cdkDragHandle]",
|
|
706
|
+
inputs: ["cdkDragHandleDisabled"]
|
|
707
|
+
},
|
|
708
|
+
{
|
|
709
|
+
kind: "directive",
|
|
710
|
+
type: CdkDragPlaceholder,
|
|
711
|
+
selector: "ng-template[cdkDragPlaceholder]",
|
|
712
|
+
inputs: ["data"]
|
|
713
|
+
}
|
|
714
|
+
],
|
|
715
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
716
|
+
encapsulation: i0.ViewEncapsulation.None
|
|
717
|
+
});
|
|
718
|
+
};
|
|
719
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
720
|
+
minVersion: "12.0.0",
|
|
721
|
+
version: "22.3.0",
|
|
722
|
+
ngImport: i0,
|
|
723
|
+
type: SplitTabStripComponent,
|
|
724
|
+
decorators: [{
|
|
725
|
+
type: Component,
|
|
726
|
+
args: [{
|
|
727
|
+
selector: "split-tab-strip",
|
|
728
|
+
imports: [
|
|
729
|
+
CdkDropList,
|
|
730
|
+
CdkDrag,
|
|
731
|
+
CdkDragHandle,
|
|
732
|
+
CdkDragPlaceholder
|
|
733
|
+
],
|
|
734
|
+
encapsulation: ViewEncapsulation.None,
|
|
735
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
736
|
+
host: { class: "split-strip-row" },
|
|
737
|
+
template: `
|
|
738
|
+
<div
|
|
739
|
+
class="split-strip"
|
|
740
|
+
role="tablist"
|
|
741
|
+
[attr.aria-label]="labels.tabList + ': ' + view().container.label"
|
|
742
|
+
cdkDropList
|
|
743
|
+
cdkDropListOrientation="horizontal"
|
|
744
|
+
[id]="listId()"
|
|
745
|
+
[cdkDropListData]="listData()"
|
|
746
|
+
[cdkDropListEnterPredicate]="enterPredicate"
|
|
747
|
+
(cdkDropListDropped)="onDrop($event)"
|
|
748
|
+
>
|
|
749
|
+
@for (tab of view().tabs; track tab.id) {
|
|
750
|
+
<div
|
|
751
|
+
class="split-tab"
|
|
752
|
+
cdkDrag
|
|
753
|
+
[cdkDragData]="tab.ref"
|
|
754
|
+
cdkDragPreviewClass="split-drag-preview"
|
|
755
|
+
(cdkDragStarted)="onDragStarted(tab.ref)"
|
|
756
|
+
[attr.data-tab-id]="tab.id"
|
|
757
|
+
[class.split-tab--active]="tab.active"
|
|
758
|
+
>
|
|
759
|
+
<div
|
|
760
|
+
class="split-tab__label"
|
|
761
|
+
role="tab"
|
|
762
|
+
cdkDragHandle
|
|
763
|
+
[id]="tab.id + '-tab'"
|
|
764
|
+
[attr.aria-selected]="tab.active"
|
|
765
|
+
[attr.aria-controls]="tab.id + '-panel'"
|
|
766
|
+
[attr.aria-keyshortcuts]="tab.closable ? 'Delete' : null"
|
|
767
|
+
[attr.tabindex]="tab.active ? 0 : -1"
|
|
768
|
+
[attr.title]="tab.label"
|
|
769
|
+
(click)="activate(tab)"
|
|
770
|
+
(keydown)="onTabKeydown($event, tab)"
|
|
771
|
+
>
|
|
772
|
+
{{ tab.label }}
|
|
773
|
+
</div>
|
|
774
|
+
@if (tab.closable) {
|
|
775
|
+
<!-- Not a nested control of the tab: hidden from assistive technology, which closes with Delete. -->
|
|
776
|
+
<button
|
|
777
|
+
type="button"
|
|
778
|
+
class="split-icon-button split-tab__close"
|
|
779
|
+
tabindex="-1"
|
|
780
|
+
aria-hidden="true"
|
|
781
|
+
[attr.title]="labels.closeTab + ': ' + tab.label"
|
|
782
|
+
(pointerdown)="$event.stopPropagation()"
|
|
783
|
+
(mousedown)="$event.stopPropagation()"
|
|
784
|
+
(click)="closeTab($event, tab)"
|
|
785
|
+
>
|
|
786
|
+
×
|
|
787
|
+
</button>
|
|
788
|
+
}
|
|
789
|
+
<div *cdkDragPlaceholder class="split-tab cdk-drag-placeholder">
|
|
790
|
+
<span class="split-tab__label">{{ tab.label }}</span>
|
|
791
|
+
</div>
|
|
792
|
+
</div>
|
|
793
|
+
}
|
|
794
|
+
</div>
|
|
795
|
+
<div class="split-actions">
|
|
796
|
+
@if (view().canExpand) {
|
|
797
|
+
<button
|
|
798
|
+
type="button"
|
|
799
|
+
class="split-icon-button split-expand-button"
|
|
800
|
+
[attr.aria-label]="expanded() ? labels.restore : labels.expand"
|
|
801
|
+
[attr.aria-pressed]="expanded()"
|
|
802
|
+
[attr.title]="expanded() ? labels.restore : labels.expand"
|
|
803
|
+
[disabled]="view().dragging"
|
|
804
|
+
(click)="toggleExpand()"
|
|
805
|
+
>
|
|
806
|
+
{{ expanded() ? '⤡' : '⤢' }}
|
|
807
|
+
</button>
|
|
808
|
+
}
|
|
809
|
+
<button
|
|
810
|
+
type="button"
|
|
811
|
+
class="split-icon-button split-close-all-button"
|
|
812
|
+
[attr.aria-label]="labels.closeAll"
|
|
813
|
+
[attr.title]="labels.closeAll"
|
|
814
|
+
[disabled]="view().closingAll || !hasClosableTabs()"
|
|
815
|
+
(click)="closeAll()"
|
|
816
|
+
>
|
|
817
|
+
⨯
|
|
818
|
+
</button>
|
|
819
|
+
</div>
|
|
820
|
+
`,
|
|
821
|
+
styles: [":where(:root){--split-bg: #ffffff;--split-fg: #1f2328;--split-muted-fg: #59636e;--split-border: #d1d9e0;--split-strip-bg: #f6f8fa;--split-tab-bg: transparent;--split-tab-hover-bg: #eaeef2;--split-tab-active-bg: #ffffff;--split-tab-active-indicator: #0969da;--split-focus-ring: #0969da;--split-drop-highlight: #0969da;--split-drop-zone-bg: rgba(9, 105, 218, .08);--split-backdrop-bg: rgba(0, 0, 0, .32);--split-radius: 6px;--split-tab-height: 36px;--split-tab-max-width: 220px;--split-font: inherit;--split-body-z-index: 1040;--split-expanded-z-index: 1050;--split-drop-zone-z-index: 1060;--split-drag-preview-z-index: 1070;--split-overlay-z-index: 1030;--split-shadow: 0 8px 24px rgba(31, 35, 40, .18)}split-container{display:flex;flex-direction:column;height:100%;min-height:0;box-sizing:border-box;background:var(--split-bg);color:var(--split-fg);font:var(--split-font);border:1px solid var(--split-border);border-radius:var(--split-radius);overflow:hidden;outline:none}split-container[hidden]{display:none}split-container.split-container--expanded{z-index:var(--split-expanded-z-index);box-shadow:var(--split-shadow)}.split-strip-row{display:flex;align-items:stretch;background:var(--split-strip-bg);border-bottom:1px solid var(--split-border);min-height:var(--split-tab-height)}.split-strip{display:flex;flex:1 1 auto;min-width:0;overflow-x:auto;scrollbar-width:thin}.split-tab{display:flex;align-items:center;gap:4px;max-width:var(--split-tab-max-width);padding:0 4px 0 0;background:var(--split-tab-bg);border-right:1px solid var(--split-border);color:var(--split-muted-fg);cursor:pointer;-webkit-user-select:none;user-select:none;box-sizing:border-box;height:var(--split-tab-height);position:relative}.split-tab:hover{background:var(--split-tab-hover-bg)}.split-tab__label:focus-visible{outline:2px solid var(--split-focus-ring);outline-offset:-2px;border-radius:4px}.split-tab--active{background:var(--split-tab-active-bg);color:var(--split-fg);box-shadow:inset 0 -2px 0 var(--split-tab-active-indicator)}.split-tab__label{flex:1 1 auto;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding:0 8px 0 12px;line-height:var(--split-tab-height)}.split-icon-button{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;padding:0;border:0;border-radius:4px;background:transparent;color:inherit;font:inherit;font-size:16px;line-height:1;cursor:pointer;flex:none}.split-icon-button:hover:not(:disabled){background:var(--split-tab-hover-bg);color:var(--split-fg)}.split-icon-button:focus-visible{outline:2px solid var(--split-focus-ring)}.split-icon-button:disabled{opacity:.4;cursor:default}.split-actions{display:flex;align-items:center;gap:2px;padding:0 6px;border-left:1px solid var(--split-border);color:var(--split-muted-fg)}.split-content{position:relative;flex:1 1 auto;min-height:0;overflow:auto}.split-content:empty:before{content:attr(data-empty-label);position:absolute;inset:0;display:flex;align-items:center;justify-content:center;color:var(--split-muted-fg)}.split-content .cdk-drag-placeholder{display:none}.split-tab-panel{height:100%;box-sizing:border-box}.split-tab-panel[hidden]{display:none}.split-strip.cdk-drop-list-dragging .split-tab:not(.cdk-drag-placeholder){transition:transform .2s cubic-bezier(0,0,.2,1)}.split-tab.cdk-drag-placeholder{opacity:.35}.split-tab.cdk-drag-animating{transition:transform .2s cubic-bezier(0,0,.2,1)}.split-drag-preview{z-index:var(--split-drag-preview-z-index)!important;background:var(--split-tab-active-bg);color:var(--split-fg);border:1px solid var(--split-border);border-radius:var(--split-radius);box-shadow:var(--split-shadow);font:var(--split-font)}split-container.split-drop-target{outline:2px solid var(--split-drop-highlight);outline-offset:-2px}.split-body-host{position:fixed;z-index:var(--split-body-z-index);box-sizing:border-box;--split-body-size: 420px}.split-body-host[hidden]{display:none}.split-body-host--left{top:0;bottom:0;left:0;width:var(--split-body-size)}.split-body-host--right{top:0;bottom:0;right:0;width:var(--split-body-size)}.split-body-host--top{top:0;left:0;right:0;height:var(--split-body-size)}.split-body-host--bottom{bottom:0;left:0;right:0;height:var(--split-body-size)}.split-body-host split-container{border-radius:0;box-shadow:var(--split-shadow)}.split-body-backdrop{position:fixed;inset:0;z-index:calc(var(--split-body-z-index) - 1);background:var(--split-backdrop-bg)}.split-body-backdrop[hidden]{display:none}.split-drop-zone{position:fixed;z-index:var(--split-drop-zone-z-index);display:flex;align-items:center;justify-content:center;box-sizing:border-box;padding:8px;border:2px dashed var(--split-drop-highlight);border-radius:var(--split-radius);background:var(--split-bg);background-image:linear-gradient(var(--split-drop-zone-bg),var(--split-drop-zone-bg));color:var(--split-fg);box-shadow:var(--split-shadow);font:var(--split-font);text-align:center}.split-drop-zone.cdk-drop-list-dragging{border-style:solid}.split-drop-zone .cdk-drag-placeholder{display:none}.split-expand-layer{position:static}split-container.split-container--custom:not(.split-layout--inline){position:absolute;inset:var(--split-inset);width:var(--split-w);height:var(--split-h)}split-container.split-container--custom.split-layout--overlay{z-index:var(--split-overlay-z-index);box-shadow:var(--split-shadow)}split-container.split-container--leaving .split-content:empty:before{content:none}@media(prefers-reduced-motion:reduce){.split-strip.cdk-drop-list-dragging .split-tab,.split-tab.cdk-drag-animating{transition:none}}\n"]
|
|
822
|
+
}]
|
|
823
|
+
}],
|
|
824
|
+
propDecorators: {
|
|
825
|
+
view: [{
|
|
826
|
+
type: i0.Input,
|
|
827
|
+
args: [{
|
|
828
|
+
isSignal: true,
|
|
829
|
+
alias: "view",
|
|
830
|
+
required: true
|
|
831
|
+
}]
|
|
832
|
+
}],
|
|
833
|
+
dropList: [{
|
|
834
|
+
type: i0.ViewChild,
|
|
835
|
+
args: [i0.forwardRef(() => CdkDropList), { isSignal: true }]
|
|
836
|
+
}]
|
|
837
|
+
}
|
|
838
|
+
});
|
|
839
|
+
var SplitContainerComponent = class SplitContainerComponent {
|
|
840
|
+
controller = inject(SplitWindowController);
|
|
841
|
+
engine = inject(AngularSplitEngine);
|
|
842
|
+
destroyRef = inject(DestroyRef);
|
|
843
|
+
host = inject(ElementRef);
|
|
844
|
+
containerKey = input.required(...ngDevMode ? [{ debugName: "containerKey" }] : /* istanbul ignore next */ []);
|
|
845
|
+
view = signal(null, ...ngDevMode ? [{ debugName: "view" }] : /* istanbul ignore next */ []);
|
|
846
|
+
highlight = signal(false, ...ngDevMode ? [{ debugName: "highlight" }] : /* istanbul ignore next */ []);
|
|
847
|
+
emptyLabel = inject(SPLIT_WINDOW_CONFIG).labels.emptyContainer;
|
|
848
|
+
content = viewChild("content", ...ngDevMode ? [{ debugName: "content" }] : /* istanbul ignore next */ []);
|
|
849
|
+
frozen = false;
|
|
850
|
+
contentId = computed$1(() => contentListId(this.containerKey()), ...ngDevMode ? [{ debugName: "contentId" }] : /* istanbul ignore next */ []);
|
|
851
|
+
contentData = computed$1(() => ({
|
|
852
|
+
key: this.containerKey(),
|
|
853
|
+
kind: "content"
|
|
854
|
+
}), ...ngDevMode ? [{ debugName: "contentData" }] : /* istanbul ignore next */ []);
|
|
855
|
+
enterPredicate = (drag) => drag.data.containerKey !== this.containerKey() && this.controller.canDrop(drag.data, this.containerKey());
|
|
856
|
+
ngOnInit() {
|
|
857
|
+
const key = this.containerKey();
|
|
858
|
+
const { controller, engine } = this;
|
|
859
|
+
this.refresh();
|
|
860
|
+
const subscription = controller.changes.pipe(filter((k) => k === key)).subscribe(() => {
|
|
861
|
+
if (!this.frozen) this.refresh();
|
|
862
|
+
const container = controller.registry._get(key);
|
|
863
|
+
if (container) engine.applyContainerOptions(container);
|
|
864
|
+
});
|
|
865
|
+
this.destroyRef.onDestroy(() => subscription.unsubscribe());
|
|
866
|
+
}
|
|
867
|
+
contentElement() {
|
|
868
|
+
return this.content()?.nativeElement ?? null;
|
|
869
|
+
}
|
|
870
|
+
onDrop(event) {
|
|
871
|
+
this.highlight.set(false);
|
|
872
|
+
this.engine.handleDrop(event);
|
|
873
|
+
}
|
|
874
|
+
onKeydown(event) {
|
|
875
|
+
if (event.key !== "Escape" || event.defaultPrevented) return;
|
|
876
|
+
const view = this.view();
|
|
877
|
+
const expand = view?.container.options.expand;
|
|
878
|
+
if (!view?.container.expanded || expand && expand.restoreOnEscape === false) return;
|
|
879
|
+
event.preventDefault();
|
|
880
|
+
this.controller.restoreContainer(view.key);
|
|
881
|
+
this.host.nativeElement.focus({ preventScroll: true });
|
|
882
|
+
}
|
|
883
|
+
freeze() {
|
|
884
|
+
this.frozen = true;
|
|
885
|
+
}
|
|
886
|
+
unfreeze() {
|
|
887
|
+
if (!this.frozen) return;
|
|
888
|
+
this.frozen = false;
|
|
889
|
+
this.refresh();
|
|
890
|
+
}
|
|
891
|
+
refresh() {
|
|
892
|
+
this.view.set(this.controller.getContainerView(this.containerKey()));
|
|
893
|
+
}
|
|
894
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
895
|
+
minVersion: "12.0.0",
|
|
896
|
+
version: "22.3.0",
|
|
897
|
+
ngImport: i0,
|
|
898
|
+
type: SplitContainerComponent,
|
|
899
|
+
deps: [],
|
|
900
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
901
|
+
});
|
|
902
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
903
|
+
minVersion: "17.0.0",
|
|
904
|
+
version: "22.3.0",
|
|
905
|
+
type: SplitContainerComponent,
|
|
906
|
+
isStandalone: true,
|
|
907
|
+
selector: "split-container",
|
|
908
|
+
inputs: { containerKey: {
|
|
909
|
+
classPropertyName: "containerKey",
|
|
910
|
+
publicName: "containerKey",
|
|
911
|
+
isSignal: true,
|
|
912
|
+
isRequired: true,
|
|
913
|
+
transformFunction: null
|
|
914
|
+
} },
|
|
915
|
+
host: {
|
|
916
|
+
attributes: { "tabindex": "-1" },
|
|
917
|
+
listeners: { "keydown": "onKeydown($event)" },
|
|
918
|
+
properties: {
|
|
919
|
+
"attr.data-container-key": "containerKey()",
|
|
920
|
+
"class.split-container--empty": "!view()?.tabs?.length",
|
|
921
|
+
"class.split-drop-target": "highlight()"
|
|
922
|
+
}
|
|
923
|
+
},
|
|
924
|
+
viewQueries: [{
|
|
925
|
+
propertyName: "content",
|
|
926
|
+
first: true,
|
|
927
|
+
predicate: ["content"],
|
|
928
|
+
descendants: true,
|
|
929
|
+
isSignal: true
|
|
930
|
+
}],
|
|
931
|
+
ngImport: i0,
|
|
932
|
+
template: `
|
|
933
|
+
@if (view(); as v) {
|
|
934
|
+
<split-tab-strip [view]="v" />
|
|
935
|
+
<div
|
|
936
|
+
#content
|
|
937
|
+
class="split-content"
|
|
938
|
+
cdkDropList
|
|
939
|
+
cdkDropListSortingDisabled
|
|
940
|
+
[id]="contentId()"
|
|
941
|
+
[cdkDropListData]="contentData()"
|
|
942
|
+
[cdkDropListEnterPredicate]="enterPredicate"
|
|
943
|
+
(cdkDropListDropped)="onDrop($event)"
|
|
944
|
+
(cdkDropListEntered)="highlight.set(true)"
|
|
945
|
+
(cdkDropListExited)="highlight.set(false)"
|
|
946
|
+
[attr.data-empty-label]="emptyLabel"
|
|
947
|
+
></div>
|
|
948
|
+
}
|
|
949
|
+
`,
|
|
950
|
+
isInline: true,
|
|
951
|
+
styles: [":where(:root){--split-bg: #ffffff;--split-fg: #1f2328;--split-muted-fg: #59636e;--split-border: #d1d9e0;--split-strip-bg: #f6f8fa;--split-tab-bg: transparent;--split-tab-hover-bg: #eaeef2;--split-tab-active-bg: #ffffff;--split-tab-active-indicator: #0969da;--split-focus-ring: #0969da;--split-drop-highlight: #0969da;--split-drop-zone-bg: rgba(9, 105, 218, .08);--split-backdrop-bg: rgba(0, 0, 0, .32);--split-radius: 6px;--split-tab-height: 36px;--split-tab-max-width: 220px;--split-font: inherit;--split-body-z-index: 1040;--split-expanded-z-index: 1050;--split-drop-zone-z-index: 1060;--split-drag-preview-z-index: 1070;--split-overlay-z-index: 1030;--split-shadow: 0 8px 24px rgba(31, 35, 40, .18)}split-container{display:flex;flex-direction:column;height:100%;min-height:0;box-sizing:border-box;background:var(--split-bg);color:var(--split-fg);font:var(--split-font);border:1px solid var(--split-border);border-radius:var(--split-radius);overflow:hidden;outline:none}split-container[hidden]{display:none}split-container.split-container--expanded{z-index:var(--split-expanded-z-index);box-shadow:var(--split-shadow)}.split-strip-row{display:flex;align-items:stretch;background:var(--split-strip-bg);border-bottom:1px solid var(--split-border);min-height:var(--split-tab-height)}.split-strip{display:flex;flex:1 1 auto;min-width:0;overflow-x:auto;scrollbar-width:thin}.split-tab{display:flex;align-items:center;gap:4px;max-width:var(--split-tab-max-width);padding:0 4px 0 0;background:var(--split-tab-bg);border-right:1px solid var(--split-border);color:var(--split-muted-fg);cursor:pointer;-webkit-user-select:none;user-select:none;box-sizing:border-box;height:var(--split-tab-height);position:relative}.split-tab:hover{background:var(--split-tab-hover-bg)}.split-tab__label:focus-visible{outline:2px solid var(--split-focus-ring);outline-offset:-2px;border-radius:4px}.split-tab--active{background:var(--split-tab-active-bg);color:var(--split-fg);box-shadow:inset 0 -2px 0 var(--split-tab-active-indicator)}.split-tab__label{flex:1 1 auto;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding:0 8px 0 12px;line-height:var(--split-tab-height)}.split-icon-button{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;padding:0;border:0;border-radius:4px;background:transparent;color:inherit;font:inherit;font-size:16px;line-height:1;cursor:pointer;flex:none}.split-icon-button:hover:not(:disabled){background:var(--split-tab-hover-bg);color:var(--split-fg)}.split-icon-button:focus-visible{outline:2px solid var(--split-focus-ring)}.split-icon-button:disabled{opacity:.4;cursor:default}.split-actions{display:flex;align-items:center;gap:2px;padding:0 6px;border-left:1px solid var(--split-border);color:var(--split-muted-fg)}.split-content{position:relative;flex:1 1 auto;min-height:0;overflow:auto}.split-content:empty:before{content:attr(data-empty-label);position:absolute;inset:0;display:flex;align-items:center;justify-content:center;color:var(--split-muted-fg)}.split-content .cdk-drag-placeholder{display:none}.split-tab-panel{height:100%;box-sizing:border-box}.split-tab-panel[hidden]{display:none}.split-strip.cdk-drop-list-dragging .split-tab:not(.cdk-drag-placeholder){transition:transform .2s cubic-bezier(0,0,.2,1)}.split-tab.cdk-drag-placeholder{opacity:.35}.split-tab.cdk-drag-animating{transition:transform .2s cubic-bezier(0,0,.2,1)}.split-drag-preview{z-index:var(--split-drag-preview-z-index)!important;background:var(--split-tab-active-bg);color:var(--split-fg);border:1px solid var(--split-border);border-radius:var(--split-radius);box-shadow:var(--split-shadow);font:var(--split-font)}split-container.split-drop-target{outline:2px solid var(--split-drop-highlight);outline-offset:-2px}.split-body-host{position:fixed;z-index:var(--split-body-z-index);box-sizing:border-box;--split-body-size: 420px}.split-body-host[hidden]{display:none}.split-body-host--left{top:0;bottom:0;left:0;width:var(--split-body-size)}.split-body-host--right{top:0;bottom:0;right:0;width:var(--split-body-size)}.split-body-host--top{top:0;left:0;right:0;height:var(--split-body-size)}.split-body-host--bottom{bottom:0;left:0;right:0;height:var(--split-body-size)}.split-body-host split-container{border-radius:0;box-shadow:var(--split-shadow)}.split-body-backdrop{position:fixed;inset:0;z-index:calc(var(--split-body-z-index) - 1);background:var(--split-backdrop-bg)}.split-body-backdrop[hidden]{display:none}.split-drop-zone{position:fixed;z-index:var(--split-drop-zone-z-index);display:flex;align-items:center;justify-content:center;box-sizing:border-box;padding:8px;border:2px dashed var(--split-drop-highlight);border-radius:var(--split-radius);background:var(--split-bg);background-image:linear-gradient(var(--split-drop-zone-bg),var(--split-drop-zone-bg));color:var(--split-fg);box-shadow:var(--split-shadow);font:var(--split-font);text-align:center}.split-drop-zone.cdk-drop-list-dragging{border-style:solid}.split-drop-zone .cdk-drag-placeholder{display:none}.split-expand-layer{position:static}split-container.split-container--custom:not(.split-layout--inline){position:absolute;inset:var(--split-inset);width:var(--split-w);height:var(--split-h)}split-container.split-container--custom.split-layout--overlay{z-index:var(--split-overlay-z-index);box-shadow:var(--split-shadow)}split-container.split-container--leaving .split-content:empty:before{content:none}@media(prefers-reduced-motion:reduce){.split-strip.cdk-drop-list-dragging .split-tab,.split-tab.cdk-drag-animating{transition:none}}\n"],
|
|
952
|
+
dependencies: [{
|
|
953
|
+
kind: "component",
|
|
954
|
+
type: SplitTabStripComponent,
|
|
955
|
+
selector: "split-tab-strip",
|
|
956
|
+
inputs: ["view"]
|
|
957
|
+
}, {
|
|
958
|
+
kind: "directive",
|
|
959
|
+
type: CdkDropList,
|
|
960
|
+
selector: "[cdkDropList], cdk-drop-list",
|
|
961
|
+
inputs: [
|
|
962
|
+
"cdkDropListConnectedTo",
|
|
963
|
+
"cdkDropListData",
|
|
964
|
+
"cdkDropListOrientation",
|
|
965
|
+
"id",
|
|
966
|
+
"cdkDropListLockAxis",
|
|
967
|
+
"cdkDropListDisabled",
|
|
968
|
+
"cdkDropListSortingDisabled",
|
|
969
|
+
"cdkDropListEnterPredicate",
|
|
970
|
+
"cdkDropListSortPredicate",
|
|
971
|
+
"cdkDropListAutoScrollDisabled",
|
|
972
|
+
"cdkDropListAutoScrollStep",
|
|
973
|
+
"cdkDropListElementContainer",
|
|
974
|
+
"cdkDropListHasAnchor"
|
|
975
|
+
],
|
|
976
|
+
outputs: [
|
|
977
|
+
"cdkDropListDropped",
|
|
978
|
+
"cdkDropListEntered",
|
|
979
|
+
"cdkDropListExited",
|
|
980
|
+
"cdkDropListSorted"
|
|
981
|
+
],
|
|
982
|
+
exportAs: ["cdkDropList"]
|
|
983
|
+
}],
|
|
984
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
985
|
+
encapsulation: i0.ViewEncapsulation.None
|
|
986
|
+
});
|
|
987
|
+
};
|
|
988
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
989
|
+
minVersion: "12.0.0",
|
|
990
|
+
version: "22.3.0",
|
|
991
|
+
ngImport: i0,
|
|
992
|
+
type: SplitContainerComponent,
|
|
993
|
+
decorators: [{
|
|
994
|
+
type: Component,
|
|
995
|
+
args: [{
|
|
996
|
+
selector: "split-container",
|
|
997
|
+
imports: [SplitTabStripComponent, CdkDropList],
|
|
998
|
+
encapsulation: ViewEncapsulation.None,
|
|
999
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
1000
|
+
host: {
|
|
1001
|
+
tabindex: "-1",
|
|
1002
|
+
"[attr.data-container-key]": "containerKey()",
|
|
1003
|
+
"[class.split-container--empty]": "!view()?.tabs?.length",
|
|
1004
|
+
"[class.split-drop-target]": "highlight()",
|
|
1005
|
+
"(keydown)": "onKeydown($event)"
|
|
1006
|
+
},
|
|
1007
|
+
template: `
|
|
1008
|
+
@if (view(); as v) {
|
|
1009
|
+
<split-tab-strip [view]="v" />
|
|
1010
|
+
<div
|
|
1011
|
+
#content
|
|
1012
|
+
class="split-content"
|
|
1013
|
+
cdkDropList
|
|
1014
|
+
cdkDropListSortingDisabled
|
|
1015
|
+
[id]="contentId()"
|
|
1016
|
+
[cdkDropListData]="contentData()"
|
|
1017
|
+
[cdkDropListEnterPredicate]="enterPredicate"
|
|
1018
|
+
(cdkDropListDropped)="onDrop($event)"
|
|
1019
|
+
(cdkDropListEntered)="highlight.set(true)"
|
|
1020
|
+
(cdkDropListExited)="highlight.set(false)"
|
|
1021
|
+
[attr.data-empty-label]="emptyLabel"
|
|
1022
|
+
></div>
|
|
1023
|
+
}
|
|
1024
|
+
`,
|
|
1025
|
+
styles: [":where(:root){--split-bg: #ffffff;--split-fg: #1f2328;--split-muted-fg: #59636e;--split-border: #d1d9e0;--split-strip-bg: #f6f8fa;--split-tab-bg: transparent;--split-tab-hover-bg: #eaeef2;--split-tab-active-bg: #ffffff;--split-tab-active-indicator: #0969da;--split-focus-ring: #0969da;--split-drop-highlight: #0969da;--split-drop-zone-bg: rgba(9, 105, 218, .08);--split-backdrop-bg: rgba(0, 0, 0, .32);--split-radius: 6px;--split-tab-height: 36px;--split-tab-max-width: 220px;--split-font: inherit;--split-body-z-index: 1040;--split-expanded-z-index: 1050;--split-drop-zone-z-index: 1060;--split-drag-preview-z-index: 1070;--split-overlay-z-index: 1030;--split-shadow: 0 8px 24px rgba(31, 35, 40, .18)}split-container{display:flex;flex-direction:column;height:100%;min-height:0;box-sizing:border-box;background:var(--split-bg);color:var(--split-fg);font:var(--split-font);border:1px solid var(--split-border);border-radius:var(--split-radius);overflow:hidden;outline:none}split-container[hidden]{display:none}split-container.split-container--expanded{z-index:var(--split-expanded-z-index);box-shadow:var(--split-shadow)}.split-strip-row{display:flex;align-items:stretch;background:var(--split-strip-bg);border-bottom:1px solid var(--split-border);min-height:var(--split-tab-height)}.split-strip{display:flex;flex:1 1 auto;min-width:0;overflow-x:auto;scrollbar-width:thin}.split-tab{display:flex;align-items:center;gap:4px;max-width:var(--split-tab-max-width);padding:0 4px 0 0;background:var(--split-tab-bg);border-right:1px solid var(--split-border);color:var(--split-muted-fg);cursor:pointer;-webkit-user-select:none;user-select:none;box-sizing:border-box;height:var(--split-tab-height);position:relative}.split-tab:hover{background:var(--split-tab-hover-bg)}.split-tab__label:focus-visible{outline:2px solid var(--split-focus-ring);outline-offset:-2px;border-radius:4px}.split-tab--active{background:var(--split-tab-active-bg);color:var(--split-fg);box-shadow:inset 0 -2px 0 var(--split-tab-active-indicator)}.split-tab__label{flex:1 1 auto;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding:0 8px 0 12px;line-height:var(--split-tab-height)}.split-icon-button{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;padding:0;border:0;border-radius:4px;background:transparent;color:inherit;font:inherit;font-size:16px;line-height:1;cursor:pointer;flex:none}.split-icon-button:hover:not(:disabled){background:var(--split-tab-hover-bg);color:var(--split-fg)}.split-icon-button:focus-visible{outline:2px solid var(--split-focus-ring)}.split-icon-button:disabled{opacity:.4;cursor:default}.split-actions{display:flex;align-items:center;gap:2px;padding:0 6px;border-left:1px solid var(--split-border);color:var(--split-muted-fg)}.split-content{position:relative;flex:1 1 auto;min-height:0;overflow:auto}.split-content:empty:before{content:attr(data-empty-label);position:absolute;inset:0;display:flex;align-items:center;justify-content:center;color:var(--split-muted-fg)}.split-content .cdk-drag-placeholder{display:none}.split-tab-panel{height:100%;box-sizing:border-box}.split-tab-panel[hidden]{display:none}.split-strip.cdk-drop-list-dragging .split-tab:not(.cdk-drag-placeholder){transition:transform .2s cubic-bezier(0,0,.2,1)}.split-tab.cdk-drag-placeholder{opacity:.35}.split-tab.cdk-drag-animating{transition:transform .2s cubic-bezier(0,0,.2,1)}.split-drag-preview{z-index:var(--split-drag-preview-z-index)!important;background:var(--split-tab-active-bg);color:var(--split-fg);border:1px solid var(--split-border);border-radius:var(--split-radius);box-shadow:var(--split-shadow);font:var(--split-font)}split-container.split-drop-target{outline:2px solid var(--split-drop-highlight);outline-offset:-2px}.split-body-host{position:fixed;z-index:var(--split-body-z-index);box-sizing:border-box;--split-body-size: 420px}.split-body-host[hidden]{display:none}.split-body-host--left{top:0;bottom:0;left:0;width:var(--split-body-size)}.split-body-host--right{top:0;bottom:0;right:0;width:var(--split-body-size)}.split-body-host--top{top:0;left:0;right:0;height:var(--split-body-size)}.split-body-host--bottom{bottom:0;left:0;right:0;height:var(--split-body-size)}.split-body-host split-container{border-radius:0;box-shadow:var(--split-shadow)}.split-body-backdrop{position:fixed;inset:0;z-index:calc(var(--split-body-z-index) - 1);background:var(--split-backdrop-bg)}.split-body-backdrop[hidden]{display:none}.split-drop-zone{position:fixed;z-index:var(--split-drop-zone-z-index);display:flex;align-items:center;justify-content:center;box-sizing:border-box;padding:8px;border:2px dashed var(--split-drop-highlight);border-radius:var(--split-radius);background:var(--split-bg);background-image:linear-gradient(var(--split-drop-zone-bg),var(--split-drop-zone-bg));color:var(--split-fg);box-shadow:var(--split-shadow);font:var(--split-font);text-align:center}.split-drop-zone.cdk-drop-list-dragging{border-style:solid}.split-drop-zone .cdk-drag-placeholder{display:none}.split-expand-layer{position:static}split-container.split-container--custom:not(.split-layout--inline){position:absolute;inset:var(--split-inset);width:var(--split-w);height:var(--split-h)}split-container.split-container--custom.split-layout--overlay{z-index:var(--split-overlay-z-index);box-shadow:var(--split-shadow)}split-container.split-container--leaving .split-content:empty:before{content:none}@media(prefers-reduced-motion:reduce){.split-strip.cdk-drop-list-dragging .split-tab,.split-tab.cdk-drag-animating{transition:none}}\n"]
|
|
1026
|
+
}]
|
|
1027
|
+
}],
|
|
1028
|
+
propDecorators: {
|
|
1029
|
+
containerKey: [{
|
|
1030
|
+
type: i0.Input,
|
|
1031
|
+
args: [{
|
|
1032
|
+
isSignal: true,
|
|
1033
|
+
alias: "containerKey",
|
|
1034
|
+
required: true
|
|
1035
|
+
}]
|
|
1036
|
+
}],
|
|
1037
|
+
content: [{
|
|
1038
|
+
type: i0.ViewChild,
|
|
1039
|
+
args: ["content", { isSignal: true }]
|
|
1040
|
+
}]
|
|
1041
|
+
}
|
|
1042
|
+
});
|
|
1043
|
+
var SplitDropZoneLayerComponent = class SplitDropZoneLayerComponent {
|
|
1044
|
+
controller = inject(SplitWindowController);
|
|
1045
|
+
engine = inject(AngularSplitEngine);
|
|
1046
|
+
zones = this.engine.floatingZones;
|
|
1047
|
+
predicates = /* @__PURE__ */ new Map();
|
|
1048
|
+
dataCache = /* @__PURE__ */ new Map();
|
|
1049
|
+
id(key) {
|
|
1050
|
+
return floatListId(key);
|
|
1051
|
+
}
|
|
1052
|
+
data(key) {
|
|
1053
|
+
let data = this.dataCache.get(key);
|
|
1054
|
+
if (!data) {
|
|
1055
|
+
data = {
|
|
1056
|
+
key,
|
|
1057
|
+
kind: "float"
|
|
1058
|
+
};
|
|
1059
|
+
this.dataCache.set(key, data);
|
|
1060
|
+
}
|
|
1061
|
+
return data;
|
|
1062
|
+
}
|
|
1063
|
+
predicate(key) {
|
|
1064
|
+
let fn = this.predicates.get(key);
|
|
1065
|
+
if (!fn) {
|
|
1066
|
+
fn = (drag) => this.controller.canDrop(drag.data, key);
|
|
1067
|
+
this.predicates.set(key, fn);
|
|
1068
|
+
}
|
|
1069
|
+
return fn;
|
|
1070
|
+
}
|
|
1071
|
+
onDrop(event) {
|
|
1072
|
+
this.engine.handleDrop(event);
|
|
1073
|
+
}
|
|
1074
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
1075
|
+
minVersion: "12.0.0",
|
|
1076
|
+
version: "22.3.0",
|
|
1077
|
+
ngImport: i0,
|
|
1078
|
+
type: SplitDropZoneLayerComponent,
|
|
1079
|
+
deps: [],
|
|
1080
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
1081
|
+
});
|
|
1082
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
1083
|
+
minVersion: "17.0.0",
|
|
1084
|
+
version: "22.3.0",
|
|
1085
|
+
type: SplitDropZoneLayerComponent,
|
|
1086
|
+
isStandalone: true,
|
|
1087
|
+
selector: "split-drop-zone-layer",
|
|
1088
|
+
ngImport: i0,
|
|
1089
|
+
template: `
|
|
1090
|
+
@for (zone of zones(); track zone.key) {
|
|
1091
|
+
<div
|
|
1092
|
+
class="split-drop-zone"
|
|
1093
|
+
cdkDropList
|
|
1094
|
+
cdkDropListSortingDisabled
|
|
1095
|
+
[id]="id(zone.key)"
|
|
1096
|
+
[cdkDropListData]="data(zone.key)"
|
|
1097
|
+
[cdkDropListEnterPredicate]="predicate(zone.key)"
|
|
1098
|
+
(cdkDropListDropped)="onDrop($event)"
|
|
1099
|
+
[attr.data-container-key]="zone.key"
|
|
1100
|
+
[style.left.px]="zone.rect.x"
|
|
1101
|
+
[style.top.px]="zone.rect.y"
|
|
1102
|
+
[style.width.px]="zone.rect.width"
|
|
1103
|
+
[style.height.px]="zone.rect.height"
|
|
1104
|
+
>
|
|
1105
|
+
<span class="split-drop-zone__label">{{ zone.label }}</span>
|
|
1106
|
+
</div>
|
|
1107
|
+
}
|
|
1108
|
+
`,
|
|
1109
|
+
isInline: true,
|
|
1110
|
+
styles: [":where(:root){--split-bg: #ffffff;--split-fg: #1f2328;--split-muted-fg: #59636e;--split-border: #d1d9e0;--split-strip-bg: #f6f8fa;--split-tab-bg: transparent;--split-tab-hover-bg: #eaeef2;--split-tab-active-bg: #ffffff;--split-tab-active-indicator: #0969da;--split-focus-ring: #0969da;--split-drop-highlight: #0969da;--split-drop-zone-bg: rgba(9, 105, 218, .08);--split-backdrop-bg: rgba(0, 0, 0, .32);--split-radius: 6px;--split-tab-height: 36px;--split-tab-max-width: 220px;--split-font: inherit;--split-body-z-index: 1040;--split-expanded-z-index: 1050;--split-drop-zone-z-index: 1060;--split-drag-preview-z-index: 1070;--split-overlay-z-index: 1030;--split-shadow: 0 8px 24px rgba(31, 35, 40, .18)}split-container{display:flex;flex-direction:column;height:100%;min-height:0;box-sizing:border-box;background:var(--split-bg);color:var(--split-fg);font:var(--split-font);border:1px solid var(--split-border);border-radius:var(--split-radius);overflow:hidden;outline:none}split-container[hidden]{display:none}split-container.split-container--expanded{z-index:var(--split-expanded-z-index);box-shadow:var(--split-shadow)}.split-strip-row{display:flex;align-items:stretch;background:var(--split-strip-bg);border-bottom:1px solid var(--split-border);min-height:var(--split-tab-height)}.split-strip{display:flex;flex:1 1 auto;min-width:0;overflow-x:auto;scrollbar-width:thin}.split-tab{display:flex;align-items:center;gap:4px;max-width:var(--split-tab-max-width);padding:0 4px 0 0;background:var(--split-tab-bg);border-right:1px solid var(--split-border);color:var(--split-muted-fg);cursor:pointer;-webkit-user-select:none;user-select:none;box-sizing:border-box;height:var(--split-tab-height);position:relative}.split-tab:hover{background:var(--split-tab-hover-bg)}.split-tab__label:focus-visible{outline:2px solid var(--split-focus-ring);outline-offset:-2px;border-radius:4px}.split-tab--active{background:var(--split-tab-active-bg);color:var(--split-fg);box-shadow:inset 0 -2px 0 var(--split-tab-active-indicator)}.split-tab__label{flex:1 1 auto;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding:0 8px 0 12px;line-height:var(--split-tab-height)}.split-icon-button{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;padding:0;border:0;border-radius:4px;background:transparent;color:inherit;font:inherit;font-size:16px;line-height:1;cursor:pointer;flex:none}.split-icon-button:hover:not(:disabled){background:var(--split-tab-hover-bg);color:var(--split-fg)}.split-icon-button:focus-visible{outline:2px solid var(--split-focus-ring)}.split-icon-button:disabled{opacity:.4;cursor:default}.split-actions{display:flex;align-items:center;gap:2px;padding:0 6px;border-left:1px solid var(--split-border);color:var(--split-muted-fg)}.split-content{position:relative;flex:1 1 auto;min-height:0;overflow:auto}.split-content:empty:before{content:attr(data-empty-label);position:absolute;inset:0;display:flex;align-items:center;justify-content:center;color:var(--split-muted-fg)}.split-content .cdk-drag-placeholder{display:none}.split-tab-panel{height:100%;box-sizing:border-box}.split-tab-panel[hidden]{display:none}.split-strip.cdk-drop-list-dragging .split-tab:not(.cdk-drag-placeholder){transition:transform .2s cubic-bezier(0,0,.2,1)}.split-tab.cdk-drag-placeholder{opacity:.35}.split-tab.cdk-drag-animating{transition:transform .2s cubic-bezier(0,0,.2,1)}.split-drag-preview{z-index:var(--split-drag-preview-z-index)!important;background:var(--split-tab-active-bg);color:var(--split-fg);border:1px solid var(--split-border);border-radius:var(--split-radius);box-shadow:var(--split-shadow);font:var(--split-font)}split-container.split-drop-target{outline:2px solid var(--split-drop-highlight);outline-offset:-2px}.split-body-host{position:fixed;z-index:var(--split-body-z-index);box-sizing:border-box;--split-body-size: 420px}.split-body-host[hidden]{display:none}.split-body-host--left{top:0;bottom:0;left:0;width:var(--split-body-size)}.split-body-host--right{top:0;bottom:0;right:0;width:var(--split-body-size)}.split-body-host--top{top:0;left:0;right:0;height:var(--split-body-size)}.split-body-host--bottom{bottom:0;left:0;right:0;height:var(--split-body-size)}.split-body-host split-container{border-radius:0;box-shadow:var(--split-shadow)}.split-body-backdrop{position:fixed;inset:0;z-index:calc(var(--split-body-z-index) - 1);background:var(--split-backdrop-bg)}.split-body-backdrop[hidden]{display:none}.split-drop-zone{position:fixed;z-index:var(--split-drop-zone-z-index);display:flex;align-items:center;justify-content:center;box-sizing:border-box;padding:8px;border:2px dashed var(--split-drop-highlight);border-radius:var(--split-radius);background:var(--split-bg);background-image:linear-gradient(var(--split-drop-zone-bg),var(--split-drop-zone-bg));color:var(--split-fg);box-shadow:var(--split-shadow);font:var(--split-font);text-align:center}.split-drop-zone.cdk-drop-list-dragging{border-style:solid}.split-drop-zone .cdk-drag-placeholder{display:none}.split-expand-layer{position:static}split-container.split-container--custom:not(.split-layout--inline){position:absolute;inset:var(--split-inset);width:var(--split-w);height:var(--split-h)}split-container.split-container--custom.split-layout--overlay{z-index:var(--split-overlay-z-index);box-shadow:var(--split-shadow)}split-container.split-container--leaving .split-content:empty:before{content:none}@media(prefers-reduced-motion:reduce){.split-strip.cdk-drop-list-dragging .split-tab,.split-tab.cdk-drag-animating{transition:none}}\n"],
|
|
1111
|
+
dependencies: [{
|
|
1112
|
+
kind: "directive",
|
|
1113
|
+
type: CdkDropList,
|
|
1114
|
+
selector: "[cdkDropList], cdk-drop-list",
|
|
1115
|
+
inputs: [
|
|
1116
|
+
"cdkDropListConnectedTo",
|
|
1117
|
+
"cdkDropListData",
|
|
1118
|
+
"cdkDropListOrientation",
|
|
1119
|
+
"id",
|
|
1120
|
+
"cdkDropListLockAxis",
|
|
1121
|
+
"cdkDropListDisabled",
|
|
1122
|
+
"cdkDropListSortingDisabled",
|
|
1123
|
+
"cdkDropListEnterPredicate",
|
|
1124
|
+
"cdkDropListSortPredicate",
|
|
1125
|
+
"cdkDropListAutoScrollDisabled",
|
|
1126
|
+
"cdkDropListAutoScrollStep",
|
|
1127
|
+
"cdkDropListElementContainer",
|
|
1128
|
+
"cdkDropListHasAnchor"
|
|
1129
|
+
],
|
|
1130
|
+
outputs: [
|
|
1131
|
+
"cdkDropListDropped",
|
|
1132
|
+
"cdkDropListEntered",
|
|
1133
|
+
"cdkDropListExited",
|
|
1134
|
+
"cdkDropListSorted"
|
|
1135
|
+
],
|
|
1136
|
+
exportAs: ["cdkDropList"]
|
|
1137
|
+
}],
|
|
1138
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
1139
|
+
encapsulation: i0.ViewEncapsulation.None
|
|
1140
|
+
});
|
|
1141
|
+
};
|
|
1142
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
1143
|
+
minVersion: "12.0.0",
|
|
1144
|
+
version: "22.3.0",
|
|
1145
|
+
ngImport: i0,
|
|
1146
|
+
type: SplitDropZoneLayerComponent,
|
|
1147
|
+
decorators: [{
|
|
1148
|
+
type: Component,
|
|
1149
|
+
args: [{
|
|
1150
|
+
selector: "split-drop-zone-layer",
|
|
1151
|
+
imports: [CdkDropList],
|
|
1152
|
+
encapsulation: ViewEncapsulation.None,
|
|
1153
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
1154
|
+
template: `
|
|
1155
|
+
@for (zone of zones(); track zone.key) {
|
|
1156
|
+
<div
|
|
1157
|
+
class="split-drop-zone"
|
|
1158
|
+
cdkDropList
|
|
1159
|
+
cdkDropListSortingDisabled
|
|
1160
|
+
[id]="id(zone.key)"
|
|
1161
|
+
[cdkDropListData]="data(zone.key)"
|
|
1162
|
+
[cdkDropListEnterPredicate]="predicate(zone.key)"
|
|
1163
|
+
(cdkDropListDropped)="onDrop($event)"
|
|
1164
|
+
[attr.data-container-key]="zone.key"
|
|
1165
|
+
[style.left.px]="zone.rect.x"
|
|
1166
|
+
[style.top.px]="zone.rect.y"
|
|
1167
|
+
[style.width.px]="zone.rect.width"
|
|
1168
|
+
[style.height.px]="zone.rect.height"
|
|
1169
|
+
>
|
|
1170
|
+
<span class="split-drop-zone__label">{{ zone.label }}</span>
|
|
1171
|
+
</div>
|
|
1172
|
+
}
|
|
1173
|
+
`,
|
|
1174
|
+
styles: [":where(:root){--split-bg: #ffffff;--split-fg: #1f2328;--split-muted-fg: #59636e;--split-border: #d1d9e0;--split-strip-bg: #f6f8fa;--split-tab-bg: transparent;--split-tab-hover-bg: #eaeef2;--split-tab-active-bg: #ffffff;--split-tab-active-indicator: #0969da;--split-focus-ring: #0969da;--split-drop-highlight: #0969da;--split-drop-zone-bg: rgba(9, 105, 218, .08);--split-backdrop-bg: rgba(0, 0, 0, .32);--split-radius: 6px;--split-tab-height: 36px;--split-tab-max-width: 220px;--split-font: inherit;--split-body-z-index: 1040;--split-expanded-z-index: 1050;--split-drop-zone-z-index: 1060;--split-drag-preview-z-index: 1070;--split-overlay-z-index: 1030;--split-shadow: 0 8px 24px rgba(31, 35, 40, .18)}split-container{display:flex;flex-direction:column;height:100%;min-height:0;box-sizing:border-box;background:var(--split-bg);color:var(--split-fg);font:var(--split-font);border:1px solid var(--split-border);border-radius:var(--split-radius);overflow:hidden;outline:none}split-container[hidden]{display:none}split-container.split-container--expanded{z-index:var(--split-expanded-z-index);box-shadow:var(--split-shadow)}.split-strip-row{display:flex;align-items:stretch;background:var(--split-strip-bg);border-bottom:1px solid var(--split-border);min-height:var(--split-tab-height)}.split-strip{display:flex;flex:1 1 auto;min-width:0;overflow-x:auto;scrollbar-width:thin}.split-tab{display:flex;align-items:center;gap:4px;max-width:var(--split-tab-max-width);padding:0 4px 0 0;background:var(--split-tab-bg);border-right:1px solid var(--split-border);color:var(--split-muted-fg);cursor:pointer;-webkit-user-select:none;user-select:none;box-sizing:border-box;height:var(--split-tab-height);position:relative}.split-tab:hover{background:var(--split-tab-hover-bg)}.split-tab__label:focus-visible{outline:2px solid var(--split-focus-ring);outline-offset:-2px;border-radius:4px}.split-tab--active{background:var(--split-tab-active-bg);color:var(--split-fg);box-shadow:inset 0 -2px 0 var(--split-tab-active-indicator)}.split-tab__label{flex:1 1 auto;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding:0 8px 0 12px;line-height:var(--split-tab-height)}.split-icon-button{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;padding:0;border:0;border-radius:4px;background:transparent;color:inherit;font:inherit;font-size:16px;line-height:1;cursor:pointer;flex:none}.split-icon-button:hover:not(:disabled){background:var(--split-tab-hover-bg);color:var(--split-fg)}.split-icon-button:focus-visible{outline:2px solid var(--split-focus-ring)}.split-icon-button:disabled{opacity:.4;cursor:default}.split-actions{display:flex;align-items:center;gap:2px;padding:0 6px;border-left:1px solid var(--split-border);color:var(--split-muted-fg)}.split-content{position:relative;flex:1 1 auto;min-height:0;overflow:auto}.split-content:empty:before{content:attr(data-empty-label);position:absolute;inset:0;display:flex;align-items:center;justify-content:center;color:var(--split-muted-fg)}.split-content .cdk-drag-placeholder{display:none}.split-tab-panel{height:100%;box-sizing:border-box}.split-tab-panel[hidden]{display:none}.split-strip.cdk-drop-list-dragging .split-tab:not(.cdk-drag-placeholder){transition:transform .2s cubic-bezier(0,0,.2,1)}.split-tab.cdk-drag-placeholder{opacity:.35}.split-tab.cdk-drag-animating{transition:transform .2s cubic-bezier(0,0,.2,1)}.split-drag-preview{z-index:var(--split-drag-preview-z-index)!important;background:var(--split-tab-active-bg);color:var(--split-fg);border:1px solid var(--split-border);border-radius:var(--split-radius);box-shadow:var(--split-shadow);font:var(--split-font)}split-container.split-drop-target{outline:2px solid var(--split-drop-highlight);outline-offset:-2px}.split-body-host{position:fixed;z-index:var(--split-body-z-index);box-sizing:border-box;--split-body-size: 420px}.split-body-host[hidden]{display:none}.split-body-host--left{top:0;bottom:0;left:0;width:var(--split-body-size)}.split-body-host--right{top:0;bottom:0;right:0;width:var(--split-body-size)}.split-body-host--top{top:0;left:0;right:0;height:var(--split-body-size)}.split-body-host--bottom{bottom:0;left:0;right:0;height:var(--split-body-size)}.split-body-host split-container{border-radius:0;box-shadow:var(--split-shadow)}.split-body-backdrop{position:fixed;inset:0;z-index:calc(var(--split-body-z-index) - 1);background:var(--split-backdrop-bg)}.split-body-backdrop[hidden]{display:none}.split-drop-zone{position:fixed;z-index:var(--split-drop-zone-z-index);display:flex;align-items:center;justify-content:center;box-sizing:border-box;padding:8px;border:2px dashed var(--split-drop-highlight);border-radius:var(--split-radius);background:var(--split-bg);background-image:linear-gradient(var(--split-drop-zone-bg),var(--split-drop-zone-bg));color:var(--split-fg);box-shadow:var(--split-shadow);font:var(--split-font);text-align:center}.split-drop-zone.cdk-drop-list-dragging{border-style:solid}.split-drop-zone .cdk-drag-placeholder{display:none}.split-expand-layer{position:static}split-container.split-container--custom:not(.split-layout--inline){position:absolute;inset:var(--split-inset);width:var(--split-w);height:var(--split-h)}split-container.split-container--custom.split-layout--overlay{z-index:var(--split-overlay-z-index);box-shadow:var(--split-shadow)}split-container.split-container--leaving .split-content:empty:before{content:none}@media(prefers-reduced-motion:reduce){.split-strip.cdk-drop-list-dragging .split-tab,.split-tab.cdk-drag-animating{transition:none}}\n"]
|
|
1175
|
+
}]
|
|
1176
|
+
}]
|
|
1177
|
+
});
|
|
1178
|
+
function rendererDomWriter(renderer) {
|
|
1179
|
+
return {
|
|
1180
|
+
setStyle: (el, property, value, priority) => renderer.setStyle(el, property, value, RendererStyleFlags2.DashCase | (priority === "important" ? RendererStyleFlags2.Important : 0)),
|
|
1181
|
+
removeStyle: (el, property) => renderer.removeStyle(el, property, RendererStyleFlags2.DashCase),
|
|
1182
|
+
addClass: (el, name) => renderer.addClass(el, name),
|
|
1183
|
+
removeClass: (el, name) => renderer.removeClass(el, name),
|
|
1184
|
+
setAttribute: (el, name, value) => renderer.setAttribute(el, name, value),
|
|
1185
|
+
removeAttribute: (el, name) => renderer.removeAttribute(el, name)
|
|
1186
|
+
};
|
|
1187
|
+
}
|
|
1188
|
+
const hasMoveBefore = typeof Element !== "undefined" && typeof Element.prototype.moveBefore === "function";
|
|
1189
|
+
function moveNode(parent, node, before = null, renderer) {
|
|
1190
|
+
if (node.parentNode === parent && node.nextSibling === before) return;
|
|
1191
|
+
if (hasMoveBefore && node.isConnected && parent.isConnected) try {
|
|
1192
|
+
parent.moveBefore(node, before);
|
|
1193
|
+
return;
|
|
1194
|
+
} catch {}
|
|
1195
|
+
if (renderer) renderer.insertBefore(parent, node, before);
|
|
1196
|
+
else parent.insertBefore(node, before);
|
|
1197
|
+
}
|
|
1198
|
+
function toRect(rect) {
|
|
1199
|
+
return {
|
|
1200
|
+
x: rect.x,
|
|
1201
|
+
y: rect.y,
|
|
1202
|
+
width: rect.width,
|
|
1203
|
+
height: rect.height
|
|
1204
|
+
};
|
|
1205
|
+
}
|
|
1206
|
+
const PANEL_INSET = {
|
|
1207
|
+
overlay: {
|
|
1208
|
+
right: "0 0 0 auto",
|
|
1209
|
+
left: "0 auto 0 0",
|
|
1210
|
+
top: "0 0 auto 0",
|
|
1211
|
+
bottom: "auto 0 0 0"
|
|
1212
|
+
},
|
|
1213
|
+
push: {
|
|
1214
|
+
right: "0 auto 0 0",
|
|
1215
|
+
left: "0 0 0 auto",
|
|
1216
|
+
top: "auto 0 0 0",
|
|
1217
|
+
bottom: "0 0 auto 0"
|
|
1218
|
+
}
|
|
1219
|
+
};
|
|
1220
|
+
var AngularSplitEngine = class AngularSplitEngine extends BaseSplitWindowEngine {
|
|
1221
|
+
appRef = inject(ApplicationRef);
|
|
1222
|
+
environmentInjector = inject(EnvironmentInjector);
|
|
1223
|
+
document = inject(DOCUMENT);
|
|
1224
|
+
resolver = inject(SplitModeResolver);
|
|
1225
|
+
config = inject(SPLIT_WINDOW_CONFIG);
|
|
1226
|
+
animationEngines = inject(SplitAnimationEngineRegistry);
|
|
1227
|
+
renderer = inject(RendererFactory2).createRenderer(null, null);
|
|
1228
|
+
domWriter = rendererDomWriter(this.renderer);
|
|
1229
|
+
isBrowser = isPlatformBrowser(inject(PLATFORM_ID));
|
|
1230
|
+
shells = /* @__PURE__ */ new Map();
|
|
1231
|
+
prepared = /* @__PURE__ */ new Map();
|
|
1232
|
+
layerRef = null;
|
|
1233
|
+
expandLayer = null;
|
|
1234
|
+
lastKnownRects = /* @__PURE__ */ new WeakMap();
|
|
1235
|
+
hostObserver = this.isBrowser && typeof ResizeObserver !== "undefined" ? new ResizeObserver((entries) => entries.forEach((e) => this.remember(e.target))) : null;
|
|
1236
|
+
floatingZones = signal([], ...ngDevMode ? [{ debugName: "floatingZones" }] : /* istanbul ignore next */ []);
|
|
1237
|
+
disconnect() {
|
|
1238
|
+
for (const key of [...this.shells.keys()]) this.destroyShell(key);
|
|
1239
|
+
for (const display of this.prepared.values()) display.stash.restore();
|
|
1240
|
+
this.prepared.clear();
|
|
1241
|
+
this.layerRef?.destroy();
|
|
1242
|
+
this.layerRef = null;
|
|
1243
|
+
if (this.expandLayer) this.detach(this.expandLayer);
|
|
1244
|
+
this.hostObserver?.disconnect();
|
|
1245
|
+
super.disconnect();
|
|
1246
|
+
}
|
|
1247
|
+
prepareContainer(container) {
|
|
1248
|
+
if (!this.isBrowser || container.kind !== "custom" || !container.host) return;
|
|
1249
|
+
if (this.shells.has(container.key)) return;
|
|
1250
|
+
this.prepared.get(container.key)?.stash.restore();
|
|
1251
|
+
const display = this.createDisplay(container);
|
|
1252
|
+
this.prepared.set(container.key, display);
|
|
1253
|
+
this.applyStatic(display, {
|
|
1254
|
+
host: container.host,
|
|
1255
|
+
shell: null,
|
|
1256
|
+
backdrop: null
|
|
1257
|
+
});
|
|
1258
|
+
}
|
|
1259
|
+
releaseContainer(container) {
|
|
1260
|
+
this.prepared.get(container.key)?.stash.restore();
|
|
1261
|
+
this.prepared.delete(container.key);
|
|
1262
|
+
}
|
|
1263
|
+
mountContainer(container) {
|
|
1264
|
+
if (!this.isBrowser || this.shells.has(container.key)) return;
|
|
1265
|
+
const prepared = this.prepared.get(container.key);
|
|
1266
|
+
this.prepared.delete(container.key);
|
|
1267
|
+
let display;
|
|
1268
|
+
if (prepared && prepared.options === container.options) display = prepared;
|
|
1269
|
+
else {
|
|
1270
|
+
prepared?.stash.restore();
|
|
1271
|
+
display = this.createDisplay(container);
|
|
1272
|
+
}
|
|
1273
|
+
let home;
|
|
1274
|
+
let bodyHost = null;
|
|
1275
|
+
if (container.kind === "body") {
|
|
1276
|
+
bodyHost = this.createElement("div", "split-body-host", `split-body-host--${container.side}`);
|
|
1277
|
+
this.setHidden(bodyHost, true);
|
|
1278
|
+
this.renderer.appendChild(this.document.body, bodyHost);
|
|
1279
|
+
home = bodyHost;
|
|
1280
|
+
} else {
|
|
1281
|
+
home = container.host;
|
|
1282
|
+
this.remember(home);
|
|
1283
|
+
this.hostObserver?.observe(home);
|
|
1284
|
+
}
|
|
1285
|
+
const componentRef = createComponent(SplitContainerComponent, { environmentInjector: this.environmentInjector });
|
|
1286
|
+
componentRef.setInput("containerKey", container.key);
|
|
1287
|
+
const shell = componentRef.location.nativeElement;
|
|
1288
|
+
this.setHidden(shell, true);
|
|
1289
|
+
this.renderer.appendChild(home, shell);
|
|
1290
|
+
this.appRef.attachView(componentRef.hostView);
|
|
1291
|
+
componentRef.changeDetectorRef.detectChanges();
|
|
1292
|
+
const entry = {
|
|
1293
|
+
componentRef,
|
|
1294
|
+
shell,
|
|
1295
|
+
home,
|
|
1296
|
+
bodyHost,
|
|
1297
|
+
backdrop: null,
|
|
1298
|
+
expandCleanup: null,
|
|
1299
|
+
display,
|
|
1300
|
+
layout: new SplitStyleStash$1(this.domWriter),
|
|
1301
|
+
modeCtx: null
|
|
1302
|
+
};
|
|
1303
|
+
this.shells.set(container.key, entry);
|
|
1304
|
+
this.syncBackdrop(entry, container);
|
|
1305
|
+
this.applyStatic(display, this.staticElements(entry));
|
|
1306
|
+
this.ensureLayer();
|
|
1307
|
+
}
|
|
1308
|
+
unmountContainer(container) {
|
|
1309
|
+
this.destroyShell(container.key);
|
|
1310
|
+
}
|
|
1311
|
+
applyContainerOptions(container) {
|
|
1312
|
+
const entry = this.shells.get(container.key);
|
|
1313
|
+
if (!entry) return;
|
|
1314
|
+
const backdropChanged = this.syncBackdrop(entry, container);
|
|
1315
|
+
if (entry.display.options !== container.options) {
|
|
1316
|
+
this.completeTransition(container.key, true);
|
|
1317
|
+
const wasOpen = entry.modeCtx !== null;
|
|
1318
|
+
if (wasOpen) this.removeLayout(entry);
|
|
1319
|
+
entry.display.stash.restore();
|
|
1320
|
+
entry.display = this.createDisplay(container);
|
|
1321
|
+
this.applyStatic(entry.display, this.staticElements(entry));
|
|
1322
|
+
if (wasOpen) this.applyLayout(entry, container);
|
|
1323
|
+
} else if (backdropChanged) this.applyStatic(entry.display, this.staticElements(entry));
|
|
1324
|
+
}
|
|
1325
|
+
contentElement(key) {
|
|
1326
|
+
return this.shells.get(key)?.componentRef.instance.contentElement() ?? null;
|
|
1327
|
+
}
|
|
1328
|
+
shellElement(key) {
|
|
1329
|
+
return this.shells.get(key)?.shell ?? null;
|
|
1330
|
+
}
|
|
1331
|
+
resolvedMode(key) {
|
|
1332
|
+
return (this.shells.get(key)?.display ?? this.prepared.get(key))?.resolved ?? null;
|
|
1333
|
+
}
|
|
1334
|
+
destroyShell(key) {
|
|
1335
|
+
const entry = this.shells.get(key);
|
|
1336
|
+
if (!entry) return;
|
|
1337
|
+
this.cancelTransition(key);
|
|
1338
|
+
this.removeLayout(entry);
|
|
1339
|
+
entry.expandCleanup?.();
|
|
1340
|
+
this.hostObserver?.unobserve(entry.home);
|
|
1341
|
+
entry.display.stash.restore();
|
|
1342
|
+
entry.componentRef.destroy();
|
|
1343
|
+
this.detach(entry.shell);
|
|
1344
|
+
if (entry.bodyHost) this.detach(entry.bodyHost);
|
|
1345
|
+
if (entry.backdrop) this.detach(entry.backdrop);
|
|
1346
|
+
this.shells.delete(key);
|
|
1347
|
+
}
|
|
1348
|
+
createElement(tag, ...classes) {
|
|
1349
|
+
const el = this.renderer.createElement(tag);
|
|
1350
|
+
for (const name of classes) this.renderer.addClass(el, name);
|
|
1351
|
+
return el;
|
|
1352
|
+
}
|
|
1353
|
+
detach(el) {
|
|
1354
|
+
const parent = this.renderer.parentNode(el);
|
|
1355
|
+
if (parent) this.renderer.removeChild(parent, el);
|
|
1356
|
+
}
|
|
1357
|
+
setHidden(el, hidden) {
|
|
1358
|
+
this.renderer.setProperty(el, "hidden", hidden);
|
|
1359
|
+
}
|
|
1360
|
+
toggleClass(el, name, on) {
|
|
1361
|
+
if (on) this.renderer.addClass(el, name);
|
|
1362
|
+
else this.renderer.removeClass(el, name);
|
|
1363
|
+
}
|
|
1364
|
+
ensureLayer() {
|
|
1365
|
+
if (this.layerRef) return;
|
|
1366
|
+
this.layerRef = createComponent(SplitDropZoneLayerComponent, { environmentInjector: this.environmentInjector });
|
|
1367
|
+
this.renderer.appendChild(this.document.body, this.layerRef.location.nativeElement);
|
|
1368
|
+
this.appRef.attachView(this.layerRef.hostView);
|
|
1369
|
+
}
|
|
1370
|
+
createDisplay(container) {
|
|
1371
|
+
return {
|
|
1372
|
+
resolved: this.resolver.resolve(container),
|
|
1373
|
+
options: container.options,
|
|
1374
|
+
stash: new SplitStyleStash$1(this.domWriter)
|
|
1375
|
+
};
|
|
1376
|
+
}
|
|
1377
|
+
staticElements(entry) {
|
|
1378
|
+
return {
|
|
1379
|
+
host: entry.home,
|
|
1380
|
+
shell: entry.shell,
|
|
1381
|
+
backdrop: entry.backdrop
|
|
1382
|
+
};
|
|
1383
|
+
}
|
|
1384
|
+
applyStatic(display, els) {
|
|
1385
|
+
const { stash, resolved } = display;
|
|
1386
|
+
const { kind, layout, side, size } = resolved;
|
|
1387
|
+
const { host, shell, backdrop } = els;
|
|
1388
|
+
stash.restore();
|
|
1389
|
+
stash.addClass(host, kind === "custom" && "split-host", `split-layout--${layout}`, `split-side--${side}`, ...resolved.hostClass);
|
|
1390
|
+
if (kind === "body") stash.set(host, "--split-body-size", size ?? this.config.bodySize);
|
|
1391
|
+
const floating = kind === "custom" && layout !== "inline";
|
|
1392
|
+
if (floating) {
|
|
1393
|
+
const axis = axisOf(side);
|
|
1394
|
+
stash.set(host, "flex", "0 0 auto");
|
|
1395
|
+
stash.set(host, axis, "0px");
|
|
1396
|
+
stash.set(host, `min-${axis}`, "0px");
|
|
1397
|
+
stash.set(host, "overflow", layout === "push" ? "hidden" : "visible");
|
|
1398
|
+
const view = this.document.defaultView;
|
|
1399
|
+
if (view && ["", "static"].includes(view.getComputedStyle(host).position)) stash.set(host, "position", "relative");
|
|
1400
|
+
}
|
|
1401
|
+
if (shell) {
|
|
1402
|
+
stash.addClass(shell, `split-container--${kind}`, `split-layout--${layout}`, `split-side--${side}`, ...resolved.panelClass);
|
|
1403
|
+
if (floating) {
|
|
1404
|
+
const horizontal = axisOf(side) === "width";
|
|
1405
|
+
stash.set(shell, "--split-inset", PANEL_INSET[layout][side]);
|
|
1406
|
+
stash.set(shell, "--split-w", horizontal ? "var(--split-size)" : "auto");
|
|
1407
|
+
stash.set(shell, "--split-h", horizontal ? "auto" : "var(--split-size)");
|
|
1408
|
+
if (layout === "overlay" && size) stash.set(shell, "--split-size", size);
|
|
1409
|
+
}
|
|
1410
|
+
}
|
|
1411
|
+
if (backdrop) stash.addClass(backdrop, ...resolved.backdropClass);
|
|
1412
|
+
}
|
|
1413
|
+
syncBackdrop(entry, container) {
|
|
1414
|
+
if (!entry.bodyHost) return false;
|
|
1415
|
+
const wanted = !!container.options.backdrop;
|
|
1416
|
+
if (wanted === !!entry.backdrop) return false;
|
|
1417
|
+
if (wanted) {
|
|
1418
|
+
entry.backdrop = this.createElement("div", "split-body-backdrop");
|
|
1419
|
+
this.setHidden(entry.backdrop, !!entry.shell.hidden);
|
|
1420
|
+
this.renderer.insertBefore(this.document.body, entry.backdrop, entry.bodyHost);
|
|
1421
|
+
} else {
|
|
1422
|
+
this.detach(entry.backdrop);
|
|
1423
|
+
entry.backdrop = null;
|
|
1424
|
+
}
|
|
1425
|
+
if (entry.modeCtx) entry.modeCtx = {
|
|
1426
|
+
...entry.modeCtx,
|
|
1427
|
+
elements: this.elements(entry)
|
|
1428
|
+
};
|
|
1429
|
+
return true;
|
|
1430
|
+
}
|
|
1431
|
+
elements(entry) {
|
|
1432
|
+
const { resolved } = entry.display;
|
|
1433
|
+
let pushTarget = null;
|
|
1434
|
+
if (resolved.kind === "body" && resolved.layout === "push") {
|
|
1435
|
+
const target = resolved.pushTarget;
|
|
1436
|
+
pushTarget = typeof target === "string" ? this.document.querySelector(target) : target ?? null;
|
|
1437
|
+
if (!pushTarget) {
|
|
1438
|
+
if (target) console.warn(`[split-window] pushTarget not found: ${String(target)}`);
|
|
1439
|
+
pushTarget = this.document.body;
|
|
1440
|
+
}
|
|
1441
|
+
}
|
|
1442
|
+
return {
|
|
1443
|
+
shell: entry.shell,
|
|
1444
|
+
host: entry.home,
|
|
1445
|
+
backdrop: entry.backdrop,
|
|
1446
|
+
pushTarget
|
|
1447
|
+
};
|
|
1448
|
+
}
|
|
1449
|
+
applyLayout(entry, container) {
|
|
1450
|
+
const { resolved } = entry.display;
|
|
1451
|
+
const ctx = {
|
|
1452
|
+
container,
|
|
1453
|
+
kind: resolved.kind,
|
|
1454
|
+
layout: resolved.layout,
|
|
1455
|
+
side: resolved.side,
|
|
1456
|
+
size: resolved.size,
|
|
1457
|
+
elements: this.elements(entry),
|
|
1458
|
+
document: this.document,
|
|
1459
|
+
styles: entry.layout,
|
|
1460
|
+
data: {}
|
|
1461
|
+
};
|
|
1462
|
+
entry.modeCtx = ctx;
|
|
1463
|
+
entry.layout.addClass(entry.home, "split-host--open");
|
|
1464
|
+
resolved.mode.open(ctx);
|
|
1465
|
+
}
|
|
1466
|
+
removeLayout(entry) {
|
|
1467
|
+
const ctx = entry.modeCtx;
|
|
1468
|
+
if (!ctx) return;
|
|
1469
|
+
try {
|
|
1470
|
+
entry.display.resolved.mode.close(ctx);
|
|
1471
|
+
} finally {
|
|
1472
|
+
entry.layout.restore();
|
|
1473
|
+
entry.modeCtx = null;
|
|
1474
|
+
}
|
|
1475
|
+
}
|
|
1476
|
+
setVisible(entry, visible) {
|
|
1477
|
+
this.setHidden(entry.shell, !visible);
|
|
1478
|
+
if (entry.bodyHost) this.setHidden(entry.bodyHost, !visible);
|
|
1479
|
+
if (entry.backdrop) this.setHidden(entry.backdrop, !visible);
|
|
1480
|
+
}
|
|
1481
|
+
isMounted(container) {
|
|
1482
|
+
return this.shells.has(container.key);
|
|
1483
|
+
}
|
|
1484
|
+
isEntered(container) {
|
|
1485
|
+
return !!this.shells.get(container.key)?.modeCtx;
|
|
1486
|
+
}
|
|
1487
|
+
enter(container) {
|
|
1488
|
+
const entry = this.shells.get(container.key);
|
|
1489
|
+
if (!entry) return;
|
|
1490
|
+
this.setVisible(entry, true);
|
|
1491
|
+
this.applyLayout(entry, container);
|
|
1492
|
+
}
|
|
1493
|
+
leave(container) {
|
|
1494
|
+
const entry = this.shells.get(container.key);
|
|
1495
|
+
if (!entry) return;
|
|
1496
|
+
const ctx = entry.modeCtx;
|
|
1497
|
+
this.removeLayout(entry);
|
|
1498
|
+
this.setVisible(entry, false);
|
|
1499
|
+
if (ctx) entry.display.resolved.mode.hidden(ctx);
|
|
1500
|
+
}
|
|
1501
|
+
beforeTransition(container) {
|
|
1502
|
+
this.applyContainerOptions(container);
|
|
1503
|
+
}
|
|
1504
|
+
setLeaving(container, leaving) {
|
|
1505
|
+
const entry = this.shells.get(container.key);
|
|
1506
|
+
if (!entry) return;
|
|
1507
|
+
this.toggleClass(entry.shell, "split-container--leaving", leaving);
|
|
1508
|
+
if (leaving) {
|
|
1509
|
+
entry.componentRef.instance.freeze();
|
|
1510
|
+
this.renderer.setAttribute(entry.shell, "inert", "");
|
|
1511
|
+
} else {
|
|
1512
|
+
this.renderer.removeAttribute(entry.shell, "inert");
|
|
1513
|
+
entry.componentRef.instance.unfreeze();
|
|
1514
|
+
}
|
|
1515
|
+
}
|
|
1516
|
+
setAnimating(container, on) {
|
|
1517
|
+
const shell = this.shells.get(container.key)?.shell;
|
|
1518
|
+
if (shell) this.toggleClass(shell, "split-animating", on);
|
|
1519
|
+
}
|
|
1520
|
+
afterShown(container) {
|
|
1521
|
+
const ctx = this.shells.get(container.key)?.modeCtx;
|
|
1522
|
+
if (ctx) this.shells.get(container.key).display.resolved.mode.shown(ctx);
|
|
1523
|
+
}
|
|
1524
|
+
prefersReducedMotion() {
|
|
1525
|
+
return !!this.document.defaultView?.matchMedia?.("(prefers-reduced-motion: reduce)").matches;
|
|
1526
|
+
}
|
|
1527
|
+
transitionPlan(container, phase) {
|
|
1528
|
+
const entry = this.shells.get(container.key);
|
|
1529
|
+
const ctx = entry?.modeCtx;
|
|
1530
|
+
if (!entry || !ctx) return null;
|
|
1531
|
+
const { resolved } = entry.display;
|
|
1532
|
+
const engine = this.animationEngineFor(resolved);
|
|
1533
|
+
if (!engine) return null;
|
|
1534
|
+
const { from, to } = resolved.mode.frames(ctx, phase);
|
|
1535
|
+
const push = resolved.layout === "push";
|
|
1536
|
+
return {
|
|
1537
|
+
engine,
|
|
1538
|
+
context: {
|
|
1539
|
+
layout: resolved.layout,
|
|
1540
|
+
side: resolved.side,
|
|
1541
|
+
size: resolved.size,
|
|
1542
|
+
elements: ctx.elements,
|
|
1543
|
+
from,
|
|
1544
|
+
to,
|
|
1545
|
+
properties: {
|
|
1546
|
+
host: push && resolved.kind === "custom" ? axisOf(resolved.side) : null,
|
|
1547
|
+
push: push && resolved.kind === "body" ? `padding-${resolved.side}` : null
|
|
1548
|
+
},
|
|
1549
|
+
options: resolved.animation
|
|
1550
|
+
}
|
|
1551
|
+
};
|
|
1552
|
+
}
|
|
1553
|
+
animationEngineFor(resolved) {
|
|
1554
|
+
if (!resolved.animated) return null;
|
|
1555
|
+
try {
|
|
1556
|
+
return this.animationEngines.resolve(resolved.engine);
|
|
1557
|
+
} catch (error) {
|
|
1558
|
+
this.reportError(error);
|
|
1559
|
+
return this.animationEngines.resolve("none");
|
|
1560
|
+
}
|
|
1561
|
+
}
|
|
1562
|
+
destroyTab(handle) {
|
|
1563
|
+
const h = handle;
|
|
1564
|
+
h.view?.destroy();
|
|
1565
|
+
this.detach(h.panel);
|
|
1566
|
+
h.containerKey = null;
|
|
1567
|
+
}
|
|
1568
|
+
containerOfTab(handle) {
|
|
1569
|
+
return handle.containerKey;
|
|
1570
|
+
}
|
|
1571
|
+
createTab(content, tab, ref, options) {
|
|
1572
|
+
const active = new SplitActiveWindow(ref);
|
|
1573
|
+
const panel = this.createElement("div", "split-tab-panel");
|
|
1574
|
+
this.renderer.setAttribute(panel, "id", `${tab.id}-panel`);
|
|
1575
|
+
this.renderer.setAttribute(panel, "role", "tabpanel");
|
|
1576
|
+
this.renderer.setAttribute(panel, "aria-labelledby", `${tab.id}-tab`);
|
|
1577
|
+
this.setHidden(panel, true);
|
|
1578
|
+
const handle = {
|
|
1579
|
+
ref,
|
|
1580
|
+
panel,
|
|
1581
|
+
view: null,
|
|
1582
|
+
componentRef: null,
|
|
1583
|
+
cd: null,
|
|
1584
|
+
active,
|
|
1585
|
+
containerKey: null
|
|
1586
|
+
};
|
|
1587
|
+
if (!this.isBrowser) return handle;
|
|
1588
|
+
const parent = options?.injector ?? this.environmentInjector;
|
|
1589
|
+
const environmentInjector = parent.get(EnvironmentInjector, this.environmentInjector);
|
|
1590
|
+
const elementInjector = Injector.create({
|
|
1591
|
+
providers: [{
|
|
1592
|
+
provide: SplitActiveWindow,
|
|
1593
|
+
useValue: active
|
|
1594
|
+
}],
|
|
1595
|
+
parent
|
|
1596
|
+
});
|
|
1597
|
+
if (content instanceof TemplateRef) {
|
|
1598
|
+
const context = {
|
|
1599
|
+
$implicit: active,
|
|
1600
|
+
window: active
|
|
1601
|
+
};
|
|
1602
|
+
const view = content.createEmbeddedView(context, elementInjector);
|
|
1603
|
+
for (const node of view.rootNodes) this.renderer.appendChild(panel, node);
|
|
1604
|
+
handle.view = view;
|
|
1605
|
+
handle.cd = view;
|
|
1606
|
+
} else {
|
|
1607
|
+
const componentRef = createComponent(content, {
|
|
1608
|
+
environmentInjector,
|
|
1609
|
+
elementInjector
|
|
1610
|
+
});
|
|
1611
|
+
for (const [name, value] of Object.entries(options?.inputs ?? {})) componentRef.setInput(name, value);
|
|
1612
|
+
this.renderer.appendChild(panel, componentRef.location.nativeElement);
|
|
1613
|
+
handle.componentRef = componentRef;
|
|
1614
|
+
handle.view = componentRef.hostView;
|
|
1615
|
+
handle.cd = componentRef.injector.get(ChangeDetectorRef);
|
|
1616
|
+
ref._setComponentInstance(componentRef.instance);
|
|
1617
|
+
}
|
|
1618
|
+
this.appRef.attachView(handle.view);
|
|
1619
|
+
handle.cd.detach();
|
|
1620
|
+
return handle;
|
|
1621
|
+
}
|
|
1622
|
+
attach(handle, container) {
|
|
1623
|
+
const h = handle;
|
|
1624
|
+
h.containerKey = container.key;
|
|
1625
|
+
const content = this.contentElement(container.key);
|
|
1626
|
+
if (content) this.renderer.appendChild(content, h.panel);
|
|
1627
|
+
h.active.sync();
|
|
1628
|
+
}
|
|
1629
|
+
move(handle, to) {
|
|
1630
|
+
const h = handle;
|
|
1631
|
+
h.containerKey = to.key;
|
|
1632
|
+
const content = this.contentElement(to.key);
|
|
1633
|
+
if (content) moveNode(content, h.panel, null, this.renderer);
|
|
1634
|
+
h.active.sync();
|
|
1635
|
+
}
|
|
1636
|
+
activate(handle) {
|
|
1637
|
+
const h = handle;
|
|
1638
|
+
this.setHidden(h.panel, false);
|
|
1639
|
+
if (!h.cd) return;
|
|
1640
|
+
h.cd.reattach();
|
|
1641
|
+
h.cd.markForCheck();
|
|
1642
|
+
try {
|
|
1643
|
+
h.cd.detectChanges();
|
|
1644
|
+
} catch (error) {
|
|
1645
|
+
console.error("[split-window] erro ao renderizar a aba", error);
|
|
1646
|
+
}
|
|
1647
|
+
}
|
|
1648
|
+
deactivate(handle) {
|
|
1649
|
+
const h = handle;
|
|
1650
|
+
this.setHidden(h.panel, true);
|
|
1651
|
+
h.cd?.detach();
|
|
1652
|
+
}
|
|
1653
|
+
setInputs(handle, inputs) {
|
|
1654
|
+
const { componentRef } = handle;
|
|
1655
|
+
if (!componentRef) return;
|
|
1656
|
+
for (const [name, value] of this.resolveInputParams(inputs, componentRef.componentType)) componentRef.setInput(name, value);
|
|
1657
|
+
}
|
|
1658
|
+
*resolveInputParams(data, componentType) {
|
|
1659
|
+
const names = /* @__PURE__ */ new Map();
|
|
1660
|
+
for (const { propName, templateName } of reflectComponentType(componentType)?.inputs ?? []) {
|
|
1661
|
+
names.set(propName, templateName);
|
|
1662
|
+
names.set(templateName, templateName);
|
|
1663
|
+
}
|
|
1664
|
+
for (const [key, value] of Object.entries(data)) {
|
|
1665
|
+
const name = names.get(key);
|
|
1666
|
+
if (value !== void 0 && name !== void 0) yield [name, value];
|
|
1667
|
+
}
|
|
1668
|
+
}
|
|
1669
|
+
setExpanded(container, expanded) {
|
|
1670
|
+
const entry = this.shells.get(container.key);
|
|
1671
|
+
if (!entry) return;
|
|
1672
|
+
entry.expandCleanup?.();
|
|
1673
|
+
entry.expandCleanup = null;
|
|
1674
|
+
if (expanded) entry.expandCleanup = this.expand(container, entry);
|
|
1675
|
+
}
|
|
1676
|
+
expand(container, entry) {
|
|
1677
|
+
const win = this.document.defaultView;
|
|
1678
|
+
const options = container.options.expand === false ? {} : container.options.expand ?? {};
|
|
1679
|
+
const { shell } = entry;
|
|
1680
|
+
const originalNext = shell.nextSibling;
|
|
1681
|
+
let movedToLayer = false;
|
|
1682
|
+
const boundsRect = () => {
|
|
1683
|
+
const viewport = {
|
|
1684
|
+
x: 0,
|
|
1685
|
+
y: 0,
|
|
1686
|
+
width: win.innerWidth,
|
|
1687
|
+
height: win.innerHeight
|
|
1688
|
+
};
|
|
1689
|
+
const bounds = options.bounds ?? "viewport";
|
|
1690
|
+
if (bounds === "viewport") return viewport;
|
|
1691
|
+
if (typeof bounds === "function") return toRect(bounds());
|
|
1692
|
+
const element = typeof bounds === "string" ? this.document.querySelector(bounds) : bounds;
|
|
1693
|
+
return element ? toRect(element.getBoundingClientRect()) : viewport;
|
|
1694
|
+
};
|
|
1695
|
+
const apply = () => {
|
|
1696
|
+
const area = boundsRect();
|
|
1697
|
+
const viewport = {
|
|
1698
|
+
width: win.innerWidth,
|
|
1699
|
+
height: win.innerHeight
|
|
1700
|
+
};
|
|
1701
|
+
const rect = computeExpandedRect(area, {
|
|
1702
|
+
maxWidth: resolveLength(options.maxWidth, "x", viewport, area),
|
|
1703
|
+
maxHeight: resolveLength(options.maxHeight, "y", viewport, area),
|
|
1704
|
+
margin: options.margin,
|
|
1705
|
+
align: options.align
|
|
1706
|
+
});
|
|
1707
|
+
const styles = {
|
|
1708
|
+
position: "fixed",
|
|
1709
|
+
left: `${rect.x}px`,
|
|
1710
|
+
top: `${rect.y}px`,
|
|
1711
|
+
width: `${rect.width}px`,
|
|
1712
|
+
height: `${rect.height}px`
|
|
1713
|
+
};
|
|
1714
|
+
for (const [prop, value] of Object.entries(styles)) this.renderer.setStyle(shell, prop, value, RendererStyleFlags2.DashCase);
|
|
1715
|
+
if (!movedToLayer && !rectsMatch(toRect(shell.getBoundingClientRect()), rect)) {
|
|
1716
|
+
moveNode(this.getExpandLayer(), shell, null, this.renderer);
|
|
1717
|
+
movedToLayer = true;
|
|
1718
|
+
}
|
|
1719
|
+
};
|
|
1720
|
+
this.renderer.addClass(shell, "split-container--expanded");
|
|
1721
|
+
this.renderer.addClass(entry.home, "split-host--expanded");
|
|
1722
|
+
apply();
|
|
1723
|
+
if (!shell.contains(this.document.activeElement)) shell.focus({ preventScroll: true });
|
|
1724
|
+
const onResize = () => apply();
|
|
1725
|
+
const unlistenResize = this.renderer.listen("window", "resize", onResize);
|
|
1726
|
+
const bounds = options.bounds;
|
|
1727
|
+
const boundsElement = typeof bounds === "string" && bounds !== "viewport" ? this.document.querySelector(bounds) : bounds instanceof HTMLElement ? bounds : null;
|
|
1728
|
+
const observer = boundsElement && typeof ResizeObserver !== "undefined" ? new ResizeObserver(onResize) : null;
|
|
1729
|
+
if (boundsElement) observer?.observe(boundsElement);
|
|
1730
|
+
return () => {
|
|
1731
|
+
unlistenResize();
|
|
1732
|
+
observer?.disconnect();
|
|
1733
|
+
this.renderer.removeClass(shell, "split-container--expanded");
|
|
1734
|
+
this.renderer.removeClass(entry.home, "split-host--expanded");
|
|
1735
|
+
for (const prop of [
|
|
1736
|
+
"position",
|
|
1737
|
+
"left",
|
|
1738
|
+
"top",
|
|
1739
|
+
"width",
|
|
1740
|
+
"height"
|
|
1741
|
+
]) this.renderer.removeStyle(shell, prop, RendererStyleFlags2.DashCase);
|
|
1742
|
+
if (movedToLayer) moveNode(entry.home, shell, originalNext && originalNext.parentNode === entry.home ? originalNext : null, this.renderer);
|
|
1743
|
+
};
|
|
1744
|
+
}
|
|
1745
|
+
getExpandLayer() {
|
|
1746
|
+
if (!this.expandLayer) {
|
|
1747
|
+
this.expandLayer = this.createElement("div", "split-expand-layer");
|
|
1748
|
+
this.renderer.appendChild(this.document.body, this.expandLayer);
|
|
1749
|
+
}
|
|
1750
|
+
return this.expandLayer;
|
|
1751
|
+
}
|
|
1752
|
+
startDrag(ref, sourceList) {
|
|
1753
|
+
const controller = this.controller;
|
|
1754
|
+
controller.beginDrag(ref);
|
|
1755
|
+
if (controller.getExpandedContainer() !== null) {
|
|
1756
|
+
sourceList.connectedTo = [];
|
|
1757
|
+
return;
|
|
1758
|
+
}
|
|
1759
|
+
const targets = controller.getDropTargets(ref);
|
|
1760
|
+
const zones = targets.filter((t) => !t.container.open).map((t) => this.floatingZone(t.container)).filter((z) => z !== null);
|
|
1761
|
+
this.floatingZones.set(zones);
|
|
1762
|
+
this.layerRef?.changeDetectorRef.detectChanges();
|
|
1763
|
+
const ids = [];
|
|
1764
|
+
for (const t of targets) {
|
|
1765
|
+
if (!t.container.open || !this.shells.has(t.key)) continue;
|
|
1766
|
+
ids.push(stripListId(t.key), contentListId(t.key));
|
|
1767
|
+
}
|
|
1768
|
+
for (const zone of zones) ids.push(floatListId(zone.key));
|
|
1769
|
+
sourceList.connectedTo = ids;
|
|
1770
|
+
}
|
|
1771
|
+
handleDrop(event) {
|
|
1772
|
+
const controller = this.controller;
|
|
1773
|
+
const ref = event.item.data;
|
|
1774
|
+
const target = event.container.data;
|
|
1775
|
+
let moved = false;
|
|
1776
|
+
if (event.isPointerOverContainer && ref.isOpen) {
|
|
1777
|
+
if (target.kind === "strip") moved = controller.moveTab(ref, target.key, event.currentIndex, "drag");
|
|
1778
|
+
else if (target.key !== ref.containerKey) moved = controller.moveTab(ref, target.key, void 0, "drag");
|
|
1779
|
+
}
|
|
1780
|
+
controller.endDrag(ref, moved);
|
|
1781
|
+
this.floatingZones.set([]);
|
|
1782
|
+
}
|
|
1783
|
+
cancelDrag() {
|
|
1784
|
+
if (!this.isBrowser) return;
|
|
1785
|
+
this.document.dispatchEvent(new MouseEvent("mouseup", {
|
|
1786
|
+
bubbles: true,
|
|
1787
|
+
cancelable: true,
|
|
1788
|
+
clientX: -1e4,
|
|
1789
|
+
clientY: -1e4
|
|
1790
|
+
}));
|
|
1791
|
+
try {
|
|
1792
|
+
const touch = new Touch({
|
|
1793
|
+
identifier: 0,
|
|
1794
|
+
target: this.document.body,
|
|
1795
|
+
clientX: -1e4,
|
|
1796
|
+
clientY: -1e4
|
|
1797
|
+
});
|
|
1798
|
+
this.document.dispatchEvent(new TouchEvent("touchend", {
|
|
1799
|
+
bubbles: true,
|
|
1800
|
+
changedTouches: [touch]
|
|
1801
|
+
}));
|
|
1802
|
+
} catch {}
|
|
1803
|
+
}
|
|
1804
|
+
floatingZone(container) {
|
|
1805
|
+
const config = this.config;
|
|
1806
|
+
const win = this.document.defaultView;
|
|
1807
|
+
const size = {
|
|
1808
|
+
width: container.options.closedDropZone?.width ?? config.closedDropZone.width,
|
|
1809
|
+
height: container.options.closedDropZone?.height ?? config.closedDropZone.height
|
|
1810
|
+
};
|
|
1811
|
+
const host = container.host;
|
|
1812
|
+
let hostInfo = null;
|
|
1813
|
+
if (host && host.isConnected) {
|
|
1814
|
+
const rect = toRect(host.getBoundingClientRect());
|
|
1815
|
+
const displayed = host.getClientRects().length > 0 && rect.width > 0 && rect.height > 0;
|
|
1816
|
+
if (displayed) this.remember(host);
|
|
1817
|
+
hostInfo = {
|
|
1818
|
+
rect,
|
|
1819
|
+
displayed
|
|
1820
|
+
};
|
|
1821
|
+
}
|
|
1822
|
+
const anchor = container.options.closedDropZoneAnchor;
|
|
1823
|
+
const rect = computeClosedDropZoneRect({
|
|
1824
|
+
size,
|
|
1825
|
+
viewport: {
|
|
1826
|
+
x: 0,
|
|
1827
|
+
y: 0,
|
|
1828
|
+
width: win.innerWidth,
|
|
1829
|
+
height: win.innerHeight
|
|
1830
|
+
},
|
|
1831
|
+
bodySide: container.side,
|
|
1832
|
+
host: hostInfo,
|
|
1833
|
+
lastKnownRect: host ? this.lastKnownRects.get(host) ?? null : null,
|
|
1834
|
+
anchorRect: anchor?.isConnected ? toRect(anchor.getBoundingClientRect()) : null
|
|
1835
|
+
});
|
|
1836
|
+
return rect ? {
|
|
1837
|
+
key: container.key,
|
|
1838
|
+
label: container.label,
|
|
1839
|
+
rect
|
|
1840
|
+
} : null;
|
|
1841
|
+
}
|
|
1842
|
+
remember(host) {
|
|
1843
|
+
if (!host.isConnected || host.getClientRects().length === 0) return;
|
|
1844
|
+
const rect = host.getBoundingClientRect();
|
|
1845
|
+
if (rect.width === 0 || rect.height === 0) return;
|
|
1846
|
+
this.lastKnownRects.set(host, toRect(rect));
|
|
1847
|
+
}
|
|
1848
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
1849
|
+
minVersion: "12.0.0",
|
|
1850
|
+
version: "22.3.0",
|
|
1851
|
+
ngImport: i0,
|
|
1852
|
+
type: AngularSplitEngine,
|
|
1853
|
+
deps: null,
|
|
1854
|
+
target: i0.ɵɵFactoryTarget.Injectable
|
|
1855
|
+
});
|
|
1856
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({
|
|
1857
|
+
minVersion: "12.0.0",
|
|
1858
|
+
version: "22.3.0",
|
|
1859
|
+
ngImport: i0,
|
|
1860
|
+
type: AngularSplitEngine
|
|
1861
|
+
});
|
|
1862
|
+
};
|
|
1863
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
1864
|
+
minVersion: "12.0.0",
|
|
1865
|
+
version: "22.3.0",
|
|
1866
|
+
ngImport: i0,
|
|
1867
|
+
type: AngularSplitEngine,
|
|
1868
|
+
decorators: [{ type: Injectable }]
|
|
1869
|
+
});
|
|
1870
|
+
const stripListId = (key) => `split-strip-${key}`;
|
|
1871
|
+
const contentListId = (key) => `split-content-${key}`;
|
|
1872
|
+
const floatListId = (key) => `split-float-${key}`;
|
|
1873
|
+
var SplitContainerRegistry = class SplitContainerRegistry extends SplitContainerRegistry$1 {
|
|
1874
|
+
resolver = inject(SplitModeResolver);
|
|
1875
|
+
registerContainer(key, host, options) {
|
|
1876
|
+
this.resolver.validate(options?.mode, "custom", "mode");
|
|
1877
|
+
super.registerContainer(key, host, options);
|
|
1878
|
+
}
|
|
1879
|
+
useBodyContainers(config) {
|
|
1880
|
+
if (config && typeof config === "object") {
|
|
1881
|
+
const { defaults } = config;
|
|
1882
|
+
this.resolver.validate(defaults?.mode, "body", "defaults.mode");
|
|
1883
|
+
for (const side of SPLIT_BODY_SIDES) {
|
|
1884
|
+
const value = config[side];
|
|
1885
|
+
if (value && typeof value === "object") this.resolver.validate(value.mode, "body", `${side}.mode`);
|
|
1886
|
+
}
|
|
1887
|
+
}
|
|
1888
|
+
super.useBodyContainers(config);
|
|
1889
|
+
}
|
|
1890
|
+
ngOnDestroy() {
|
|
1891
|
+
this.destroy();
|
|
1892
|
+
}
|
|
1893
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
1894
|
+
minVersion: "12.0.0",
|
|
1895
|
+
version: "22.3.0",
|
|
1896
|
+
ngImport: i0,
|
|
1897
|
+
type: SplitContainerRegistry,
|
|
1898
|
+
deps: null,
|
|
1899
|
+
target: i0.ɵɵFactoryTarget.Injectable
|
|
1900
|
+
});
|
|
1901
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({
|
|
1902
|
+
minVersion: "12.0.0",
|
|
1903
|
+
version: "22.3.0",
|
|
1904
|
+
ngImport: i0,
|
|
1905
|
+
type: SplitContainerRegistry
|
|
1906
|
+
});
|
|
1907
|
+
};
|
|
1908
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
1909
|
+
minVersion: "12.0.0",
|
|
1910
|
+
version: "22.3.0",
|
|
1911
|
+
ngImport: i0,
|
|
1912
|
+
type: SplitContainerRegistry,
|
|
1913
|
+
decorators: [{ type: Injectable }]
|
|
1914
|
+
});
|
|
1915
|
+
var SplitWindowController = class SplitWindowController extends SplitWindowController$1 {
|
|
1916
|
+
constructor() {
|
|
1917
|
+
super(inject(SplitContainerRegistry), inject(AngularSplitEngine), inject(SPLIT_WINDOW_CONFIG));
|
|
1918
|
+
}
|
|
1919
|
+
ngOnDestroy() {
|
|
1920
|
+
this.destroy();
|
|
1921
|
+
}
|
|
1922
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
1923
|
+
minVersion: "12.0.0",
|
|
1924
|
+
version: "22.3.0",
|
|
1925
|
+
ngImport: i0,
|
|
1926
|
+
type: SplitWindowController,
|
|
1927
|
+
deps: [],
|
|
1928
|
+
target: i0.ɵɵFactoryTarget.Injectable
|
|
1929
|
+
});
|
|
1930
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({
|
|
1931
|
+
minVersion: "12.0.0",
|
|
1932
|
+
version: "22.3.0",
|
|
1933
|
+
ngImport: i0,
|
|
1934
|
+
type: SplitWindowController
|
|
1935
|
+
});
|
|
1936
|
+
};
|
|
1937
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
1938
|
+
minVersion: "12.0.0",
|
|
1939
|
+
version: "22.3.0",
|
|
1940
|
+
ngImport: i0,
|
|
1941
|
+
type: SplitWindowController,
|
|
1942
|
+
decorators: [{ type: Injectable }],
|
|
1943
|
+
ctorParameters: () => []
|
|
1944
|
+
});
|
|
1945
|
+
var SplitWindowManager = class SplitWindowManager {
|
|
1946
|
+
controller = inject(SplitWindowController);
|
|
1947
|
+
registry = inject(SplitContainerRegistry);
|
|
1948
|
+
tabMoved = this.controller.tabMoved;
|
|
1949
|
+
tabRejected = this.controller.tabRejected;
|
|
1950
|
+
containerStateChanged = this.controller.containerStateChanged;
|
|
1951
|
+
containerTransitions = this.controller.engine.transitions;
|
|
1952
|
+
open(content, options = {}) {
|
|
1953
|
+
const { inputs, injector, ...coreOptions } = options ?? {};
|
|
1954
|
+
return this.controller.open(content, coreOptions, {
|
|
1955
|
+
inputs,
|
|
1956
|
+
injector
|
|
1957
|
+
});
|
|
1958
|
+
}
|
|
1959
|
+
dismissAll(options) {
|
|
1960
|
+
return this.controller.dismissAll(options);
|
|
1961
|
+
}
|
|
1962
|
+
hasOpenWindows(containerKey) {
|
|
1963
|
+
return this.controller.hasOpenWindows(containerKey);
|
|
1964
|
+
}
|
|
1965
|
+
getTabs(containerKey) {
|
|
1966
|
+
return this.controller.getTabs(containerKey);
|
|
1967
|
+
}
|
|
1968
|
+
expandContainer(key) {
|
|
1969
|
+
this.controller.expandContainer(key);
|
|
1970
|
+
}
|
|
1971
|
+
restoreContainer(key) {
|
|
1972
|
+
this.controller.restoreContainer(key);
|
|
1973
|
+
}
|
|
1974
|
+
isContainerOpen(key) {
|
|
1975
|
+
return this.controller.isContainerOpen(key);
|
|
1976
|
+
}
|
|
1977
|
+
isContainerExpanded(key) {
|
|
1978
|
+
return this.controller.isContainerExpanded(key);
|
|
1979
|
+
}
|
|
1980
|
+
getExpandedContainer() {
|
|
1981
|
+
return this.controller.getExpandedContainer();
|
|
1982
|
+
}
|
|
1983
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
1984
|
+
minVersion: "12.0.0",
|
|
1985
|
+
version: "22.3.0",
|
|
1986
|
+
ngImport: i0,
|
|
1987
|
+
type: SplitWindowManager,
|
|
1988
|
+
deps: [],
|
|
1989
|
+
target: i0.ɵɵFactoryTarget.Injectable
|
|
1990
|
+
});
|
|
1991
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({
|
|
1992
|
+
minVersion: "12.0.0",
|
|
1993
|
+
version: "22.3.0",
|
|
1994
|
+
ngImport: i0,
|
|
1995
|
+
type: SplitWindowManager
|
|
1996
|
+
});
|
|
1997
|
+
};
|
|
1998
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
1999
|
+
minVersion: "12.0.0",
|
|
2000
|
+
version: "22.3.0",
|
|
2001
|
+
ngImport: i0,
|
|
2002
|
+
type: SplitWindowManager,
|
|
2003
|
+
decorators: [{ type: Injectable }]
|
|
2004
|
+
});
|
|
2005
|
+
function provideSplitWindows(config) {
|
|
2006
|
+
const { modes, containerDefaults, animationEngines, animationEngineRegistry, engine, controller, ...core } = config ?? {};
|
|
2007
|
+
const providers = [
|
|
2008
|
+
SplitContainerRegistry,
|
|
2009
|
+
SplitModeResolver,
|
|
2010
|
+
animationEngineRegistry ? {
|
|
2011
|
+
provide: SplitAnimationEngineRegistry,
|
|
2012
|
+
useClass: animationEngineRegistry
|
|
2013
|
+
} : SplitAnimationEngineRegistry,
|
|
2014
|
+
engine ? {
|
|
2015
|
+
provide: AngularSplitEngine,
|
|
2016
|
+
useClass: engine
|
|
2017
|
+
} : AngularSplitEngine,
|
|
2018
|
+
controller ? {
|
|
2019
|
+
provide: SplitWindowController,
|
|
2020
|
+
useClass: controller
|
|
2021
|
+
} : SplitWindowController,
|
|
2022
|
+
SplitWindowManager,
|
|
2023
|
+
{
|
|
2024
|
+
provide: SPLIT_WINDOW_CONFIG,
|
|
2025
|
+
useValue: mergeSplitWindowConfig(core)
|
|
2026
|
+
},
|
|
2027
|
+
{
|
|
2028
|
+
provide: SPLIT_CONTAINER_DEFAULTS,
|
|
2029
|
+
useValue: containerDefaults ?? {}
|
|
2030
|
+
}
|
|
2031
|
+
];
|
|
2032
|
+
if (modes) providers.push({
|
|
2033
|
+
provide: SPLIT_WINDOW_MODES,
|
|
2034
|
+
useValue: modes,
|
|
2035
|
+
multi: true
|
|
2036
|
+
});
|
|
2037
|
+
if (animationEngines) providers.push({
|
|
2038
|
+
provide: SPLIT_ANIMATION_ENGINES,
|
|
2039
|
+
useValue: animationEngines,
|
|
2040
|
+
multi: true
|
|
2041
|
+
});
|
|
2042
|
+
return makeEnvironmentProviders(providers);
|
|
2043
|
+
}
|
|
2044
|
+
function provideSplitModes(modes) {
|
|
2045
|
+
return makeEnvironmentProviders([{
|
|
2046
|
+
provide: SPLIT_WINDOW_MODES,
|
|
2047
|
+
useValue: modes,
|
|
2048
|
+
multi: true
|
|
2049
|
+
}]);
|
|
2050
|
+
}
|
|
2051
|
+
function provideSplitAnimationEngines(engines) {
|
|
2052
|
+
return makeEnvironmentProviders([{
|
|
2053
|
+
provide: SPLIT_ANIMATION_ENGINES,
|
|
2054
|
+
useValue: engines,
|
|
2055
|
+
multi: true
|
|
2056
|
+
}]);
|
|
2057
|
+
}
|
|
2058
|
+
var SplitContainerDirective = class SplitContainerDirective {
|
|
2059
|
+
registry = inject(SplitContainerRegistry);
|
|
2060
|
+
element = inject(ElementRef);
|
|
2061
|
+
splitContainer = input.required(...ngDevMode ? [{ debugName: "splitContainer" }] : /* istanbul ignore next */ []);
|
|
2062
|
+
splitContainerDefault = input(false, {
|
|
2063
|
+
...ngDevMode ? { debugName: "splitContainerDefault" } : /* istanbul ignore next */ {},
|
|
2064
|
+
transform: booleanAttribute
|
|
2065
|
+
});
|
|
2066
|
+
splitContainerOptions = input(void 0, ...ngDevMode ? [{ debugName: "splitContainerOptions" }] : /* istanbul ignore next */ []);
|
|
2067
|
+
registeredKey = null;
|
|
2068
|
+
ngOnInit() {
|
|
2069
|
+
this.register();
|
|
2070
|
+
}
|
|
2071
|
+
ngOnChanges(changes) {
|
|
2072
|
+
if (this.registeredKey === null) return;
|
|
2073
|
+
if (changes["splitContainer"] && this.splitContainer() !== this.registeredKey) {
|
|
2074
|
+
this.unregister();
|
|
2075
|
+
this.register();
|
|
2076
|
+
} else if (changes["splitContainerDefault"]) this.applyDefault();
|
|
2077
|
+
}
|
|
2078
|
+
ngOnDestroy() {
|
|
2079
|
+
this.unregister();
|
|
2080
|
+
}
|
|
2081
|
+
register() {
|
|
2082
|
+
const key = this.splitContainer();
|
|
2083
|
+
this.registry.registerContainer(key, this.element.nativeElement, this.splitContainerOptions());
|
|
2084
|
+
this.registeredKey = key;
|
|
2085
|
+
this.applyDefault();
|
|
2086
|
+
}
|
|
2087
|
+
applyDefault() {
|
|
2088
|
+
const key = this.registeredKey;
|
|
2089
|
+
if (key === null) return;
|
|
2090
|
+
if (this.splitContainerDefault()) this.registry.setDefaultContainer(key);
|
|
2091
|
+
else if (this.registry.getDefaultContainer() === key) this.registry.setDefaultContainer(null);
|
|
2092
|
+
}
|
|
2093
|
+
unregister() {
|
|
2094
|
+
if (this.registeredKey !== null && this.registry.hasContainer(this.registeredKey)) this.registry.unregisterContainer(this.registeredKey);
|
|
2095
|
+
this.registeredKey = null;
|
|
2096
|
+
}
|
|
2097
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
2098
|
+
minVersion: "12.0.0",
|
|
2099
|
+
version: "22.3.0",
|
|
2100
|
+
ngImport: i0,
|
|
2101
|
+
type: SplitContainerDirective,
|
|
2102
|
+
deps: [],
|
|
2103
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
2104
|
+
});
|
|
2105
|
+
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
2106
|
+
minVersion: "17.1.0",
|
|
2107
|
+
version: "22.3.0",
|
|
2108
|
+
type: SplitContainerDirective,
|
|
2109
|
+
isStandalone: true,
|
|
2110
|
+
selector: "[splitContainer]",
|
|
2111
|
+
inputs: {
|
|
2112
|
+
splitContainer: {
|
|
2113
|
+
classPropertyName: "splitContainer",
|
|
2114
|
+
publicName: "splitContainer",
|
|
2115
|
+
isSignal: true,
|
|
2116
|
+
isRequired: true,
|
|
2117
|
+
transformFunction: null
|
|
2118
|
+
},
|
|
2119
|
+
splitContainerDefault: {
|
|
2120
|
+
classPropertyName: "splitContainerDefault",
|
|
2121
|
+
publicName: "splitContainerDefault",
|
|
2122
|
+
isSignal: true,
|
|
2123
|
+
isRequired: false,
|
|
2124
|
+
transformFunction: null
|
|
2125
|
+
},
|
|
2126
|
+
splitContainerOptions: {
|
|
2127
|
+
classPropertyName: "splitContainerOptions",
|
|
2128
|
+
publicName: "splitContainerOptions",
|
|
2129
|
+
isSignal: true,
|
|
2130
|
+
isRequired: false,
|
|
2131
|
+
transformFunction: null
|
|
2132
|
+
}
|
|
2133
|
+
},
|
|
2134
|
+
exportAs: ["splitContainer"],
|
|
2135
|
+
usesOnChanges: true,
|
|
2136
|
+
ngImport: i0
|
|
2137
|
+
});
|
|
2138
|
+
};
|
|
2139
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
2140
|
+
minVersion: "12.0.0",
|
|
2141
|
+
version: "22.3.0",
|
|
2142
|
+
ngImport: i0,
|
|
2143
|
+
type: SplitContainerDirective,
|
|
2144
|
+
decorators: [{
|
|
2145
|
+
type: Directive,
|
|
2146
|
+
args: [{
|
|
2147
|
+
selector: "[splitContainer]",
|
|
2148
|
+
exportAs: "splitContainer"
|
|
2149
|
+
}]
|
|
2150
|
+
}],
|
|
2151
|
+
propDecorators: {
|
|
2152
|
+
splitContainer: [{
|
|
2153
|
+
type: i0.Input,
|
|
2154
|
+
args: [{
|
|
2155
|
+
isSignal: true,
|
|
2156
|
+
alias: "splitContainer",
|
|
2157
|
+
required: true
|
|
2158
|
+
}]
|
|
2159
|
+
}],
|
|
2160
|
+
splitContainerDefault: [{
|
|
2161
|
+
type: i0.Input,
|
|
2162
|
+
args: [{
|
|
2163
|
+
isSignal: true,
|
|
2164
|
+
alias: "splitContainerDefault",
|
|
2165
|
+
required: false
|
|
2166
|
+
}]
|
|
2167
|
+
}],
|
|
2168
|
+
splitContainerOptions: [{
|
|
2169
|
+
type: i0.Input,
|
|
2170
|
+
args: [{
|
|
2171
|
+
isSignal: true,
|
|
2172
|
+
alias: "splitContainerOptions",
|
|
2173
|
+
required: false
|
|
2174
|
+
}]
|
|
2175
|
+
}]
|
|
2176
|
+
}
|
|
2177
|
+
});
|
|
2178
|
+
export { AngularSplitEngine, DEFAULT_SPLIT_WINDOW_CONFIG, DIRECT_DOM_WRITER, NoopSplitAnimationEngine, SPLIT_ANIMATION_ENGINES, SPLIT_CONTAINER_DEFAULTS, SPLIT_CONTAINER_LAYOUTS, SPLIT_DEFAULT_EASING, SPLIT_NOOP_ANIMATION_ENGINE, SPLIT_WINDOW_CONFIG, SPLIT_WINDOW_MODES, SplitActiveWindow, SplitAnimationEngine, SplitAnimationEngineRegistry, SplitContainerComponent, SplitContainerDirective, SplitContainerFullError, SplitContainerMode, SplitContainerNotFoundError, SplitContainerRegistry, SplitDefinedMode, SplitDuplicateContainerError, SplitFunctionAnimationEngine, SplitInlineMode, SplitInvalidOptionError, SplitNoDefaultContainerError, SplitOverlayMode, SplitPushMode, SplitReservedContainerKeyError, SplitStyleStash, SplitTabStripComponent, SplitWindowController, SplitWindowError, SplitWindowManager, SplitWindowRef, axisOf, moveNode, offsetRect, provideSplitAnimationEngines, provideSplitModes, provideSplitWindows, rendererDomWriter, toClassList };
|
|
2179
|
+
|
|
2180
|
+
//# sourceMappingURL=split-window-angular.mjs.map
|