UNPKG

@dvcol/neo-svelte

Version:

Neomorphic ui library for svelte 5

14 lines (13 loc) 526 B
export const displayValue = (selection) => { if (Array.isArray(selection)) { if (selection?.length > 2) return `${selection?.length} items selected`; return selection?.map(s => s.item?.label ?? s.item?.value?.toString()).join(', '); } return selection?.item?.label ?? selection?.item?.value?.toString(); }; export const transformValue = (selection) => { if (Array.isArray(selection)) return selection?.map?.(s => s?.item?.value) ?? []; return selection?.item?.value; };