@functionalcms/svelte-components 4.7.6 → 4.8.0
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,10 +1,30 @@
|
|
|
1
|
-
<script
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
import type { EventHandler } from 'svelte/elements';
|
|
4
|
+
|
|
2
5
|
interface Props {
|
|
3
6
|
children: Snippet;
|
|
7
|
+
css: string;
|
|
8
|
+
isOpen: boolean;
|
|
9
|
+
onClose: EventHandler<Event, HTMLDialogElement> | undefined;
|
|
10
|
+
showModal: boolean;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
let { children, onClose, css, isOpen = false }: Props = $props();
|
|
14
|
+
let dialog: any;
|
|
15
|
+
|
|
16
|
+
export function showModal() {
|
|
17
|
+
dialog.showModal();
|
|
18
|
+
}
|
|
19
|
+
export function close() {
|
|
20
|
+
dialog.close();
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
if(isOpen) {
|
|
24
|
+
dialog.showModal();
|
|
4
25
|
}
|
|
5
|
-
let { children } = $props();
|
|
6
|
-
let dialog: any;
|
|
7
26
|
</script>
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
27
|
+
|
|
28
|
+
<dialog bind:this={dialog} onclose={onClose} class={css}>
|
|
29
|
+
{@render children?.()}
|
|
30
|
+
</dialog>
|
|
@@ -1,31 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
type
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
declare const Dialog: $$__sveltets_2_IsomorphicComponent<{
|
|
10
|
-
children: any;
|
|
11
|
-
}, {
|
|
12
|
-
close: Event;
|
|
13
|
-
} & {
|
|
14
|
-
[evt: string]: CustomEvent<any>;
|
|
15
|
-
}, {}, {}, "">;
|
|
16
|
-
type $$ComponentProps = {
|
|
17
|
-
children: any;
|
|
18
|
-
};
|
|
19
|
-
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
20
|
-
new (options: import("svelte").ComponentConstructorOptions<Props>): import("svelte").SvelteComponent<Props, Events, Slots> & {
|
|
21
|
-
$$bindings?: Bindings;
|
|
22
|
-
} & Exports;
|
|
23
|
-
(internal: unknown, props: Props & {
|
|
24
|
-
$$events?: Events;
|
|
25
|
-
$$slots?: Slots;
|
|
26
|
-
}): Exports & {
|
|
27
|
-
$set?: any;
|
|
28
|
-
$on?: any;
|
|
29
|
-
};
|
|
30
|
-
z_$$bindings?: Bindings;
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
import type { EventHandler } from 'svelte/elements';
|
|
3
|
+
interface Props {
|
|
4
|
+
children: Snippet;
|
|
5
|
+
css: string;
|
|
6
|
+
isOpen: boolean;
|
|
7
|
+
onClose: EventHandler<Event, HTMLDialogElement> | undefined;
|
|
8
|
+
showModal: boolean;
|
|
31
9
|
}
|
|
10
|
+
declare const Dialog: import("svelte").Component<Props, {
|
|
11
|
+
showModal: () => void;
|
|
12
|
+
close: () => void;
|
|
13
|
+
}, "">;
|
|
14
|
+
type Dialog = ReturnType<typeof Dialog>;
|
|
15
|
+
export default Dialog;
|
package/dist/index.d.ts
CHANGED
|
@@ -18,6 +18,7 @@ export { default as Drawer } from './components/presentation/Drawer.svelte';
|
|
|
18
18
|
export { default as Disclose } from './components/presentation/Disclose.svelte';
|
|
19
19
|
export { default as EmptyState } from './components/presentation/EmptyState.svelte';
|
|
20
20
|
export { default as ImageCompare } from './components/presentation/ImageCompare.svelte';
|
|
21
|
+
export { default as Dialog } from './components/presentation/Dialog.svelte';
|
|
21
22
|
export { default as ListMenu } from './components/menu/ListMenu.svelte';
|
|
22
23
|
export { default as DynamicMenu } from './components/menu/DynamicMenu.svelte';
|
|
23
24
|
export { default as HamburgerMenu } from './components/menu/HamburgerMenu.svelte';
|
package/dist/index.js
CHANGED
|
@@ -25,6 +25,7 @@ export { default as Drawer } from './components/presentation/Drawer.svelte';
|
|
|
25
25
|
export { default as Disclose } from './components/presentation/Disclose.svelte';
|
|
26
26
|
export { default as EmptyState } from './components/presentation/EmptyState.svelte';
|
|
27
27
|
export { default as ImageCompare } from './components/presentation/ImageCompare.svelte';
|
|
28
|
+
export { default as Dialog } from './components/presentation/Dialog.svelte';
|
|
28
29
|
/*
|
|
29
30
|
* Menu
|
|
30
31
|
*/
|