- {(provided) => (
+ {(provided, snapshot) => (
- t.transitions.create("background"),
+ "&:hover": {
+ background: (t) => t.palette.action.hover,
+ },
+ ...(snapshot.isDragging
+ ? ({
+ ...paper(1),
+ ...acrylic,
+ } as SxProps)
+ : undefined),
}}
>
- {variant === "outlined" ? (
-
- {content(provided.dragHandleProps)}
-
- ) : (
- content(provided.dragHandleProps)
- )}
-
+ {renderEditor?.({
+ value,
+ onValueChange: (e: any) => onChangeItem(id ?? i, e, enabled),
+ handle: sortable && (
+
+
+
+ ),
+ content: (
+
+ {cloneElement(editor, {
+ onDelete: () => onDeleteItem(id ?? i),
+ autoFocus,
+ value,
+ key: id ?? i,
+ onValueChange: (e: any) =>
+ onChangeItem(id ?? i, e, enabled),
+ onChange: (e: any) =>
+ onChangeItem(id ?? i, e.target.value, enabled),
+ ref: (e: HTMLElement | null) => setField(e),
+ })}
+
+ ),
+ extras: (
+
+ {useSwitch && (
+ onChangeItem(id ?? i, value, v)}
+ checked={enabled}
+ />
+ )}
+ {useEditButton && (
+ {
+ if (field?.focus) {
+ field.focus();
+ }
+ }}
+ >
+
+
+ )}
+ {useDelete && (
+ onDeleteItem(id ?? i)}>
+
+
+ )}
+ {getExtras && getExtras(value)}
+
+ ),
+ })}
+
)}
@@ -240,6 +259,7 @@ export default function Editor