@operato/popup
Advanced tools
Comparing version 2.0.0-alpha.116 to 2.0.0-alpha.118
@@ -6,2 +6,11 @@ # Change Log | ||
## [2.0.0-alpha.118](https://github.com/hatiolab/operato/compare/v2.0.0-alpha.117...v2.0.0-alpha.118) (2024-05-04) | ||
### :bug: Bug Fix | ||
* tweak popup position ([cf962de](https://github.com/hatiolab/operato/commit/cf962deda8c92e0fb59d51a7c4f7e06d6c0bde07)) | ||
## [2.0.0-alpha.116](https://github.com/hatiolab/operato/compare/v2.0.0-alpha.115...v2.0.0-alpha.116) (2024-05-04) | ||
@@ -8,0 +17,0 @@ |
@@ -161,18 +161,21 @@ import { __decorate } from "tslib"; | ||
// To prevent pop-ups from crossing screen boundaries, use the | ||
const computedStyle = getComputedStyle(this); | ||
// const computedStyle = getComputedStyle(this) | ||
if (t < 0) { | ||
this.style.top = '0'; | ||
this.style.top = '10px'; | ||
this.style.bottom = ''; | ||
} | ||
else if (vh < t + h) { | ||
this.style.top = `calc(${computedStyle.top} - ${t + h - vh}px)`; // 현재의 top 값에 차감한다. | ||
this.style.bottom = ''; | ||
// this.style.top = `calc(${computedStyle.top} - ${t + h - vh - 20}px)` // 현재의 top 값에 차감한다. | ||
this.style.top = ''; | ||
this.style.bottom = '10px'; | ||
} | ||
if (l < 0) { | ||
this.style.left = `calc(${computedStyle.left} - ${l}px)`; // 현재의 left 값에 l를 차감한다. (왼쪽으로 이탈했기 때문에 오른쪽으로 가야 화면에 보임) | ||
// this.style.left = `calc(${computedStyle.left} - ${l - 20}px)` // 현재의 left 값에 l를 차감한다. (왼쪽으로 이탈했기 때문에 오른쪽으로 가야 화면에 보임) | ||
this.style.left = '10px'; | ||
this.style.right = ''; | ||
} | ||
else if (vw < l + w) { | ||
this.style.left = `calc(${computedStyle.left} - ${l + w - vw}px)`; // 현재의 left 값에 차감한다. | ||
this.style.right = ''; | ||
// this.style.left = `calc(${computedStyle.left} - ${l + w - vw + 20}px)` // 현재의 left 값에 차감한다. | ||
this.style.left = ''; | ||
this.style.right = '10px'; | ||
} | ||
@@ -179,0 +182,0 @@ }); |
@@ -5,3 +5,3 @@ { | ||
"author": "heartyoh", | ||
"version": "2.0.0-alpha.116", | ||
"version": "2.0.0-alpha.118", | ||
"main": "dist/src/index.js", | ||
@@ -64,3 +64,3 @@ "module": "dist/src/index.js", | ||
"@material/web": "^1.4.0", | ||
"@operato/styles": "^2.0.0-alpha.111", | ||
"@operato/styles": "^2.0.0-alpha.118", | ||
"@operato/utils": "^2.0.0-alpha.111", | ||
@@ -101,3 +101,3 @@ "lit": "^3.1.2" | ||
}, | ||
"gitHead": "ed8f106ca422d5479a869c700d5bc4786fff849f" | ||
"gitHead": "78a0819daea046dafc63234648df0632f85d7275" | ||
} |
@@ -249,18 +249,21 @@ import { css, html, LitElement } from 'lit' | ||
// To prevent pop-ups from crossing screen boundaries, use the | ||
const computedStyle = getComputedStyle(this) | ||
// const computedStyle = getComputedStyle(this) | ||
if (t < 0) { | ||
this.style.top = '0' | ||
this.style.top = '10px' | ||
this.style.bottom = '' | ||
} else if (vh < t + h) { | ||
this.style.top = `calc(${computedStyle.top} - ${t + h - vh}px)` // 현재의 top 값에 차감한다. | ||
this.style.bottom = '' | ||
// this.style.top = `calc(${computedStyle.top} - ${t + h - vh - 20}px)` // 현재의 top 값에 차감한다. | ||
this.style.top = '' | ||
this.style.bottom = '10px' | ||
} | ||
if (l < 0) { | ||
this.style.left = `calc(${computedStyle.left} - ${l}px)` // 현재의 left 값에 l를 차감한다. (왼쪽으로 이탈했기 때문에 오른쪽으로 가야 화면에 보임) | ||
// this.style.left = `calc(${computedStyle.left} - ${l - 20}px)` // 현재의 left 값에 l를 차감한다. (왼쪽으로 이탈했기 때문에 오른쪽으로 가야 화면에 보임) | ||
this.style.left = '10px' | ||
this.style.right = '' | ||
} else if (vw < l + w) { | ||
this.style.left = `calc(${computedStyle.left} - ${l + w - vw}px)` // 현재의 left 값에 차감한다. | ||
this.style.right = '' | ||
// this.style.left = `calc(${computedStyle.left} - ${l + w - vw + 20}px)` // 현재의 left 값에 차감한다. | ||
this.style.left = '' | ||
this.style.right = '10px' | ||
} | ||
@@ -267,0 +270,0 @@ }) |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
511609
6047