sveltacular 0.0.37 → 0.0.39
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/forms/form.svelte +2 -1
- package/dist/forms/form.svelte.d.ts +2 -0
- package/dist/generic/card/card-container.d.ts +3 -0
- package/dist/generic/card/card-container.js +1 -0
- package/dist/generic/card/card-container.svelte +58 -15
- package/dist/generic/card/card-container.svelte.d.ts +7 -15
- package/dist/generic/card/card.svelte +8 -1
- package/dist/generic/card/card.svelte.d.ts +1 -1
- package/dist/generic/scorecard/scorecard.svelte +8 -2
- package/dist/generic/scorecard/scorecard.svelte.d.ts +1 -1
- package/dist/generic/section/section.svelte +17 -1
- package/dist/generic/section/section.svelte.d.ts +2 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/layout/flex-row.svelte +1 -1
- package/dist/modals/dialog-window.svelte +12 -10
- package/dist/navigation/app-bar/app-nav.svelte.d.ts +1 -1
- package/dist/navigation/tabs/tab.svelte +0 -1
- package/package.json +1 -1
package/dist/forms/form.svelte
CHANGED
|
@@ -3,6 +3,7 @@ import Section from "../generic/section/section.svelte";
|
|
|
3
3
|
export let method = "get";
|
|
4
4
|
export let title = void 0;
|
|
5
5
|
export let action = void 0;
|
|
6
|
+
export let size = "full";
|
|
6
7
|
const dispatch = createEventDispatcher();
|
|
7
8
|
const onSubmit = (e) => {
|
|
8
9
|
e.preventDefault();
|
|
@@ -10,7 +11,7 @@ const onSubmit = (e) => {
|
|
|
10
11
|
};
|
|
11
12
|
</script>
|
|
12
13
|
|
|
13
|
-
<Section {title}>
|
|
14
|
+
<Section {title} {size}>
|
|
14
15
|
<form {method} {action} on:submit={onSubmit}>
|
|
15
16
|
<slot />
|
|
16
17
|
</form>
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { SvelteComponent } from "svelte";
|
|
2
|
+
import type { FormFieldSizeOptions } from '../index.js';
|
|
2
3
|
declare const __propDef: {
|
|
3
4
|
props: {
|
|
4
5
|
method?: "get" | "post" | "put" | "delete" | undefined;
|
|
5
6
|
title?: string | undefined;
|
|
6
7
|
action?: string | undefined;
|
|
8
|
+
size?: FormFieldSizeOptions | undefined;
|
|
7
9
|
};
|
|
8
10
|
events: {
|
|
9
11
|
submit: CustomEvent<void>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,18 +1,61 @@
|
|
|
1
|
-
<
|
|
1
|
+
<script>import { setContext } from "svelte";
|
|
2
|
+
export let align = "left";
|
|
3
|
+
export let spacing = "space-around";
|
|
4
|
+
let cards = [];
|
|
5
|
+
const register = (id) => {
|
|
6
|
+
cards = [...cards, id];
|
|
7
|
+
};
|
|
8
|
+
setContext("CardContainer", {
|
|
9
|
+
register
|
|
10
|
+
});
|
|
11
|
+
$:
|
|
12
|
+
count = cards.length;
|
|
13
|
+
</script>
|
|
14
|
+
|
|
15
|
+
<ul data-count={count} class="{spacing} {align}">
|
|
2
16
|
<slot />
|
|
3
17
|
</ul>
|
|
4
18
|
|
|
5
|
-
<style>
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
+
<style>ul {
|
|
20
|
+
list-style: none;
|
|
21
|
+
padding: 0;
|
|
22
|
+
margin: 0;
|
|
23
|
+
display: flex;
|
|
24
|
+
flex-wrap: wrap;
|
|
25
|
+
flex-direction: row;
|
|
26
|
+
align-items: stretch;
|
|
27
|
+
justify-content: space-between;
|
|
28
|
+
align-content: stretch;
|
|
29
|
+
row-gap: 1rem;
|
|
30
|
+
column-gap: 1rem;
|
|
31
|
+
}
|
|
32
|
+
ul.left, ul.start {
|
|
33
|
+
justify-content: flex-start;
|
|
34
|
+
}
|
|
35
|
+
ul.center {
|
|
36
|
+
justify-content: center;
|
|
37
|
+
}
|
|
38
|
+
ul.right {
|
|
39
|
+
justify-content: flex-end;
|
|
40
|
+
}
|
|
41
|
+
ul.none {
|
|
42
|
+
gap: 0;
|
|
43
|
+
}
|
|
44
|
+
ul.tight {
|
|
45
|
+
gap: 0.5rem;
|
|
46
|
+
}
|
|
47
|
+
ul.compact {
|
|
48
|
+
gap: 1rem;
|
|
49
|
+
}
|
|
50
|
+
ul.loose {
|
|
51
|
+
gap: 2rem;
|
|
52
|
+
}
|
|
53
|
+
ul.space-evenly {
|
|
54
|
+
justify-content: space-evenly;
|
|
55
|
+
}
|
|
56
|
+
ul.space-between {
|
|
57
|
+
justify-content: space-between;
|
|
58
|
+
}
|
|
59
|
+
ul.space-around {
|
|
60
|
+
justify-content: space-around;
|
|
61
|
+
}</style>
|
|
@@ -1,21 +1,8 @@
|
|
|
1
|
-
/** @typedef {typeof __propDef.props} CardContainerProps */
|
|
2
|
-
/** @typedef {typeof __propDef.events} CardContainerEvents */
|
|
3
|
-
/** @typedef {typeof __propDef.slots} CardContainerSlots */
|
|
4
|
-
export default class CardContainer extends SvelteComponent<{
|
|
5
|
-
[x: string]: never;
|
|
6
|
-
}, {
|
|
7
|
-
[evt: string]: CustomEvent<any>;
|
|
8
|
-
}, {
|
|
9
|
-
default: {};
|
|
10
|
-
}> {
|
|
11
|
-
}
|
|
12
|
-
export type CardContainerProps = typeof __propDef.props;
|
|
13
|
-
export type CardContainerEvents = typeof __propDef.events;
|
|
14
|
-
export type CardContainerSlots = typeof __propDef.slots;
|
|
15
1
|
import { SvelteComponent } from "svelte";
|
|
16
2
|
declare const __propDef: {
|
|
17
3
|
props: {
|
|
18
|
-
|
|
4
|
+
align?: "center" | "end" | "start" | "left" | "right" | undefined;
|
|
5
|
+
spacing?: "none" | "tight" | "compact" | "loose" | "space-evenly" | "space-around" | "space-between" | undefined;
|
|
19
6
|
};
|
|
20
7
|
events: {
|
|
21
8
|
[evt: string]: CustomEvent<any>;
|
|
@@ -24,4 +11,9 @@ declare const __propDef: {
|
|
|
24
11
|
default: {};
|
|
25
12
|
};
|
|
26
13
|
};
|
|
14
|
+
export type CardContainerProps = typeof __propDef.props;
|
|
15
|
+
export type CardContainerEvents = typeof __propDef.events;
|
|
16
|
+
export type CardContainerSlots = typeof __propDef.slots;
|
|
17
|
+
export default class CardContainer extends SvelteComponent<CardContainerProps, CardContainerEvents, CardContainerSlots> {
|
|
18
|
+
}
|
|
27
19
|
export {};
|
|
@@ -1,17 +1,24 @@
|
|
|
1
1
|
<script>import { navigateTo } from "../../helpers/navigate-to.js";
|
|
2
|
+
import { uniqueId } from "../../index.js";
|
|
3
|
+
import { getContext } from "svelte";
|
|
2
4
|
export let title = void 0;
|
|
3
5
|
export let href = void 0;
|
|
4
6
|
export let size = "md";
|
|
5
7
|
$:
|
|
6
8
|
role = href ? "link" : "listitem";
|
|
9
|
+
const id = uniqueId();
|
|
7
10
|
const onClick = () => {
|
|
8
11
|
if (!href)
|
|
9
12
|
return;
|
|
10
13
|
navigateTo(href);
|
|
11
14
|
};
|
|
15
|
+
const container = getContext("CardContainer");
|
|
16
|
+
if (container) {
|
|
17
|
+
container.register(id);
|
|
18
|
+
}
|
|
12
19
|
</script>
|
|
13
20
|
|
|
14
|
-
<li {role} on:click={onClick} class="{size} {role}">
|
|
21
|
+
<li {role} {id} on:click={onClick} class="{size} {role}">
|
|
15
22
|
{#if title}
|
|
16
23
|
<strong>{title}</strong>
|
|
17
24
|
{/if}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
<script>import { navigateTo } from "../../index.js";
|
|
1
|
+
<script>import { navigateTo, uniqueId } from "../../index.js";
|
|
2
|
+
import { getContext } from "svelte";
|
|
2
3
|
export let value;
|
|
3
4
|
export let caption = "below";
|
|
4
5
|
export let href = void 0;
|
|
@@ -7,13 +8,18 @@ const onClick = () => {
|
|
|
7
8
|
return;
|
|
8
9
|
navigateTo(href);
|
|
9
10
|
};
|
|
11
|
+
const id = uniqueId();
|
|
12
|
+
const container = getContext("CardContainer");
|
|
13
|
+
if (container) {
|
|
14
|
+
container.register(id);
|
|
15
|
+
}
|
|
10
16
|
$:
|
|
11
17
|
formattedValue = typeof value === "number" ? value.toLocaleString() : value;
|
|
12
18
|
$:
|
|
13
19
|
isLink = !!href;
|
|
14
20
|
</script>
|
|
15
21
|
|
|
16
|
-
<button on:click={onClick} class:isLink>
|
|
22
|
+
<button on:click={onClick} class:isLink {id}>
|
|
17
23
|
<figure class={caption}>
|
|
18
24
|
<span class="value">{formattedValue}</span>
|
|
19
25
|
<figcaption><slot /></figcaption>
|
|
@@ -2,7 +2,7 @@ import { SvelteComponent } from "svelte";
|
|
|
2
2
|
declare const __propDef: {
|
|
3
3
|
props: {
|
|
4
4
|
value: string | number;
|
|
5
|
-
caption?: "
|
|
5
|
+
caption?: "left" | "right" | "above" | "below" | undefined;
|
|
6
6
|
href?: string | undefined;
|
|
7
7
|
};
|
|
8
8
|
events: {
|
|
@@ -2,10 +2,11 @@
|
|
|
2
2
|
import Header from "../header/header.svelte";
|
|
3
3
|
export let title = void 0;
|
|
4
4
|
export let level = 2;
|
|
5
|
+
export let size = "full";
|
|
5
6
|
setContext("section", { level, title });
|
|
6
7
|
</script>
|
|
7
8
|
|
|
8
|
-
<section class="level-{level}">
|
|
9
|
+
<section class="level-{level} {size}">
|
|
9
10
|
{#if title}
|
|
10
11
|
<Header />
|
|
11
12
|
{/if}
|
|
@@ -17,4 +18,19 @@ setContext("section", { level, title });
|
|
|
17
18
|
margin-top: 1rem;
|
|
18
19
|
margin-bottom: 1rem;
|
|
19
20
|
font-family: var(--base-font-family, sans-serif);
|
|
21
|
+
}
|
|
22
|
+
section.sm {
|
|
23
|
+
max-width: 25rem;
|
|
24
|
+
}
|
|
25
|
+
section.md {
|
|
26
|
+
max-width: 35rem;
|
|
27
|
+
}
|
|
28
|
+
section.lg {
|
|
29
|
+
max-width: 50rem;
|
|
30
|
+
}
|
|
31
|
+
section.xl {
|
|
32
|
+
max-width: 65rem;
|
|
33
|
+
}
|
|
34
|
+
section.full {
|
|
35
|
+
width: 100%;
|
|
20
36
|
}</style>
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { SvelteComponent } from "svelte";
|
|
2
2
|
import type { SectionLevel } from '../../types/generic.js';
|
|
3
|
+
import type { FormFieldSizeOptions } from '../../index.js';
|
|
3
4
|
declare const __propDef: {
|
|
4
5
|
props: {
|
|
5
6
|
title?: string | undefined;
|
|
6
7
|
level?: SectionLevel | undefined;
|
|
8
|
+
size?: FormFieldSizeOptions | undefined;
|
|
7
9
|
};
|
|
8
10
|
events: {
|
|
9
11
|
[evt: string]: CustomEvent<any>;
|
package/dist/index.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ export { default as FileArea } from './forms/file-area/file-area.svelte';
|
|
|
9
9
|
export { default as NumberBox } from './forms/number-box/number-box.svelte';
|
|
10
10
|
export { default as MoneyBox } from './forms/money-box/money-box.svelte';
|
|
11
11
|
export { default as RadioGroup } from './forms/radio-group/radio-group.svelte';
|
|
12
|
+
export { default as RadioBox } from './forms/radio-group/radio-box.svelte';
|
|
12
13
|
export { default as TextArea } from './forms/text-area/text-area.svelte';
|
|
13
14
|
export { default as TextBox } from './forms/text-box/text-box.svelte';
|
|
14
15
|
export { default as FormField } from './forms/form-field.svelte';
|
package/dist/index.js
CHANGED
|
@@ -10,6 +10,7 @@ export { default as FileArea } from './forms/file-area/file-area.svelte';
|
|
|
10
10
|
export { default as NumberBox } from './forms/number-box/number-box.svelte';
|
|
11
11
|
export { default as MoneyBox } from './forms/money-box/money-box.svelte';
|
|
12
12
|
export { default as RadioGroup } from './forms/radio-group/radio-group.svelte';
|
|
13
|
+
export { default as RadioBox } from './forms/radio-group/radio-box.svelte';
|
|
13
14
|
export { default as TextArea } from './forms/text-area/text-area.svelte';
|
|
14
15
|
export { default as TextBox } from './forms/text-box/text-box.svelte';
|
|
15
16
|
export { default as FormField } from './forms/form-field.svelte';
|
|
@@ -17,26 +17,28 @@ const captureClick = (e) => {
|
|
|
17
17
|
background-color: #fff;
|
|
18
18
|
border-radius: 1rem;
|
|
19
19
|
box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
|
|
20
|
-
width: 20rem;
|
|
21
|
-
max-width: 70%;
|
|
22
20
|
z-index: 9999;
|
|
23
21
|
font-family: var(--base-font-family, sans-serif);
|
|
24
22
|
}
|
|
25
23
|
div.sm {
|
|
26
|
-
width: 15rem;
|
|
27
|
-
max-width: 50%;
|
|
28
|
-
}
|
|
29
|
-
div.lg {
|
|
30
24
|
width: 25rem;
|
|
31
25
|
max-width: 80%;
|
|
32
26
|
}
|
|
33
|
-
div.
|
|
34
|
-
width:
|
|
27
|
+
div.md {
|
|
28
|
+
width: 35rem;
|
|
29
|
+
max-width: 85%;
|
|
30
|
+
}
|
|
31
|
+
div.lg {
|
|
32
|
+
width: 50rem;
|
|
35
33
|
max-width: 90%;
|
|
36
34
|
}
|
|
35
|
+
div.xl {
|
|
36
|
+
width: 65rem;
|
|
37
|
+
max-width: 95%;
|
|
38
|
+
}
|
|
37
39
|
div.full {
|
|
38
|
-
width:
|
|
39
|
-
max-width:
|
|
40
|
+
width: 98%;
|
|
41
|
+
max-width: 98%;
|
|
40
42
|
}
|
|
41
43
|
|
|
42
44
|
@media (max-width: 640px) {
|
|
@@ -2,7 +2,7 @@ import { SvelteComponent } from "svelte";
|
|
|
2
2
|
declare const __propDef: {
|
|
3
3
|
props: {
|
|
4
4
|
align?: "center" | "end" | "start" | "left" | "right" | undefined;
|
|
5
|
-
spacing?: "none" | "
|
|
5
|
+
spacing?: "none" | "tight" | "loose" | "space-evenly" | "space-around" | "space-between" | "medium" | undefined;
|
|
6
6
|
};
|
|
7
7
|
events: {
|
|
8
8
|
[evt: string]: CustomEvent<any>;
|