@netless/telebox-insider 0.3.1 → 0.3.2-beta.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.
|
@@ -3328,6 +3328,7 @@ class TeleBoxManager {
|
|
|
3328
3328
|
return this.boxesStatus$;
|
|
3329
3329
|
},
|
|
3330
3330
|
onEvent: (event) => {
|
|
3331
|
+
var _a;
|
|
3331
3332
|
switch (event.type) {
|
|
3332
3333
|
case TELE_BOX_DELEGATE_EVENT.Maximize: {
|
|
3333
3334
|
if (forceMaximized$.value && this.state === TELE_BOX_STATE.Maximized) {
|
|
@@ -3394,13 +3395,16 @@ class TeleBoxManager {
|
|
|
3394
3395
|
break;
|
|
3395
3396
|
}
|
|
3396
3397
|
case TELE_BOX_EVENT.Close: {
|
|
3398
|
+
const targetBox = this.hasBoxesStatus() ? this.maxTitleBar.focusedBox || this.getMaximizedTopBox() : this.topBox;
|
|
3399
|
+
if (targetBox && ((_a = this.closeRequestHandler) == null ? void 0 : _a.call(this, targetBox.id)))
|
|
3400
|
+
break;
|
|
3397
3401
|
if (this.hasBoxesStatus()) {
|
|
3398
|
-
let
|
|
3399
|
-
if (!
|
|
3400
|
-
|
|
3402
|
+
let targetBox2 = this.maxTitleBar.focusedBox;
|
|
3403
|
+
if (!targetBox2) {
|
|
3404
|
+
targetBox2 = this.getMaximizedTopBox();
|
|
3401
3405
|
}
|
|
3402
|
-
if (
|
|
3403
|
-
const box = this.getBox(
|
|
3406
|
+
if (targetBox2 == null ? void 0 : targetBox2.id) {
|
|
3407
|
+
const box = this.getBox(targetBox2.id);
|
|
3404
3408
|
if (box) {
|
|
3405
3409
|
let isFocusChanged = false;
|
|
3406
3410
|
if (box.focus) {
|
|
@@ -3927,6 +3931,9 @@ class TeleBoxManager {
|
|
|
3927
3931
|
}
|
|
3928
3932
|
});
|
|
3929
3933
|
box._delegateEvents.on(TELE_BOX_DELEGATE_EVENT.Close, () => {
|
|
3934
|
+
var _a;
|
|
3935
|
+
if ((_a = this.closeRequestHandler) == null ? void 0 : _a.call(this, box.id))
|
|
3936
|
+
return;
|
|
3930
3937
|
if (this.useBoxesStatus && box.focus) {
|
|
3931
3938
|
this.blurBox(box);
|
|
3932
3939
|
}
|
|
@@ -4093,6 +4100,9 @@ class TeleBoxManager {
|
|
|
4093
4100
|
setLazyFocusRequestHandler(handler) {
|
|
4094
4101
|
this.lazyFocusRequestHandler = handler;
|
|
4095
4102
|
}
|
|
4103
|
+
setCloseRequestHandler(handler) {
|
|
4104
|
+
this.closeRequestHandler = handler;
|
|
4105
|
+
}
|
|
4096
4106
|
focusBox(boxOrID, skipUpdate = false) {
|
|
4097
4107
|
var _a;
|
|
4098
4108
|
const targetBox = this.getBox(boxOrID);
|