y200subcontrols 0.0.386 → 0.0.388

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.
@@ -1,4 +1,5 @@
1
- <script>export let theme = "teal";
1
+ <script>import { onMount } from "svelte";
2
+ export let theme = "teal";
2
3
  export let direction = "ltr";
3
4
  export let sliderWidth = 384;
4
5
  let isTransitionning = false;
@@ -20,6 +21,17 @@ function closeMenu() {
20
21
  isTransitionning = false;
21
22
  }, 301);
22
23
  }
24
+ onMount(() => {
25
+ const buttons = menu.querySelectorAll('[data-close-menu="true"]');
26
+ for (const button of buttons) {
27
+ button.addEventListener("click", (event) => {
28
+ event.stopImmediatePropagation();
29
+ event.stopPropagation();
30
+ event.preventDefault();
31
+ closeMenu();
32
+ });
33
+ }
34
+ });
23
35
  </script>
24
36
 
25
37
  <button
@@ -65,14 +77,14 @@ function closeMenu() {
65
77
  bind:this={menu}
66
78
  style="width: 0px;"
67
79
  class="fixed
68
- {direction === 'ltr' ? 'left-0' : ''}
69
- {direction === 'rtl' ? 'right-0' : ''}
70
- inset-y-0 bg-neutral-100 border-r border-r-neutral-400
80
+ {direction === 'ltr' ? 'left-0 border-r border-r-neutral-400' : ''}
81
+ {direction === 'rtl' ? 'right-0 border-l border-l-neutral-400' : ''}
82
+ inset-y-0 bg-neutral-100
71
83
  shadow-lg
72
84
  {isMenuOpen ? 'visible z-[1001] ' : 'invisible'}
73
85
  transition-all ease-in-out duration-300"
74
86
  >
75
- <div class="p-2 {isTransitionning || !isMenuOpen ? 'hidden' : 'block'} ">
87
+ <div class="{isTransitionning || !isMenuOpen ? 'hidden' : 'block'} ">
76
88
  <slot />
77
89
  </div>
78
90
  </div>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "y200subcontrols",
3
- "version": "0.0.386",
3
+ "version": "0.0.388",
4
4
  "scripts": {
5
5
  "dev": "vite dev",
6
6
  "build": "vite build && npm run package",