winduum 1.2.0-next.3 → 1.2.0-next.4

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "winduum",
3
- "version": "1.2.0-next.3",
3
+ "version": "1.2.0-next.4",
4
4
  "type": "module",
5
5
  "types": "types/index.d.ts",
6
6
  "main": "plugin/index.cjs",
@@ -25,13 +25,19 @@ export const closePopover = async (element) => {
25
25
 
26
26
  popoverElement.classList.remove('in')
27
27
  await animationsFinished(popoverElement)
28
- popoverElement._cleanup()
28
+ popoverElement?._cleanup()
29
29
  popoverElement.hidePopover && popoverElement.hidePopover()
30
30
 
31
31
  element.ariaExpanded = false
32
32
  }
33
33
 
34
34
  export const showPopover = async (element, options) => {
35
+ options = {
36
+ visibleClass: 'in',
37
+ compute: true,
38
+ ...options
39
+ }
40
+
35
41
  const { autoUpdate } = await import('@floating-ui/dom')
36
42
 
37
43
  const popoverElement = document.getElementById(element.getAttribute('popovertarget'))
@@ -43,6 +49,11 @@ export const showPopover = async (element, options) => {
43
49
 
44
50
  popoverElement.showPopover && popoverElement.showPopover()
45
51
 
52
+ if (!options.compute) {
53
+ popoverElement.classList.add(options.visibleClass)
54
+ return
55
+ }
56
+
46
57
  popoverElement._cleanup = autoUpdate(
47
58
  element,
48
59
  popoverElement,