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
@@ -4,3 +4,6 @@ In your tailwind.config.js file add the following to content
4
4
 
5
5
  './node_modules/y200subcontrols/**/*.{html,js,svelte,ts}'
6
6
 
7
+
8
+ Please note, this is a work in progress, it is not in a usable state yet!
9
+
@@ -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
- <span>Ok</span>
103
+ {@html okButtonContent}
100
104
  </Button>
101
105
  <Button type="button" buttonStyle="dark" id="cancelButtonDialog">
102
- <span>Cancel</span>
106
+ {@html cancelButtonContent}
103
107
  </Button>
104
108
  </div>
105
109
  </ModalDialog>
@@ -3,6 +3,8 @@ declare const __propDef: {
3
3
  props: {
4
4
  message?: string | undefined;
5
5
  style?: "warning" | "info" | "danger" | "success";
6
+ okButtonContent?: string;
7
+ cancelButtonContent?: string;
6
8
  showDialog?: () => Promise<"cancel" | "accept">;
7
9
  };
8
10
  events: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "y200subcontrols",
3
- "version": "0.0.31",
3
+ "version": "0.0.33",
4
4
  "scripts": {
5
5
  "dev": "vite dev",
6
6
  "build": "vite build && npm run package",