@sjsf/skeleton-theme 1.9.2 → 2.0.0-next.1
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/README.md +5 -4
- package/dist/components/button.svelte +20 -0
- package/dist/components/button.svelte.d.ts +9 -0
- package/dist/components/description.svelte +8 -0
- package/dist/components/description.svelte.d.ts +7 -0
- package/dist/components/errors-list.svelte +7 -6
- package/dist/components/errors-list.svelte.d.ts +5 -2
- package/dist/components/exports.d.ts +8 -0
- package/dist/components/exports.js +8 -0
- package/dist/components/form.svelte +18 -0
- package/dist/components/form.svelte.d.ts +9 -0
- package/dist/components/help.svelte +8 -0
- package/dist/components/help.svelte.d.ts +6 -0
- package/dist/components/{layout-component.svelte → layout.svelte} +16 -11
- package/dist/components/layout.svelte.d.ts +7 -0
- package/dist/components/submit-button.svelte +14 -0
- package/dist/components/submit-button.svelte.d.ts +7 -0
- package/dist/components/title.svelte +17 -0
- package/dist/components/title.svelte.d.ts +9 -0
- package/dist/definitions.d.ts +7 -0
- package/dist/definitions.js +8 -0
- package/dist/extra-widgets/checkboxes-include.d.ts +6 -0
- package/dist/extra-widgets/checkboxes-include.js +4 -0
- package/dist/extra-widgets/checkboxes.svelte +37 -0
- package/dist/extra-widgets/checkboxes.svelte.d.ts +4 -0
- package/dist/extra-widgets/date-picker-include.d.ts +6 -0
- package/dist/extra-widgets/date-picker-include.js +4 -0
- package/dist/extra-widgets/date-picker.svelte +12 -0
- package/dist/extra-widgets/date-picker.svelte.d.ts +4 -0
- package/dist/extra-widgets/file-include.d.ts +6 -0
- package/dist/extra-widgets/file-include.js +4 -0
- package/dist/extra-widgets/file.svelte +27 -0
- package/dist/extra-widgets/file.svelte.d.ts +8 -0
- package/dist/extra-widgets/multi-select-include.d.ts +6 -0
- package/dist/extra-widgets/multi-select-include.js +4 -0
- package/dist/extra-widgets/multi-select.svelte +34 -0
- package/dist/extra-widgets/multi-select.svelte.d.ts +4 -0
- package/dist/extra-widgets/radio-include.d.ts +6 -0
- package/dist/extra-widgets/radio-include.js +4 -0
- package/dist/{widgets/radio-widget.svelte → extra-widgets/radio.svelte} +9 -3
- package/dist/extra-widgets/radio.svelte.d.ts +4 -0
- package/dist/extra-widgets/range-include.d.ts +6 -0
- package/dist/extra-widgets/range-include.js +4 -0
- package/dist/extra-widgets/range.svelte +12 -0
- package/dist/extra-widgets/range.svelte.d.ts +4 -0
- package/dist/extra-widgets/textarea-include.d.ts +6 -0
- package/dist/extra-widgets/textarea-include.js +4 -0
- package/dist/extra-widgets/textarea.svelte +14 -0
- package/dist/extra-widgets/textarea.svelte.d.ts +4 -0
- package/dist/index.d.ts +1 -4
- package/dist/index.js +4 -6
- package/dist/preset.d.ts +5 -1
- package/dist/styles.css +1 -1
- package/dist/widgets/checkbox.svelte +15 -0
- package/dist/widgets/checkbox.svelte.d.ts +4 -0
- package/dist/widgets/exports.d.ts +4 -0
- package/dist/widgets/exports.js +4 -0
- package/dist/widgets/number.svelte +18 -0
- package/dist/widgets/number.svelte.d.ts +4 -0
- package/dist/widgets/select.svelte +30 -0
- package/dist/widgets/select.svelte.d.ts +4 -0
- package/dist/widgets/text.svelte +13 -0
- package/dist/widgets/text.svelte.d.ts +4 -0
- package/package.json +38 -24
- package/dist/components/button-component.svelte +0 -19
- package/dist/components/button-component.svelte.d.ts +0 -3
- package/dist/components/description-component.svelte +0 -7
- package/dist/components/description-component.svelte.d.ts +0 -3
- package/dist/components/form-component.svelte +0 -9
- package/dist/components/form-component.svelte.d.ts +0 -3
- package/dist/components/help-component.svelte +0 -7
- package/dist/components/help-component.svelte.d.ts +0 -3
- package/dist/components/index.d.ts +0 -5
- package/dist/components/index.js +0 -17
- package/dist/components/layout-component.svelte.d.ts +0 -3
- package/dist/components/title-component.svelte +0 -16
- package/dist/components/title-component.svelte.d.ts +0 -3
- package/dist/widgets/checkbox-widget.svelte +0 -15
- package/dist/widgets/checkbox-widget.svelte.d.ts +0 -2
- package/dist/widgets/checkboxes-widget.svelte +0 -26
- package/dist/widgets/checkboxes-widget.svelte.d.ts +0 -2
- package/dist/widgets/file-widget.svelte +0 -21
- package/dist/widgets/file-widget.svelte.d.ts +0 -2
- package/dist/widgets/index.d.ts +0 -5
- package/dist/widgets/index.js +0 -20
- package/dist/widgets/number-widget.svelte +0 -14
- package/dist/widgets/number-widget.svelte.d.ts +0 -2
- package/dist/widgets/radio-widget.svelte.d.ts +0 -2
- package/dist/widgets/select-widget.svelte +0 -40
- package/dist/widgets/select-widget.svelte.d.ts +0 -2
- package/dist/widgets/text-widget.svelte +0 -12
- package/dist/widgets/text-widget.svelte.d.ts +0 -2
- package/dist/widgets/textarea-widget.svelte +0 -7
- package/dist/widgets/textarea-widget.svelte.d.ts +0 -2
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import type { FormComponentProps } from '@sjsf/form'
|
|
3
|
-
|
|
4
|
-
let { children, form = $bindable(), onsubmit, attributes }: FormComponentProps = $props();
|
|
5
|
-
</script>
|
|
6
|
-
|
|
7
|
-
<form class="flex flex-col gap-4" {onsubmit} {...attributes} bind:this={form} >
|
|
8
|
-
{@render children?.()}
|
|
9
|
-
</form>
|
package/dist/components/index.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import FormComponent from "./form-component.svelte";
|
|
2
|
-
import ButtonComponent from "./button-component.svelte";
|
|
3
|
-
import LayoutComponent from "./layout-component.svelte";
|
|
4
|
-
import TitleComponent from "./title-component.svelte";
|
|
5
|
-
import DescriptionComponent from "./description-component.svelte";
|
|
6
|
-
import HelpComponent from "./help-component.svelte";
|
|
7
|
-
import ErrorsList from './errors-list.svelte';
|
|
8
|
-
export const registry = {
|
|
9
|
-
form: FormComponent,
|
|
10
|
-
button: ButtonComponent,
|
|
11
|
-
layout: LayoutComponent,
|
|
12
|
-
title: TitleComponent,
|
|
13
|
-
description: DescriptionComponent,
|
|
14
|
-
help: HelpComponent,
|
|
15
|
-
errorsList: ErrorsList
|
|
16
|
-
};
|
|
17
|
-
export const components = (type) => registry[type];
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import type { ComponentProps } from "@sjsf/form";
|
|
3
|
-
|
|
4
|
-
const { title, type, forId, required }: ComponentProps<"title"> = $props();
|
|
5
|
-
</script>
|
|
6
|
-
|
|
7
|
-
{#if type === "field"}
|
|
8
|
-
<label class="label-text" for={forId}>
|
|
9
|
-
{title}
|
|
10
|
-
{#if required}
|
|
11
|
-
<span>*</span>
|
|
12
|
-
{/if}
|
|
13
|
-
</label>
|
|
14
|
-
{:else}
|
|
15
|
-
<div class="font-bold text-2xl">{title}</div>
|
|
16
|
-
{/if}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import type { WidgetProps } from '@sjsf/form';
|
|
3
|
-
|
|
4
|
-
let { config, value = $bindable(), attributes }: WidgetProps<'checkbox'> = $props();
|
|
5
|
-
</script>
|
|
6
|
-
|
|
7
|
-
<label class="flex items-center space-x-2 cursor-pointer">
|
|
8
|
-
<input
|
|
9
|
-
type="checkbox"
|
|
10
|
-
class="checkbox"
|
|
11
|
-
bind:checked={value}
|
|
12
|
-
{...attributes}
|
|
13
|
-
/>
|
|
14
|
-
<p>{config.title}</p>
|
|
15
|
-
</label>
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import { multipleOptions, indexMapper, type WidgetProps } from '@sjsf/form';
|
|
3
|
-
|
|
4
|
-
let { attributes, value = $bindable(), options }: WidgetProps<'checkboxes'> = $props();
|
|
5
|
-
|
|
6
|
-
const mapped = multipleOptions({
|
|
7
|
-
mapper: () => indexMapper(options),
|
|
8
|
-
value: () => value,
|
|
9
|
-
update: (v) => (value = v),
|
|
10
|
-
});
|
|
11
|
-
</script>
|
|
12
|
-
|
|
13
|
-
{#each options as option, index (option.id)}
|
|
14
|
-
<label class="flex items-center space-x-2 cursor-pointer">
|
|
15
|
-
<input
|
|
16
|
-
type="checkbox"
|
|
17
|
-
class="checkbox"
|
|
18
|
-
bind:group={mapped.value}
|
|
19
|
-
value={index}
|
|
20
|
-
{...attributes}
|
|
21
|
-
id={option.id}
|
|
22
|
-
disabled={option.disabled || attributes.disabled}
|
|
23
|
-
/>
|
|
24
|
-
<p>{option.label}</p>
|
|
25
|
-
</label>
|
|
26
|
-
{/each}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import type { WidgetProps } from '@sjsf/form';
|
|
3
|
-
|
|
4
|
-
let {
|
|
5
|
-
attributes,
|
|
6
|
-
multiple,
|
|
7
|
-
loading,
|
|
8
|
-
processing,
|
|
9
|
-
value = $bindable()
|
|
10
|
-
}: WidgetProps<'file'> = $props();
|
|
11
|
-
</script>
|
|
12
|
-
|
|
13
|
-
<input
|
|
14
|
-
type="file"
|
|
15
|
-
bind:files={value}
|
|
16
|
-
{multiple}
|
|
17
|
-
class="input"
|
|
18
|
-
data-loading={loading}
|
|
19
|
-
data-processing={processing}
|
|
20
|
-
{...attributes}
|
|
21
|
-
/>
|
package/dist/widgets/index.d.ts
DELETED
package/dist/widgets/index.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import TextWidget from './text-widget.svelte';
|
|
2
|
-
import TextareaWidget from './textarea-widget.svelte';
|
|
3
|
-
import NumberWidget from './number-widget.svelte';
|
|
4
|
-
import SelectWidget from './select-widget.svelte';
|
|
5
|
-
import CheckBoxWidget from './checkbox-widget.svelte';
|
|
6
|
-
import RadioWidget from './radio-widget.svelte';
|
|
7
|
-
import CheckboxesWidget from './checkboxes-widget.svelte';
|
|
8
|
-
import FileWidget from './file-widget.svelte';
|
|
9
|
-
export const registry = {
|
|
10
|
-
text: TextWidget,
|
|
11
|
-
textarea: TextareaWidget,
|
|
12
|
-
number: NumberWidget,
|
|
13
|
-
select: SelectWidget,
|
|
14
|
-
checkbox: CheckBoxWidget,
|
|
15
|
-
radio: RadioWidget,
|
|
16
|
-
checkboxes: CheckboxesWidget,
|
|
17
|
-
file: FileWidget,
|
|
18
|
-
};
|
|
19
|
-
// @ts-expect-error TODO: improve `widgets` type
|
|
20
|
-
export const widgets = (type) => registry[type];
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import type { WidgetProps } from '@sjsf/form';
|
|
3
|
-
|
|
4
|
-
let { value = $bindable(), attributes }: WidgetProps<'number'> = $props();
|
|
5
|
-
</script>
|
|
6
|
-
|
|
7
|
-
<input
|
|
8
|
-
type="number"
|
|
9
|
-
bind:value
|
|
10
|
-
class={attributes.type === 'range'
|
|
11
|
-
? 'range grow w-0'
|
|
12
|
-
: 'input'}
|
|
13
|
-
{...attributes}
|
|
14
|
-
/>
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import { singleOption, indexMapper, multipleOptions, type WidgetProps } from '@sjsf/form';
|
|
3
|
-
|
|
4
|
-
let {
|
|
5
|
-
attributes,
|
|
6
|
-
value = $bindable(),
|
|
7
|
-
options,
|
|
8
|
-
multiple,
|
|
9
|
-
config
|
|
10
|
-
}: WidgetProps<'select'> = $props();
|
|
11
|
-
|
|
12
|
-
const mapped = $derived(
|
|
13
|
-
(multiple ? multipleOptions : singleOption)({
|
|
14
|
-
mapper: () => indexMapper(options),
|
|
15
|
-
// @ts-expect-error
|
|
16
|
-
value: () => value,
|
|
17
|
-
update: (v) => (value = v)
|
|
18
|
-
})
|
|
19
|
-
);
|
|
20
|
-
</script>
|
|
21
|
-
|
|
22
|
-
{#snippet children()}
|
|
23
|
-
{#if !multiple && config.schema.default === undefined}
|
|
24
|
-
<option value={-1}>{attributes.placeholder}</option>
|
|
25
|
-
{/if}
|
|
26
|
-
{#each options as option, index (option.id)}
|
|
27
|
-
<option value={index} disabled={option.disabled}>
|
|
28
|
-
{option.label}
|
|
29
|
-
</option>
|
|
30
|
-
{/each}
|
|
31
|
-
{/snippet}
|
|
32
|
-
{#if multiple}
|
|
33
|
-
<select class="select" bind:value={mapped.value} multiple {...attributes}>
|
|
34
|
-
{@render children()}
|
|
35
|
-
</select>
|
|
36
|
-
{:else}
|
|
37
|
-
<select class="select" bind:value={mapped.value} {...attributes}>
|
|
38
|
-
{@render children()}
|
|
39
|
-
</select>
|
|
40
|
-
{/if}
|