@sjsf/flowbite-theme
Advanced tools
@@ -14,3 +14,3 @@ <script lang="ts" module> | ||
| import { getFormContext, inputAttributes, type ComponentProps } from '@sjsf/form'; | ||
| import { multipleOptions, stringIndexMapper } from '@sjsf/form/options.svelte'; | ||
| import { multipleOptions, idMapper } from '@sjsf/form/options.svelte'; | ||
| import Checkbox from 'flowbite-svelte/Checkbox.svelte'; | ||
@@ -26,3 +26,3 @@ | ||
| const mapped = multipleOptions({ | ||
| mapper: () => stringIndexMapper(options), | ||
| mapper: () => idMapper(options), | ||
| value: () => value, | ||
@@ -33,4 +33,4 @@ update: (v) => (value = v) | ||
| const choices = $derived( | ||
| options.map((option, i) => ({ | ||
| value: String(i), | ||
| options.map((option) => ({ | ||
| value: option.id, | ||
| label: option.label | ||
@@ -37,0 +37,0 @@ })) |
@@ -14,3 +14,3 @@ <script lang="ts" module> | ||
| import { getFormContext, selectAttributes, type ComponentProps } from '@sjsf/form'; | ||
| import { multipleOptions, indexMapper } from '@sjsf/form/options.svelte'; | ||
| import { multipleOptions, idMapper } from '@sjsf/form/options.svelte'; | ||
| import MultiSelect from 'flowbite-svelte/MultiSelect.svelte'; | ||
@@ -27,13 +27,11 @@ | ||
| 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 selectOptions = $derived( | ||
| options.map((option, i) => ({ | ||
| value: i, | ||
| options.map((option) => ({ | ||
| value: option.id, | ||
| name: option.label, | ||
@@ -40,0 +38,0 @@ disabled: option.disabled |
@@ -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'; | ||
| import Radio from 'flowbite-svelte/Radio.svelte'; | ||
@@ -21,3 +21,3 @@ | ||
| const mapped = singleOption({ | ||
| mapper: () => indexMapper(options), | ||
| mapper: () => idMapper(options), | ||
| value: () => value, | ||
@@ -32,6 +32,6 @@ update: (v) => (value = v) | ||
| {#each options as option, index (option.id)} | ||
| {#each options as option (option.id)} | ||
| <Radio | ||
| bind:group={mapped.value} | ||
| value={index} | ||
| value={option.id} | ||
| {...attributes} | ||
@@ -38,0 +38,0 @@ id={option.id} |
@@ -13,3 +13,3 @@ <script lang="ts" module> | ||
| 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 Select from 'flowbite-svelte/Select.svelte'; | ||
@@ -19,9 +19,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) | ||
| }); | ||
@@ -37,6 +35,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} | ||
@@ -43,0 +41,0 @@ </option> |
+7
-7
| { | ||
| "name": "@sjsf/flowbite-theme", | ||
| "version": "3.0.0-next.12", | ||
| "version": "3.0.0", | ||
| "description": "The flowbite based theme for svelte-jsonschema-form", | ||
@@ -23,3 +23,3 @@ "license": "MIT", | ||
| "url": "git+https://github.com/x0k/svelte-jsonschema-form.git", | ||
| "directory": "packages/flowbite-theme" | ||
| "directory": "legacy/flowbite-theme" | ||
| }, | ||
@@ -56,3 +56,3 @@ "bugs": "https://github.com/x0k/svelte-jsonschema-form/issues", | ||
| "peerDependencies": { | ||
| "@sjsf/form": "^3.0.0-next.12", | ||
| "@sjsf/form": "^3.0.0", | ||
| "flowbite": "^2.5.0", | ||
@@ -66,8 +66,8 @@ "flowbite-svelte": "~0.47.0", | ||
| "flowbite-svelte": "~0.47.4", | ||
| "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%175180
-0.04%