sveltacular 0.0.28 → 0.0.29
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-footer.svelte +11 -3
- package/dist/forms/form-header.svelte +9 -3
- package/dist/forms/form-header.svelte.d.ts +4 -2
- package/dist/forms/form-label.svelte +1 -1
- package/dist/forms/form-label.svelte.d.ts +1 -1
- package/dist/forms/form-section.svelte +17 -0
- package/dist/forms/form-section.svelte.d.ts +20 -0
- package/dist/forms/info-box/info-box.svelte +25 -0
- package/dist/forms/info-box/info-box.svelte.d.ts +20 -0
- package/dist/forms/list-box/list-box.svelte +1 -1
- package/dist/generic/panel/panel.svelte +1 -1
- package/dist/generic/panel/panel.svelte.d.ts +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/modals/alert.svelte +6 -1
- package/dist/modals/alert.svelte.d.ts +2 -0
- package/dist/modals/confirm.svelte +2 -2
- package/dist/modals/modal.svelte +6 -1
- package/dist/modals/modal.svelte.d.ts +2 -0
- package/dist/tables/data-grid.svelte +10 -5
- package/dist/tables/data-grid.svelte.d.ts +1 -1
- package/package.json +1 -1
|
@@ -2,6 +2,14 @@
|
|
|
2
2
|
import FlexRow from '../layout/flex-row.svelte';
|
|
3
3
|
</script>
|
|
4
4
|
|
|
5
|
-
<
|
|
6
|
-
<
|
|
7
|
-
|
|
5
|
+
<div>
|
|
6
|
+
<FlexRow layout="stretch">
|
|
7
|
+
<slot />
|
|
8
|
+
</FlexRow>
|
|
9
|
+
</div>
|
|
10
|
+
|
|
11
|
+
<style>
|
|
12
|
+
div {
|
|
13
|
+
margin-top: 1.5rem;
|
|
14
|
+
}
|
|
15
|
+
</style>
|
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
<script>import Headline from "../typography/headline.svelte";
|
|
2
|
-
export let title;
|
|
3
2
|
export let level = 4;
|
|
3
|
+
export let underline = true;
|
|
4
4
|
</script>
|
|
5
5
|
|
|
6
|
-
<div>
|
|
7
|
-
<Headline {level}>
|
|
6
|
+
<div class:underline>
|
|
7
|
+
<Headline {level}>
|
|
8
|
+
<slot />
|
|
9
|
+
</Headline>
|
|
8
10
|
</div>
|
|
9
11
|
|
|
10
12
|
<style>div {
|
|
11
13
|
margin-bottom: 1rem;
|
|
14
|
+
}
|
|
15
|
+
div.underline {
|
|
16
|
+
padding-bottom: 0.5rem;
|
|
17
|
+
border-bottom: solid 1px var(--divider-color, rgba(127, 127, 127, 0.5));
|
|
12
18
|
}</style>
|
|
@@ -2,13 +2,15 @@ import { SvelteComponent } from "svelte";
|
|
|
2
2
|
import type { SectionLevel } from '../types/generic.js';
|
|
3
3
|
declare const __propDef: {
|
|
4
4
|
props: {
|
|
5
|
-
title: string;
|
|
6
5
|
level?: SectionLevel | undefined;
|
|
6
|
+
underline?: boolean | undefined;
|
|
7
7
|
};
|
|
8
8
|
events: {
|
|
9
9
|
[evt: string]: CustomEvent<any>;
|
|
10
10
|
};
|
|
11
|
-
slots: {
|
|
11
|
+
slots: {
|
|
12
|
+
default: {};
|
|
13
|
+
};
|
|
12
14
|
};
|
|
13
15
|
export type FormHeaderProps = typeof __propDef.props;
|
|
14
16
|
export type FormHeaderEvents = typeof __propDef.events;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<script>import FormHeader from "./form-header.svelte";
|
|
2
|
+
export let title = void 0;
|
|
3
|
+
export let level = 4;
|
|
4
|
+
</script>
|
|
5
|
+
|
|
6
|
+
<section>
|
|
7
|
+
{#if title}
|
|
8
|
+
<FormHeader {level}>{title}</FormHeader>
|
|
9
|
+
{/if}
|
|
10
|
+
<slot />
|
|
11
|
+
</section>
|
|
12
|
+
|
|
13
|
+
<style>
|
|
14
|
+
section {
|
|
15
|
+
margin-bottom: 1rem;
|
|
16
|
+
}
|
|
17
|
+
</style>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
2
|
+
import type { SectionLevel } from '../types/generic.js';
|
|
3
|
+
declare const __propDef: {
|
|
4
|
+
props: {
|
|
5
|
+
title?: string | undefined;
|
|
6
|
+
level?: SectionLevel | undefined;
|
|
7
|
+
};
|
|
8
|
+
events: {
|
|
9
|
+
[evt: string]: CustomEvent<any>;
|
|
10
|
+
};
|
|
11
|
+
slots: {
|
|
12
|
+
default: {};
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
export type FormSectionProps = typeof __propDef.props;
|
|
16
|
+
export type FormSectionEvents = typeof __propDef.events;
|
|
17
|
+
export type FormSectionSlots = typeof __propDef.slots;
|
|
18
|
+
export default class FormSection extends SvelteComponent<FormSectionProps, FormSectionEvents, FormSectionSlots> {
|
|
19
|
+
}
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
<script>import FormField from "../form-field.svelte";
|
|
2
|
+
import FormLabel from "../form-label.svelte";
|
|
3
|
+
export let size = "md";
|
|
4
|
+
export let value;
|
|
5
|
+
</script>
|
|
6
|
+
|
|
7
|
+
<FormField {size}>
|
|
8
|
+
{#if $$slots.default}
|
|
9
|
+
<FormLabel><slot /></FormLabel>
|
|
10
|
+
{/if}
|
|
11
|
+
<div class="input">
|
|
12
|
+
{value}
|
|
13
|
+
</div>
|
|
14
|
+
</FormField>
|
|
15
|
+
|
|
16
|
+
<style>
|
|
17
|
+
.input {
|
|
18
|
+
background-color: transparent;
|
|
19
|
+
line-height: 2rem;
|
|
20
|
+
font-size: 1rem;
|
|
21
|
+
width: 100%;
|
|
22
|
+
padding-left: 1rem;
|
|
23
|
+
border-bottom: solid 1px var(--form-input-border, black);
|
|
24
|
+
}
|
|
25
|
+
</style>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
2
|
+
import type { FormFieldSizeOptions } from '../../index.js';
|
|
3
|
+
declare const __propDef: {
|
|
4
|
+
props: {
|
|
5
|
+
size?: FormFieldSizeOptions | undefined;
|
|
6
|
+
value: string;
|
|
7
|
+
};
|
|
8
|
+
events: {
|
|
9
|
+
[evt: string]: CustomEvent<any>;
|
|
10
|
+
};
|
|
11
|
+
slots: {
|
|
12
|
+
default: {};
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
export type InfoBoxProps = typeof __propDef.props;
|
|
16
|
+
export type InfoBoxEvents = typeof __propDef.events;
|
|
17
|
+
export type InfoBoxSlots = typeof __propDef.slots;
|
|
18
|
+
export default class InfoBox extends SvelteComponent<InfoBoxProps, InfoBoxEvents, InfoBoxSlots> {
|
|
19
|
+
}
|
|
20
|
+
export {};
|
|
@@ -113,7 +113,7 @@ triggerSearch();
|
|
|
113
113
|
<button type="button" class="icon" on:click={clickArrow} on:keydown={clickArrow}>
|
|
114
114
|
<AngleUpIcon />
|
|
115
115
|
</button>
|
|
116
|
-
{#if text}
|
|
116
|
+
{#if text && searchable}
|
|
117
117
|
<button type="button" class="clear" on:click={clear} on:keydown={clear}> X </button>
|
|
118
118
|
{/if}
|
|
119
119
|
<div class="dropdown">
|
package/dist/index.d.ts
CHANGED
|
@@ -16,6 +16,8 @@ export { default as FormLabel } from './forms/form-label.svelte';
|
|
|
16
16
|
export { default as Form } from './forms/form.svelte';
|
|
17
17
|
export { default as FormHeader } from './forms/form-header.svelte';
|
|
18
18
|
export { default as FormFooter } from './forms/form-footer.svelte';
|
|
19
|
+
export { default as FormSection } from './forms/form-section.svelte';
|
|
20
|
+
export { default as InfoBox } from './forms/info-box/info-box.svelte';
|
|
19
21
|
export { default as Card } from './generic/card/card.svelte';
|
|
20
22
|
export { default as Divider } from './generic/divider/divider.svelte';
|
|
21
23
|
export { default as Link } from './generic/link/link.svelte';
|
package/dist/index.js
CHANGED
|
@@ -17,6 +17,8 @@ export { default as FormLabel } from './forms/form-label.svelte';
|
|
|
17
17
|
export { default as Form } from './forms/form.svelte';
|
|
18
18
|
export { default as FormHeader } from './forms/form-header.svelte';
|
|
19
19
|
export { default as FormFooter } from './forms/form-footer.svelte';
|
|
20
|
+
export { default as FormSection } from './forms/form-section.svelte';
|
|
21
|
+
export { default as InfoBox } from './forms/info-box/info-box.svelte';
|
|
20
22
|
// Generic
|
|
21
23
|
export { default as Card } from './generic/card/card.svelte';
|
|
22
24
|
export { default as Divider } from './generic/divider/divider.svelte';
|
package/dist/modals/alert.svelte
CHANGED
|
@@ -6,12 +6,17 @@ 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
8
|
import DialogCloseButton from "./dialog-close-button.svelte";
|
|
9
|
+
import { createEventDispatcher } from "svelte";
|
|
10
|
+
const dispatch = createEventDispatcher();
|
|
9
11
|
export let open = false;
|
|
10
12
|
export let title = void 0;
|
|
11
13
|
export let size = "md";
|
|
12
14
|
export let buttonText = "OK";
|
|
13
15
|
export let showCloseButton = true;
|
|
14
|
-
const close = () =>
|
|
16
|
+
const close = () => {
|
|
17
|
+
dispatch("close");
|
|
18
|
+
open = false;
|
|
19
|
+
};
|
|
15
20
|
</script>
|
|
16
21
|
|
|
17
22
|
{#if open}
|
|
@@ -15,12 +15,12 @@ export let noText = "No";
|
|
|
15
15
|
export let showCloseButton = true;
|
|
16
16
|
const dispatch = createEventDispatcher();
|
|
17
17
|
const no = () => {
|
|
18
|
-
open = false;
|
|
19
18
|
dispatch("no");
|
|
19
|
+
open = false;
|
|
20
20
|
};
|
|
21
21
|
const yes = () => {
|
|
22
|
-
open = false;
|
|
23
22
|
dispatch("yes");
|
|
23
|
+
open = false;
|
|
24
24
|
};
|
|
25
25
|
</script>
|
|
26
26
|
|
package/dist/modals/modal.svelte
CHANGED
|
@@ -2,10 +2,15 @@
|
|
|
2
2
|
import Dialog from "./dialog-window.svelte";
|
|
3
3
|
import Overlay from "../generic/overlay.svelte";
|
|
4
4
|
import DialogCloseButton from "./dialog-close-button.svelte";
|
|
5
|
+
import { createEventDispatcher } from "svelte";
|
|
6
|
+
const dispatch = createEventDispatcher();
|
|
5
7
|
export let open = false;
|
|
6
8
|
export let size = "md";
|
|
7
9
|
export let showCloseButton = true;
|
|
8
|
-
const close = () =>
|
|
10
|
+
const close = () => {
|
|
11
|
+
dispatch("close");
|
|
12
|
+
open = false;
|
|
13
|
+
};
|
|
9
14
|
</script>
|
|
10
15
|
|
|
11
16
|
{#if open}
|
|
@@ -8,10 +8,11 @@ import TableHeaderRow from "./table-header-row.svelte";
|
|
|
8
8
|
import TableHeader from "./table-header.svelte";
|
|
9
9
|
import TableRow from "./table-row.svelte";
|
|
10
10
|
import Table from "./table.svelte";
|
|
11
|
+
import Loading from "../placeholders/loading.svelte";
|
|
11
12
|
import Text from "../typography/text.svelte";
|
|
12
13
|
import TableCaption from "./table-caption.svelte";
|
|
13
14
|
export let caption = "";
|
|
14
|
-
export let rows;
|
|
15
|
+
export let rows = void 0;
|
|
15
16
|
export let cols;
|
|
16
17
|
export let pagination = void 0;
|
|
17
18
|
export let editRow = void 0;
|
|
@@ -19,7 +20,7 @@ export let deleteRow = void 0;
|
|
|
19
20
|
const getColType = (col) => {
|
|
20
21
|
if (col.type)
|
|
21
22
|
return col.type;
|
|
22
|
-
if (rows
|
|
23
|
+
if (!rows?.length)
|
|
23
24
|
return "string";
|
|
24
25
|
return typeof rows[0][col.key];
|
|
25
26
|
};
|
|
@@ -44,7 +45,7 @@ $:
|
|
|
44
45
|
$:
|
|
45
46
|
colCount = Math.max(1, cols.filter((col) => !col.hide).length) + (hasActionRow ? 1 : 0);
|
|
46
47
|
$:
|
|
47
|
-
totalPages = pagination ? Math.ceil((pagination.total || rows.length) / pagination.perPage) : 1;
|
|
48
|
+
totalPages = pagination && rows ? Math.ceil((pagination.total || rows.length) / pagination.perPage) : 1;
|
|
48
49
|
</script>
|
|
49
50
|
|
|
50
51
|
<Table>
|
|
@@ -64,11 +65,15 @@ $:
|
|
|
64
65
|
</TableHeaderRow>
|
|
65
66
|
</TableHeader>
|
|
66
67
|
<TableBody>
|
|
67
|
-
{#if rows
|
|
68
|
+
{#if !rows?.length}
|
|
68
69
|
<TableRow>
|
|
69
70
|
<TableCell colspan={colCount}>
|
|
70
71
|
<div class="empty">
|
|
71
|
-
|
|
72
|
+
{#if rows === undefined}
|
|
73
|
+
<Loading />
|
|
74
|
+
{:else}
|
|
75
|
+
<Text>No data</Text>
|
|
76
|
+
{/if}
|
|
72
77
|
</div>
|
|
73
78
|
</TableCell>
|
|
74
79
|
</TableRow>
|
|
@@ -3,7 +3,7 @@ import type { DataCol, DataRow, Pagination } from '../types/data.js';
|
|
|
3
3
|
declare const __propDef: {
|
|
4
4
|
props: {
|
|
5
5
|
caption?: string | undefined;
|
|
6
|
-
rows
|
|
6
|
+
rows?: DataRow[] | undefined;
|
|
7
7
|
cols: DataCol[];
|
|
8
8
|
pagination?: Pagination | undefined;
|
|
9
9
|
editRow?: ((row: DataRow) => unknown) | undefined;
|