|
|
@ -16,6 +16,7 @@ import { |
|
|
|
} from "@/core"; |
|
|
|
} from "@/core"; |
|
|
|
import { Label, IconButton, Button } from "../single"; |
|
|
|
import { Label, IconButton, Button } from "../single"; |
|
|
|
import { Resizers } from "../0.base"; |
|
|
|
import { Resizers } from "../0.base"; |
|
|
|
|
|
|
|
import { getOuterBody } from "@/core/utils/dom"; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Popover弹出层, |
|
|
|
* Popover弹出层, |
|
|
@ -66,10 +67,11 @@ export class Popover extends Widget { |
|
|
|
this.startX = 0; |
|
|
|
this.startX = 0; |
|
|
|
this.startY = 0; |
|
|
|
this.startY = 0; |
|
|
|
const size = this._calculateSize(); |
|
|
|
const size = this._calculateSize(); |
|
|
|
|
|
|
|
const bodyDom = getOuterBody(); |
|
|
|
this.tracker = new MouseMoveTracker( |
|
|
|
this.tracker = new MouseMoveTracker( |
|
|
|
(deltaX, deltaY) => { |
|
|
|
(deltaX, deltaY) => { |
|
|
|
const W = Widget._renderEngine.createElement("body").width(); |
|
|
|
const W = Widget._renderEngine.createElement(bodyDom).width(); |
|
|
|
const H = Widget._renderEngine.createElement("body").height(); |
|
|
|
const H = Widget._renderEngine.createElement(bodyDom).height(); |
|
|
|
this.startX += deltaX; |
|
|
|
this.startX += deltaX; |
|
|
|
this.startY += deltaY; |
|
|
|
this.startY += deltaY; |
|
|
|
this.element.css({ |
|
|
|
this.element.css({ |
|
|
@ -228,11 +230,11 @@ export class Popover extends Widget { |
|
|
|
|
|
|
|
|
|
|
|
_getSuitableBodyHeight(height) { |
|
|
|
_getSuitableBodyHeight(height) { |
|
|
|
const { headerHeight, footer, footerHeight, bodyTgap } = this.options; |
|
|
|
const { headerHeight, footer, footerHeight, bodyTgap } = this.options; |
|
|
|
|
|
|
|
const bodyDom = getOuterBody(); |
|
|
|
return clamp( |
|
|
|
return clamp( |
|
|
|
height, |
|
|
|
height, |
|
|
|
0, |
|
|
|
0, |
|
|
|
Widget._renderEngine.createElement("body")[0].clientHeight - |
|
|
|
Widget._renderEngine.createElement(bodyDom)[0].clientHeight - |
|
|
|
headerHeight - |
|
|
|
headerHeight - |
|
|
|
(footer ? footerHeight : 0) - |
|
|
|
(footer ? footerHeight : 0) - |
|
|
|
bodyTgap |
|
|
|
bodyTgap |
|
|
@ -240,11 +242,11 @@ export class Popover extends Widget { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
_getSuitableHeight(height) { |
|
|
|
_getSuitableHeight(height) { |
|
|
|
return clamp(height, 0, Widget._renderEngine.createElement("body")[0].clientHeight); |
|
|
|
return clamp(height, 0, Widget._renderEngine.createElement(getOuterBody())[0].clientHeight); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
_getSuitableWidth(width) { |
|
|
|
_getSuitableWidth(width) { |
|
|
|
return clamp(width, 0, Widget._renderEngine.createElement("body").width()); |
|
|
|
return clamp(width, 0, Widget._renderEngine.createElement(getOuterBody()).width()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
_calculateSize() { |
|
|
|
_calculateSize() { |
|
|
|