elementari
Advanced tools
Comparing version 0.1.4 to 0.1.5
@@ -14,2 +14,3 @@ import { SvelteComponentTyped } from "svelte"; | ||
orientation?: "horizontal" | "vertical" | undefined; | ||
precision?: number | undefined; | ||
}; | ||
@@ -16,0 +17,0 @@ events: { |
@@ -17,2 +17,3 @@ import { SvelteComponentTyped } from "svelte"; | ||
text_color?: string | null | undefined; | ||
precision?: number | undefined; | ||
}; | ||
@@ -19,0 +20,0 @@ slots: {}; |
@@ -0,1 +1,3 @@ | ||
import { get } from 'svelte/store'; | ||
import { precision_store } from './stores'; | ||
// TODO add labels and units for all elemental properties | ||
@@ -35,3 +37,3 @@ export const property_labels = { | ||
})); | ||
export const pretty_num = (num, precision = 2) => { | ||
export const pretty_num = (num, precision = get(precision_store)) => { | ||
if (num === null) | ||
@@ -38,0 +40,0 @@ return ``; |
@@ -10,2 +10,3 @@ import { SvelteComponentTyped } from "svelte"; | ||
text_color_threshold?: number | undefined; | ||
precision?: number | undefined; | ||
} | undefined; | ||
@@ -12,0 +13,0 @@ show_photo?: boolean | undefined; |
@@ -6,10 +6,5 @@ import type { ChemicalElement } from '.'; | ||
export declare const heatmap_key: import("svelte/store").Writable<keyof ChemicalElement | null>; | ||
export declare const show_icons: { | ||
subscribe: (this: void, run: import("svelte/store").Subscriber<boolean>, invalidate?: ((value?: boolean | undefined) => void) | undefined) => import("svelte/store").Unsubscriber; | ||
set: (val: boolean) => void; | ||
}; | ||
export declare const show_icons: any; | ||
export declare const default_category_colors: Record<string, string>; | ||
export declare const category_colors: { | ||
subscribe: (this: void, run: import("svelte/store").Subscriber<Record<string, string>>, invalidate?: ((value?: Record<string, string> | undefined) => void) | undefined) => import("svelte/store").Unsubscriber; | ||
set: (val: Record<string, string>) => void; | ||
}; | ||
export declare const category_colors: any; | ||
export declare const precision_store: any; |
@@ -0,1 +1,2 @@ | ||
import { session_store } from 'svelte-zoo/stores'; | ||
import { writable } from 'svelte/store'; | ||
@@ -10,17 +11,2 @@ export const active_category = writable(null); | ||
export const heatmap_key = writable(null); | ||
function session_store(name, initialValue) { | ||
if (typeof sessionStorage !== `undefined` && sessionStorage[name]) { | ||
initialValue = JSON.parse(sessionStorage[name]); | ||
} | ||
const { subscribe, set } = writable(initialValue); | ||
return { | ||
subscribe, | ||
set: (val) => { | ||
if (val !== undefined && typeof sessionStorage !== `undefined`) { | ||
sessionStorage[name] = JSON.stringify(val); | ||
} | ||
set(val); | ||
}, | ||
}; | ||
} | ||
export const show_icons = session_store(`show-icons`, true); | ||
@@ -43,1 +29,2 @@ // color values have to be in hex format as that's the only format | ||
export const category_colors = session_store(`category-colors`, { ...default_category_colors }); | ||
export const precision_store = session_store(`elementari-precision`, 2); |
@@ -8,3 +8,3 @@ { | ||
"license": "MIT", | ||
"version": "0.1.4", | ||
"version": "0.1.5", | ||
"type": "module", | ||
@@ -36,3 +36,3 @@ "svelte": "./dist/index.js", | ||
"svelte": "^3.57.0", | ||
"svelte-multiselect": "^8.5.0" | ||
"svelte-multiselect": "^8.6.0" | ||
}, | ||
@@ -39,0 +39,0 @@ "devDependencies": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
0
319569
8404
Updatedsvelte-multiselect@^8.6.0