(
props: {
readonly uniqueId: Id;
readonly title: JSXElement;
readonly editable?: Accessor<boolean>;
readonly handleEditable?: (event: MouseEvent) => void;
} & ChildrenProp &
StoreProp,
)
| 149 | }; |
| 150 | |
| 151 | const Details = ( |
| 152 | props: { |
| 153 | readonly uniqueId: Id; |
| 154 | readonly title: JSXElement; |
| 155 | readonly editable?: Accessor<boolean>; |
| 156 | readonly handleEditable?: (event: MouseEvent) => void; |
| 157 | } & ChildrenProp & |
| 158 | StoreProp, |
| 159 | ) => { |
| 160 | const open = useCell(STATE_TABLE, props.uniqueId, OPEN_CELL, props.s); |
| 161 | const handleToggle = (event: Event & {currentTarget: HTMLDetailsElement}) => |
| 162 | props.s.setCell( |
| 163 | STATE_TABLE, |
| 164 | props.uniqueId, |
| 165 | OPEN_CELL, |
| 166 | event.currentTarget.open, |
| 167 | ); |
| 168 | return ( |
| 169 | <details open={!!open()} onToggle={handleToggle}> |
| 170 | <summary> |
| 171 | <span>{props.title}</span> |
| 172 | {props.handleEditable ? ( |
| 173 | <img |
| 174 | onClick={props.handleEditable} |
| 175 | class={props.editable?.() ? 'done' : 'edit'} |
| 176 | title={props.editable?.() ? 'Done editing' : 'Edit'} |
| 177 | /> |
| 178 | ) : ( |
| 179 | EMPTY_STRING |
| 180 | )} |
| 181 | </summary> |
| 182 | <div>{props.children}</div> |
| 183 | </details> |
| 184 | ); |
| 185 | }; |
| 186 | |
| 187 | const ConfirmableActions = < |
| 188 | Props extends TableProps | RowProps | CellProps | ValuesProps | ValueProps, |
no test coverage detected
searching dependent graphs…