bwin 0.2.1 → 0.2.3
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/README.md +2 -2
- package/dist/bwin.js +84 -84
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# Binary Window
|
|
2
2
|
|
|
3
|
-
A
|
|
3
|
+
A lightweight window-tiling JavaScript library for the browser, featuring resizable panes, drag-and-drop, and more.
|
|
4
4
|
|
|
5
|
-
[
|
|
5
|
+
[Documentation](https://bhjsdev.github.io/bwin-docs/)
|
package/dist/bwin.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var f = (e, t, i) =>
|
|
1
|
+
var $ = Object.defineProperty;
|
|
2
|
+
var P = (e, t, i) => t in e ? $(e, t, { enumerable: !0, configurable: !0, writable: !0, value: i }) : e[t] = i;
|
|
3
|
+
var f = (e, t, i) => P(e, typeof t != "symbol" ? t + "" : t, i);
|
|
4
4
|
function W(e = 0.7, t = 128) {
|
|
5
5
|
const i = 256 - t, n = Math.floor(Math.random() * i + t), s = Math.floor(Math.random() * i + t), o = Math.floor(Math.random() * i + t), h = Math.max(0.5, Math.random() * e);
|
|
6
6
|
return `rgba(${n}, ${s}, ${o}, ${h})`;
|
|
@@ -77,7 +77,7 @@ function m(e) {
|
|
|
77
77
|
}
|
|
78
78
|
return e instanceof Node ? e : document.createTextNode(String(e));
|
|
79
79
|
}
|
|
80
|
-
function
|
|
80
|
+
function A(e) {
|
|
81
81
|
const t = parseFloat(e.style.left) || 0, i = parseFloat(e.style.top) || 0, n = parseFloat(e.style.width) || 0, s = parseFloat(e.style.height) || 0;
|
|
82
82
|
return { left: t, top: i, width: n, height: s };
|
|
83
83
|
}
|
|
@@ -121,8 +121,8 @@ function X(e, { clientX: t, clientY: i }) {
|
|
|
121
121
|
const n = e.getBoundingClientRect(), { width: s, height: o } = n, h = t - n.left, l = i - n.top;
|
|
122
122
|
if (h < 0 || h > s || l < 0 || l > o)
|
|
123
123
|
return r.Outside;
|
|
124
|
-
const
|
|
125
|
-
return h < s * (0.5 -
|
|
124
|
+
const d = 0.3, a = _({ width: s, height: o, x: h }), c = U({ width: s, height: o, x: h }), p = k({ width: s, height: o, y: l }), u = Y({ width: s, height: o, y: l });
|
|
125
|
+
return h < s * (0.5 - d / 2) && l > a && l < c ? r.Left : h > s * (0.5 + d / 2) && l < a && l > c ? r.Right : l < o * (0.5 - d / 2) && h > p && h < u ? r.Top : l > o * (0.5 + d / 2) && h < p && h > u ? r.Bottom : h > s * (0.5 - d / 2) && h < s * (0.5 + d / 2) && l > o * (0.5 - d / 2) && l < o * (0.5 + d / 2) ? r.Center : r.Unknown;
|
|
126
126
|
}
|
|
127
127
|
const q = 100, j = 100, w = {
|
|
128
128
|
left: 0,
|
|
@@ -133,7 +133,7 @@ const q = 100, j = 100, w = {
|
|
|
133
133
|
minWidth: q,
|
|
134
134
|
minHeight: j
|
|
135
135
|
};
|
|
136
|
-
class
|
|
136
|
+
class g {
|
|
137
137
|
constructor({
|
|
138
138
|
left: t = w.left,
|
|
139
139
|
top: i = w.top,
|
|
@@ -142,13 +142,13 @@ class p {
|
|
|
142
142
|
minWidth: o = w.minWidth,
|
|
143
143
|
minHeight: h = w.minHeight,
|
|
144
144
|
domNode: l = null,
|
|
145
|
-
store:
|
|
146
|
-
position:
|
|
147
|
-
id:
|
|
145
|
+
store: d = {},
|
|
146
|
+
position: a,
|
|
147
|
+
id: c
|
|
148
148
|
} = w) {
|
|
149
|
-
if (this.id =
|
|
149
|
+
if (this.id = c ?? z(), !a)
|
|
150
150
|
throw new Error("[bwin] Sash position is required");
|
|
151
|
-
this.position =
|
|
151
|
+
this.position = a, this.domNode = l, this._top = i, this._left = t, this._width = n, this._height = s, this.children = [], this.minWidth = o, this.minHeight = h, this.store = d;
|
|
152
152
|
}
|
|
153
153
|
walk(t) {
|
|
154
154
|
this.children.forEach((i) => i.walk(t)), t(this);
|
|
@@ -282,10 +282,10 @@ class p {
|
|
|
282
282
|
this._width = t;
|
|
283
283
|
const [n, s, o, h] = this.getChildren();
|
|
284
284
|
if (h && s) {
|
|
285
|
-
const l = h.width + s.width,
|
|
286
|
-
let
|
|
285
|
+
const l = h.width + s.width, d = i * (h.width / l), a = l + i;
|
|
286
|
+
let c = h.width + d, p = a - c, u = s.left + d;
|
|
287
287
|
const E = h.calcMinWidth(), y = s.calcMinWidth();
|
|
288
|
-
i < 0 && (
|
|
288
|
+
i < 0 && (c < E && p > y ? (c = h.width, p = a - c, u = h.left + c) : p < y && c > E && (p = s.width, c = a - p, u = h.left + c)), h.width = c, s.width = p, s.left = u;
|
|
289
289
|
}
|
|
290
290
|
n && o && (n.width += i, o.width += i);
|
|
291
291
|
}
|
|
@@ -297,22 +297,22 @@ class p {
|
|
|
297
297
|
this._height = t;
|
|
298
298
|
const [n, s, o, h] = this.getChildren();
|
|
299
299
|
if (n && o) {
|
|
300
|
-
const l = n.height + o.height,
|
|
301
|
-
let
|
|
300
|
+
const l = n.height + o.height, d = i * (n.height / l), a = l + i;
|
|
301
|
+
let c = n.height + d, p = a - c, u = o.top + d;
|
|
302
302
|
if (i < 0) {
|
|
303
303
|
const E = n.calcMinHeight(), y = o.calcMinHeight();
|
|
304
|
-
|
|
304
|
+
c < E && p > y ? (c = n.height, p = a - c, u = n.top + c) : p < y && c > E && (p = o.height, c = a - p, u = n.top + c);
|
|
305
305
|
}
|
|
306
|
-
n.height =
|
|
306
|
+
n.height = c, o.height = p, o.top = u;
|
|
307
307
|
}
|
|
308
308
|
h && s && (h.height += i, s.height += i);
|
|
309
309
|
}
|
|
310
310
|
}
|
|
311
|
-
const
|
|
311
|
+
const v = {
|
|
312
312
|
size: "50%",
|
|
313
313
|
position: r.Left
|
|
314
314
|
};
|
|
315
|
-
class
|
|
315
|
+
class R {
|
|
316
316
|
constructor({
|
|
317
317
|
parentRect: t,
|
|
318
318
|
children: i,
|
|
@@ -321,14 +321,14 @@ class A {
|
|
|
321
321
|
minWidth: o,
|
|
322
322
|
minHeight: h,
|
|
323
323
|
position: l,
|
|
324
|
-
size:
|
|
325
|
-
...
|
|
324
|
+
size: d,
|
|
325
|
+
...a
|
|
326
326
|
}) {
|
|
327
327
|
f(this, "left");
|
|
328
328
|
f(this, "top");
|
|
329
329
|
f(this, "width");
|
|
330
330
|
f(this, "height");
|
|
331
|
-
this.parentRect = t, this.children = i, this.siblingConfigNode = n, this.id = s, this.minWidth = o, this.minHeight = h, this.position = this.getPosition(l), this.size = this.getSize(
|
|
331
|
+
this.parentRect = t, this.children = i, this.siblingConfigNode = n, this.id = s, this.minWidth = o, this.minHeight = h, this.position = this.getPosition(l), this.size = this.getSize(d), this.nonCoreData = a, this.setBounds();
|
|
332
332
|
}
|
|
333
333
|
getPosition(t) {
|
|
334
334
|
if (!this.siblingConfigNode)
|
|
@@ -381,7 +381,7 @@ class A {
|
|
|
381
381
|
}
|
|
382
382
|
}
|
|
383
383
|
createSash() {
|
|
384
|
-
return new
|
|
384
|
+
return new g({
|
|
385
385
|
left: this.left,
|
|
386
386
|
top: this.top,
|
|
387
387
|
width: this.width,
|
|
@@ -414,10 +414,10 @@ class A {
|
|
|
414
414
|
}
|
|
415
415
|
}
|
|
416
416
|
createPrimaryConfigNode({ size: t, position: i, children: n, id: s, minWidth: o, minHeight: h, ...l }) {
|
|
417
|
-
return new
|
|
417
|
+
return new R({
|
|
418
418
|
parentRect: this,
|
|
419
|
-
size: t ??
|
|
420
|
-
position: i ??
|
|
419
|
+
size: t ?? v.size,
|
|
420
|
+
position: i ?? v.position,
|
|
421
421
|
children: n,
|
|
422
422
|
id: s,
|
|
423
423
|
minWidth: o,
|
|
@@ -425,13 +425,13 @@ class A {
|
|
|
425
425
|
...l
|
|
426
426
|
});
|
|
427
427
|
}
|
|
428
|
-
createSecondaryConfigNode({ size: t, position: i, children: n, id: s, minWidth: o, minHeight: h, ...l },
|
|
429
|
-
return new
|
|
428
|
+
createSecondaryConfigNode({ size: t, position: i, children: n, id: s, minWidth: o, minHeight: h, ...l }, d) {
|
|
429
|
+
return new R({
|
|
430
430
|
parentRect: this,
|
|
431
431
|
size: t,
|
|
432
432
|
position: i,
|
|
433
433
|
children: n,
|
|
434
|
-
siblingConfigNode:
|
|
434
|
+
siblingConfigNode: d,
|
|
435
435
|
id: s,
|
|
436
436
|
minWidth: o,
|
|
437
437
|
minHeight: h,
|
|
@@ -453,22 +453,22 @@ class A {
|
|
|
453
453
|
)), s && o && (t.children.push(s.buildSashTree()), t.children.push(o.buildSashTree())), t;
|
|
454
454
|
}
|
|
455
455
|
}
|
|
456
|
-
const
|
|
456
|
+
const S = {
|
|
457
457
|
width: 333,
|
|
458
458
|
height: 333
|
|
459
459
|
}, D = {
|
|
460
460
|
fitContainer: !1
|
|
461
461
|
};
|
|
462
|
-
class K extends
|
|
462
|
+
class K extends R {
|
|
463
463
|
constructor({
|
|
464
464
|
id: t,
|
|
465
465
|
children: i,
|
|
466
|
-
width: n =
|
|
467
|
-
height: s =
|
|
466
|
+
width: n = S.width,
|
|
467
|
+
height: s = S.height,
|
|
468
468
|
fitContainer: o = D.fitContainer,
|
|
469
469
|
...h
|
|
470
470
|
} = {
|
|
471
|
-
...
|
|
471
|
+
...S,
|
|
472
472
|
...D
|
|
473
473
|
}) {
|
|
474
474
|
super({
|
|
@@ -481,7 +481,7 @@ class K extends A {
|
|
|
481
481
|
}), this.fitContainer = o;
|
|
482
482
|
}
|
|
483
483
|
}
|
|
484
|
-
class V extends
|
|
484
|
+
class V extends g {
|
|
485
485
|
constructor(t = w) {
|
|
486
486
|
super({ ...t, position: r.Root }), Object.assign(this, D);
|
|
487
487
|
}
|
|
@@ -498,13 +498,13 @@ function Q(e, { size: t }) {
|
|
|
498
498
|
const i = C(t);
|
|
499
499
|
let n = e.width / 2;
|
|
500
500
|
i && (i < 1 ? n = e.width * i : n = i);
|
|
501
|
-
const s = new
|
|
501
|
+
const s = new g({
|
|
502
502
|
top: e.top,
|
|
503
503
|
left: e.left,
|
|
504
504
|
width: n,
|
|
505
505
|
height: e.height,
|
|
506
506
|
position: r.Left
|
|
507
|
-
}), o = new
|
|
507
|
+
}), o = new g({
|
|
508
508
|
top: e.top,
|
|
509
509
|
left: e.left + s.width,
|
|
510
510
|
width: e.width - n,
|
|
@@ -517,13 +517,13 @@ function Z(e, { size: t }) {
|
|
|
517
517
|
const i = C(t);
|
|
518
518
|
let n = e.width / 2;
|
|
519
519
|
i && (i < 1 ? n = e.width * i : n = i);
|
|
520
|
-
const s = new
|
|
520
|
+
const s = new g({
|
|
521
521
|
left: e.left,
|
|
522
522
|
top: e.top,
|
|
523
523
|
width: e.width - n,
|
|
524
524
|
height: e.height,
|
|
525
525
|
position: r.Left
|
|
526
|
-
}), o = new
|
|
526
|
+
}), o = new g({
|
|
527
527
|
left: e.left + s.width,
|
|
528
528
|
top: e.top,
|
|
529
529
|
width: n,
|
|
@@ -536,13 +536,13 @@ function tt(e, { size: t }) {
|
|
|
536
536
|
const i = C(t);
|
|
537
537
|
let n = e.height / 2;
|
|
538
538
|
i && (i < 1 ? n = e.height * i : n = i);
|
|
539
|
-
const s = new
|
|
539
|
+
const s = new g({
|
|
540
540
|
left: e.left,
|
|
541
541
|
top: e.top,
|
|
542
542
|
width: e.width,
|
|
543
543
|
height: n,
|
|
544
544
|
position: r.Top
|
|
545
|
-
}), o = new
|
|
545
|
+
}), o = new g({
|
|
546
546
|
left: e.left,
|
|
547
547
|
top: e.top + s.height,
|
|
548
548
|
width: e.width,
|
|
@@ -555,13 +555,13 @@ function et(e, { size: t }) {
|
|
|
555
555
|
const i = C(t);
|
|
556
556
|
let n = e.height / 2;
|
|
557
557
|
i && (i < 1 ? n = e.height * i : n = i);
|
|
558
|
-
const s = new
|
|
558
|
+
const s = new g({
|
|
559
559
|
top: e.top,
|
|
560
560
|
left: e.left,
|
|
561
561
|
width: e.width,
|
|
562
562
|
height: e.height - n,
|
|
563
563
|
position: r.Top
|
|
564
|
-
}), o = new
|
|
564
|
+
}), o = new g({
|
|
565
565
|
top: e.top + s.height,
|
|
566
566
|
left: e.left,
|
|
567
567
|
width: e.width,
|
|
@@ -587,14 +587,14 @@ const nt = {
|
|
|
587
587
|
},
|
|
588
588
|
// Intended to be overridden
|
|
589
589
|
onPaneCreate(e, t) {
|
|
590
|
-
t.store.content && e.append(m(t.store.content)), this != null && this.debug && (e.style.backgroundColor = W(), e.innerHTML = "", e.append(
|
|
590
|
+
t.store.content && e.append(m(t.store.content)), this != null && this.debug && (e.style.backgroundColor = W(), e.innerHTML = "", e.append(x(e)));
|
|
591
591
|
},
|
|
592
592
|
updatePane(e) {
|
|
593
593
|
return J(e);
|
|
594
594
|
},
|
|
595
595
|
// Intended to be overridden
|
|
596
596
|
onPaneUpdate(e, t) {
|
|
597
|
-
this != null && this.debug && (e.innerHTML = "", e.append(
|
|
597
|
+
this != null && this.debug && (e.innerHTML = "", e.append(x(e)));
|
|
598
598
|
},
|
|
599
599
|
/**
|
|
600
600
|
* Add a pane into the target pane. The two panes become next to each other
|
|
@@ -619,10 +619,10 @@ const nt = {
|
|
|
619
619
|
const t = this.rootSash.getDescendantParentById(e);
|
|
620
620
|
if (!t) throw new Error("[bwin] Parent sash not found when removing pane");
|
|
621
621
|
const i = t.getChildSiblingById(e);
|
|
622
|
-
|
|
622
|
+
i.children.length === 0 ? (t.id = i.id, t.domNode = i.domNode, t.domNode.setAttribute("sash-id", i.id), t.children = []) : (t.id = z(), t.children = i.children, i.position === r.Left ? i.width = t.width : i.position === r.Right ? (i.width = t.width, i.left = t.left) : i.position === r.Top ? i.height = t.height : i.position === r.Bottom && (i.height = t.height, i.top = t.top)), this.update();
|
|
623
623
|
}
|
|
624
624
|
};
|
|
625
|
-
function
|
|
625
|
+
function x(e) {
|
|
626
626
|
const t = document.createElement("pre");
|
|
627
627
|
t.style.fontSize = "10px";
|
|
628
628
|
const i = `
|
|
@@ -702,13 +702,13 @@ const st = {
|
|
|
702
702
|
if (!this.isResizeStarted || !this.activeMuntinSash) return;
|
|
703
703
|
const [t, i, n, s] = this.activeMuntinSash.getChildren(), o = this.activeMuntinSash.isLeftRightSplit(), h = this.activeMuntinSash.isTopBottomSplit();
|
|
704
704
|
if (o && s && i) {
|
|
705
|
-
const l = e.pageX - this.lastX,
|
|
706
|
-
if (l > 0 &&
|
|
707
|
-
s.width =
|
|
705
|
+
const l = e.pageX - this.lastX, d = s.width + l, a = i.width - l;
|
|
706
|
+
if (l > 0 && a <= i.calcMinWidth() || l < 0 && d <= s.calcMinWidth()) return;
|
|
707
|
+
s.width = d, i.width = a, i.left = i.left + l, this.update(), this.lastX = e.pageX;
|
|
708
708
|
} else if (h && t && n) {
|
|
709
|
-
const l = e.pageY - this.lastY,
|
|
710
|
-
if (l > 0 &&
|
|
711
|
-
t.height =
|
|
709
|
+
const l = e.pageY - this.lastY, d = t.height + l, a = n.height - l;
|
|
710
|
+
if (l > 0 && a <= n.calcMinHeight() || l < 0 && d <= t.calcMinHeight()) return;
|
|
711
|
+
t.height = d, n.height = a, n.top = n.top + l, this.update(), this.lastY = e.pageY;
|
|
712
712
|
}
|
|
713
713
|
}), document.addEventListener("mouseup", () => {
|
|
714
714
|
this.isResizeStarted = !1, this.activeMuntinSash = null, this.revertResizeStyles();
|
|
@@ -734,12 +734,12 @@ const st = {
|
|
|
734
734
|
this.onPaneDrop(e, i), typeof i.store.onDrop == "function" && i.store.onDrop(e, i), this.activeDropPaneEl.removeAttribute("drop-area"), this.activeDropPaneEl = null;
|
|
735
735
|
});
|
|
736
736
|
}
|
|
737
|
-
},
|
|
738
|
-
class
|
|
737
|
+
}, dt = !1;
|
|
738
|
+
class L {
|
|
739
739
|
constructor(t) {
|
|
740
740
|
f(this, "windowElement", null);
|
|
741
741
|
f(this, "containerElement", null);
|
|
742
|
-
f(this, "debug",
|
|
742
|
+
f(this, "debug", dt);
|
|
743
743
|
let i = null;
|
|
744
744
|
t instanceof V ? (i = t, this.rootSash = t) : (i = new K(t), this.rootSash = i.buildSashTree()), this.fitContainer = i.fitContainer;
|
|
745
745
|
}
|
|
@@ -759,7 +759,7 @@ class T {
|
|
|
759
759
|
});
|
|
760
760
|
}
|
|
761
761
|
}
|
|
762
|
-
|
|
762
|
+
L.assemble(
|
|
763
763
|
st,
|
|
764
764
|
ot,
|
|
765
765
|
nt,
|
|
@@ -767,7 +767,7 @@ T.assemble(
|
|
|
767
767
|
lt,
|
|
768
768
|
rt
|
|
769
769
|
);
|
|
770
|
-
function
|
|
770
|
+
function B(e) {
|
|
771
771
|
if (e.tagName === "BW-PANE")
|
|
772
772
|
return e.getAttribute("sash-id");
|
|
773
773
|
const t = e.closest("bw-pane");
|
|
@@ -775,11 +775,11 @@ function L(e) {
|
|
|
775
775
|
throw new Error("[bwin] Pane element not found");
|
|
776
776
|
return t.getAttribute("sash-id");
|
|
777
777
|
}
|
|
778
|
-
const
|
|
778
|
+
const at = {
|
|
779
779
|
label: "",
|
|
780
780
|
className: "bw-glass-action--close",
|
|
781
781
|
onClick: (e, t) => {
|
|
782
|
-
const i =
|
|
782
|
+
const i = B(e.target);
|
|
783
783
|
t.removePane(i);
|
|
784
784
|
}
|
|
785
785
|
}, ct = {
|
|
@@ -791,29 +791,29 @@ const dt = {
|
|
|
791
791
|
const n = m('<button class="bw-minimized-glass" />');
|
|
792
792
|
i.append(n);
|
|
793
793
|
const s = e.target.closest("bw-pane"), o = e.target.closest("bw-glass"), h = s.getAttribute("sash-id"), l = s.getAttribute("position");
|
|
794
|
-
n.bwGlassElement = o, n.bwOriginalPosition = l, n.bwOriginalBoundingRect =
|
|
794
|
+
n.bwGlassElement = o, n.bwOriginalPosition = l, n.bwOriginalBoundingRect = A(s), t.removePane(h);
|
|
795
795
|
}
|
|
796
|
-
},
|
|
796
|
+
}, pt = {
|
|
797
797
|
label: "",
|
|
798
798
|
className: "bw-glass-action--maximize",
|
|
799
799
|
onClick: (e) => {
|
|
800
800
|
const t = e.target.closest("bw-pane");
|
|
801
|
-
t.hasAttribute("maximized") ? (t.removeAttribute("maximized"), t.style.left = `${t.bwOriginalBoundingRect.left}px`, t.style.top = `${t.bwOriginalBoundingRect.top}px`, t.style.width = `${t.bwOriginalBoundingRect.width}px`, t.style.height = `${t.bwOriginalBoundingRect.height}px`) : (t.setAttribute("maximized", ""), t.bwOriginalBoundingRect =
|
|
801
|
+
t.hasAttribute("maximized") ? (t.removeAttribute("maximized"), t.style.left = `${t.bwOriginalBoundingRect.left}px`, t.style.top = `${t.bwOriginalBoundingRect.top}px`, t.style.width = `${t.bwOriginalBoundingRect.width}px`, t.style.height = `${t.bwOriginalBoundingRect.height}px`) : (t.setAttribute("maximized", ""), t.bwOriginalBoundingRect = A(t), t.style.left = "0", t.style.top = "0", t.style.width = "100%", t.style.height = "100%");
|
|
802
802
|
}
|
|
803
803
|
};
|
|
804
804
|
function ut(e, t) {
|
|
805
805
|
const i = e.left + e.width, n = e.top + e.height, s = t.left + t.width, o = t.top + t.height;
|
|
806
806
|
if (e.left >= s || t.left >= i || e.top >= o || t.top >= n)
|
|
807
807
|
return null;
|
|
808
|
-
const h = Math.max(e.left, t.left), l = Math.max(e.top, t.top),
|
|
808
|
+
const h = Math.max(e.left, t.left), l = Math.max(e.top, t.top), d = Math.min(i, s), a = Math.min(n, o);
|
|
809
809
|
return {
|
|
810
810
|
left: h,
|
|
811
811
|
top: l,
|
|
812
|
-
width:
|
|
813
|
-
height:
|
|
812
|
+
width: d - h,
|
|
813
|
+
height: a - l
|
|
814
814
|
};
|
|
815
815
|
}
|
|
816
|
-
const ft = [ct,
|
|
816
|
+
const ft = [ct, pt, at], gt = {
|
|
817
817
|
enableActions() {
|
|
818
818
|
this.handleMinimizedGlassClick(), this.observeActionButtons();
|
|
819
819
|
},
|
|
@@ -821,23 +821,23 @@ const ft = [ct, gt, dt], pt = {
|
|
|
821
821
|
const t = e.bwOriginalBoundingRect;
|
|
822
822
|
let i = 0, n = null;
|
|
823
823
|
if (this.windowElement.querySelectorAll("bw-pane").forEach((s) => {
|
|
824
|
-
const o =
|
|
824
|
+
const o = A(s), h = ut(t, o);
|
|
825
825
|
if (h) {
|
|
826
826
|
const l = h.width * h.height;
|
|
827
827
|
l > i && (i = l, n = s);
|
|
828
828
|
}
|
|
829
829
|
}), n) {
|
|
830
|
-
const s = e.bwOriginalPosition, o =
|
|
831
|
-
let
|
|
830
|
+
const s = e.bwOriginalPosition, o = A(n), h = n.getAttribute("sash-id"), l = this.rootSash.getById(h);
|
|
831
|
+
let d = 0;
|
|
832
832
|
if (s === r.Left || s === r.Right)
|
|
833
|
-
|
|
833
|
+
d = o.width - t.width < l.minWidth ? o.width / 2 : t.width;
|
|
834
834
|
else if (s === r.Top || s === r.Bottom)
|
|
835
|
-
|
|
835
|
+
d = o.height - t.height < l.minHeight ? o.height / 2 : t.height;
|
|
836
836
|
else
|
|
837
837
|
throw new Error("[bwin] Invalid position when restoring glass");
|
|
838
838
|
this.addPane(n.getAttribute("sash-id"), {
|
|
839
839
|
position: s,
|
|
840
|
-
size:
|
|
840
|
+
size: d
|
|
841
841
|
}).domNode.append(e.bwGlassElement);
|
|
842
842
|
}
|
|
843
843
|
},
|
|
@@ -876,7 +876,7 @@ const ft = [ct, gt, dt], pt = {
|
|
|
876
876
|
actions: void 0,
|
|
877
877
|
draggable: !0
|
|
878
878
|
};
|
|
879
|
-
class
|
|
879
|
+
class T {
|
|
880
880
|
constructor({
|
|
881
881
|
title: t = N.title,
|
|
882
882
|
content: i = N.content,
|
|
@@ -937,7 +937,7 @@ const wt = {
|
|
|
937
937
|
H(n, this.activeDropPaneEl), n.setAttribute("can-drop", s);
|
|
938
938
|
return;
|
|
939
939
|
} else {
|
|
940
|
-
const n =
|
|
940
|
+
const n = B(this.activeDragGlassEl);
|
|
941
941
|
this.addPane(t.id, { position: i }).domNode.append(this.activeDragGlassEl), this.removePane(n);
|
|
942
942
|
}
|
|
943
943
|
},
|
|
@@ -973,7 +973,7 @@ const wt = {
|
|
|
973
973
|
this.trimMuntin(e);
|
|
974
974
|
}
|
|
975
975
|
};
|
|
976
|
-
class bt extends
|
|
976
|
+
class bt extends L {
|
|
977
977
|
constructor() {
|
|
978
978
|
super(...arguments);
|
|
979
979
|
f(this, "sillElement", null);
|
|
@@ -987,7 +987,7 @@ class bt extends T {
|
|
|
987
987
|
super.enableFeatures(), this.enableDrag(), this.enableActions();
|
|
988
988
|
}
|
|
989
989
|
onPaneCreate(i, n) {
|
|
990
|
-
const s = new
|
|
990
|
+
const s = new T({ ...n.store, sash: n, binaryWindow: this });
|
|
991
991
|
i.innerHTML = "", i.append(s.domNode), this.debug && s.contentElement.prepend(`${n.id}`);
|
|
992
992
|
}
|
|
993
993
|
onPaneUpdate() {
|
|
@@ -1000,17 +1000,17 @@ class bt extends T {
|
|
|
1000
1000
|
* @returns {Sash} - The newly created Sash
|
|
1001
1001
|
*/
|
|
1002
1002
|
addPane(i, n) {
|
|
1003
|
-
const { position: s, size: o, ...h } = n, l = super.addPane(i, { position: s, size: o }),
|
|
1004
|
-
return l.domNode.append(
|
|
1003
|
+
const { position: s, size: o, ...h } = n, l = super.addPane(i, { position: s, size: o }), d = new T({ ...h, sash: l, binaryWindow: this });
|
|
1004
|
+
return l.domNode.append(d.domNode), l;
|
|
1005
1005
|
}
|
|
1006
1006
|
}
|
|
1007
|
-
bt.assemble(wt, mt,
|
|
1007
|
+
bt.assemble(wt, mt, gt);
|
|
1008
1008
|
export {
|
|
1009
1009
|
ft as BUILTIN_ACTIONS,
|
|
1010
1010
|
bt as BinaryWindow,
|
|
1011
1011
|
K as ConfigRoot,
|
|
1012
|
-
|
|
1012
|
+
L as Frame,
|
|
1013
1013
|
r as Position,
|
|
1014
|
-
|
|
1014
|
+
g as Sash,
|
|
1015
1015
|
V as SashConfig
|
|
1016
1016
|
};
|