sveltacular 0.0.15 → 0.0.16
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/dist/generic/overlay.svelte +13 -3
- package/dist/generic/overlay.svelte.d.ts +7 -14
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/modals/alert.svelte +4 -2
- package/dist/modals/confirm.svelte +4 -2
- package/dist/modals/dialog-close-button.svelte +32 -0
- package/dist/modals/dialog-close-button.svelte.d.ts +18 -0
- package/dist/modals/dialog-header.svelte +0 -20
- package/dist/modals/dialog-header.svelte.d.ts +15 -8
- package/dist/modals/modal.svelte +20 -0
- package/dist/modals/modal.svelte.d.ts +21 -0
- package/dist/modals/prompt.svelte +5 -2
- package/package.json +1 -1
|
@@ -1,8 +1,18 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
|
|
1
|
+
<script>import { createEventDispatcher } from "svelte";
|
|
2
|
+
export let show = true;
|
|
3
|
+
const dispatch = createEventDispatcher();
|
|
4
|
+
const onClick = () => {
|
|
5
|
+
dispatch("click");
|
|
6
|
+
};
|
|
7
|
+
const onKeyPress = (event) => {
|
|
8
|
+
if (event.key === "Escape") {
|
|
9
|
+
onClick();
|
|
10
|
+
}
|
|
11
|
+
};
|
|
3
12
|
</script>
|
|
4
13
|
|
|
5
|
-
|
|
14
|
+
<!-- svelte-ignore a11y-no-static-element-interactions -->
|
|
15
|
+
<div class:show on:click={onClick} on:keypress={onKeyPress}>
|
|
6
16
|
<slot />
|
|
7
17
|
</div>
|
|
8
18
|
|
|
@@ -1,27 +1,20 @@
|
|
|
1
|
-
/** @typedef {typeof __propDef.props} OverlayProps */
|
|
2
|
-
/** @typedef {typeof __propDef.events} OverlayEvents */
|
|
3
|
-
/** @typedef {typeof __propDef.slots} OverlaySlots */
|
|
4
|
-
export default class Overlay extends SvelteComponent<{
|
|
5
|
-
show?: boolean | undefined;
|
|
6
|
-
}, {
|
|
7
|
-
[evt: string]: CustomEvent<any>;
|
|
8
|
-
}, {
|
|
9
|
-
default: {};
|
|
10
|
-
}> {
|
|
11
|
-
}
|
|
12
|
-
export type OverlayProps = typeof __propDef.props;
|
|
13
|
-
export type OverlayEvents = typeof __propDef.events;
|
|
14
|
-
export type OverlaySlots = typeof __propDef.slots;
|
|
15
1
|
import { SvelteComponent } from "svelte";
|
|
16
2
|
declare const __propDef: {
|
|
17
3
|
props: {
|
|
18
4
|
show?: boolean | undefined;
|
|
19
5
|
};
|
|
20
6
|
events: {
|
|
7
|
+
click: CustomEvent<void>;
|
|
8
|
+
} & {
|
|
21
9
|
[evt: string]: CustomEvent<any>;
|
|
22
10
|
};
|
|
23
11
|
slots: {
|
|
24
12
|
default: {};
|
|
25
13
|
};
|
|
26
14
|
};
|
|
15
|
+
export type OverlayProps = typeof __propDef.props;
|
|
16
|
+
export type OverlayEvents = typeof __propDef.events;
|
|
17
|
+
export type OverlaySlots = typeof __propDef.slots;
|
|
18
|
+
export default class Overlay extends SvelteComponent<OverlayProps, OverlayEvents, OverlaySlots> {
|
|
19
|
+
}
|
|
27
20
|
export {};
|
package/dist/index.d.ts
CHANGED
|
@@ -38,6 +38,7 @@ export { default as DialogBody } from './modals/dialog-body.svelte';
|
|
|
38
38
|
export { default as DialogFooter } from './modals/dialog-footer.svelte';
|
|
39
39
|
export { default as DialogHeader } from './modals/dialog-header.svelte';
|
|
40
40
|
export { default as DialogWindow } from './modals/dialog-window.svelte';
|
|
41
|
+
export { default as Modal } from './modals/modal.svelte';
|
|
41
42
|
export { default as Accordian } from './navigation/accordian/accordian.svelte';
|
|
42
43
|
export { default as AppBar } from './navigation/app-bar/app-bar.svelte';
|
|
43
44
|
export { default as Breadcrumbs } from './navigation/breadcrumbs/breadcrumbs.svelte';
|
package/dist/index.js
CHANGED
|
@@ -42,6 +42,7 @@ export { default as DialogBody } from './modals/dialog-body.svelte';
|
|
|
42
42
|
export { default as DialogFooter } from './modals/dialog-footer.svelte';
|
|
43
43
|
export { default as DialogHeader } from './modals/dialog-header.svelte';
|
|
44
44
|
export { default as DialogWindow } from './modals/dialog-window.svelte';
|
|
45
|
+
export { default as Modal } from './modals/modal.svelte';
|
|
45
46
|
// Navigation
|
|
46
47
|
export { default as Accordian } from './navigation/accordian/accordian.svelte';
|
|
47
48
|
export { default as AppBar } from './navigation/app-bar/app-bar.svelte';
|
package/dist/modals/alert.svelte
CHANGED
|
@@ -5,6 +5,7 @@ import Dialog from "./dialog-window.svelte";
|
|
|
5
5
|
import Divider from "../generic/divider/divider.svelte";
|
|
6
6
|
import Overlay from "../generic/overlay.svelte";
|
|
7
7
|
import Button from "../forms/button/button.svelte";
|
|
8
|
+
import DialogCloseButton from "./dialog-close-button.svelte";
|
|
8
9
|
export let open = false;
|
|
9
10
|
export let title = void 0;
|
|
10
11
|
export let size = "md";
|
|
@@ -14,14 +15,15 @@ const close = () => open = false;
|
|
|
14
15
|
</script>
|
|
15
16
|
|
|
16
17
|
{#if open}
|
|
17
|
-
<Overlay>
|
|
18
|
+
<Overlay on:click={close}>
|
|
18
19
|
<Dialog {size}>
|
|
19
20
|
{#if title}
|
|
20
|
-
<DialogHeader
|
|
21
|
+
<DialogHeader>
|
|
21
22
|
{title}
|
|
22
23
|
</DialogHeader>
|
|
23
24
|
<Divider />
|
|
24
25
|
{/if}
|
|
26
|
+
<DialogCloseButton show={showCloseButton} on:click={close} />
|
|
25
27
|
<DialogBody>
|
|
26
28
|
<slot />
|
|
27
29
|
</DialogBody>
|
|
@@ -6,6 +6,7 @@ import Overlay from "../generic/overlay.svelte";
|
|
|
6
6
|
import { createEventDispatcher } from "svelte";
|
|
7
7
|
import Button from "../forms/button/button.svelte";
|
|
8
8
|
import Divider from "../generic/divider/divider.svelte";
|
|
9
|
+
import DialogCloseButton from "./dialog-close-button.svelte";
|
|
9
10
|
export let open = false;
|
|
10
11
|
export let title = void 0;
|
|
11
12
|
export let size = "md";
|
|
@@ -24,14 +25,15 @@ const yes = () => {
|
|
|
24
25
|
</script>
|
|
25
26
|
|
|
26
27
|
{#if open}
|
|
27
|
-
<Overlay>
|
|
28
|
+
<Overlay on:click={no}>
|
|
28
29
|
<Dialog {size}>
|
|
29
30
|
{#if title}
|
|
30
|
-
<DialogHeader
|
|
31
|
+
<DialogHeader>
|
|
31
32
|
{title}
|
|
32
33
|
</DialogHeader>
|
|
33
34
|
<Divider />
|
|
34
35
|
{/if}
|
|
36
|
+
<DialogCloseButton show={showCloseButton} on:click={no} />
|
|
35
37
|
<DialogBody>
|
|
36
38
|
<slot />
|
|
37
39
|
</DialogBody>
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
<script>import { createEventDispatcher } from "svelte";
|
|
2
|
+
const dispatch = createEventDispatcher();
|
|
3
|
+
export let show = true;
|
|
4
|
+
const onClick = (e) => {
|
|
5
|
+
e.preventDefault();
|
|
6
|
+
e.stopPropagation();
|
|
7
|
+
dispatch("click");
|
|
8
|
+
};
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
{#if show}
|
|
12
|
+
<button on:click={onClick}>X</button>
|
|
13
|
+
{/if}
|
|
14
|
+
|
|
15
|
+
<style>button {
|
|
16
|
+
appearance: none;
|
|
17
|
+
border: none;
|
|
18
|
+
background-color: transparent;
|
|
19
|
+
font-size: 1rem;
|
|
20
|
+
cursor: pointer;
|
|
21
|
+
position: absolute;
|
|
22
|
+
top: 0.7rem;
|
|
23
|
+
right: 0.7rem;
|
|
24
|
+
width: 2rem;
|
|
25
|
+
height: 2rem;
|
|
26
|
+
line-height: 2rem;
|
|
27
|
+
text-align: center;
|
|
28
|
+
border-radius: 0.5rem;
|
|
29
|
+
}
|
|
30
|
+
button:hover {
|
|
31
|
+
background-color: #eee;
|
|
32
|
+
}</style>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: {
|
|
4
|
+
show?: boolean | undefined;
|
|
5
|
+
};
|
|
6
|
+
events: {
|
|
7
|
+
click: CustomEvent<void>;
|
|
8
|
+
} & {
|
|
9
|
+
[evt: string]: CustomEvent<any>;
|
|
10
|
+
};
|
|
11
|
+
slots: {};
|
|
12
|
+
};
|
|
13
|
+
export type DialogCloseButtonProps = typeof __propDef.props;
|
|
14
|
+
export type DialogCloseButtonEvents = typeof __propDef.events;
|
|
15
|
+
export type DialogCloseButtonSlots = typeof __propDef.slots;
|
|
16
|
+
export default class DialogCloseButton extends SvelteComponent<DialogCloseButtonProps, DialogCloseButtonEvents, DialogCloseButtonSlots> {
|
|
17
|
+
}
|
|
18
|
+
export {};
|
|
@@ -1,15 +1,5 @@
|
|
|
1
|
-
<script>import { createEventDispatcher } from "svelte";
|
|
2
|
-
const dispatch = createEventDispatcher();
|
|
3
|
-
export let showCloseButton = true;
|
|
4
|
-
</script>
|
|
5
|
-
|
|
6
1
|
<header>
|
|
7
2
|
<h1><slot /></h1>
|
|
8
|
-
{#if showCloseButton}
|
|
9
|
-
<div>
|
|
10
|
-
<button on:click={() => dispatch('close')}>X</button>
|
|
11
|
-
</div>
|
|
12
|
-
{/if}
|
|
13
3
|
</header>
|
|
14
4
|
|
|
15
5
|
<style>header {
|
|
@@ -25,14 +15,4 @@ header h1 {
|
|
|
25
15
|
flex-grow: 1;
|
|
26
16
|
font-size: 1.25rem;
|
|
27
17
|
line-height: 1.75rem;
|
|
28
|
-
}
|
|
29
|
-
header div {
|
|
30
|
-
text-align: right;
|
|
31
|
-
}
|
|
32
|
-
header div button {
|
|
33
|
-
appearance: none;
|
|
34
|
-
border: none;
|
|
35
|
-
background-color: transparent;
|
|
36
|
-
font-size: 1.5rem;
|
|
37
|
-
cursor: pointer;
|
|
38
18
|
}</style>
|
|
@@ -1,20 +1,27 @@
|
|
|
1
|
+
/** @typedef {typeof __propDef.props} DialogHeaderProps */
|
|
2
|
+
/** @typedef {typeof __propDef.events} DialogHeaderEvents */
|
|
3
|
+
/** @typedef {typeof __propDef.slots} DialogHeaderSlots */
|
|
4
|
+
export default class DialogHeader extends SvelteComponent<{
|
|
5
|
+
[x: string]: never;
|
|
6
|
+
}, {
|
|
7
|
+
[evt: string]: CustomEvent<any>;
|
|
8
|
+
}, {
|
|
9
|
+
default: {};
|
|
10
|
+
}> {
|
|
11
|
+
}
|
|
12
|
+
export type DialogHeaderProps = typeof __propDef.props;
|
|
13
|
+
export type DialogHeaderEvents = typeof __propDef.events;
|
|
14
|
+
export type DialogHeaderSlots = typeof __propDef.slots;
|
|
1
15
|
import { SvelteComponent } from "svelte";
|
|
2
16
|
declare const __propDef: {
|
|
3
17
|
props: {
|
|
4
|
-
|
|
18
|
+
[x: string]: never;
|
|
5
19
|
};
|
|
6
20
|
events: {
|
|
7
|
-
close: CustomEvent<void>;
|
|
8
|
-
} & {
|
|
9
21
|
[evt: string]: CustomEvent<any>;
|
|
10
22
|
};
|
|
11
23
|
slots: {
|
|
12
24
|
default: {};
|
|
13
25
|
};
|
|
14
26
|
};
|
|
15
|
-
export type DialogHeaderProps = typeof __propDef.props;
|
|
16
|
-
export type DialogHeaderEvents = typeof __propDef.events;
|
|
17
|
-
export type DialogHeaderSlots = typeof __propDef.slots;
|
|
18
|
-
export default class DialogHeader extends SvelteComponent<DialogHeaderProps, DialogHeaderEvents, DialogHeaderSlots> {
|
|
19
|
-
}
|
|
20
27
|
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<script>import DialogBody from "./dialog-body.svelte";
|
|
2
|
+
import Dialog from "./dialog-window.svelte";
|
|
3
|
+
import Overlay from "../generic/overlay.svelte";
|
|
4
|
+
import DialogCloseButton from "./dialog-close-button.svelte";
|
|
5
|
+
export let open = false;
|
|
6
|
+
export let size = "md";
|
|
7
|
+
export let showCloseButton = true;
|
|
8
|
+
const close = () => open = false;
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
{#if open}
|
|
12
|
+
<Overlay on:click={close}>
|
|
13
|
+
<Dialog {size}>
|
|
14
|
+
<DialogCloseButton show={showCloseButton} on:click={close} />
|
|
15
|
+
<DialogBody>
|
|
16
|
+
<slot />
|
|
17
|
+
</DialogBody>
|
|
18
|
+
</Dialog>
|
|
19
|
+
</Overlay>
|
|
20
|
+
{/if}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
2
|
+
import type { FormFieldSizeOptions } from '../types/form.js';
|
|
3
|
+
declare const __propDef: {
|
|
4
|
+
props: {
|
|
5
|
+
open?: boolean | undefined;
|
|
6
|
+
size?: FormFieldSizeOptions | undefined;
|
|
7
|
+
showCloseButton?: boolean | undefined;
|
|
8
|
+
};
|
|
9
|
+
events: {
|
|
10
|
+
[evt: string]: CustomEvent<any>;
|
|
11
|
+
};
|
|
12
|
+
slots: {
|
|
13
|
+
default: {};
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
export type ModalProps = typeof __propDef.props;
|
|
17
|
+
export type ModalEvents = typeof __propDef.events;
|
|
18
|
+
export type ModalSlots = typeof __propDef.slots;
|
|
19
|
+
export default class Modal extends SvelteComponent<ModalProps, ModalEvents, ModalSlots> {
|
|
20
|
+
}
|
|
21
|
+
export {};
|
|
@@ -7,6 +7,7 @@ import { createEventDispatcher } from "svelte";
|
|
|
7
7
|
import Button from "../forms/button/button.svelte";
|
|
8
8
|
import Divider from "../generic/divider/divider.svelte";
|
|
9
9
|
import TextBox from "../forms/text-box/text-box.svelte";
|
|
10
|
+
import DialogCloseButton from "./dialog-close-button.svelte";
|
|
10
11
|
export let open = false;
|
|
11
12
|
export let title = void 0;
|
|
12
13
|
export let size = "md";
|
|
@@ -19,6 +20,7 @@ export let required = false;
|
|
|
19
20
|
let value = "";
|
|
20
21
|
const dispatch = createEventDispatcher();
|
|
21
22
|
const no = () => {
|
|
23
|
+
console.log("no");
|
|
22
24
|
open = false;
|
|
23
25
|
dispatch("cancel");
|
|
24
26
|
};
|
|
@@ -31,14 +33,15 @@ const yes = () => {
|
|
|
31
33
|
</script>
|
|
32
34
|
|
|
33
35
|
{#if open}
|
|
34
|
-
<Overlay>
|
|
36
|
+
<Overlay on:click={no}>
|
|
35
37
|
<Dialog {size}>
|
|
36
38
|
{#if title}
|
|
37
|
-
<DialogHeader
|
|
39
|
+
<DialogHeader>
|
|
38
40
|
{title}
|
|
39
41
|
</DialogHeader>
|
|
40
42
|
<Divider />
|
|
41
43
|
{/if}
|
|
44
|
+
<DialogCloseButton show={showCloseButton} on:click={no} />
|
|
42
45
|
<DialogBody>
|
|
43
46
|
<TextBox bind:value {placeholder} {type} {required} size="full">
|
|
44
47
|
<slot />
|