MCPcopy Index your code
hub / github.com/FlowiseAI/Flowise / toggle

Function toggle

packages/ui/src/ui-component/picker/WeekDaysPicker.jsx:37–49  ·  view source on GitHub ↗
(dayValue)

Source from the content-addressed store, hash-verified

35 }, [value])
36
37 const toggle = (dayValue) => {
38 if (disabled) return
39 let next
40 if (selected.includes(dayValue)) {
41 next = selected.filter((d) => d !== dayValue)
42 } else {
43 next = [...selected, dayValue]
44 }
45 // Sort by the days array order
46 next.sort((a, b) => days.findIndex((d) => d.value === a) - days.findIndex((d) => d.value === b))
47 setSelected(next)
48 onChange(next.join(','))
49 }
50
51 return (
52 <Box sx={{ mt: 1, display: 'flex', flexWrap: 'wrap', gap: 0.5 }}>

Callers 1

WeekDaysPickerFunction · 0.70

Calls 1

onChangeFunction · 0.50

Tested by

no test coverage detected