mirror of
https://github.com/react/react-native-devtools-frontend.git
synced 2026-10-11 14:14:36 +08:00
Bug: chromium:1144106 Change-Id: Id5cbfd901d97013b0de5674ed557830967872e1d Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2612862 Commit-Queue: Jack Franklin <jacktfranklin@chromium.org> Auto-Submit: Jack Franklin <jacktfranklin@chromium.org> Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
31 lines
1.4 KiB
TypeScript
31 lines
1.4 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 EnvironmentHelpers from '../../../test/unittests/front_end/helpers/EnvironmentHelpers.js';
|
|
import * as ComponentHelpers from '../../component_helpers/component_helpers.js';
|
|
import * as Components from '../../ui/components/components.js';
|
|
|
|
EnvironmentHelpers.initializeGlobalVars().then(() => {
|
|
return ComponentHelpers.ComponentServerSetup.setup().then(() => renderComponent());
|
|
});
|
|
|
|
const renderComponent = (): void => {
|
|
const component = new Components.DataGridController.DataGridController();
|
|
|
|
component.data = {
|
|
columns: [
|
|
{id: 'key', title: 'Key', sortable: true, widthWeighting: 1, visible: true, hideable: false},
|
|
{id: 'value', title: 'Value', sortable: true, widthWeighting: 1, visible: true, hideable: true},
|
|
],
|
|
rows: [
|
|
// Each key is the ID of a column, and the value is the value for that column
|
|
{cells: [{columnId: 'key', value: 'Bravo', title: 'Bravo'}, {columnId: 'value', value: 'Letter B'}]},
|
|
{cells: [{columnId: 'key', value: 'Alpha', title: 'Alpha'}, {columnId: 'value', value: 'Letter A'}]},
|
|
{cells: [{columnId: 'key', value: 'Charlie', title: 'Charlie'}, {columnId: 'value', value: 'Letter C'}]},
|
|
],
|
|
};
|
|
|
|
document.getElementById('container')?.appendChild(component);
|
|
};
|