@sjsf/daisyui-theme
Advanced tools
| <script lang="ts"> | ||
| import { getFormContext, inputAttributes, type ComponentProps } from '@sjsf/form'; | ||
| import { multipleOptions, indexMapper } from '@sjsf/form/options.svelte'; | ||
| import { multipleOptions, idMapper } from '@sjsf/form/options.svelte'; | ||
| import '@sjsf/basic-theme/extra-widgets/checkboxes.svelte'; | ||
@@ -15,3 +15,3 @@ | ||
| const mapped = multipleOptions({ | ||
| mapper: () => indexMapper(options), | ||
| mapper: () => idMapper(options), | ||
| value: () => value, | ||
@@ -30,3 +30,3 @@ update: (v) => (value = v) | ||
| {#each options as option, index (option.id)} | ||
| {#each options as option (option.id)} | ||
| <label class="label cursor-pointer gap-2 justify-start"> | ||
@@ -36,3 +36,3 @@ <input | ||
| bind:group={mapped.value} | ||
| value={index} | ||
| value={option.id} | ||
| {...attributes} | ||
@@ -39,0 +39,0 @@ id={option.id} |
| <script lang="ts"> | ||
| import { getFormContext, selectAttributes, type ComponentProps } from '@sjsf/form'; | ||
| import { indexMapper, multipleOptions } from '@sjsf/form/options.svelte'; | ||
| import { idMapper, multipleOptions } from '@sjsf/form/options.svelte'; | ||
| import '@sjsf/basic-theme/extra-widgets/multi-select.svelte'; | ||
@@ -14,9 +14,7 @@ | ||
| const mapped = $derived( | ||
| multipleOptions({ | ||
| mapper: () => indexMapper(options), | ||
| value: () => value, | ||
| update: (v) => (value = v) | ||
| }) | ||
| ); | ||
| const mapped = multipleOptions({ | ||
| mapper: () => idMapper(options), | ||
| value: () => value, | ||
| update: (v) => (value = v) | ||
| }); | ||
| const ctx = getFormContext(); | ||
@@ -31,4 +29,4 @@ </script> | ||
| > | ||
| {#each options as option, index (option.id)} | ||
| <option value={index} disabled={option.disabled}> | ||
| {#each options as option (option.id)} | ||
| <option value={option.id} disabled={option.disabled}> | ||
| {option.label} | ||
@@ -35,0 +33,0 @@ </option> |
@@ -14,3 +14,3 @@ <script lang="ts" module> | ||
| import { getFormContext, inputAttributes, type ComponentProps } from '@sjsf/form'; | ||
| import { indexMapper, singleOption } from '@sjsf/form/options.svelte'; | ||
| import { idMapper, singleOption } from '@sjsf/form/options.svelte'; | ||
@@ -26,3 +26,3 @@ let { | ||
| const mapped = singleOption({ | ||
| mapper: () => indexMapper(options), | ||
| mapper: () => idMapper(options), | ||
| value: () => value, | ||
@@ -40,7 +40,7 @@ update: (v) => (value = v) | ||
| <div class="join"> | ||
| {#each options as option, index (option.id)} | ||
| {#each options as option (option.id)} | ||
| <input | ||
| class={['join-item btn', errors.length > 0 && 'btn-error']} | ||
| bind:group={mapped.value} | ||
| value={index} | ||
| value={option.id} | ||
| aria-label={option.label} | ||
@@ -47,0 +47,0 @@ {...attributes} |
| <script lang="ts"> | ||
| import { getFormContext, inputAttributes, type ComponentProps } from '@sjsf/form'; | ||
| import { indexMapper, singleOption } from '@sjsf/form/options.svelte'; | ||
| import { idMapper, singleOption } from '@sjsf/form/options.svelte'; | ||
| import '@sjsf/basic-theme/extra-widgets/radio.svelte'; | ||
@@ -15,3 +15,3 @@ | ||
| const mapped = singleOption({ | ||
| mapper: () => indexMapper(options), | ||
| mapper: () => idMapper(options), | ||
| value: () => value, | ||
@@ -26,3 +26,3 @@ update: (v) => (value = v) | ||
| {#each options as option, index (option.id)} | ||
| {#each options as option (option.id)} | ||
| <label class="label cursor-pointer gap-2"> | ||
@@ -32,3 +32,3 @@ <input | ||
| bind:group={mapped.value} | ||
| value={index} | ||
| value={option.id} | ||
| {...attributes} | ||
@@ -35,0 +35,0 @@ id={option.id} |
| <script lang="ts"> | ||
| import { getFormContext, selectAttributes, type ComponentProps } from '@sjsf/form'; | ||
| import { singleOption, indexMapper } from '@sjsf/form/options.svelte'; | ||
| import { singleOption, idMapper, UNDEFINED_ID } from '@sjsf/form/options.svelte'; | ||
| import '@sjsf/basic-theme/widgets/select.svelte'; | ||
@@ -14,9 +14,7 @@ | ||
| const mapped = $derived( | ||
| singleOption({ | ||
| mapper: () => indexMapper(options), | ||
| value: () => value, | ||
| update: (v) => (value = v) | ||
| }) | ||
| ); | ||
| const mapped = singleOption({ | ||
| mapper: () => idMapper(options), | ||
| value: () => value, | ||
| update: (v) => (value = v) | ||
| }); | ||
@@ -34,6 +32,6 @@ const ctx = getFormContext(); | ||
| {#if config.schema.default === undefined} | ||
| <option value={-1}>{attributes.placeholder}</option> | ||
| <option value={UNDEFINED_ID}>{attributes.placeholder}</option> | ||
| {/if} | ||
| {#each options as option, index (option.id)} | ||
| <option value={index} disabled={option.disabled}> | ||
| {#each options as option (option.id)} | ||
| <option value={option.id} disabled={option.disabled}> | ||
| {option.label} | ||
@@ -40,0 +38,0 @@ </option> |
+8
-8
| { | ||
| "name": "@sjsf/daisyui-theme", | ||
| "version": "3.0.0-next.12", | ||
| "version": "3.0.0", | ||
| "description": "The daisyUI based theme for svelte-jsonschema-form", | ||
@@ -23,3 +23,3 @@ "license": "MIT", | ||
| "url": "git+https://github.com/x0k/svelte-jsonschema-form.git", | ||
| "directory": "packages/daisyui-theme" | ||
| "directory": "legacy/daisyui-theme" | ||
| }, | ||
@@ -55,6 +55,6 @@ "bugs": "https://github.com/x0k/svelte-jsonschema-form/issues", | ||
| "dependencies": { | ||
| "@sjsf/basic-theme": "^3.0.0-next.12" | ||
| "@sjsf/basic-theme": "^3.0.0" | ||
| }, | ||
| "peerDependencies": { | ||
| "@sjsf/form": "^3.0.0-next.12", | ||
| "@sjsf/form": "^3.0.0", | ||
| "daisyui": "^4.12.0", | ||
@@ -66,8 +66,8 @@ "svelte": "^5.33.0" | ||
| "daisyui": "^4.12.24", | ||
| "globals": "16.4.0", | ||
| "globals": "16.5.0", | ||
| "postcss": "^8.5.6", | ||
| "svelte": "^5.42.3", | ||
| "svelte": "^5.43.3", | ||
| "tailwindcss": "^3.4.18", | ||
| "@sjsf/form": "3.0.0-next.12", | ||
| "theme-testing": "1.0.13-next.12" | ||
| "@sjsf/form": "3.0.0", | ||
| "theme-testing": "1.0.13" | ||
| }, | ||
@@ -74,0 +74,0 @@ "svelte": "./dist/index.js", |
Sorry, the diff of this file is too big to display
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
0
-100%103439
-0.23%Updated