Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import {
ConfigurableUiManager,
ConfigurableCreateInfo,
WidgetControl,
} from "@bentley/ui-framework";
import { Orientation, GlobalContextMenu, ContextMenuItem, ContextMenuItemProps } from "@bentley/ui-core";
import { PropertyGrid, PropertyGridContextMenuArgs } from "@bentley/ui-components";
import { PresentationPropertyDataProvider, propertyGridWithUnifiedSelection } from "@bentley/presentation-components";
import { Field } from "@bentley/presentation-common";
import { Presentation } from "@bentley/presentation-frontend";
import { IModelApp, IModelConnection } from "@bentley/imodeljs-frontend";
// create a HOC property grid component that supports unified selection
// tslint:disable-next-line:variable-name
const UnifiedSelectionPropertyGrid = propertyGridWithUnifiedSelection(PropertyGrid);
export class UnifiedSelectionPropertyGridWidgetControl extends WidgetControl {
constructor(info: ConfigurableCreateInfo, options: any) {
super(info, options);
if (options && options.iModelConnection && options.rulesetId)
this.reactElement = ;
}
}
interface UnifiedSelectionPropertyGridWidgetProps {
iModelConnection: IModelConnection;
rulesetId: string;
}
export type ContextMenuItemInfo = ContextMenuItemProps & React.Attributes & { label: string };
*--------------------------------------------------------------------------------------------*/
import * as React from "react";
import { IModelApp, IModelConnection, PropertyRecord } from "@bentley/imodeljs-frontend";
import {
PresentationPropertyDataProvider, propertyGridWithUnifiedSelection,
IPresentationPropertyDataProvider,
} from "@bentley/presentation-components";
import { Field } from "@bentley/presentation-common";
import { GlobalContextMenu, ContextMenuItem, ContextMenuItemProps } from "@bentley/ui-core";
import { PropertyGrid, PropertyData, PropertyCategory, PropertyGridContextMenuArgs } from "@bentley/ui-components";
import { Presentation } from "@bentley/presentation-frontend";
import "./PropertiesWidget.css";
// tslint:disable-next-line:variable-name naming-convention
const SamplePropertyGrid = propertyGridWithUnifiedSelection(PropertyGrid);
export interface Props {
imodel: IModelConnection;
rulesetId: string;
onFindSimilar?: (propertiesProvider: IPresentationPropertyDataProvider, record: PropertyRecord) => void;
}
type ContextMenuItemInfo = ContextMenuItemProps & React.Attributes & { label: string };
export interface State {
dataProvider: PresentationPropertyDataProvider;
contextMenu?: PropertyGridContextMenuArgs;
contextMenuItemInfos?: ContextMenuItemInfo[];
}
export default class PropertiesWidget extends React.Component {
constructor(props: Props, context?: any) {
* Copyright (c) 2019 Bentley Systems, Incorporated. All rights reserved.
* Licensed under the MIT License. See LICENSE.md in the project root for license terms.
*--------------------------------------------------------------------------------------------*/
import * as React from "react";
import { IModelApp, IModelConnection } from "@bentley/imodeljs-frontend";
import { Orientation } from "@bentley/ui-core";
import { PropertyGrid } from "@bentley/ui-components";
import {
IPresentationPropertyDataProvider,
PresentationPropertyDataProvider,
propertyGridWithUnifiedSelection,
} from "@bentley/presentation-components";
// create a HOC property grid component that supports unified selection
// tslint:disable-next-line:variable-name
const SimplePropertyGrid = propertyGridWithUnifiedSelection(PropertyGrid);
/** React properties for the property pane component, that accepts an iModel connection with ruleset id */
export interface IModelConnectionProps {
/** iModel whose contents should be displayed in the property pane */
imodel: IModelConnection;
/** ID of the presentation rule set to use for creating the hierarchy in the property pane */
rulesetId: string;
}
/** React properties for the property pane component, that accepts a data provider */
export interface DataProviderProps {
/** Custom property pane data provider. */
dataProvider: IPresentationPropertyDataProvider;
}
/** React properties for the property pane component */