@itwin/presentation-components
Version:
React components based on iTwin.js Presentation library
29 lines • 3.21 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.PresentationInstanceFilterProperty = PresentationInstanceFilterProperty;
const jsx_runtime_1 = require("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
*/
require("./PresentationInstanceFilterProperty.scss");
const itwinui_react_1 = require("@itwin/itwinui-react");
const Utils_js_1 = require("../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
*/
function PresentationInstanceFilterProperty(props) {
const { propertyDescription, categoryLabel, fullClassName } = props;
return ((0, jsx_runtime_1.jsxs)("div", { className: "property-item-line", children: [(0, jsx_runtime_1.jsx)(itwinui_react_1.Text, { className: "property-display-label", title: propertyDescription.displayLabel, children: propertyDescription.displayLabel }), (0, jsx_runtime_1.jsx)("div", { className: "property-badge-container", children: categoryLabel && ((0, jsx_runtime_1.jsx)(itwinui_react_1.Tooltip, { className: "property-item-tooltip", content: (0, jsx_runtime_1.jsx)(CategoryTooltipContent, { categoryLabel: categoryLabel, fullClassName: fullClassName }), placement: "bottom", style: { textAlign: "left" }, children: (0, jsx_runtime_1.jsx)("div", { className: "badge", children: (0, jsx_runtime_1.jsx)(itwinui_react_1.Badge, { className: "property-category-badge", backgroundColor: "montecarlo", children: categoryLabel }) }) })) })] }));
}
function CategoryTooltipContent(props) {
const { categoryLabel, fullClassName } = props;
const [schemaName, className] = fullClassName.split(":");
return ((0, jsx_runtime_1.jsxs)("table", { children: [(0, jsx_runtime_1.jsx)("tbody", { children: (0, jsx_runtime_1.jsxs)("tr", { children: [(0, jsx_runtime_1.jsx)("th", { className: "tooltip-content-header", children: (0, Utils_js_1.translate)("instance-filter-builder.category") }), (0, jsx_runtime_1.jsx)("td", { className: "tooltip-content-data", children: categoryLabel })] }) }), (0, jsx_runtime_1.jsx)("tbody", { children: (0, jsx_runtime_1.jsxs)("tr", { children: [(0, jsx_runtime_1.jsx)("th", { className: "tooltip-content-header", children: (0, Utils_js_1.translate)("instance-filter-builder.class") }), (0, jsx_runtime_1.jsx)("td", { className: "tooltip-content-data", children: className })] }) }), (0, jsx_runtime_1.jsx)("tbody", { children: (0, jsx_runtime_1.jsxs)("tr", { children: [(0, jsx_runtime_1.jsx)("th", { className: "tooltip-content-header", children: (0, Utils_js_1.translate)("instance-filter-builder.schema") }), (0, jsx_runtime_1.jsx)("td", { className: "tooltip-content-data", children: schemaName })] }) })] }));
}
//# sourceMappingURL=PresentationInstanceFilterProperty.js.map