UNPKG

@itwin/presentation-components

Version:

React components based on iTwin.js Presentation library

26 lines 2.62 kB
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; /*--------------------------------------------------------------------------------------------- * Copyright (c) Bentley Systems, Incorporated. All rights reserved. * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ /** @packageDocumentation * @module InstancesFilter */ import "./PresentationInstanceFilterProperty.scss"; import { Badge, Text, Tooltip } from "@itwin/itwinui-react"; import { translate } from "../common/Utils.js"; /** * Component for rendering property in [FilterBuilder]($components-react) property selector. Property category and * class info is rendered in addition to property label. * @internal */ export function PresentationInstanceFilterProperty(props) { const { propertyDescription, categoryLabel, fullClassName } = props; return (_jsxs("div", { className: "property-item-line", children: [_jsx(Text, { className: "property-display-label", title: propertyDescription.displayLabel, children: propertyDescription.displayLabel }), _jsx("div", { className: "property-badge-container", children: categoryLabel && (_jsx(Tooltip, { className: "property-item-tooltip", content: _jsx(CategoryTooltipContent, { categoryLabel: categoryLabel, fullClassName: fullClassName }), placement: "bottom", style: { textAlign: "left" }, children: _jsx("div", { className: "badge", children: _jsx(Badge, { className: "property-category-badge", backgroundColor: "montecarlo", children: categoryLabel }) }) })) })] })); } function CategoryTooltipContent(props) { const { categoryLabel, fullClassName } = props; const [schemaName, className] = fullClassName.split(":"); return (_jsxs("table", { children: [_jsx("tbody", { children: _jsxs("tr", { children: [_jsx("th", { className: "tooltip-content-header", children: translate("instance-filter-builder.category") }), _jsx("td", { className: "tooltip-content-data", children: categoryLabel })] }) }), _jsx("tbody", { children: _jsxs("tr", { children: [_jsx("th", { className: "tooltip-content-header", children: translate("instance-filter-builder.class") }), _jsx("td", { className: "tooltip-content-data", children: className })] }) }), _jsx("tbody", { children: _jsxs("tr", { children: [_jsx("th", { className: "tooltip-content-header", children: translate("instance-filter-builder.schema") }), _jsx("td", { className: "tooltip-content-data", children: schemaName })] }) })] })); } //# sourceMappingURL=PresentationInstanceFilterProperty.js.map