y200subcontrols 0.0.31 → 0.0.33
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/README.md
CHANGED
|
@@ -2,12 +2,16 @@
|
|
|
2
2
|
import ModalDialog from "./ModalDialog.svelte";
|
|
3
3
|
export let message = "Message goes here";
|
|
4
4
|
export let style = "warning";
|
|
5
|
+
export let okButtonContent = "<span>Ok</span>";
|
|
6
|
+
export let cancelButtonContent = "<span>Ok</span>";
|
|
5
7
|
let dialog;
|
|
6
8
|
export async function showDialog() {
|
|
7
9
|
const okButton = document.getElementById("okButtonDialog");
|
|
8
10
|
const cancelButton = document.getElementById("cancelButtonDialog");
|
|
9
11
|
const p = new Promise((resolve) => {
|
|
10
12
|
function closeDialog(result) {
|
|
13
|
+
okButton?.removeEventListener("click", acceptDialog);
|
|
14
|
+
cancelButton?.removeEventListener("click", cancelDialog);
|
|
11
15
|
dialog.dismissDialog();
|
|
12
16
|
resolve(result);
|
|
13
17
|
}
|
|
@@ -96,10 +100,10 @@ export async function showDialog() {
|
|
|
96
100
|
</slot>
|
|
97
101
|
<div class="grid grid-cols-2 gap-2" slot="buttons">
|
|
98
102
|
<Button type="button" id="okButtonDialog">
|
|
99
|
-
|
|
103
|
+
{@html okButtonContent}
|
|
100
104
|
</Button>
|
|
101
105
|
<Button type="button" buttonStyle="dark" id="cancelButtonDialog">
|
|
102
|
-
|
|
106
|
+
{@html cancelButtonContent}
|
|
103
107
|
</Button>
|
|
104
108
|
</div>
|
|
105
109
|
</ModalDialog>
|