@csedl/hotwire-svelte-helpers 4.6.0 → 4.7.0

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": "@csedl/hotwire-svelte-helpers",
3
- "version": "4.6.0",
3
+ "version": "4.7.0",
4
4
  "description": "Hotwire + Svelte helpers for Rails: Stimulus floating dropdowns/toolips + Svelte global panels/modals + RTurbo-friendly utilities. Build together with the rubygem svelte-on-rails and its npm-package.",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -4,7 +4,11 @@
4
4
  import { cleanMount } from "../cleanMount.js";
5
5
  import { getOverlayTarget } from "../../lib/utils.js";
6
6
 
7
- let { panelContent, panelTitle, panelClass, label, svgIcon, panelPlacement } = $props();
7
+ let {
8
+ panel,
9
+ label,
10
+ svgIcon
11
+ } = $props();
8
12
 
9
13
  let buttonElement, panelInstance;
10
14
 
@@ -24,12 +28,8 @@
24
28
  DropdownPanel, {
25
29
  target: getOverlayTarget(),
26
30
  props: {
27
- title: panelTitle,
31
+ ...panel,
28
32
  closeFunction: closeDropdown,
29
- buttonElement: buttonElement,
30
- panelClass: panelClass,
31
- content: panelContent,
32
- placement: panelPlacement
33
33
  }
34
34
  }
35
35
  );
@@ -6,9 +6,9 @@
6
6
  panelClass,
7
7
  closeFunction,
8
8
  content,
9
- contentX,
10
9
  actionButtonLabel,
11
10
  actionButtonFunction,
11
+ actionButtonClass,
12
12
  } = $props()
13
13
  let panelElement
14
14
 
@@ -63,17 +63,17 @@
63
63
  </div>
64
64
  {/if}
65
65
 
66
- <div class="footer">
67
- {#if actionButtonLabel}
66
+ {#if actionButtonLabel}
67
+ <div class="footer">
68
68
  <span
69
69
  role="button"
70
70
  tabindex="0"
71
71
  onkeydown={(e) => {}}
72
- class="action button"
72
+ class={actionButtonClass || "action button"}
73
73
  onclick={actionButtonFunction}>
74
74
  {actionButtonLabel}
75
75
  </span>
76
- {/if}
77
- </div>
76
+ </div>
77
+ {/if}
78
78
  </div>
79
79
  </div>
@@ -4,7 +4,12 @@
4
4
  import { cleanMount } from "../cleanMount.js";
5
5
  import { getOverlayTarget } from "../../lib/utils.js";
6
6
 
7
- let {panelTitle, panelContent, label, svgIcon} = $props()
7
+ let {
8
+ label,
9
+ svgIcon,
10
+ modal,
11
+ beforeOpen
12
+ } = $props()
8
13
  let modalInstance;
9
14
 
10
15
  export function closeModal() {
@@ -14,12 +19,12 @@
14
19
  };
15
20
 
16
21
  function openModal() {
22
+ beforeOpen()
17
23
 
18
24
  modalInstance = cleanMount(Modal, {
19
25
  target: getOverlayTarget(),
20
26
  props: {
21
- title: panelTitle,
22
- content: panelContent,
27
+ ...modal,
23
28
  closeFunction: closeModal
24
29
  }
25
30
  });