y200subcontrols 0.0.334 → 0.0.3332

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,20 +1,15 @@
1
- <script>import { onMount } from "svelte";
2
- import Button from "./Button.svelte";
1
+ <script>import Button from "./Button.svelte";
3
2
  import ModalDialog from "./ModalDialog.svelte";
4
3
  export let message = "Message goes here";
5
4
  export let style = "warning";
6
5
  export let okButtonContent = "<span>Ok</span>";
7
6
  export let cancelButtonContent = "<span>Cancel</span>";
8
7
  let dialog;
9
- let dialogId = "";
10
- let buttonsContainer;
11
8
  export async function showDialog() {
12
- const okButton = document.getElementById(`okButtonDialog-${dialogId}`);
13
- const cancelButton = document.getElementById(`cancelButtonDialog-${dialogId}`);
9
+ const okButton = document.getElementById("okButtonDialog");
10
+ const cancelButton = document.getElementById("cancelButtonDialog");
14
11
  const p = new Promise((resolve) => {
15
12
  function closeDialog(result) {
16
- console.log(okButton);
17
- console.log(cancelButton);
18
13
  okButton?.removeEventListener("click", acceptDialog);
19
14
  cancelButton?.removeEventListener("click", cancelDialog);
20
15
  dialog.dismissDialog();
@@ -32,10 +27,6 @@ export async function showDialog() {
32
27
  });
33
28
  return p;
34
29
  }
35
- onMount(() => {
36
- let r = (Math.random() + 1).toString(36).substring(2);
37
- dialogId = `dialog-${r}`;
38
- });
39
30
  </script>
40
31
 
41
32
  <ModalDialog bind:this={dialog} showCloseButton={false} allowSubmit={false}>
@@ -107,11 +98,11 @@ onMount(() => {
107
98
  {@html message}
108
99
  </div>
109
100
  </slot>
110
- <div class="grid grid-cols-2 gap-2" slot="buttons" bind:this={buttonsContainer}>
111
- <Button type="button" id="okButtonDialog-{dialogId}">
101
+ <div class="grid grid-cols-2 gap-2" slot="buttons">
102
+ <Button type="button" id="okButtonDialog">
112
103
  {@html okButtonContent}
113
104
  </Button>
114
- <Button type="button" buttonStyle="dark" id="cancelButtonDialog-{dialogId}">
105
+ <Button type="button" buttonStyle="dark" id="cancelButtonDialog">
115
106
  {@html cancelButtonContent}
116
107
  </Button>
117
108
  </div>
@@ -125,7 +125,7 @@ onMount(() => {
125
125
  cancelButtonContent="Cancel"
126
126
  >
127
127
  <span slot="title"> Confirm Delete </span>
128
- <div class="text-center my-2">
129
- <span class="text-lg"> Are you sure you want to delete this record ?</span>
128
+ <div class="text-center">
129
+ <span> Are you sure you want to delete this record </span>
130
130
  </div>
131
131
  </ConfirmModalDialog>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "y200subcontrols",
3
- "version": "0.0.334",
3
+ "version": "0.0.3332",
4
4
  "scripts": {
5
5
  "dev": "vite dev",
6
6
  "build": "vite build && npm run package",