+
+
+
+
+
+
+
+
+
+
+ {(mode === 'budget' || mode === 'horizontal') && (
+ <>
+
+
+
+ {JSON.stringify(
+ DashKit.reflowLayout({
+ layout: config.layout.map((entry) => ({...entry})),
+ groups,
+ }),
+ )}
+
+ >
+ )}
+
+
Events: {events}
+
+
+
+ setFocused(item.id)}
+ onItemBlur={() => setFocused(null)}
+ groups={groups}
+ itemsStateAndParams={states}
+ onChange={({config: next, itemsStateAndParams}) => {
+ previous.current = config;
+ lastConfig.current = next;
+ setConfig(next);
+ setStates(itemsStateAndParams);
+ }}
+ onDragStart={(event) =>
+ callbacks.current.push({
+ phase: 'start',
+ group: event.group,
+ ids: event.layout.map(({i}) => i),
+ old: event.oldItem,
+ next: event.newItem,
+ placeholder: event.placeholder,
+ })
+ }
+ onDrag={(event) =>
+ callbacks.current.push({
+ phase: 'move',
+ group: event.group,
+ ids: event.layout.map(({i}) => i),
+ old: event.oldItem,
+ next: event.newItem,
+ placeholder: event.placeholder,
+ })
+ }
+ onDragStop={(event) =>
+ callbacks.current.push({
+ phase: 'stop',
+ group: event.group,
+ ids: event.layout.map(({i}) => i),
+ old: event.oldItem,
+ next: event.newItem,
+ placeholder: event.placeholder,
+ })
+ }
+ onDrop={({itemLayout, newLayout, commit, dragProps}) => {
+ setDrops((count) => count + 1);
+ const next = DashKitGridStack.setItem({
+ config: lastConfig.current,
+ item: {type: dragProps.type, data: {}, layout: itemLayout},
+ options: {updateLayout: newLayout},
+ groups,
+ });
+ setConfig(next);
+ lastConfig.current = next;
+ commit();
+ }}
+ />
+
+
{focused || ''}
+
{JSON.stringify(callbacks.current)}
+
{JSON.stringify(lastConfig.current)}
+
{JSON.stringify(meta)}
+
{drops}
+
+