@sjsf/skeleton-theme 2.0.0-next.7 → 2.0.0-next.9
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 +1 -1
- package/dist/components/button.svelte +3 -1
- package/dist/components/description.svelte +10 -2
- package/dist/components/errors-list.svelte +9 -2
- package/dist/components/form.svelte +1 -0
- package/dist/components/help.svelte +10 -2
- package/dist/components/label.svelte +9 -2
- package/dist/components/layout.svelte +6 -2
- package/dist/components/submit-button.svelte +6 -1
- package/dist/components/title.svelte +4 -1
- package/dist/extra-widgets/checkboxes.svelte +9 -1
- package/dist/extra-widgets/date-picker.svelte +9 -1
- package/dist/extra-widgets/file.svelte +9 -1
- package/dist/extra-widgets/multi-select.svelte +7 -1
- package/dist/extra-widgets/radio.svelte +9 -1
- package/dist/extra-widgets/range.svelte +9 -1
- package/dist/extra-widgets/textarea.svelte +7 -1
- package/dist/index.d.ts +1 -1
- package/dist/specs.d.ts +1 -0
- package/dist/specs.js +1 -0
- package/dist/widgets/checkbox.svelte +9 -1
- package/dist/widgets/number.svelte +9 -1
- package/dist/widgets/select.svelte +9 -1
- package/dist/widgets/text.svelte +9 -1
- package/package.json +18 -18
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
The [skeleton](https://github.com/skeletonlabs/skeleton) v3 (tailwind v3) based theme for [svelte-jsonschema-form](https://github.com/x0k/svelte-jsonschema-form).
|
|
4
4
|
|
|
5
|
-
- [Documentation](https://x0k.github.io/svelte-jsonschema-form/themes/skeleton/)
|
|
5
|
+
- [Documentation](https://x0k.github.io/svelte-jsonschema-form/v2/themes/skeleton/)
|
|
6
6
|
- [Playground](https://x0k.github.io/svelte-jsonschema-form/playground2/)
|
|
7
7
|
|
|
8
8
|
## Installation
|
|
@@ -10,7 +10,9 @@
|
|
|
10
10
|
defineDisabled(ctx, {
|
|
11
11
|
disabled,
|
|
12
12
|
...config.uiOptions?.button,
|
|
13
|
-
...config.uiOptions?.buttons?.[type]
|
|
13
|
+
...config.uiOptions?.buttons?.[type],
|
|
14
|
+
...ctx.extraUiOptions?.('button', config),
|
|
15
|
+
...ctx.extraUiOptions?.('buttons', config)?.[type]
|
|
14
16
|
})
|
|
15
17
|
);
|
|
16
18
|
</script>
|
|
@@ -1,8 +1,16 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import type
|
|
2
|
+
import { getFormContext, type ComponentProps } from '@sjsf/form';
|
|
3
3
|
import '@sjsf/basic-theme/components/description.svelte';
|
|
4
4
|
|
|
5
5
|
const { description, config }: ComponentProps['description'] = $props();
|
|
6
|
+
|
|
7
|
+
const ctx = getFormContext();
|
|
6
8
|
</script>
|
|
7
9
|
|
|
8
|
-
<div
|
|
10
|
+
<div
|
|
11
|
+
class="opacity-60"
|
|
12
|
+
{...config.uiOptions?.descriptionAttributes}
|
|
13
|
+
{...ctx.extraUiOptions?.('descriptionAttributes', config)}
|
|
14
|
+
>
|
|
15
|
+
{description}
|
|
16
|
+
</div>
|
|
@@ -1,11 +1,18 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import type
|
|
2
|
+
import { getFormContext, type ComponentProps } from '@sjsf/form';
|
|
3
3
|
import '@sjsf/basic-theme/components/errors-list.svelte';
|
|
4
4
|
|
|
5
5
|
const { errors, config }: ComponentProps['errorsList'] = $props();
|
|
6
|
+
|
|
7
|
+
const ctx = getFormContext();
|
|
6
8
|
</script>
|
|
7
9
|
|
|
8
|
-
<ui
|
|
10
|
+
<ui
|
|
11
|
+
class="text-error-500"
|
|
12
|
+
data-errors-for={config.id}
|
|
13
|
+
{...config.uiOptions?.errorsList}
|
|
14
|
+
{...ctx.extraUiOptions?.('errorsList', config)}
|
|
15
|
+
>
|
|
9
16
|
{#each errors as err}
|
|
10
17
|
<li>{err.message}</li>
|
|
11
18
|
{/each}
|
|
@@ -1,8 +1,16 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import type
|
|
2
|
+
import { getFormContext, type ComponentProps } from '@sjsf/form';
|
|
3
3
|
import '@sjsf/basic-theme/components/help.svelte';
|
|
4
4
|
|
|
5
5
|
const { help, config }: ComponentProps['help'] = $props();
|
|
6
|
+
|
|
7
|
+
const ctx = getFormContext();
|
|
6
8
|
</script>
|
|
7
9
|
|
|
8
|
-
<div
|
|
10
|
+
<div
|
|
11
|
+
class="opacity-60"
|
|
12
|
+
{...config.uiOptions?.helpAttributes}
|
|
13
|
+
{...ctx.extraUiOptions?.('helpAttributes', config)}
|
|
14
|
+
>
|
|
15
|
+
{help}
|
|
16
|
+
</div>
|
|
@@ -1,11 +1,18 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import type
|
|
2
|
+
import { getFormContext, type ComponentProps } from '@sjsf/form';
|
|
3
3
|
import '@sjsf/basic-theme/components/label.svelte';
|
|
4
4
|
|
|
5
5
|
const { title, config }: ComponentProps['label'] = $props();
|
|
6
|
+
|
|
7
|
+
const ctx = getFormContext();
|
|
6
8
|
</script>
|
|
7
9
|
|
|
8
|
-
<label
|
|
10
|
+
<label
|
|
11
|
+
class="label-text"
|
|
12
|
+
for={config.id}
|
|
13
|
+
{...config.uiOptions?.labelAttributes}
|
|
14
|
+
{...ctx.extraUiOptions?.('labelAttributes', config)}
|
|
15
|
+
>
|
|
9
16
|
{title}
|
|
10
17
|
{#if config.required}
|
|
11
18
|
<span>*</span>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import type
|
|
2
|
+
import { getFormContext, type ComponentProps } from '@sjsf/form';
|
|
3
3
|
import '@sjsf/basic-theme/components/layout.svelte';
|
|
4
4
|
|
|
5
5
|
const { type, children, config }: ComponentProps['layout'] = $props();
|
|
@@ -23,9 +23,13 @@
|
|
|
23
23
|
type === 'object-properties'
|
|
24
24
|
);
|
|
25
25
|
|
|
26
|
+
const ctx = getFormContext();
|
|
27
|
+
|
|
26
28
|
const attributes = $derived({
|
|
27
29
|
...config.uiOptions?.layout,
|
|
28
|
-
...config.uiOptions?.layouts?.[type]
|
|
30
|
+
...config.uiOptions?.layouts?.[type],
|
|
31
|
+
...ctx.extraUiOptions?.('layout', config),
|
|
32
|
+
...ctx.extraUiOptions?.('layouts', config)?.[type]
|
|
29
33
|
});
|
|
30
34
|
</script>
|
|
31
35
|
|
|
@@ -6,7 +6,12 @@
|
|
|
6
6
|
|
|
7
7
|
const ctx = getFormContext();
|
|
8
8
|
|
|
9
|
-
const attributes = $derived(
|
|
9
|
+
const attributes = $derived(
|
|
10
|
+
defineDisabled(ctx, {
|
|
11
|
+
...config.uiOptions?.submitButton,
|
|
12
|
+
...ctx.extraUiOptions?.('submitButton', config)
|
|
13
|
+
})
|
|
14
|
+
);
|
|
10
15
|
</script>
|
|
11
16
|
|
|
12
17
|
<button class="btn preset-filled preset-filled-primary-500 w-full" type="submit" {...attributes}>
|
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import type
|
|
2
|
+
import { getFormContext, type ComponentProps } from '@sjsf/form';
|
|
3
3
|
import '@sjsf/basic-theme/components/title.svelte';
|
|
4
4
|
|
|
5
5
|
const { title, type, config }: ComponentProps['title'] = $props();
|
|
6
|
+
|
|
7
|
+
const ctx = getFormContext();
|
|
6
8
|
</script>
|
|
7
9
|
|
|
8
10
|
<div
|
|
9
11
|
class={type === 'field' ? 'label-text' : 'font-bold text-xl'}
|
|
10
12
|
{...config.uiOptions?.titleAttributes}
|
|
13
|
+
{...ctx.extraUiOptions?.('titleAttributes', config)}
|
|
11
14
|
>
|
|
12
15
|
{title}
|
|
13
16
|
</div>
|
|
@@ -18,7 +18,15 @@
|
|
|
18
18
|
|
|
19
19
|
const ctx = getFormContext();
|
|
20
20
|
|
|
21
|
-
const attributes = $derived(
|
|
21
|
+
const attributes = $derived(
|
|
22
|
+
inputAttributes(
|
|
23
|
+
ctx,
|
|
24
|
+
config,
|
|
25
|
+
handlers,
|
|
26
|
+
config.uiOptions?.checkboxes,
|
|
27
|
+
ctx.extraUiOptions?.('checkbox', config)
|
|
28
|
+
)
|
|
29
|
+
);
|
|
22
30
|
</script>
|
|
23
31
|
|
|
24
32
|
{#each options as option, index (option.id)}
|
|
@@ -6,7 +6,15 @@
|
|
|
6
6
|
|
|
7
7
|
const ctx = getFormContext();
|
|
8
8
|
|
|
9
|
-
const attributes = $derived(
|
|
9
|
+
const attributes = $derived(
|
|
10
|
+
inputAttributes(
|
|
11
|
+
ctx,
|
|
12
|
+
config,
|
|
13
|
+
handlers,
|
|
14
|
+
config.uiOptions?.datePicker,
|
|
15
|
+
ctx.extraUiOptions?.('datePicker', config)
|
|
16
|
+
)
|
|
17
|
+
);
|
|
10
18
|
</script>
|
|
11
19
|
|
|
12
20
|
<input type="date" bind:value class="input" {...attributes} />
|
|
@@ -13,7 +13,15 @@
|
|
|
13
13
|
|
|
14
14
|
const ctx = getFormContext();
|
|
15
15
|
|
|
16
|
-
const attributes = $derived(
|
|
16
|
+
const attributes = $derived(
|
|
17
|
+
inputAttributes(
|
|
18
|
+
ctx,
|
|
19
|
+
config,
|
|
20
|
+
handlers,
|
|
21
|
+
config.uiOptions?.file,
|
|
22
|
+
ctx.extraUiOptions?.('file', config)
|
|
23
|
+
)
|
|
24
|
+
);
|
|
17
25
|
</script>
|
|
18
26
|
|
|
19
27
|
<input
|
|
@@ -13,7 +13,13 @@
|
|
|
13
13
|
const ctx = getFormContext();
|
|
14
14
|
|
|
15
15
|
const attributes = $derived(
|
|
16
|
-
selectAttributes(
|
|
16
|
+
selectAttributes(
|
|
17
|
+
ctx,
|
|
18
|
+
config,
|
|
19
|
+
handlers,
|
|
20
|
+
config.uiOptions?.multiSelect,
|
|
21
|
+
ctx.extraUiOptions?.('multiSelect', config)
|
|
22
|
+
)
|
|
17
23
|
);
|
|
18
24
|
|
|
19
25
|
const mapped = $derived(
|
|
@@ -13,7 +13,15 @@
|
|
|
13
13
|
|
|
14
14
|
const ctx = getFormContext();
|
|
15
15
|
|
|
16
|
-
const attributes = $derived(
|
|
16
|
+
const attributes = $derived(
|
|
17
|
+
inputAttributes(
|
|
18
|
+
ctx,
|
|
19
|
+
config,
|
|
20
|
+
handlers,
|
|
21
|
+
config.uiOptions?.radio,
|
|
22
|
+
ctx.extraUiOptions?.('radio', config)
|
|
23
|
+
)
|
|
24
|
+
);
|
|
17
25
|
</script>
|
|
18
26
|
|
|
19
27
|
{#each options as option, index (option.id)}
|
|
@@ -6,7 +6,15 @@
|
|
|
6
6
|
|
|
7
7
|
const ctx = getFormContext();
|
|
8
8
|
|
|
9
|
-
const attributes = $derived(
|
|
9
|
+
const attributes = $derived(
|
|
10
|
+
inputAttributes(
|
|
11
|
+
ctx,
|
|
12
|
+
config,
|
|
13
|
+
handlers,
|
|
14
|
+
config.uiOptions?.range,
|
|
15
|
+
ctx.extraUiOptions?.('range', config)
|
|
16
|
+
)
|
|
17
|
+
);
|
|
10
18
|
</script>
|
|
11
19
|
|
|
12
20
|
<input
|
|
@@ -7,7 +7,13 @@
|
|
|
7
7
|
const ctx = getFormContext();
|
|
8
8
|
|
|
9
9
|
const attributes = $derived(
|
|
10
|
-
textareaAttributes(
|
|
10
|
+
textareaAttributes(
|
|
11
|
+
ctx,
|
|
12
|
+
config,
|
|
13
|
+
handlers,
|
|
14
|
+
config.uiOptions?.textarea,
|
|
15
|
+
ctx.extraUiOptions?.('textarea', config)
|
|
16
|
+
)
|
|
11
17
|
);
|
|
12
18
|
</script>
|
|
13
19
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const theme: import("@sjsf/form/lib/resolver").Resolver<import("@sjsf/form/lib/resolver").Chain<Record<"stringField" | "numberField" | "integerField" | "booleanField" | "objectField" | "arrayField" | "tupleField" | "nullField" | "oneOfField" | "anyOfField" | "arrayItemField" | "objectPropertyField" | keyof import("@sjsf/form/fields/resolver/definitions").ExtraFields, any>, Record<"form" | "button" | "
|
|
1
|
+
export declare const theme: import("@sjsf/form/lib/resolver").Resolver<import("@sjsf/form/lib/resolver").Chain<Record<"stringField" | "numberField" | "integerField" | "booleanField" | "objectField" | "arrayField" | "tupleField" | "nullField" | "oneOfField" | "anyOfField" | "arrayItemField" | "objectPropertyField" | keyof import("@sjsf/form/fields/resolver/definitions").ExtraFields, any>, Record<"form" | "button" | "title" | "description" | "help" | "submitButton" | "layout" | "errorsList" | "fieldTemplate" | "objectTemplate" | "objectPropertyTemplate" | "arrayTemplate" | "arrayItemTemplate" | "multiFieldTemplate" | "textWidget" | "numberWidget" | "selectWidget" | "checkboxWidget" | "label" | keyof import("./definitions").ExtraWidgets, any>>, import("@sjsf/form/lib/resolver").Chain<typeof import("@sjsf/form/fields/exports") & Pick<import("@sjsf/form").ComponentDefinitions, keyof import("@sjsf/form/fields/resolver/definitions").ExtraFields>, typeof import("@sjsf/form/templates/exports") & typeof import("./components/exports.js") & typeof import("./widgets/exports.js") & Pick<import("@sjsf/form").ComponentDefinitions, keyof import("./definitions").ExtraWidgets>>>;
|
package/dist/specs.d.ts
CHANGED
package/dist/specs.js
CHANGED
|
@@ -13,3 +13,4 @@ export const specs = {
|
|
|
13
13
|
range: [s.number, { 'ui:components': { numberWidget: 'rangeWidget' } }],
|
|
14
14
|
textarea: [s.text, { 'ui:components': { textWidget: 'textareaWidget' } }]
|
|
15
15
|
};
|
|
16
|
+
export const extraWidgets = Object.keys(import.meta.glob('./extra-widgets/*.svelte')).map((widget) => widget.substring(16, widget.length - 7));
|
|
@@ -6,7 +6,15 @@
|
|
|
6
6
|
|
|
7
7
|
const ctx = getFormContext();
|
|
8
8
|
|
|
9
|
-
const attributes = $derived(
|
|
9
|
+
const attributes = $derived(
|
|
10
|
+
inputAttributes(
|
|
11
|
+
ctx,
|
|
12
|
+
config,
|
|
13
|
+
handlers,
|
|
14
|
+
config.uiOptions?.checkbox,
|
|
15
|
+
ctx.extraUiOptions?.('checkbox', config)
|
|
16
|
+
)
|
|
17
|
+
);
|
|
10
18
|
</script>
|
|
11
19
|
|
|
12
20
|
<label class="flex items-center space-x-2 cursor-pointer">
|
|
@@ -6,7 +6,15 @@
|
|
|
6
6
|
|
|
7
7
|
const ctx = getFormContext();
|
|
8
8
|
|
|
9
|
-
const attributes = $derived(
|
|
9
|
+
const attributes = $derived(
|
|
10
|
+
inputAttributes(
|
|
11
|
+
ctx,
|
|
12
|
+
config,
|
|
13
|
+
handlers,
|
|
14
|
+
config.uiOptions?.number,
|
|
15
|
+
ctx.extraUiOptions?.('number', config)
|
|
16
|
+
)
|
|
17
|
+
);
|
|
10
18
|
</script>
|
|
11
19
|
|
|
12
20
|
<input
|
|
@@ -15,7 +15,15 @@
|
|
|
15
15
|
|
|
16
16
|
const ctx = getFormContext();
|
|
17
17
|
|
|
18
|
-
const attributes = $derived(
|
|
18
|
+
const attributes = $derived(
|
|
19
|
+
selectAttributes(
|
|
20
|
+
ctx,
|
|
21
|
+
config,
|
|
22
|
+
handlers,
|
|
23
|
+
config.uiOptions?.select,
|
|
24
|
+
ctx.extraUiOptions?.('select', config)
|
|
25
|
+
)
|
|
26
|
+
);
|
|
19
27
|
</script>
|
|
20
28
|
|
|
21
29
|
<select class="select" bind:value={mapped.value} {...attributes}>
|
package/dist/widgets/text.svelte
CHANGED
|
@@ -6,7 +6,15 @@
|
|
|
6
6
|
|
|
7
7
|
const ctx = getFormContext();
|
|
8
8
|
|
|
9
|
-
const attributes = $derived(
|
|
9
|
+
const attributes = $derived(
|
|
10
|
+
inputAttributes(
|
|
11
|
+
ctx,
|
|
12
|
+
config,
|
|
13
|
+
handlers,
|
|
14
|
+
config.uiOptions?.text,
|
|
15
|
+
ctx.extraUiOptions?.('text', config)
|
|
16
|
+
)
|
|
17
|
+
);
|
|
10
18
|
</script>
|
|
11
19
|
|
|
12
20
|
<input type="text" bind:value class="input" {...attributes} />
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sjsf/skeleton-theme",
|
|
3
|
-
"version": "2.0.0-next.
|
|
3
|
+
"version": "2.0.0-next.9",
|
|
4
4
|
"description": "The skeleton based theme for svelte-jsonschema-form",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"keywords": [
|
|
@@ -52,40 +52,40 @@
|
|
|
52
52
|
}
|
|
53
53
|
},
|
|
54
54
|
"peerDependencies": {
|
|
55
|
-
"@sjsf/form": "^2.0.0-next.
|
|
56
|
-
"@sjsf/basic-theme": "^2.0.0-next.
|
|
55
|
+
"@sjsf/form": "^2.0.0-next.9",
|
|
56
|
+
"@sjsf/basic-theme": "^2.0.0-next.9",
|
|
57
57
|
"@skeletonlabs/skeleton": ">=3.0.0-next.0 <=3.0.0-next.10",
|
|
58
58
|
"@tailwindcss/forms": "^0.5.0",
|
|
59
59
|
"svelte": "^5.25.0"
|
|
60
60
|
},
|
|
61
61
|
"devDependencies": {
|
|
62
|
-
"@playwright/test": "^1.51.
|
|
62
|
+
"@playwright/test": "^1.51.1",
|
|
63
63
|
"@skeletonlabs/skeleton": "3.0.0-next.10",
|
|
64
64
|
"@sveltejs/adapter-static": "^3.0.8",
|
|
65
|
-
"@sveltejs/kit": "^2.20.
|
|
66
|
-
"@sveltejs/package": "^2.3.
|
|
65
|
+
"@sveltejs/kit": "^2.20.7",
|
|
66
|
+
"@sveltejs/package": "^2.3.11",
|
|
67
67
|
"@sveltejs/vite-plugin-svelte": "^5.0.3",
|
|
68
68
|
"@tailwindcss/forms": "^0.5.10",
|
|
69
69
|
"@types/eslint": "^9.6.1",
|
|
70
70
|
"ajv": "^8.17.1",
|
|
71
71
|
"autoprefixer": "^10.4.21",
|
|
72
|
-
"eslint": "^9.
|
|
73
|
-
"eslint-config-prettier": "^10.1.
|
|
74
|
-
"eslint-plugin-svelte": "^3.
|
|
72
|
+
"eslint": "^9.24.0",
|
|
73
|
+
"eslint-config-prettier": "^10.1.2",
|
|
74
|
+
"eslint-plugin-svelte": "^3.5.1",
|
|
75
75
|
"globals": "^16.0.0",
|
|
76
76
|
"postcss": "^8.5.3",
|
|
77
77
|
"prettier": "^3.5.3",
|
|
78
78
|
"prettier-plugin-svelte": "^3.3.3",
|
|
79
|
-
"svelte": "^5.
|
|
80
|
-
"svelte-check": "^4.1.
|
|
79
|
+
"svelte": "^5.27.3",
|
|
80
|
+
"svelte-check": "^4.1.6",
|
|
81
81
|
"tailwindcss": "^3.4.17",
|
|
82
|
-
"typescript-eslint": "^8.
|
|
83
|
-
"vite": "6.
|
|
84
|
-
"vitest": "3.
|
|
85
|
-
"@sjsf/ajv8-validator": "2.0.0-next.
|
|
86
|
-
"@sjsf/basic-theme": "2.0.0-next.
|
|
87
|
-
"@sjsf/form": "2.0.0-next.
|
|
88
|
-
"testing": "0.1.0-next.
|
|
82
|
+
"typescript-eslint": "^8.30.1",
|
|
83
|
+
"vite": "6.3.2",
|
|
84
|
+
"vitest": "3.1.1",
|
|
85
|
+
"@sjsf/ajv8-validator": "2.0.0-next.9",
|
|
86
|
+
"@sjsf/basic-theme": "2.0.0-next.9",
|
|
87
|
+
"@sjsf/form": "2.0.0-next.9",
|
|
88
|
+
"testing": "0.1.0-next.9"
|
|
89
89
|
},
|
|
90
90
|
"svelte": "./dist/index.js",
|
|
91
91
|
"types": "./dist/index.d.ts",
|