@csedl/hotwire-svelte-helpers 2.1.0 → 2.1.1
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": "2.1.
|
|
3
|
+
"version": "2.1.1",
|
|
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": {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
<script>
|
|
2
|
-
import {openDropdownPanel} from "@csedl/hotwire-svelte-helpers";
|
|
3
|
-
|
|
2
|
+
import { openDropdownPanel, hotwireSvelteConfig } from "@csedl/hotwire-svelte-helpers";
|
|
4
3
|
import {onMount} from "svelte";
|
|
5
4
|
|
|
6
5
|
let {
|
|
@@ -23,6 +22,12 @@
|
|
|
23
22
|
}, 0)
|
|
24
23
|
}
|
|
25
24
|
|
|
25
|
+
function closeSvg() {
|
|
26
|
+
const path = hotwireSvelteConfig('closeButtonSvg');
|
|
27
|
+
const svg = (path ? path : '?')
|
|
28
|
+
return svg;
|
|
29
|
+
}
|
|
30
|
+
|
|
26
31
|
</script>
|
|
27
32
|
|
|
28
33
|
<div class="dropdown-panel {panelClass}" bind:this={panelElement} onclose={closeFunc}>
|
|
@@ -33,7 +38,7 @@
|
|
|
33
38
|
{title || 'missing title'}
|
|
34
39
|
</span>
|
|
35
40
|
<button class="close-btn"
|
|
36
|
-
onclick={closeFunction}>{@html
|
|
41
|
+
onclick={closeFunction}>{@html closeSvg()}</button>
|
|
37
42
|
</div>
|
|
38
43
|
|
|
39
44
|
<div class="content">
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script>
|
|
2
|
-
import {
|
|
2
|
+
import {hotwireSvelteConfig} from "@csedl/hotwire-svelte-helpers";
|
|
3
3
|
import {onMount} from "svelte";
|
|
4
4
|
|
|
5
5
|
let {
|
|
@@ -26,6 +26,15 @@
|
|
|
26
26
|
}, 0)
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
+
function closeSvg() {
|
|
30
|
+
const path = hotwireSvelteConfig('closeButtonSvg');
|
|
31
|
+
const svg = (path ? path : '?')
|
|
32
|
+
return svg;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export function setTitle(newTitle) {
|
|
36
|
+
title = newTitle
|
|
37
|
+
}
|
|
29
38
|
</script>
|
|
30
39
|
|
|
31
40
|
<div class="modal-overlay">
|
|
@@ -37,7 +46,7 @@
|
|
|
37
46
|
{title || 'missing title'}
|
|
38
47
|
</span>
|
|
39
48
|
<button class="close-btn"
|
|
40
|
-
onclick={closeFunction}>{@html
|
|
49
|
+
onclick={closeFunction}>{@html closeSvg()}</button>
|
|
41
50
|
</div>
|
|
42
51
|
|
|
43
52
|
<div class="content">
|