Files
react-native-devtools-frontend/front_end/component_docs/layout_pane/basic.ts
T
Tim van der Lippe 868a2f738a Use top level await in component_docs
This cleans up the promise chaining and removes the need for nesting
the implementation in a separate function.

R=jacktfranklin@chromium.org

Change-Id: I76f1fcd7443a7673e1166cec2d7379543b811cef
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2618259
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
2021-01-08 16:21:37 +00:00

76 lines
1.8 KiB
TypeScript

// Copyright 2020 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import * as ComponentHelpers from '../../component_helpers/component_helpers.js';
import * as Elements from '../../elements/elements.js';
await ComponentHelpers.ComponentServerSetup.setup();
const component = new Elements.LayoutPane.LayoutPane();
document.getElementById('container')?.appendChild(component);
component.data = {
gridElements: [
{
id: 1,
name: 'div',
domId: 'foo',
color: 'blue',
enabled: false,
reveal: (): void => {},
setColor: (): void => {},
toggle: (): void => {},
highlight: (): void => {},
hideHighlight: (): void => {},
},
{
id: 2,
name: 'div',
domClasses: ['for', 'bar', 'some-very-long-class-name-very-very-very-very-very-long'],
enabled: true,
color: 'blue',
reveal: (): void => {},
setColor: (): void => {},
toggle: (): void => {},
highlight: (): void => {},
hideHighlight: (): void => {},
},
],
settings: [
{
name: 'showGridTracks',
type: Elements.LayoutPaneUtils.SettingType.BOOLEAN,
value: false,
title: 'Show grid tracks',
options: [
{
title: 'Show grid tracks',
value: true,
},
{
title: 'Do not show grid tracks',
value: false,
},
],
},
{
name: 'showGridBorders',
type: Elements.LayoutPaneUtils.SettingType.ENUM,
value: 'both',
title: 'Show grid borders',
options: [
{
title: 'Show grid borders',
value: 'both',
},
{
title: 'Do not show grid borders',
value: 'none',
},
],
},
],
};