@isoftdata/svelte-modal
Advanced tools
@@ -25,2 +25,3 @@ <script | ||
| import type { ButtonColors } from '@isoftdata/utility-bootstrap' | ||
| import type { Promisable } from 'type-fest' | ||
@@ -113,3 +114,3 @@ import { fade, fly } from 'svelte/transition' | ||
| // Callbacks | ||
| confirm?: (event: MouseEvent | SubmitEvent) => void | ||
| confirm?: (event: MouseEvent | SubmitEvent) => Promisable<void> | ||
| close?: (event: MouseEvent | KeyboardEvent) => void | ||
@@ -217,6 +218,6 @@ // Snippets | ||
| isLoading: confirmButtonIsLoading || savingInProgress, | ||
| onclick: (e: MouseEvent | SubmitEvent) => { | ||
| onclick: async (e: MouseEvent | SubmitEvent) => { | ||
| // Don't call confirm if using a form, the form submit will do that. | ||
| if (!form) { | ||
| internalConfirm?.(e) | ||
| await internalConfirm?.(e) | ||
| } | ||
@@ -307,5 +308,5 @@ }, | ||
| function internalConfirm(...args: Parameters<NonNullable<Props['confirm']>>) { | ||
| async function internalConfirm(...args: Parameters<NonNullable<Props['confirm']>>) { | ||
| if (confirm) { | ||
| confirm(...args) | ||
| await confirm(...args) | ||
| } else { | ||
@@ -424,5 +425,5 @@ // confirm doesn't have a default implementation like close does, so if it's not passed we'll just close the modal | ||
| id={computedFormId} | ||
| onsubmit={e => { | ||
| onsubmit={async e => { | ||
| e.preventDefault() | ||
| internalConfirm?.(e) | ||
| await internalConfirm?.(e) | ||
| }} | ||
@@ -429,0 +430,0 @@ > |
@@ -5,2 +5,3 @@ import type { ClassValue } from 'svelte/elements'; | ||
| import type { ButtonColors } from '@isoftdata/utility-bootstrap'; | ||
| import type { Promisable } from 'type-fest'; | ||
| import Button from '@isoftdata/svelte-button'; | ||
@@ -69,3 +70,3 @@ type Fullscreen = boolean | 'sm' | 'md' | 'lg' | 'xl' | 'xxl'; | ||
| zIndex?: number; | ||
| confirm?: (event: MouseEvent | SubmitEvent) => void; | ||
| confirm?: (event: MouseEvent | SubmitEvent) => Promisable<void>; | ||
| close?: (event: MouseEvent | KeyboardEvent) => void; | ||
@@ -72,0 +73,0 @@ /** @deprecated Use header instead*/ |
+13
-12
| { | ||
| "name": "@isoftdata/svelte-modal", | ||
| "version": "2.6.3", | ||
| "version": "2.6.4-beta.0", | ||
| "scripts": { | ||
| "dev": "vite dev", | ||
| "build": "vite build && npm run package", | ||
| "preview": "vite preview", | ||
| "package": "svelte-kit sync && svelte-package && publint", | ||
| "prepublishOnly": "npm run package", | ||
| "check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json", | ||
| "check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch", | ||
| "lint": "prettier --plugin-search-dir . --check . && eslint .", | ||
| "format": "prettier --plugin-search-dir . --write ." | ||
| }, | ||
| "exports": { | ||
@@ -57,13 +68,3 @@ ".": { | ||
| "pnpm": "11.x" | ||
| }, | ||
| "scripts": { | ||
| "dev": "vite dev", | ||
| "build": "vite build && npm run package", | ||
| "preview": "vite preview", | ||
| "package": "svelte-kit sync && svelte-package && publint", | ||
| "check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json", | ||
| "check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch", | ||
| "lint": "prettier --plugin-search-dir . --check . && eslint .", | ||
| "format": "prettier --plugin-search-dir . --write ." | ||
| } | ||
| } | ||
| } |
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
29031
0.94%87
1.16%3
50%