Skip to content

Commit

Permalink
added toBoolean to handle abbreviations prop string value
Browse files Browse the repository at this point in the history
  • Loading branch information
kwongz committed Jan 15, 2025
1 parent a8edba2 commit c3ff561
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/afraid-pumpkins-destroy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@evidence-dev/core-components': patch
---

fixed US map abbreviaabbreviations string handling
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,9 @@
{@const data = Query.create(`SELECT * from state_sales`, slowQuery)}
<USMap {data} {...args} state="state" value="sales" />
</Story>

<Story name="No Abb" let:args>
{@const data = Query.create(`SELECT * from state_sales`, query)}
<USMap {data} {...args} state="state" value="sales" abbreviations="false" />
<USMap {data} {...args} state="state" value="sales" abbreviations={false} />
</Story>
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import InvisibleLinks from '../../../atoms/InvisibleLinks.svelte';
import { getThemeStores } from '../../../themes/themes.js';
import { checkDeprecatedColor } from '../../../deprecated-colors.js';
import { toBoolean } from '../../../utils.js';
const { theme, resolveColorPalette, resolveColorScale } = getThemeStores();
Expand Down Expand Up @@ -95,7 +96,7 @@
export let connectGroup = undefined;
export let abbreviations = false;
$: abbreviations = abbreviations === 'true' || abbreviations === true;
$: abbreviations = toBoolean(abbreviations);
let nameProperty = abbreviations ? 'abbrev' : 'name';
Expand Down

0 comments on commit c3ff561

Please sign in to comment.