@operato/layout
Advanced tools
Comparing version 1.0.0-alpha.23 to 1.0.0-alpha.24
@@ -6,2 +6,11 @@ # Change Log | ||
## [1.0.0-alpha.24](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.23...v1.0.0-alpha.24) (2022-03-17) | ||
### :bug: Bug Fix | ||
* refactoring grist-editor, property-editor and input ([ea7431a](https://github.com/hatiolab/operato/commit/ea7431a5e2dfd96ef392c1905e9622df7c2ef88c)) | ||
## [1.0.0-alpha.23](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.22...v1.0.0-alpha.23) (2022-03-17) | ||
@@ -8,0 +17,0 @@ |
@@ -93,3 +93,3 @@ import { TemplateResult } from 'lit'; | ||
/** | ||
* open popup | ||
* open popup in operato application environment | ||
* | ||
@@ -100,2 +100,3 @@ * @param {*} template html template to be rendered inside the popup | ||
*/ | ||
export declare const openPopup: (template: TemplateResult, options?: PopupOptions) => PopupHandle; | ||
export declare const layoutOpenPopup: (template: TemplateResult, options?: PopupOptions) => PopupHandle; | ||
export declare const openPopup: (template: TemplateResult, options: PopupOptions) => PopupHandle; |
@@ -0,1 +1,2 @@ | ||
import { OxPopup } from '@operato/popup'; | ||
import { store } from '@operato/shell'; | ||
@@ -118,3 +119,3 @@ export const appendViewpart = ({ name, viewpart, position }) => { | ||
/** | ||
* open popup | ||
* open popup in operato application environment | ||
* | ||
@@ -125,3 +126,3 @@ * @param {*} template html template to be rendered inside the popup | ||
*/ | ||
export const openPopup = (template, options = {}) => { | ||
export const layoutOpenPopup = (template, options = {}) => { | ||
var name = `$popup-${popupSequence++}`; | ||
@@ -161,2 +162,29 @@ appendViewpart({ | ||
}; | ||
/** | ||
* open popup out of operato application environment | ||
* | ||
* @param {*} template html template to be rendered inside the popup | ||
* @param {PopupOptions} options | ||
* @returns popup handle object. This object is used to close the popup. | ||
*/ | ||
const liteOpenPopup = (template, options = {}) => { | ||
history.pushState({}, '', location.href); | ||
const popup = OxPopup.open({ | ||
template, | ||
width: '90%', | ||
height: '90%' | ||
}); | ||
popup.style.setProperty('--overlay-center-normal-width', '100%'); | ||
popup.style.setProperty('--overlay-center-normal-height', '100%'); | ||
requestAnimationFrame(() => { | ||
dispatchEvent(new Event('resize')); | ||
}); | ||
return { | ||
close: () => { | ||
popup.close(); | ||
history.back(); | ||
} | ||
}; | ||
}; | ||
export const openPopup = 'operato' in window ? layoutOpenPopup : liteOpenPopup; | ||
//# sourceMappingURL=layout.js.map |
@@ -6,3 +6,3 @@ { | ||
"author": "heartyoh", | ||
"version": "1.0.0-alpha.23", | ||
"version": "1.0.0-alpha.24", | ||
"main": "dist/src/index.js", | ||
@@ -42,5 +42,6 @@ "module": "dist/src/index.js", | ||
"@material/mwc-icon": "^0.25.3", | ||
"@operato/shell": "^1.0.0-alpha.23", | ||
"@operato/styles": "^1.0.0-alpha.23", | ||
"@operato/utils": "^1.0.0-alpha.23", | ||
"@operato/popup": "^1.0.0-alpha.24", | ||
"@operato/shell": "^1.0.0-alpha.24", | ||
"@operato/styles": "^1.0.0-alpha.24", | ||
"@operato/utils": "^1.0.0-alpha.24", | ||
"lit": "^2.2.0", | ||
@@ -81,3 +82,3 @@ "pwa-helpers": "^0.9.1" | ||
}, | ||
"gitHead": "5500e6cf45b5650ad657e24451fa9c0620d99531" | ||
"gitHead": "83b1479e80639e5bc365f3dc8ad4b119a84dc31e" | ||
} |
@@ -0,1 +1,2 @@ | ||
import { OxPopup } from '@operato/popup' | ||
import { TemplateResult } from 'lit' | ||
@@ -198,3 +199,3 @@ import { store } from '@operato/shell' | ||
/** | ||
* open popup | ||
* open popup in operato application environment | ||
* | ||
@@ -205,3 +206,3 @@ * @param {*} template html template to be rendered inside the popup | ||
*/ | ||
export const openPopup = (template: TemplateResult, options: PopupOptions = {}): PopupHandle => { | ||
export const layoutOpenPopup = (template: TemplateResult, options: PopupOptions = {}): PopupHandle => { | ||
var name = `$popup-${popupSequence++}` | ||
@@ -247,1 +248,35 @@ | ||
} | ||
/** | ||
* open popup out of operato application environment | ||
* | ||
* @param {*} template html template to be rendered inside the popup | ||
* @param {PopupOptions} options | ||
* @returns popup handle object. This object is used to close the popup. | ||
*/ | ||
const liteOpenPopup = (template: TemplateResult, options: PopupOptions = {}): PopupHandle => { | ||
history.pushState({}, '', location.href) | ||
const popup = OxPopup.open({ | ||
template, | ||
width: '90%', | ||
height: '90%' | ||
}) | ||
popup.style.setProperty('--overlay-center-normal-width', '100%') | ||
popup.style.setProperty('--overlay-center-normal-height', '100%') | ||
requestAnimationFrame(() => { | ||
dispatchEvent(new Event('resize')) | ||
}) | ||
return { | ||
close: () => { | ||
popup.close() | ||
history.back() | ||
} | ||
} as PopupHandle | ||
} | ||
export const openPopup: (template: TemplateResult, options: PopupOptions) => PopupHandle = | ||
'operato' in window ? layoutOpenPopup : liteOpenPopup |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
209475
2910
8
+ Added@operato/popup@1.19.10(transitive)