(props: { value: unknown })
| 354 | {'{'} |
| 355 | </span> |
| 356 | |
| 357 | <Show when={expanded()}> |
| 358 | <span |
| 359 | data-tsd-separator={props.keyName ? '' : undefined} |
| 360 | class={styles().tree.expandedLine(Boolean(props.keyName))} |
| 361 | > |
| 362 | <For each={keys}> |
| 363 | {(k) => ( |
| 364 | <> |
| 365 | <JsonValue |
| 366 | value={props.value[k]} |
| 367 | keyName={k} |
| 368 | isLastKey={lastKeyName === k} |
| 369 | copyable={props.copyable} |
| 370 | defaultExpansionDepth={props.defaultExpansionDepth} |
| 371 | depth={props.depth + 1} |
| 372 | collapsePaths={props.collapsePaths} |
| 373 | path={`${props.path}${props.path ? '.' : ''}${k}`} |
| 374 | config={props.config} |
| 375 | /> |
| 376 | </> |
| 377 | )} |
| 378 | </For> |
| 379 | </span> |
| 380 | </Show> |
| 381 | |
| 382 | <Show when={!expanded()}> |
| 383 | <span |
| 384 | data-tsd-syntax="comment" |
| 385 | onClick={(e) => { |
| 386 | e.stopPropagation() |
| 387 | e.stopImmediatePropagation() |
| 388 | setExpanded(!expanded()) |
| 389 | }} |
| 390 | class={clsx(styles().tree.valueKey, styles().tree.collapsible)} |
| 391 | > |
| 392 | {`...`} |
| 393 | </span> |
| 394 | </Show> |
| 395 | |
| 396 | <span data-tsd-syntax="punctuation" class={styles().tree.valueBraces}> |
| 397 | {'}'} |
| 398 | </span> |
| 399 | </span> |
| 400 | ) |
| 401 | } |
| 402 | |
| 403 | type CopyState = 'NoCopy' | 'SuccessCopy' | 'ErrorCopy' |
| 404 | |
| 405 | const CopyButton = (props: { value: unknown }) => { |
| 406 | const styles = createStyles() |
| 407 | const { theme } = createTheme() |
| 408 | const [copyState, setCopyState] = createSignal<CopyState>('NoCopy') |
| 409 | |
| 410 | return ( |
| 411 | <button |
nothing calls this directly
no test coverage detected