@itwin/components-react 4.0.0 → 4.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -1
- package/lib/cjs/components-react/common/DelayedSpinner.js +2 -3
- package/lib/cjs/components-react/common/DelayedSpinner.js.map +1 -1
- package/lib/cjs/components-react/common/UseDebouncedAsyncValue.js +1 -2
- package/lib/cjs/components-react/common/UseDebouncedAsyncValue.js.map +1 -1
- package/lib/cjs/components-react/converters/NumericTypeConverter.js +2 -4
- package/lib/cjs/components-react/converters/NumericTypeConverter.js.map +1 -1
- package/lib/cjs/components-react/converters/TypeConverter.js +1 -2
- package/lib/cjs/components-react/converters/TypeConverter.js.map +1 -1
- package/lib/cjs/components-react/editors/CustomNumberEditor.js +2 -4
- package/lib/cjs/components-react/editors/CustomNumberEditor.js.map +1 -1
- package/lib/cjs/components-react/editors/DateTimeEditor.js +2 -3
- package/lib/cjs/components-react/editors/DateTimeEditor.js.map +1 -1
- package/lib/cjs/components-react/editors/PopupButton.js +3 -4
- package/lib/cjs/components-react/editors/PopupButton.js.map +1 -1
- package/lib/cjs/components-react/editors/TextEditor.js +2 -4
- package/lib/cjs/components-react/editors/TextEditor.js.map +1 -1
- package/lib/cjs/components-react/favorite/FavoritePropertyList.js +2 -3
- package/lib/cjs/components-react/favorite/FavoritePropertyList.js.map +1 -1
- package/lib/cjs/components-react/filter-builder/FilterBuilderRuleOperator.js +1 -2
- package/lib/cjs/components-react/filter-builder/FilterBuilderRuleOperator.js.map +1 -1
- package/lib/cjs/components-react/filter-builder/FilterBuilderRuleProperty.js +3 -3
- package/lib/cjs/components-react/filter-builder/FilterBuilderRuleProperty.js.map +1 -1
- package/lib/cjs/components-react/filter-builder/FilterBuilderRuleValue.js +1 -1
- package/lib/cjs/components-react/filter-builder/FilterBuilderRuleValue.js.map +1 -1
- package/lib/cjs/components-react/properties/renderers/CommonPropertyRenderer.js +3 -4
- package/lib/cjs/components-react/properties/renderers/CommonPropertyRenderer.js.map +1 -1
- package/lib/cjs/components-react/properties/renderers/NonPrimitivePropertyRenderer.js +1 -1
- package/lib/cjs/components-react/properties/renderers/NonPrimitivePropertyRenderer.js.map +1 -1
- package/lib/cjs/components-react/properties/renderers/PrimitivePropertyRenderer.js +2 -3
- package/lib/cjs/components-react/properties/renderers/PrimitivePropertyRenderer.js.map +1 -1
- package/lib/cjs/components-react/properties/renderers/label/PropertyLabelRenderer.js +1 -2
- package/lib/cjs/components-react/properties/renderers/label/PropertyLabelRenderer.js.map +1 -1
- package/lib/cjs/components-react/properties/renderers/value/DoublePropertyValueRenderer.js +1 -2
- package/lib/cjs/components-react/properties/renderers/value/DoublePropertyValueRenderer.js.map +1 -1
- package/lib/cjs/components-react/properties/renderers/value/MultilineTextPropertyValueRenderer.js +3 -6
- package/lib/cjs/components-react/properties/renderers/value/MultilineTextPropertyValueRenderer.js.map +1 -1
- package/lib/cjs/components-react/properties/renderers/value/NavigationPropertyValueRenderer.js +1 -2
- package/lib/cjs/components-react/properties/renderers/value/NavigationPropertyValueRenderer.js.map +1 -1
- package/lib/cjs/components-react/properties/renderers/value/PrimitivePropertyValueRenderer.js +4 -7
- package/lib/cjs/components-react/properties/renderers/value/PrimitivePropertyValueRenderer.js.map +1 -1
- package/lib/cjs/components-react/propertygrid/PropertyCategoryRendererManager.js +1 -2
- package/lib/cjs/components-react/propertygrid/PropertyCategoryRendererManager.js.map +1 -1
- package/lib/cjs/components-react/propertygrid/component/PropertyCategoryBlock.js +1 -2
- package/lib/cjs/components-react/propertygrid/component/PropertyCategoryBlock.js.map +1 -1
- package/lib/cjs/components-react/propertygrid/component/PropertyGridCommons.js +2 -2
- package/lib/cjs/components-react/propertygrid/component/PropertyGridCommons.js.map +1 -1
- package/lib/cjs/components-react/propertygrid/component/VirtualizedPropertyGrid.js +46 -51
- package/lib/cjs/components-react/propertygrid/component/VirtualizedPropertyGrid.js.map +1 -1
- package/lib/cjs/components-react/propertygrid/dataproviders/FilteringDataProvider.js +11 -13
- package/lib/cjs/components-react/propertygrid/dataproviders/FilteringDataProvider.js.map +1 -1
- package/lib/cjs/components-react/propertygrid/dataproviders/filterers/CompositePropertyDataFilterer.js +2 -2
- package/lib/cjs/components-react/propertygrid/dataproviders/filterers/CompositePropertyDataFilterer.js.map +1 -1
- package/lib/cjs/components-react/propertygrid/dataproviders/filterers/DisplayValuePropertyDataFilterer.js +1 -2
- package/lib/cjs/components-react/propertygrid/dataproviders/filterers/DisplayValuePropertyDataFilterer.js.map +1 -1
- package/lib/cjs/components-react/propertygrid/internal/flat-items/MutableCustomGridCategory.js +1 -2
- package/lib/cjs/components-react/propertygrid/internal/flat-items/MutableCustomGridCategory.js.map +1 -1
- package/lib/cjs/components-react/propertygrid/internal/flat-items/MutableFlatGridItem.js +2 -2
- package/lib/cjs/components-react/propertygrid/internal/flat-items/MutableFlatGridItem.js.map +1 -1
- package/lib/cjs/components-react/propertygrid/internal/flat-items/MutableGridCategory.js +2 -3
- package/lib/cjs/components-react/propertygrid/internal/flat-items/MutableGridCategory.js.map +1 -1
- package/lib/cjs/components-react/propertygrid/internal/flat-items/MutableGridItemFactory.js +1 -1
- package/lib/cjs/components-react/propertygrid/internal/flat-items/MutableGridItemFactory.js.map +1 -1
- package/lib/cjs/components-react/propertygrid/internal/flat-properties/FlatNonPrimitivePropertyRenderer.js +1 -1
- package/lib/cjs/components-react/propertygrid/internal/flat-properties/FlatNonPrimitivePropertyRenderer.js.map +1 -1
- package/lib/cjs/components-react/propertygrid/internal/flat-properties/FlatPropertyRenderer.js +5 -7
- package/lib/cjs/components-react/propertygrid/internal/flat-properties/FlatPropertyRenderer.js.map +1 -1
- package/lib/cjs/components-react/selectable-content/SelectableContent.js +2 -3
- package/lib/cjs/components-react/selectable-content/SelectableContent.js.map +1 -1
- package/lib/cjs/components-react/toolbar/ToolbarWithOverflow.d.ts.map +1 -1
- package/lib/cjs/components-react/toolbar/ToolbarWithOverflow.js +8 -4
- package/lib/cjs/components-react/toolbar/ToolbarWithOverflow.js.map +1 -1
- package/lib/cjs/components-react/toolbar/groupPanel/tool/Tool.d.ts.map +1 -1
- package/lib/cjs/components-react/toolbar/groupPanel/tool/Tool.js +3 -1
- package/lib/cjs/components-react/toolbar/groupPanel/tool/Tool.js.map +1 -1
- package/lib/cjs/components-react/tree/controlled/TreeModel.js +4 -7
- package/lib/cjs/components-react/tree/controlled/TreeModel.js.map +1 -1
- package/lib/cjs/components-react/tree/controlled/TreeNodeLoader.js +6 -8
- package/lib/cjs/components-react/tree/controlled/TreeNodeLoader.js.map +1 -1
- package/lib/cjs/components-react/tree/controlled/internal/SparseTree.js +1 -2
- package/lib/cjs/components-react/tree/controlled/internal/SparseTree.js.map +1 -1
- package/lib/cjs/components-react/tree/controlled/internal/TreeSelectionManager.js +2 -4
- package/lib/cjs/components-react/tree/controlled/internal/TreeSelectionManager.js.map +1 -1
- package/lib/esm/components-react/common/DelayedSpinner.js +2 -3
- package/lib/esm/components-react/common/DelayedSpinner.js.map +1 -1
- package/lib/esm/components-react/common/UseDebouncedAsyncValue.js +1 -2
- package/lib/esm/components-react/common/UseDebouncedAsyncValue.js.map +1 -1
- package/lib/esm/components-react/converters/NumericTypeConverter.js +2 -4
- package/lib/esm/components-react/converters/NumericTypeConverter.js.map +1 -1
- package/lib/esm/components-react/converters/TypeConverter.js +1 -2
- package/lib/esm/components-react/converters/TypeConverter.js.map +1 -1
- package/lib/esm/components-react/editors/CustomNumberEditor.js +2 -4
- package/lib/esm/components-react/editors/CustomNumberEditor.js.map +1 -1
- package/lib/esm/components-react/editors/DateTimeEditor.js +2 -3
- package/lib/esm/components-react/editors/DateTimeEditor.js.map +1 -1
- package/lib/esm/components-react/editors/PopupButton.js +3 -4
- package/lib/esm/components-react/editors/PopupButton.js.map +1 -1
- package/lib/esm/components-react/editors/TextEditor.js +2 -4
- package/lib/esm/components-react/editors/TextEditor.js.map +1 -1
- package/lib/esm/components-react/favorite/FavoritePropertyList.js +2 -3
- package/lib/esm/components-react/favorite/FavoritePropertyList.js.map +1 -1
- package/lib/esm/components-react/filter-builder/FilterBuilderRuleOperator.js +1 -2
- package/lib/esm/components-react/filter-builder/FilterBuilderRuleOperator.js.map +1 -1
- package/lib/esm/components-react/filter-builder/FilterBuilderRuleProperty.js +3 -3
- package/lib/esm/components-react/filter-builder/FilterBuilderRuleProperty.js.map +1 -1
- package/lib/esm/components-react/filter-builder/FilterBuilderRuleValue.js +1 -1
- package/lib/esm/components-react/filter-builder/FilterBuilderRuleValue.js.map +1 -1
- package/lib/esm/components-react/properties/renderers/CommonPropertyRenderer.js +3 -4
- package/lib/esm/components-react/properties/renderers/CommonPropertyRenderer.js.map +1 -1
- package/lib/esm/components-react/properties/renderers/NonPrimitivePropertyRenderer.js +1 -1
- package/lib/esm/components-react/properties/renderers/NonPrimitivePropertyRenderer.js.map +1 -1
- package/lib/esm/components-react/properties/renderers/PrimitivePropertyRenderer.js +2 -3
- package/lib/esm/components-react/properties/renderers/PrimitivePropertyRenderer.js.map +1 -1
- package/lib/esm/components-react/properties/renderers/label/PropertyLabelRenderer.js +1 -2
- package/lib/esm/components-react/properties/renderers/label/PropertyLabelRenderer.js.map +1 -1
- package/lib/esm/components-react/properties/renderers/value/DoublePropertyValueRenderer.js +1 -2
- package/lib/esm/components-react/properties/renderers/value/DoublePropertyValueRenderer.js.map +1 -1
- package/lib/esm/components-react/properties/renderers/value/MultilineTextPropertyValueRenderer.js +3 -6
- package/lib/esm/components-react/properties/renderers/value/MultilineTextPropertyValueRenderer.js.map +1 -1
- package/lib/esm/components-react/properties/renderers/value/NavigationPropertyValueRenderer.js +1 -2
- package/lib/esm/components-react/properties/renderers/value/NavigationPropertyValueRenderer.js.map +1 -1
- package/lib/esm/components-react/properties/renderers/value/PrimitivePropertyValueRenderer.js +4 -7
- package/lib/esm/components-react/properties/renderers/value/PrimitivePropertyValueRenderer.js.map +1 -1
- package/lib/esm/components-react/propertygrid/PropertyCategoryRendererManager.js +1 -2
- package/lib/esm/components-react/propertygrid/PropertyCategoryRendererManager.js.map +1 -1
- package/lib/esm/components-react/propertygrid/component/PropertyCategoryBlock.js +1 -2
- package/lib/esm/components-react/propertygrid/component/PropertyCategoryBlock.js.map +1 -1
- package/lib/esm/components-react/propertygrid/component/PropertyGridCommons.js +2 -2
- package/lib/esm/components-react/propertygrid/component/PropertyGridCommons.js.map +1 -1
- package/lib/esm/components-react/propertygrid/component/VirtualizedPropertyGrid.js +46 -51
- package/lib/esm/components-react/propertygrid/component/VirtualizedPropertyGrid.js.map +1 -1
- package/lib/esm/components-react/propertygrid/dataproviders/FilteringDataProvider.js +11 -13
- package/lib/esm/components-react/propertygrid/dataproviders/FilteringDataProvider.js.map +1 -1
- package/lib/esm/components-react/propertygrid/dataproviders/filterers/CompositePropertyDataFilterer.js +2 -2
- package/lib/esm/components-react/propertygrid/dataproviders/filterers/CompositePropertyDataFilterer.js.map +1 -1
- package/lib/esm/components-react/propertygrid/dataproviders/filterers/DisplayValuePropertyDataFilterer.js +1 -2
- package/lib/esm/components-react/propertygrid/dataproviders/filterers/DisplayValuePropertyDataFilterer.js.map +1 -1
- package/lib/esm/components-react/propertygrid/internal/flat-items/MutableCustomGridCategory.js +1 -2
- package/lib/esm/components-react/propertygrid/internal/flat-items/MutableCustomGridCategory.js.map +1 -1
- package/lib/esm/components-react/propertygrid/internal/flat-items/MutableFlatGridItem.js +2 -2
- package/lib/esm/components-react/propertygrid/internal/flat-items/MutableFlatGridItem.js.map +1 -1
- package/lib/esm/components-react/propertygrid/internal/flat-items/MutableGridCategory.js +2 -3
- package/lib/esm/components-react/propertygrid/internal/flat-items/MutableGridCategory.js.map +1 -1
- package/lib/esm/components-react/propertygrid/internal/flat-items/MutableGridItemFactory.js +1 -1
- package/lib/esm/components-react/propertygrid/internal/flat-items/MutableGridItemFactory.js.map +1 -1
- package/lib/esm/components-react/propertygrid/internal/flat-properties/FlatNonPrimitivePropertyRenderer.js +1 -1
- package/lib/esm/components-react/propertygrid/internal/flat-properties/FlatNonPrimitivePropertyRenderer.js.map +1 -1
- package/lib/esm/components-react/propertygrid/internal/flat-properties/FlatPropertyRenderer.js +5 -7
- package/lib/esm/components-react/propertygrid/internal/flat-properties/FlatPropertyRenderer.js.map +1 -1
- package/lib/esm/components-react/selectable-content/SelectableContent.js +2 -3
- package/lib/esm/components-react/selectable-content/SelectableContent.js.map +1 -1
- package/lib/esm/components-react/toolbar/ToolbarWithOverflow.d.ts.map +1 -1
- package/lib/esm/components-react/toolbar/ToolbarWithOverflow.js +8 -4
- package/lib/esm/components-react/toolbar/ToolbarWithOverflow.js.map +1 -1
- package/lib/esm/components-react/toolbar/groupPanel/tool/Tool.d.ts.map +1 -1
- package/lib/esm/components-react/toolbar/groupPanel/tool/Tool.js +3 -1
- package/lib/esm/components-react/toolbar/groupPanel/tool/Tool.js.map +1 -1
- package/lib/esm/components-react/tree/controlled/TreeModel.js +4 -7
- package/lib/esm/components-react/tree/controlled/TreeModel.js.map +1 -1
- package/lib/esm/components-react/tree/controlled/TreeNodeLoader.js +6 -8
- package/lib/esm/components-react/tree/controlled/TreeNodeLoader.js.map +1 -1
- package/lib/esm/components-react/tree/controlled/internal/SparseTree.js +1 -2
- package/lib/esm/components-react/tree/controlled/internal/SparseTree.js.map +1 -1
- package/lib/esm/components-react/tree/controlled/internal/TreeSelectionManager.js +2 -4
- package/lib/esm/components-react/tree/controlled/internal/TreeSelectionManager.js.map +1 -1
- package/package.json +5 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CommonPropertyRenderer.js","sourceRoot":"","sources":["../../../../../src/components-react/properties/renderers/CommonPropertyRenderer.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AACzE,OAAO,EAAE,eAAe,EAAE,MAAM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E;YAC1B,YAAY,GAAG,oBAAoB,CAAC,cAAc,CAAC,QAAQ,CAAC,YAAY,CAAC,WAAW,EAAE,EAAE,SAAS,CAAC,eAAe,CAAC,CAAC;SACpH;aAAM;YACL,YAAY,GAAG,CAAC,CAAC;SAClB;QAED,MAAM,gBAAgB,GAAG,CAAC,cAAc,CAAC,QAAQ,CAAC,IAAI,KAAK,YAAY,CAAC,IAAI,CAAC,CAAC,UAAU,GAAG,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,UAAU,GAAG,YAAY,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;QACzJ,MAAM,iBAAiB,GAAG,CAAC,IAAY,EAAE,EAAE,CAAC,CAAC,oBAAC,eAAe,IAAC,IAAI,EAAE,IAAI,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,UAAU,EAAE,SAAS,CAAC,eAAe,GAAI,CAAC,CAAC;QAEzJ,OAAO,iBAAiB,CAAC;IAC3B,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Properties\n */\n\nimport * as React from \"react\";\nimport { PropertyRecord } from \"@itwin/appui-abstract\";\nimport { Orientation } from \"@itwin/core-react\";\nimport { countMatchesInString } from \"../../common/countMatchesInString\";\nimport { HighlightedText } from \"../../common/HighlightedText\";\nimport { HighlightingComponentProps } from \"../../common/HighlightingComponentProps\";\nimport { PropertyContainerType, PropertyValueRendererContext, PropertyValueRendererManager } from \"../ValueRendererManager\";\n\n/**\n * @internal\n */\nexport class CommonPropertyRenderer {\n public static getLabelOffset(indentation?: number, orientation?: Orientation, width?: number, columnRatio?: number, minColumnLabelWidth?: number): number {\n if (!indentation)\n return 0;\n\n const maxIndent = 17;\n const minIndent = 6;\n if (orientation !== Orientation.Horizontal || !width || !columnRatio || !minColumnLabelWidth)\n return indentation * maxIndent;\n\n const currentSize = Math.ceil(width * columnRatio);\n const shrinkThreshold = minColumnLabelWidth + (maxIndent * indentation);\n if (currentSize >= shrinkThreshold)\n return indentation * maxIndent;\n\n const minShrink = minColumnLabelWidth + minIndent + (maxIndent * (indentation - 1));\n if (currentSize <= minShrink)\n return minIndent + this.getLabelOffset(indentation - 1, orientation, width, columnRatio, minColumnLabelWidth);\n\n return currentSize - minColumnLabelWidth;\n }\n\n public static createNewDisplayValue(\n orientation: Orientation,\n propertyRecord: PropertyRecord,\n indentation?: number,\n propertyValueRendererManager?: PropertyValueRendererManager,\n isExpanded?: boolean,\n onExpansionToggled?: () => void,\n onHeightChanged?: (newHeight: number) => void,\n highlight?: HighlightingComponentProps & { applyOnLabel: boolean, applyOnValue: boolean }\n ) {\n const highlightCallback = highlight?.applyOnValue ? (CommonPropertyRenderer.createHighlightCallback(highlight, propertyRecord)) : undefined;\n const rendererContext: PropertyValueRendererContext = {\n orientation,\n containerType: PropertyContainerType.PropertyPane,\n isExpanded,\n onExpansionToggled,\n onHeightChanged,\n textHighlighter: highlightCallback,\n };\n\n let displayValue: React.ReactNode | undefined;\n if (propertyValueRendererManager)\n displayValue = propertyValueRendererManager.render(propertyRecord, rendererContext);\n else\n displayValue = PropertyValueRendererManager.defaultManager.render(propertyRecord, rendererContext);\n\n // Align value with label if orientation is vertical\n if (orientation === Orientation.Vertical)\n displayValue = <span style={{ paddingLeft: CommonPropertyRenderer.getLabelOffset(indentation, orientation) }}>{displayValue}</span>;\n\n return displayValue;\n }\n\n private static createHighlightCallback(highlight: HighlightingComponentProps & { applyOnLabel: boolean }, propertyRecord: PropertyRecord) {\n const activeMatch = highlight.activeHighlight;\n const propertyName = activeMatch?.highlightedItemIdentifier;\n const matchIndex = activeMatch?.highlightIndex ?? 0;\n let labelMatches: number;\n\n if (highlight.applyOnLabel) {\n labelMatches = countMatchesInString(propertyRecord.property.displayLabel.toLowerCase(), highlight.highlightedText);\n } else {\n labelMatches = 0;\n }\n\n const activeMatchIndex = (propertyRecord.property.name === propertyName) && ((matchIndex - labelMatches) >= 0) ? (matchIndex - labelMatches) : undefined;\n const highlightCallback = (text: string) => (<HighlightedText text={text} activeMatchIndex={activeMatchIndex} searchText={highlight.highlightedText} />);\n\n return highlightCallback;\n }\n}\n"]}
|
|
@@ -38,7 +38,7 @@ export class NonPrimitivePropertyRenderer extends React.Component {
|
|
|
38
38
|
getLabel(props, state) {
|
|
39
39
|
const { orientation, indentation, width, columnRatio, columnInfo } = props;
|
|
40
40
|
// istanbul ignore next
|
|
41
|
-
const minLabelWidth = columnInfo
|
|
41
|
+
const minLabelWidth = columnInfo?.minLabelWidth;
|
|
42
42
|
const offset = CommonPropertyRenderer.getLabelOffset(indentation, orientation, width, columnRatio, minLabelWidth);
|
|
43
43
|
let displayLabel = props.propertyRecord.property.displayLabel;
|
|
44
44
|
if (this.props.propertyRecord.value.valueFormat === PropertyValueFormat.Array)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NonPrimitivePropertyRenderer.js","sourceRoot":"","sources":["../../../../../src/components-react/properties/renderers/NonPrimitivePropertyRenderer.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,qCAAqC,CAAC;AAC7C,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5E,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,iCAAiC,EAAE,MAAM,2CAA2C,CAAC;AAE9F,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAkB9C;;GAEG;AACH,MAAM,OAAO,4BAA6B,SAAQ,KAAK,CAAC,SAA+E;IAOrI,YAAY,KAAwC;QAClD,KAAK,CAAC,KAAK,CAAC,CAAC;QAP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CAAC,KAAK,CAAC,qBAAqB,EACvD,0BAA0B,EAAE,IAAI,CAAC,KAAK,CAAC,0BAA0B,EACjE,0BAA0B,EAAE,IAAI,CAAC,KAAK,CAAC,0BAA0B,EACjE,yBAAyB,EAAE,IAAI,CAAC,KAAK,CAAC,yBAAyB,EAC/D,UAAU,EAAE,IAAI,CAAC,KAAK,CAAC,UAAU,GACjC,CACH,CAAC;QACJ,CAAC,CAAC;IAjEF,CAAC;IAUO,QAAQ,CAAC,KAAwC,EAAE,KAAwC;QACjG,MAAM,EAAE,WAAW,EAAE,WAAW,EAAE,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,GAAG,KAAK,CAAC;QAC3E,uBAAuB;QACvB,MAAM,aAAa,GAAG,UAAU,
|
|
1
|
+
{"version":3,"file":"NonPrimitivePropertyRenderer.js","sourceRoot":"","sources":["../../../../../src/components-react/properties/renderers/NonPrimitivePropertyRenderer.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,qCAAqC,CAAC;AAC7C,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5E,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,iCAAiC,EAAE,MAAM,2CAA2C,CAAC;AAE9F,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAkB9C;;GAEG;AACH,MAAM,OAAO,4BAA6B,SAAQ,KAAK,CAAC,SAA+E;IAOrI,YAAY,KAAwC;QAClD,KAAK,CAAC,KAAK,CAAC,CAAC;QAPf,gBAAgB;QACS,UAAK,GAAsC;YAClE,0FAA0F;YAC1F,UAAU,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,aAAa,IAAI,IAAI,CAAC,KAAK,CAAC,cAAc,CAA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AG,CAAC;YAC5C,WAAW,CAAC,IAAI,GAAG,GAAG,WAAW,CAAC,IAAI,IAAI,KAAK,EAAE,CAAC;YAClD,OAAO,IAAI,cAAc,CAAC,IAAI,CAAC,KAAK,EAAE,WAAW,CAAC,CAAC;QACrD,CAAC,CAAC,CAAC;QAEH,OAAO,kBAAkB,CAAC;IAC5B,CAAC;IAyBD,gBAAgB;IACA,MAAM;QACpB,IAAI,KAAK,GAAqB,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,kBAAkB,EAAE,CAAC;QAC7E,IAAI,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,WAAW,KAAK,mBAAmB,CAAC,KAAK;YAC3E,KAAK,GAAG,IAAI,CAAC,0BAA0B,CAAC,KAAK,CAAC,CAAC;QAEjD,MAAM,EAAE,WAAW,EAAE,GAAG,KAAK,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,wDAAwD;QACtG,OAAO,CACL;YACG,IAAI,CAAC,KAAK,CAAC,aAAa;gBACvB,CAAC;oBACD,oBAAC,YAAY,IACX,YAAY,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAC/C,KAAK,GACT;gBACF,CAAC,CAAC,SAAS;YAEZ,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,SAAS,CAC1E,CACJ,CAAC;IACJ,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Properties\n */\n\nimport \"./NonPrimitivePropertyRenderer.scss\";\nimport * as React from \"react\";\nimport { PropertyRecord, PropertyValueFormat } from \"@itwin/appui-abstract\";\nimport { CommonPropertyRenderer } from \"./CommonPropertyRenderer\";\nimport { NonPrimitivePropertyLabelRenderer } from \"./label/NonPrimitivePropertyLabelRenderer\";\nimport { PrimitiveRendererProps } from \"./PrimitivePropertyRenderer\";\nimport { PropertyRenderer } from \"./PropertyRenderer\";\nimport { PropertyView } from \"./PropertyView\";\n\n/** Properties of [[NonPrimitivePropertyRenderer]] React component\n * @public\n */\nexport interface NonPrimitivePropertyRendererProps extends PrimitiveRendererProps {\n /** Can struct/array property be collapsed */\n isCollapsible?: boolean;\n}\n\n/** State of [[NonPrimitivePropertyRenderer]] React component\n * @internal\n */\ninterface NonPrimitivePropertyRendererState {\n /** Is struct/array property expanded */\n isExpanded?: boolean;\n}\n\n/** React Component that renders struct and array properties\n * @public\n */\nexport class NonPrimitivePropertyRenderer extends React.Component<NonPrimitivePropertyRendererProps, NonPrimitivePropertyRendererState> {\n /** @internal */\n public override readonly state: NonPrimitivePropertyRendererState = {\n /** If it's not collapsible, that means it's expanded by default and can't be collapsed */\n isExpanded: !this.props.isCollapsible || this.props.propertyRecord.autoExpand,\n };\n\n constructor(props: NonPrimitivePropertyRendererProps) {\n super(props);\n }\n\n private _onExpanded = () => {\n this.setState({ isExpanded: true });\n };\n\n private _onCollapsed = () => {\n this.setState({ isExpanded: false });\n };\n\n private getLabel(props: NonPrimitivePropertyRendererProps, state: NonPrimitivePropertyRendererState): React.ReactNode {\n const { orientation, indentation, width, columnRatio, columnInfo } = props;\n // istanbul ignore next\n const minLabelWidth = columnInfo?.minLabelWidth;\n const offset = CommonPropertyRenderer.getLabelOffset(indentation, orientation, width, columnRatio, minLabelWidth);\n\n let displayLabel = props.propertyRecord.property.displayLabel;\n if (this.props.propertyRecord.value.valueFormat === PropertyValueFormat.Array)\n displayLabel = `${displayLabel} (${this.props.propertyRecord.value.items.length})`;\n\n return (\n <NonPrimitivePropertyLabelRenderer\n isExpanded={!!state.isExpanded}\n onExpand={this._onExpanded}\n onCollapse={this._onCollapsed}\n offset={offset}\n renderColon={false}\n >\n {displayLabel}\n </NonPrimitivePropertyLabelRenderer>\n );\n }\n\n private overrideArrayChildrenNames(items: PropertyRecord[]) {\n const modifiedProperties: PropertyRecord[] = items.map((item, index): PropertyRecord => {\n const newProperty = { ...item.property };\n newProperty.displayLabel = `[${index + 1}]`;\n newProperty.name = `${newProperty.name}_${index}`;\n return new PropertyRecord(item.value, newProperty);\n });\n\n return modifiedProperties;\n }\n\n private _renderPropertyForItem = (item: PropertyRecord) => {\n const prefix = this.props.uniqueKey ? this.props.uniqueKey : this.props.propertyRecord.property.name;\n const uniqueKey = `${prefix}_${item.property.name}`;\n return (\n <PropertyRenderer\n key={uniqueKey}\n uniqueKey={uniqueKey}\n propertyRecord={item}\n indentation={this.props.indentation ? this.props.indentation + 1 : 1}\n orientation={this.props.orientation}\n columnRatio={this.props.columnRatio}\n actionButtonRenderers={this.props.actionButtonRenderers}\n onColumnRatioChanged={this.props.onColumnRatioChanged}\n width={this.props.width}\n isResizeHandleHovered={this.props.isResizeHandleHovered}\n onResizeHandleHoverChanged={this.props.onResizeHandleHoverChanged}\n isResizeHandleBeingDragged={this.props.isResizeHandleBeingDragged}\n onResizeHandleDragChanged={this.props.onResizeHandleDragChanged}\n columnInfo={this.props.columnInfo}\n />\n );\n };\n\n /** @internal */\n public override render() {\n let items: PropertyRecord[] = this.props.propertyRecord.getChildrenRecords();\n if (this.props.propertyRecord.value.valueFormat === PropertyValueFormat.Array)\n items = this.overrideArrayChildrenNames(items);\n\n const { indentation, ...props } = this.props; // eslint-disable-line @typescript-eslint/no-unused-vars\n return (\n <>\n {this.props.isCollapsible\n ?\n <PropertyView\n labelElement={this.getLabel(this.props, this.state)}\n {...props}\n />\n : undefined}\n\n {this.state.isExpanded ? items.map(this._renderPropertyForItem) : undefined}\n </>\n );\n }\n}\n"]}
|
|
@@ -20,11 +20,10 @@ export class PrimitivePropertyRenderer extends React.Component {
|
|
|
20
20
|
}
|
|
21
21
|
/** @internal */
|
|
22
22
|
render() {
|
|
23
|
-
var _a, _b;
|
|
24
23
|
const { indentation, highlight, ...props } = this.props; // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
25
24
|
const displayLabel = this.props.propertyRecord.property.displayLabel;
|
|
26
|
-
const offset = CommonPropertyRenderer.getLabelOffset(indentation, props.orientation, props.width, props.columnRatio,
|
|
27
|
-
const activeMatchIndex = this.props.propertyRecord.property.name ===
|
|
25
|
+
const offset = CommonPropertyRenderer.getLabelOffset(indentation, props.orientation, props.width, props.columnRatio, props.columnInfo?.minLabelWidth);
|
|
26
|
+
const activeMatchIndex = this.props.propertyRecord.property.name === highlight?.activeHighlight?.highlightedItemIdentifier ? highlight.activeHighlight.highlightIndex : undefined;
|
|
28
27
|
const label = highlight ?
|
|
29
28
|
(HighlightedText({ text: displayLabel, searchText: highlight.highlightedText, activeMatchIndex })) :
|
|
30
29
|
displayLabel;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrimitivePropertyRenderer.js","sourceRoot":"","sources":["../../../../../src/components-react/properties/renderers/PrimitivePropertyRenderer.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAE/D,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,8BAA8B,EAAE,MAAM,wCAAwC,CAAC;AAExF,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAiB9C;;GAEG;AACH,MAAM,OAAO,yBAA0B,SAAQ,KAAK,CAAC,SAAiC;IACpF,YAAY,KAA6B;QACvC,KAAK,CAAC,KAAK,CAAC,CAAC;IACf,CAAC;IAED,gBAAgB;IACA,MAAM
|
|
1
|
+
{"version":3,"file":"PrimitivePropertyRenderer.js","sourceRoot":"","sources":["../../../../../src/components-react/proper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E,gBAAgB,EAAE,CAAC,CAAC,CAAC,CAAC;YACpG,YAAY,CAAC;QAEf,OAAO,CACL,oBAAC,YAAY,OACP,KAAK,EACT,YAAY,EACV,oBAAC,8BAA8B,IAAC,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,IAAI,CAAC,KAAK,CAAC,WAAW,KAAK,WAAW,CAAC,UAAU,EAAE,OAAO,EAAE,YAAY,IAClI,KAAK,CACyB,GACnC,CACH,CAAC;IACJ,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Properties\n */\n\nimport * as React from \"react\";\nimport { Orientation } from \"@itwin/core-react\";\nimport { HighlightedText } from \"../../common/HighlightedText\";\nimport { HighlightingComponentProps } from \"../../common/HighlightingComponentProps\";\nimport { CommonPropertyRenderer } from \"./CommonPropertyRenderer\";\nimport { PrimitivePropertyLabelRenderer } from \"./label/PrimitivePropertyLabelRenderer\";\nimport { SharedRendererProps } from \"./PropertyRenderer\";\nimport { PropertyView } from \"./PropertyView\";\n\n/** Properties of [[PrimitivePropertyRenderer]] React component\n * @public\n */\nexport interface PrimitiveRendererProps extends SharedRendererProps {\n /** Property value as a React element */\n valueElement?: React.ReactNode;\n /** Render callback for property value. If specified, `valueElement` is ignored. */\n valueElementRenderer?: () => React.ReactNode;\n /** Multiplier of how much the property is indented to the right */\n indentation?: number;\n /** Properties used for highlighting\n */\n highlight?: HighlightingComponentProps;\n}\n\n/** React Component that renders primitive properties\n * @public\n */\nexport class PrimitivePropertyRenderer extends React.Component<PrimitiveRendererProps> {\n constructor(props: PrimitiveRendererProps) {\n super(props);\n }\n\n /** @internal */\n public override render() {\n const { indentation, highlight, ...props } = this.props; // eslint-disable-line @typescript-eslint/no-unused-vars\n const displayLabel = this.props.propertyRecord.property.displayLabel;\n const offset = CommonPropertyRenderer.getLabelOffset(indentation, props.orientation, props.width, props.columnRatio, props.columnInfo?.minLabelWidth);\n\n const activeMatchIndex = this.props.propertyRecord.property.name === highlight?.activeHighlight?.highlightedItemIdentifier ? highlight.activeHighlight.highlightIndex : undefined;\n const label = highlight ?\n (HighlightedText({ text: displayLabel, searchText: highlight.highlightedText, activeMatchIndex })) :\n displayLabel;\n\n return (\n <PropertyView\n {...props}\n labelElement={\n <PrimitivePropertyLabelRenderer offset={offset} renderColon={this.props.orientation === Orientation.Horizontal} tooltip={displayLabel}>\n {label}\n </PrimitivePropertyLabelRenderer>}\n />\n );\n }\n}\n"]}
|
|
@@ -18,8 +18,7 @@ export class PropertyLabelRenderer extends React.PureComponent {
|
|
|
18
18
|
};
|
|
19
19
|
}
|
|
20
20
|
render() {
|
|
21
|
-
|
|
22
|
-
const title = (_a = this.props.tooltip) !== null && _a !== void 0 ? _a : (typeof this.props.children == "string" ? this.props.children : /* istanbul ignore next */ undefined);
|
|
21
|
+
const title = this.props.tooltip ?? (typeof this.props.children == "string" ? this.props.children : /* istanbul ignore next */ undefined);
|
|
23
22
|
return (React.createElement(React.Fragment, null,
|
|
24
23
|
React.createElement("span", { className: "components-property-label-renderer", title: title }, this.props.children),
|
|
25
24
|
this.props.renderColon ? React.createElement("span", { className: "components-property-label-renderer-colon" }, ":") : undefined));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PropertyLabelRenderer.js","sourceRoot":"","sources":["../../../../../../src/components-react/properties/renderers/label/PropertyLabelRenderer.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,8BAA8B,CAAC;AACtC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAc/B,gBAAgB;AAChB,MAAM,OAAO,qBAAsB,SAAQ,KAAK,CAAC,aAAyC;IACxF,6EAA6E;IACtE,MAAM,CAAC,QAAQ,CAAC,MAAe;QACpC,MAAM,GAAG,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;QAC7B,OAAO;YACL,WAAW,EAAE,MAAM;YACnB,KAAK,EAAE,eAAe,MAAM,KAAK;SAClC,CAAC;IACJ,CAAC;IAEe,MAAM
|
|
1
|
+
{"version":3,"file":"PropertyLabelRenderer.js","sourceRoot":"","sources":["../../../../../../src/components-react/properties/renderers/label/PropertyLabelRenderer.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,8BAA8B,CAAC;AACtC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAc/B,gBAAgB;AAChB,MAAM,OAAO,qBAAsB,SAAQ,KAAK,CAAC,aAAyC;IACxF,6EAA6E;IACtE,MAAM,CAAC,QAAQ,CAAC,MAAe;QACpC,MAAM,GAAG,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;QAC7B,OAAO;YACL,WAAW,EAAE,MAAM;YACnB,KAAK,EAAE,eAAe,MAAM,KAAK;SAClC,CAAC;IACJ,CAAC;IAEe,MAAM;QACpB,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,IAAI,CAAC,OAAO,IAAI,CAAC,KAAK,CAAC,QAAQ,IAAI,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,0BAA0B,CAAC,SAAS,CAAC,CAAC;QAC1I,OAAO,CACL;YACE,8BAAM,SAAS,EAAC,oCAAoC,EAAC,KAAK,EAAE,KAAK,IAC9D,IAAI,CAAC,KAAK,CAAC,QAAQ,CACf;YACN,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,8BAAM,SAAS,EAAC,0CAA0C,QAAS,CAAC,CAAC,CAAC,SAAS,CACxG,CACJ,CAAC;IACJ,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Properties\n */\n\nimport \"./PropertyLabelRenderer.scss\";\nimport * as React from \"react\";\n\n/** Base properties for a property label renderer\n * @public\n */\nexport interface PropertyLabelRendererProps {\n /** Label to be rendered */\n children: string|JSX.Element;\n /** Indicates whether to render a colon after the label */\n renderColon?: boolean;\n /** Custom tooltip for the component. */\n tooltip?: string;\n}\n\n/** @internal */\nexport class PropertyLabelRenderer extends React.PureComponent<PropertyLabelRendererProps> {\n /** Get React CSS style object based on provided offset from the left side */\n public static getStyle(offset?: number): React.CSSProperties {\n offset = offset ? offset : 0;\n return {\n paddingLeft: offset,\n width: `calc(100% - ${offset}px)`,\n };\n }\n\n public override render() {\n const title = this.props.tooltip ?? (typeof this.props.children == \"string\" ? this.props.children : /* istanbul ignore next */ undefined);\n return (\n <>\n <span className=\"components-property-label-renderer\" title={title}>\n {this.props.children}\n </span>\n {this.props.renderColon ? <span className=\"components-property-label-renderer-colon\">:</span> : undefined}\n </>\n );\n }\n}\n"]}
|
|
@@ -24,10 +24,9 @@ export class DoublePropertyValueRenderer {
|
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
26
|
function convertRecordToString(record) {
|
|
27
|
-
var _a;
|
|
28
27
|
const primitive = record.value;
|
|
29
28
|
if (primitive.displayValue)
|
|
30
29
|
return primitive.displayValue;
|
|
31
|
-
return TypeConverterManager.getConverter(record.property.typename,
|
|
30
|
+
return TypeConverterManager.getConverter(record.property.typename, record.property.converter?.name).convertPropertyToString(record.property, primitive.value);
|
|
32
31
|
}
|
|
33
32
|
//# sourceMappingURL=DoublePropertyValueRenderer.js.map
|
package/lib/esm/components-react/properties/renderers/value/DoublePropertyValueRenderer.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DoublePropertyValueRenderer.js","sourceRoot":"","sources":["../../../../../../src/components-react/properties/renderers/value/DoublePropertyValueRenderer.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAkC,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC/G,OAAO,EAAE,oBAAoB,EAAE,MAAM,0CAA0C,CAAC;AAEhF,OAAO,EAAE,kCAAkC,EAAE,MAAM,kCAAkC,CAAC;AAEtF;;GAEG;AACH,MAAM,OAAO,2BAA2B;IAEtC,uDAAuD;IAChD,SAAS,CAAC,MAAsB;QACrC,OAAO,MAAM,CAAC,KAAK,CAAC,WAAW,KAAK,mBAAmB,CAAC,SAAS;eAC5D,MAAM,CAAC,QAAQ,CAAC,QAAQ,KAAK,iBAAiB,CAAC,MAAM,CAAC;IAC7D,CAAC;IAED,iEAAiE;IAC1D,MAAM,CAAC,MAAsB,EAAE,OAAsC;QAC1E,OAAO,oBAAC,kCAAkC,IACxC,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,OAAO,EAChB,qBAAqB,EAAE,qBAAqB,GAC5C,CAAC;IACL,CAAC;CACF;AAED,SAAS,qBAAqB,CAAC,MAAsB
|
|
1
|
+
{"version":3,"file":"DoublePropertyValueRenderer.js","sourceRoot":"","sources":["../../../../../../src/components-react/properties/renderers/value/DoublePropertyValueRenderer.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAkC,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC/G,OAAO,EAAE,oBAAoB,EAAE,MAAM,0CAA0C,CAAC;AAEhF,OAAO,EAAE,kCAAkC,EAAE,MAAM,kCAAkC,CAAC;AAEtF;;GAEG;AACH,MAAM,OAAO,2BAA2B;IAEtC,uDAAuD;IAChD,SAAS,CAAC,MAAsB;QACrC,OAAO,MAAM,CAAC,KAAK,CAAC,WAAW,KAAK,mBAAmB,CAAC,SAAS;eAC5D,MAAM,CAAC,QAAQ,CAAC,QAAQ,KAAK,iBAAiB,CAAC,MAAM,CAAC;IAC7D,CAAC;IAED,iEAAiE;IAC1D,MAAM,CAAC,MAAsB,EAAE,OAAsC;QAC1E,OAAO,oBAAC,kCAAkC,IACxC,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,OAAO,EAChB,qBAAqB,EAAE,qBAAqB,GAC5C,CAAC;IACL,CAAC;CACF;AAED,SAAS,qBAAqB,CAAC,MAAsB;IACnD,MAAM,SAAS,GAAG,MAAM,CAAC,KAAuB,CAAC;IACjD,IAAI,SAAS,CAAC,YAAY;QACxB,OAAO,SAAS,CAAC,YAAY,CAAC;IAChC,OAAO,oBAAoB,CAAC,YAAY,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC,QAAQ,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC,uBAAuB,CAAC,MAAM,CAAC,QAAQ,EAAE,SAAS,CAAC,KAAK,CAAC,CAAC;AAChK,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Properties\n */\n\nimport * as React from \"react\";\nimport { PrimitiveValue, PropertyRecord, PropertyValueFormat, StandardTypeNames } from \"@itwin/appui-abstract\";\nimport { TypeConverterManager } from \"../../../converters/TypeConverterManager\";\nimport { IPropertyValueRenderer, PropertyValueRendererContext } from \"../../ValueRendererManager\";\nimport { PrimitivePropertyValueRendererImpl } from \"./PrimitivePropertyValueRenderer\";\n\n/** Default Double Property Renderer\n * @public\n */\nexport class DoublePropertyValueRenderer implements IPropertyValueRenderer {\n\n /** Checks if the renderer can handle given property */\n public canRender(record: PropertyRecord) {\n return record.value.valueFormat === PropertyValueFormat.Primitive\n && record.property.typename === StandardTypeNames.Double;\n }\n\n /** Method that returns a JSX representation of PropertyRecord */\n public render(record: PropertyRecord, context?: PropertyValueRendererContext) {\n return <PrimitivePropertyValueRendererImpl\n record={record}\n context={context}\n stringValueCalculator={convertRecordToString}\n />;\n }\n}\n\nfunction convertRecordToString(record: PropertyRecord): string | Promise<string> {\n const primitive = record.value as PrimitiveValue;\n if (primitive.displayValue)\n return primitive.displayValue;\n return TypeConverterManager.getConverter(record.property.typename, record.property.converter?.name).convertPropertyToString(record.property, primitive.value);\n}\n"]}
|
package/lib/esm/components-react/properties/renderers/value/MultilineTextPropertyValueRenderer.js
CHANGED
|
@@ -25,9 +25,8 @@ export class MultilineTextPropertyValueRenderer {
|
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
27
|
const MultilineTextPropertyValueRendererImpl = (props) => {
|
|
28
|
-
var _a, _b, _c, _d;
|
|
29
28
|
const { stringValue, element } = useRenderedStringValue(props.record, convertRecordToString, props.context);
|
|
30
|
-
return (React.createElement(MultilineTextRenderer, { style:
|
|
29
|
+
return (React.createElement(MultilineTextRenderer, { style: props.context?.style, stringValue: stringValue, isExpanded: props.context?.isExpanded, onExpansionToggled: props.context?.onExpansionToggled, onHeightChanged: props.context?.onHeightChanged }, element));
|
|
31
30
|
};
|
|
32
31
|
/** @internal */
|
|
33
32
|
export const MultilineTextRenderer = (props) => {
|
|
@@ -36,7 +35,6 @@ export const MultilineTextRenderer = (props) => {
|
|
|
36
35
|
const divRef = useRef(null);
|
|
37
36
|
const previousHeightRef = useRef(0);
|
|
38
37
|
useLayoutEffect(() => {
|
|
39
|
-
var _a;
|
|
40
38
|
assert(divRef.current !== null && spanRef.current !== null);
|
|
41
39
|
const contentOverflows = spanRef.current.clientWidth < spanRef.current.scrollWidth;
|
|
42
40
|
if (numRerenders === 0 && contentOverflows) {
|
|
@@ -45,14 +43,13 @@ export const MultilineTextRenderer = (props) => {
|
|
|
45
43
|
if (numRerenders === 1 || !contentOverflows) {
|
|
46
44
|
const currentHeight = Math.max(divRef.current.offsetHeight, 27);
|
|
47
45
|
if (currentHeight !== previousHeightRef.current) {
|
|
48
|
-
|
|
46
|
+
props.onHeightChanged?.(currentHeight);
|
|
49
47
|
previousHeightRef.current = currentHeight;
|
|
50
48
|
}
|
|
51
49
|
}
|
|
52
50
|
});
|
|
53
51
|
const handleExpansionToggleClick = (event) => {
|
|
54
|
-
|
|
55
|
-
(_a = props.onExpansionToggled) === null || _a === void 0 ? void 0 : _a.call(props);
|
|
52
|
+
props.onExpansionToggled?.();
|
|
56
53
|
event.stopPropagation();
|
|
57
54
|
};
|
|
58
55
|
// In order to always trigger onMouseLeave event on PropertyView, collapse button must remain mounted at all times.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MultilineTextPropertyValueRenderer.js","sourceRoot":"","sources":["../../../../../../src/components-react/properties/renderers/value/MultilineTextPropertyValueRenderer.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;;GAGG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,gDAAgD;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAChD,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAkC,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC/G,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC1D,OAAO,EAAE,oBAAoB,EAAE,MAAM,0CAA0C,CAAC;AAChF,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAErD,OAAO,EAAE,sBAAsB,EAAE,MAAM,kCAAkC,CAAC;AAE1E,gBAAgB;AAChB,MAAM,OAAO,kCAAkC;IACtC,SAAS,CAAC,MAAsB;QACrC,OAAO,MAAM,CAAC,KAAK,CAAC,WAAW,KAAK,mBAAmB,CAAC,SAAS,CAAC;IACpE,CAAC;IAEM,MAAM,CAAC,MAAsB,EAAE,OAAsC;QAC1E,OAAO,oBAAC,sCAAsC,IAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAI,CAAC;IACtF,CAAC;CACF;AAQD,MAAM,sCAAsC,GACxC,CAAC,KAAK,EAAE,EAAE
|
|
1
|
+
{"version":3,"file":"MultilineTextPropertyValueRenderer.js","sourceRoot":"","sources":["../../../../../../src/components-react/properties/renderers/value/MultilineTextPropertyValueRenderer.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;;GAGG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,gDAAgD;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAChD,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAkC,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC/G,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC1D,OAAO,EAAE,oBAAoB,EAAE,MAAM,0CAA0C,CAAC;AAChF,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAErD,OAAO,EAAE,sBAAsB,EAAE,MAAM,kCAAkC,CAAC;AAE1E,gBAAgB;AAChB,MAAM,OAAO,kCAAkC;IACtC,SAAS,CAAC,MAAsB;QACrC,OAAO,MAAM,CAAC,KAAK,CAAC,WAAW,KAAK,mBAAmB,CAAC,SAAS,CAAC;IACpE,CAAC;IAEM,MAAM,CAAC,MAAsB,EAAE,OAAsC;QAC1E,OAAO,oBAAC,sCAAsC,IAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAI,CAAC;IACtF,CAAC;CACF;AAQD,MAAM,sCAAsC,GACxC,CAAC,KAAK,EAAE,EAAE;IACV,MAAM,EAAE,WAAW,EAAE,OAAO,EAAE,GAAG,sBAAsB,CAAC,KAAK,CAAC,MAAM,EAAE,qBAAqB,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;IAC5G,OAAO,CACL,oBAAC,qBAAqB,IACpB,KAAK,EAAE,KA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MAAM,CAAC,KAAwB,CAAC,KAAK,CAAC,CAAC;AACtF,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/**\n * @packageDocumentation\n * @module Properties\n */\n\nimport * as React from \"react\";\n// eslint-disable-next-line no-duplicate-imports\nimport { useLayoutEffect, useRef } from \"react\";\nimport { assert } from \"@itwin/core-bentley\";\nimport { PrimitiveValue, PropertyRecord, PropertyValueFormat, StandardTypeNames } from \"@itwin/appui-abstract\";\nimport { useRerender } from \"../../../common/UseRerender\";\nimport { TypeConverterManager } from \"../../../converters/TypeConverterManager\";\nimport { UiComponents } from \"../../../UiComponents\";\nimport { IPropertyValueRenderer, PropertyValueRendererContext } from \"../../ValueRendererManager\";\nimport { useRenderedStringValue } from \"./PrimitivePropertyValueRenderer\";\n\n/** @internal */\nexport class MultilineTextPropertyValueRenderer implements IPropertyValueRenderer {\n public canRender(record: PropertyRecord): boolean {\n return record.value.valueFormat === PropertyValueFormat.Primitive;\n }\n\n public render(record: PropertyRecord, context?: PropertyValueRendererContext): React.ReactNode {\n return <MultilineTextPropertyValueRendererImpl record={record} context={context} />;\n }\n}\n\ninterface MultilineTextPropertyValueRendererImplProps {\n record: PropertyRecord;\n context?: PropertyValueRendererContext;\n children?: never;\n}\n\nconst MultilineTextPropertyValueRendererImpl: React.FC<MultilineTextPropertyValueRendererImplProps>\n = (props) => {\n const { stringValue, element } = useRenderedStringValue(props.record, convertRecordToString, props.context);\n return (\n <MultilineTextRenderer\n style={props.context?.style}\n stringValue={stringValue}\n isExpanded={props.context?.isExpanded}\n onExpansionToggled={props.context?.onExpansionToggled}\n onHeightChanged={props.context?.onHeightChanged}\n >\n {element}\n </MultilineTextRenderer>\n );\n };\n\ninterface MultilineTextRenderer {\n stringValue?: string;\n isExpanded?: boolean;\n onExpansionToggled?: () => void;\n onHeightChanged?: (newHeight: number) => void;\n style?: React.CSSProperties;\n /** Content */\n children?: React.ReactNode;\n}\n\n/** @internal */\nexport const MultilineTextRenderer: React.FC<MultilineTextRenderer> = (props) => { // eslint-disable-line @typescript-eslint/no-redeclare\n const { rerenderContext, numRerenders, rerender } = useRerender({ contentOverflows: false });\n const spanRef = useRef<HTMLSpanElement>(null);\n const divRef = useRef<HTMLDivElement>(null);\n const previousHeightRef = useRef(0);\n useLayoutEffect(() => {\n assert(divRef.current !== null && spanRef.current !== null);\n\n const contentOverflows = spanRef.current.clientWidth < spanRef.current.scrollWidth;\n if (numRerenders === 0 && contentOverflows) {\n rerender({ contentOverflows });\n }\n\n if (numRerenders === 1 || !contentOverflows) {\n const currentHeight = Math.max(divRef.current.offsetHeight, 27);\n if (currentHeight !== previousHeightRef.current) {\n props.onHeightChanged?.(currentHeight);\n previousHeightRef.current = currentHeight;\n }\n }\n });\n\n const handleExpansionToggleClick = (event: React.MouseEvent) => {\n props.onExpansionToggled?.();\n event.stopPropagation();\n };\n\n // In order to always trigger onMouseLeave event on PropertyView, collapse button must remain mounted at all times.\n // https://github.com/facebook/react/issues/6807\n return (\n <div ref={divRef} className=\"multiline\">\n <span\n ref={spanRef}\n className={(numRerenders !== 0 && props.isExpanded) ? \"expanded\" : \"\"}\n style={props.style}\n title={props.isExpanded ? undefined : props.stringValue}\n >\n {props.children}\n <button\n className=\"expand-toggle\"\n style={{ display: (rerenderContext.contentOverflows && props.isExpanded) ? \"inline-block\" : \"none\" }}\n onClick={handleExpansionToggleClick}\n >\n {UiComponents.translate(\"property.collapse\")}\n </button>\n </span>\n {\n rerenderContext.contentOverflows && !props.isExpanded &&\n <button className=\"expand-toggle\" onClick={handleExpansionToggleClick}>\n {UiComponents.translate(\"property.expand\")}\n </button>\n }\n </div>\n );\n};\n\nfunction convertRecordToString(record: PropertyRecord): string | Promise<string> {\n return TypeConverterManager\n .getConverter(StandardTypeNames.Text)\n .convertPropertyToString(record.property, (record.value as PrimitiveValue).value);\n}\n"]}
|
package/lib/esm/components-react/properties/renderers/value/NavigationPropertyValueRenderer.js
CHANGED
|
@@ -24,10 +24,9 @@ export class NavigationPropertyValueRenderer {
|
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
26
|
function convertRecordToString(record) {
|
|
27
|
-
var _a;
|
|
28
27
|
const primitive = record.value;
|
|
29
28
|
if (primitive.displayValue)
|
|
30
29
|
return primitive.displayValue;
|
|
31
|
-
return TypeConverterManager.getConverter(record.property.typename,
|
|
30
|
+
return TypeConverterManager.getConverter(record.property.typename, record.property.converter?.name).convertPropertyToString(record.property, primitive.value);
|
|
32
31
|
}
|
|
33
32
|
//# sourceMappingURL=NavigationPropertyValueRenderer.js.map
|
package/lib/esm/components-react/properties/renderers/value/NavigationPropertyValueRenderer.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NavigationPropertyValueRenderer.js","sourceRoot":"","sources":["../../../../../../src/components-react/properties/renderers/value/NavigationPropertyValueRenderer.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAkC,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC/G,OAAO,EAAE,oBAAoB,EAAE,MAAM,0CAA0C,CAAC;AAEhF,OAAO,EAAE,kCAAkC,EAAE,MAAM,kCAAkC,CAAC;AAEtF;;GAEG;AACH,MAAM,OAAO,+BAA+B;IAE1C,uDAAuD;IAChD,SAAS,CAAC,MAAsB;QACrC,OAAO,MAAM,CAAC,KAAK,CAAC,WAAW,KAAK,mBAAmB,CAAC,SAAS;eAC5D,MAAM,CAAC,QAAQ,CAAC,QAAQ,KAAK,iBAAiB,CAAC,UAAU,CAAC;IACjE,CAAC;IAED,iEAAiE;IAC1D,MAAM,CAAC,MAAsB,EAAE,OAAsC;QAC1E,OAAO,oBAAC,kCAAkC,IACxC,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,OAAO,EAChB,qBAAqB,EAAE,qBAAqB,GAC5C,CAAC;IACL,CAAC;CACF;AAED,SAAS,qBAAqB,CAAC,MAAsB
|
|
1
|
+
{"version":3,"file":"NavigationPropertyValueRenderer.js","sourceRoot":"","sources":["../../../../../../src/components-react/properties/renderers/value/NavigationPropertyValueRenderer.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAkC,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC/G,OAAO,EAAE,oBAAoB,EAAE,MAAM,0CAA0C,CAAC;AAEhF,OAAO,EAAE,kCAAkC,EAAE,MAAM,kCAAkC,CAAC;AAEtF;;GAEG;AACH,MAAM,OAAO,+BAA+B;IAE1C,uDAAuD;IAChD,SAAS,CAAC,MAAsB;QACrC,OAAO,MAAM,CAAC,KAAK,CAAC,WAAW,KAAK,mBAAmB,CAAC,SAAS;eAC5D,MAAM,CAAC,QAAQ,CAAC,QAAQ,KAAK,iBAAiB,CAAC,UAAU,CAAC;IACjE,CAAC;IAED,iEAAiE;IAC1D,MAAM,CAAC,MAAsB,EAAE,OAAsC;QAC1E,OAAO,oBAAC,kCAAkC,IACxC,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,OAAO,EAChB,qBAAqB,EAAE,qBAAqB,GAC5C,CAAC;IACL,CAAC;CACF;AAED,SAAS,qBAAqB,CAAC,MAAsB;IACnD,MAAM,SAAS,GAAG,MAAM,CAAC,KAAuB,CAAC;IACjD,IAAI,SAAS,CAAC,YAAY;QACxB,OAAO,SAAS,CAAC,YAAY,CAAC;IAChC,OAAO,oBAAoB,CAAC,YAAY,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC,QAAQ,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC,uBAAuB,CAAC,MAAM,CAAC,QAAQ,EAAE,SAAS,CAAC,KAAK,CAAC,CAAC;AAChK,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Properties\n */\n\nimport * as React from \"react\";\nimport { PrimitiveValue, PropertyRecord, PropertyValueFormat, StandardTypeNames } from \"@itwin/appui-abstract\";\nimport { TypeConverterManager } from \"../../../converters/TypeConverterManager\";\nimport { IPropertyValueRenderer, PropertyValueRendererContext } from \"../../ValueRendererManager\";\nimport { PrimitivePropertyValueRendererImpl } from \"./PrimitivePropertyValueRenderer\";\n\n/** Default Navigation Property Renderer\n * @public\n */\nexport class NavigationPropertyValueRenderer implements IPropertyValueRenderer {\n\n /** Checks if the renderer can handle given property */\n public canRender(record: PropertyRecord) {\n return record.value.valueFormat === PropertyValueFormat.Primitive\n && record.property.typename === StandardTypeNames.Navigation;\n }\n\n /** Method that returns a JSX representation of PropertyRecord */\n public render(record: PropertyRecord, context?: PropertyValueRendererContext) {\n return <PrimitivePropertyValueRendererImpl\n record={record}\n context={context}\n stringValueCalculator={convertRecordToString}\n />;\n }\n}\n\nfunction convertRecordToString(record: PropertyRecord): string | Promise<string> {\n const primitive = record.value as PrimitiveValue;\n if (primitive.displayValue)\n return primitive.displayValue;\n return TypeConverterManager.getConverter(record.property.typename, record.property.converter?.name).convertPropertyToString(record.property, primitive.value);\n}\n"]}
|
package/lib/esm/components-react/properties/renderers/value/PrimitivePropertyValueRenderer.js
CHANGED
|
@@ -29,15 +29,13 @@ export class PrimitivePropertyValueRenderer {
|
|
|
29
29
|
* @internal
|
|
30
30
|
*/
|
|
31
31
|
export function convertPrimitiveRecordToString(record) {
|
|
32
|
-
var _a;
|
|
33
32
|
const primitive = record.value;
|
|
34
|
-
return TypeConverterManager.getConverter(record.property.typename,
|
|
33
|
+
return TypeConverterManager.getConverter(record.property.typename, record.property.converter?.name).convertPropertyToString(record.property, primitive.value);
|
|
35
34
|
}
|
|
36
35
|
/** @internal */
|
|
37
36
|
export function PrimitivePropertyValueRendererImpl(props) {
|
|
38
|
-
var _a;
|
|
39
37
|
const { stringValue, element } = useRenderedStringValue(props.record, props.stringValueCalculator, props.context, props.linksHandler);
|
|
40
|
-
return React.createElement("span", { style:
|
|
38
|
+
return React.createElement("span", { style: props.context?.style, title: stringValue }, element);
|
|
41
39
|
}
|
|
42
40
|
/**
|
|
43
41
|
* Default link handler used for handling records,
|
|
@@ -53,11 +51,10 @@ export const DEFAULT_LINKS_HANDLER = {
|
|
|
53
51
|
};
|
|
54
52
|
/** @internal */
|
|
55
53
|
export function useRenderedStringValue(record, stringValueCalculator, context, linksHandler) {
|
|
56
|
-
var _a, _b;
|
|
57
54
|
const stringValue = useAsyncValue(stringValueCalculator(record));
|
|
58
55
|
const el = (stringValue === undefined)
|
|
59
|
-
? context
|
|
60
|
-
: React.createElement(LinksRenderer, { value: stringValue, links:
|
|
56
|
+
? context?.defaultValue
|
|
57
|
+
: React.createElement(LinksRenderer, { value: stringValue, links: record.links ?? linksHandler ?? DEFAULT_LINKS_HANDLER, highlighter: context?.textHighlighter });
|
|
61
58
|
return { stringValue, element: el };
|
|
62
59
|
}
|
|
63
60
|
//# sourceMappingURL=PrimitivePropertyValueRenderer.js.map
|
package/lib/esm/components-react/properties/renderers/value/PrimitivePropertyValueRenderer.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrimitivePropertyValueRenderer.js","sourceRoot":"","sources":["../../../../../../src/components-react/properties/renderers/value/PrimitivePropertyValueRenderer.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAoD,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC9G,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAC9D,OAAO,EAAE,oBAAoB,EAAE,MAAM,0CAA0C,CAAC;AAChF,OAAO,EAAE,mBAAmB,EAAE,MAAM,qDAAqD,CAAC;AAC1F,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAGlD;;GAEG;AACH,MAAM,OAAO,8BAA8B;IAEzC,uDAAuD;IAChD,SAAS,CAAC,MAAsB;QACrC,OAAO,MAAM,CAAC,KAAK,CAAC,WAAW,KAAK,mBAAmB,CAAC,SAAS,CAAC;IACpE,CAAC;IAED,iEAAiE;IAC1D,MAAM,CAAC,MAAsB,EAAE,OAAsC;QAC1E,OAAO,oBAAC,kCAAkC,IACxC,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,OAAO,EAChB,qBAAqB,EAAE,8BAA8B,GACrD,CAAC;IACL,CAAC;CACF;AAED;;;GAGG;AACH,MAAM,UAAU,8BAA8B,CAAC,MAAsB
|
|
1
|
+
{"version":3,"file":"PrimitivePropertyValueRenderer.js","sourceRoot":"","sources":["../../../../../../src/components-react/properties/renderers/value/PrimitivePropertyValueRenderer.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAoD,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC9G,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAC9D,OAAO,EAAE,oBAAoB,EAAE,MAAM,0CAA0C,CAAC;AAChF,OAAO,EAAE,mBAAmB,EAAE,MAAM,qDAAqD,CAAC;AAC1F,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAGlD;;GAEG;AACH,MAAM,OAAO,8BAA8B;IAEzC,uDAAuD;IAChD,SAAS,CAAC,MAAsB;QACrC,OAAO,MAAM,CAAC,KAAK,CAAC,WAAW,KAAK,mBAAmB,CAAC,SAAS,CAAC;IACpE,CAAC;IAED,iEAAiE;IAC1D,MAAM,CAAC,MAAsB,EAAE,OAAsC;QAC1E,OAAO,oBAAC,kCA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,EAClB,KAAK,EAAE,MAAM,CAAC,KAAK,IAAI,YAAY,IAAI,qBAAqB,EAC5D,WAAW,EAAE,OAAO,EAAE,eAAe,GACrC,CAAC;IACL,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;AACtC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Properties\n */\n\nimport * as React from \"react\";\nimport { LinkElementsInfo, PrimitiveValue, PropertyRecord, PropertyValueFormat } from \"@itwin/appui-abstract\";\nimport { useAsyncValue } from \"../../../common/UseAsyncValue\";\nimport { TypeConverterManager } from \"../../../converters/TypeConverterManager\";\nimport { PropertyGridCommons } from \"../../../propertygrid/component/PropertyGridCommons\";\nimport { LinksRenderer } from \"../../LinkHandler\";\nimport { IPropertyValueRenderer, PropertyValueRendererContext } from \"../../ValueRendererManager\";\n\n/** Default Primitive Property Renderer\n * @public\n */\nexport class PrimitivePropertyValueRenderer implements IPropertyValueRenderer {\n\n /** Checks if the renderer can handle given property */\n public canRender(record: PropertyRecord) {\n return record.value.valueFormat === PropertyValueFormat.Primitive;\n }\n\n /** Method that returns a JSX representation of PropertyRecord */\n public render(record: PropertyRecord, context?: PropertyValueRendererContext) {\n return <PrimitivePropertyValueRendererImpl\n record={record}\n context={context}\n stringValueCalculator={convertPrimitiveRecordToString}\n />;\n }\n}\n\n/**\n * Function that converts primitive [[PropertyRecord]] to string\n * @internal\n */\nexport function convertPrimitiveRecordToString(record: PropertyRecord): string | Promise<string> {\n const primitive = record.value as PrimitiveValue;\n return TypeConverterManager.getConverter(record.property.typename, record.property.converter?.name).convertPropertyToString(record.property, primitive.value);\n}\n\n/** @internal */\ninterface PrimitivePropertyValueRendererImplProps {\n record: PropertyRecord;\n stringValueCalculator: (record: PropertyRecord) => string | Promise<string>;\n context?: PropertyValueRendererContext;\n linksHandler?: LinkElementsInfo;\n}\n\n/** @internal */\nexport function PrimitivePropertyValueRendererImpl(props: PrimitivePropertyValueRendererImplProps) {\n const { stringValue, element } = useRenderedStringValue(props.record, props.stringValueCalculator, props.context, props.linksHandler);\n return <span style={props.context?.style} title={stringValue}>{element}</span>;\n}\n\n/**\n * Default link handler used for handling records,\n * which did not have any specified LinkElementsInfo.\n *\n * Default matcher matches all URLs using regex.\n * Default onClick opens window or sets location.href with found URL.\n * @public\n */\nexport const DEFAULT_LINKS_HANDLER: LinkElementsInfo = {\n matcher: PropertyGridCommons.getLinks,\n onClick: PropertyGridCommons.handleLinkClick,\n};\n\n/** @internal */\nexport function useRenderedStringValue(\n record: PropertyRecord,\n stringValueCalculator: (record: PropertyRecord) => string | Promise<string>,\n context?: PropertyValueRendererContext,\n linksHandler?: LinkElementsInfo,\n): { stringValue?: string, element: React.ReactNode } {\n const stringValue = useAsyncValue(stringValueCalculator(record));\n const el = (stringValue === undefined)\n ? context?.defaultValue\n : <LinksRenderer\n value={stringValue}\n links={record.links ?? linksHandler ?? DEFAULT_LINKS_HANDLER}\n highlighter={context?.textHighlighter}\n />;\n return { stringValue, element: el };\n}\n"]}
|
|
@@ -16,11 +16,10 @@ class PropertyCategoryRendererManager {
|
|
|
16
16
|
}
|
|
17
17
|
/** Retrieves a category rendering component based for the passed category item. */
|
|
18
18
|
getCategoryComponent(categoryItem) {
|
|
19
|
-
var _a;
|
|
20
19
|
if (categoryItem.derivedCategory.renderer === undefined) {
|
|
21
20
|
return undefined;
|
|
22
21
|
}
|
|
23
|
-
return
|
|
22
|
+
return this._categoryRenderers.get(categoryItem.derivedCategory.renderer.name)?.(categoryItem);
|
|
24
23
|
}
|
|
25
24
|
/** Registers a renderer factory function to be invoked on categories with specific renderer name. */
|
|
26
25
|
addRenderer(rendererName, categoryRenderer, override = false) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PropertyCategoryRendererManager.js","sourceRoot":"","sources":["../../../../src/components-react/propertygrid/PropertyCategoryRendererManager.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAyBH;;;;GAIG;AACH,MAAa,+BAA+B;IAA5C;QACU,uBAAkB,GAAG,IAAI,GAAG,EAAoC,CAAC;IA4B3E,CAAC;IAxBC,mFAAmF;IAC5E,oBAAoB,CAAC,YAA8B
|
|
1
|
+
{"version":3,"file":"PropertyCategoryRendererManager.js","sourceRoot":"","sources":["../../../../src/components-react/propertygrid/PropertyCategoryRendererManager.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAyBH;;;;GAIG;AACH,MAAa,+BAA+B;IAA5C;QACU,uBAAkB,GAAG,IAAI,GAAG,EAAoC,CAAC;IA4B3E,CAAC;IAxBC,mFAAmF;IAC5E,oBAAoB,CAAC,YAA8B;QACxD,IAAI,YAAY,CAAC,eAAe,CAAC,QAAQ,KAAK,SAAS,EAAE;YACvD,OAAO,SAAS,CAAC;SAClB;QAED,OAAO,IAAI,CAAC,kBAAkB,CAAC,GAAG,CAAC,YAAY,CAAC,eAAe,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,YAAY,CAAC,CAAC;IACjG,CAAC;IAED,qGAAqG;IAC9F,WAAW,CAAC,YAAoB,EAAE,gBAA0C,EAAE,QAAQ,GAAG,KAAK;QACnG,IAAI,IAAI,CAAC,kBAAkB,CAAC,GAAG,CAAC,YAAY,CAAC,IAAI,CAAC,QAAQ,EAAE;YAC1D,MAAM,SAAS,GAAG,+BAA+B,CAAC,IAAI,CAAC;YACvD,MAAM,UAAU,GAAG,+BAA+B,CAAC,SAAS,CAAC,WAAW,CAAC,IAAI,CAAC;YAC9E,MAAM,IAAI,KAAK,CAAC,GAAG,SAAS,IAAI,UAAU,qBAAqB,YAAY,wDAAwD,CAAC,CAAC;SACtI;QAED,IAAI,CAAC,kBAAkB,CAAC,GAAG,CAAC,YAAY,EAAE,gBAAgB,CAAC,CAAC;IAC9D,CAAC;IAED,sDAAsD;IAC/C,cAAc,CAAC,YAAoB;QACxC,IAAI,CAAC,kBAAkB,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;IAC/C,CAAC;;AAzBa,8CAAc,GAAG,IAAI,+BAA+B,EAAE,AAAxC,CAAyC;SAH1D,+BAA+B","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module PropertyGrid\n */\n\nimport * as React from \"react\";\nimport { VirtualizedPropertyGridContext } from \"./component/VirtualizedPropertyGrid\";\nimport { GridCategoryItem } from \"./internal/flat-items/FlatGridItem\";\n\n/**\n * Props that property category renderer receives.\n * @public\n */\nexport interface PropertyCategoryRendererProps {\n /** The category being rendered. */\n categoryItem: GridCategoryItem;\n /** Context of the surrounding property grid. */\n gridContext: VirtualizedPropertyGridContext;\n /** Sets the allocated height for category contents. */\n onHeightChanged: (newHeight: number) => void;\n}\n\n/**\n * Factory function that produces custom property category components.\n * @public\n */\nexport type PropertyCategoryRenderer = (categoryItem: GridCategoryItem) => React.ComponentType<PropertyCategoryRendererProps> | undefined;\n\n/**\n * Keeps a record of currently registered property category renderers and determines which renderers get invoked for\n * each category.\n * @public\n */\nexport class PropertyCategoryRendererManager {\n private _categoryRenderers = new Map<string, PropertyCategoryRenderer>();\n\n public static defaultManager = new PropertyCategoryRendererManager();\n\n /** Retrieves a category rendering component based for the passed category item. */\n public getCategoryComponent(categoryItem: GridCategoryItem): React.ComponentType<PropertyCategoryRendererProps> | undefined {\n if (categoryItem.derivedCategory.renderer === undefined) {\n return undefined;\n }\n\n return this._categoryRenderers.get(categoryItem.derivedCategory.renderer.name)?.(categoryItem);\n }\n\n /** Registers a renderer factory function to be invoked on categories with specific renderer name. */\n public addRenderer(rendererName: string, categoryRenderer: PropertyCategoryRenderer, override = false): void {\n if (this._categoryRenderers.has(rendererName) && !override) {\n const className = PropertyCategoryRendererManager.name;\n const methodName = PropertyCategoryRendererManager.prototype.addRenderer.name;\n throw new Error(`${className}.${methodName} error: renderer '${rendererName}' has already been added. Did you mean to override it?`);\n }\n\n this._categoryRenderers.set(rendererName, categoryRenderer);\n }\n\n /** Removes previous renderer factory registration. */\n public removeRenderer(rendererName: string): void {\n this._categoryRenderers.delete(rendererName);\n }\n}\n"]}
|
|
@@ -25,10 +25,9 @@ export class PropertyCategoryBlock extends React.Component {
|
|
|
25
25
|
}
|
|
26
26
|
/** @internal */
|
|
27
27
|
render() {
|
|
28
|
-
var _a;
|
|
29
28
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
30
29
|
const { highlight, category, children, onExpansionToggled, ...props } = this.props;
|
|
31
|
-
const activeMatchIndex = this.props.category.name ===
|
|
30
|
+
const activeMatchIndex = this.props.category.name === highlight?.activeHighlight?.highlightedItemIdentifier ? highlight.activeHighlight.highlightIndex : undefined;
|
|
32
31
|
const label = highlight ?
|
|
33
32
|
(React.createElement(HighlightedText, { text: category.label, activeMatchIndex: activeMatchIndex, searchText: highlight.highlightedText })) :
|
|
34
33
|
category.label;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PropertyCategoryBlock.js","sourceRoot":"","sources":["../../../../../src/components-react/propertygrid/component/PropertyCategoryBlock.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAmB/D;;;GAGG;AACH,MAAM,OAAO,qBAAsB,SAAQ,KAAK,CAAC,SAAqC;IACpF,YAAY,KAAiC;QAC3C,KAAK,CAAC,KAAK,CAAC,CAAC;QAQP,kBAAa,GAAG,CAAC,YAAqB,EAAQ,EAAE;YACtD,IAAI,CAAC,eAAe,EAAE,CAAC;QACzB,CAAC,CAAC;IATF,CAAC;IAEO,eAAe;QACrB,IAAI,IAAI,CAAC,KAAK,CAAC,kBAAkB;YAC/B,IAAI,CAAC,KAAK,CAAC,kBAAkB,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;IAC5D,CAAC;IAMD,gBAAgB;IACA,MAAM
|
|
1
|
+
{"version":3,"file":"PropertyCategoryBlock.js","sourceRoot":"","sources":["../../../../../src/components-react/propertygrid/component/PropertyCategoryBlock.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAmB/D;;;GAGG;AACH,MAAM,OAAO,qBAAsB,SAAQ,KAAK,CAAC,SAAqC;IACpF,YAAY,KAAiC;QAC3C,KAAK,CAAC,KAAK,CAAC,CAAC;QAQP,kBAAa,GAAG,CAAC,YAAqB,EAAQ,EAAE;YACtD,IAAI,CAAC,eAAe,EAAE,CAAC;QACzB,CAAC,CAAC;IATF,CAAC;IAEO,eAAe;QACrB,IAAI,IAAI,CAAC,KAAK,CAAC,kBAAkB;YAC/B,IAAI,CAAC,KAAK,CAAC,kBAAkB,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;IAC5D,CAAC;IAMD,gBAAgB;IACA,MAAM;QACpB,6DAA6D;QAC7D,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE,kBAAkB,EAAE,GAAG,KAAK,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC;QACnF,MAAM,gBAAgB,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,KAAK,SAAS,EAAE,eAAe,EAAE,yBAAyB,CAAC,CAAC,CAAC,SAAS,CAAC,eAAe,CAAC,cAAc,CAAC,CAAC,CAAC,SAAS,CAAC;QACnK,MAAM,KAAK,GAAG,SAAS,CAAC,CAAC;YACvB,CAAC,oBAAC,eAAe,IAAC,IAAI,EAAE,QAAQ,CAAC,KAAK,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,UAAU,EAAE,SAAS,CAAC,eAAe,GAAI,CAAC,CAAC,CAAC;YACxH,QAAQ,CAAC,KAAK,CAAC;QACjB,OAAO,CACL,oBAAC,eAAe,IACd,UAAU,EAAE,QAAQ,CAAC,MAAM,EAC3B,QAAQ,EAAE,IAAI,CAAC,aAAa,EAC5B,KAAK,EAAE,KAAK,EACZ,IAAI,EAAC,OAAO,KACR,KAAK,IAER,QAAQ,CAAC,MAAM,IAAI,QAAQ,CACZ,CACnB,CAAC;IACJ,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module PropertyGrid\n */\n\nimport * as React from \"react\";\nimport { CommonProps } from \"@itwin/core-react\";\nimport { ExpandableBlock } from \"@itwin/itwinui-react\";\nimport { HighlightedText } from \"../../common/HighlightedText\";\nimport { HighlightingComponentProps } from \"../../common/HighlightingComponentProps\";\nimport { PropertyCategory } from \"../PropertyDataProvider\";\n\n/**\n * Properties for the [[PropertyCategoryBlock]] React component\n * @public\n */\nexport interface PropertyCategoryBlockProps extends CommonProps {\n /** Category of the properties */\n category: PropertyCategory;\n /** Callback to when PropertyCategoryBlock gets expended or collapsed */\n onExpansionToggled?: (categoryName: string) => void;\n /** Properties used for highlighting */\n highlight?: HighlightingComponentProps;\n /** Content */\n children?: React.ReactNode;\n}\n\n/**\n * PropertyCategoryBlock React component\n * @public\n */\nexport class PropertyCategoryBlock extends React.Component<PropertyCategoryBlockProps> {\n constructor(props: PropertyCategoryBlockProps) {\n super(props);\n }\n\n private toggleExpansion() {\n if (this.props.onExpansionToggled)\n this.props.onExpansionToggled(this.props.category.name);\n }\n\n private _handleToggle = (_isExpanding: boolean): void => {\n this.toggleExpansion();\n };\n\n /** @internal */\n public override render() {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const { highlight, category, children, onExpansionToggled, ...props } = this.props;\n const activeMatchIndex = this.props.category.name === highlight?.activeHighlight?.highlightedItemIdentifier ? highlight.activeHighlight.highlightIndex : undefined;\n const label = highlight ?\n (<HighlightedText text={category.label} activeMatchIndex={activeMatchIndex} searchText={highlight.highlightedText} />) :\n category.label;\n return (\n <ExpandableBlock\n isExpanded={category.expand}\n onToggle={this._handleToggle}\n title={label}\n size=\"small\"\n {...props}\n >\n {category.expand && children}\n </ExpandableBlock>\n );\n }\n}\n"]}
|
|
@@ -10,10 +10,10 @@ import { matchLinks } from "../../common/Links";
|
|
|
10
10
|
/** @internal */
|
|
11
11
|
class PropertyGridCommons {
|
|
12
12
|
static getCurrentOrientation(width, preferredOrientation, isOrientationFixed, horizontalOrientationMinWidth) {
|
|
13
|
-
const orientation = preferredOrientation
|
|
13
|
+
const orientation = preferredOrientation ?? Orientation.Horizontal;
|
|
14
14
|
if (isOrientationFixed)
|
|
15
15
|
return orientation;
|
|
16
|
-
horizontalOrientationMinWidth = horizontalOrientationMinWidth
|
|
16
|
+
horizontalOrientationMinWidth = horizontalOrientationMinWidth ?? 300;
|
|
17
17
|
// Switch to Vertical if width too small
|
|
18
18
|
if (width < horizontalOrientationMinWidth)
|
|
19
19
|
return Orientation.Vertical;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PropertyGridCommons.js","sourceRoot":"","sources":["../../../../../src/components-react/propertygrid/component/PropertyGridCommons.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAGH,OAAO,EAAe,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAE7D,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAyFhD,gBAAgB;AAChB,MAAa,mBAAmB;IACvB,MAAM,CAAC,qBAAqB,CAAC,KAAa,EAAE,oBAAkC,EAAE,kBAA4B,EAAE,6BAAsC;QACzJ,MAAM,WAAW,GAAG,oBAAoB,
|
|
1
|
+
{"version":3,"file":"PropertyGridCommons.js","sourceRoot":"","sources":["../../../../../src/components-react/propertygrid/component/PropertyGridCommons.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAGH,OAAO,EAAe,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAE7D,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAyFhD,gBAAgB;AAChB,MAAa,mBAAmB;IACvB,MAAM,CAAC,qBAAqB,CAAC,KAAa,EAAE,oBAAkC,EAAE,kBAA4B,EAAE,6BAAsC;QACzJ,MAAM,WAAW,GAAG,oBAAoB,IAAI,WAAW,CAAC,UAAU,CAAC;QACnE,IAAI,kBAAkB;YACpB,OAAO,WAAW,CAAC;QAErB,6BAA6B,GAAG,6BAA6B,IAAI,GAAG,CAAC;QACrE,wCAAwC;QACxC,IAAI,KAAK,GAAG,6BAA6B;YACvC,OAAO,WAAW,CAAC,QAAQ,CAAC;QAE9B,OAAO,WAAW,CAAC;IACrB,CAAC;IAED;;;OAGG;IACI,MAAM,CAAC,eAAe,CAAC,IAAY;QACxC,MAAM,UAAU,GAAG,UAAU,CAAC,IAAI,CAAC,CAAC;QACpC,IAAI,UAAU,CAAC,MAAM,IAAI,CAAC;YACxB,OAAO;QACT,MAAM,SAAS,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC;QAChC,uBAAuB;QACvB,IAAI,SAAS,IAAI,SAAS,CAAC,GAAG,EAAE;YAC9B,IAAI,SAAS,CAAC,MAAM,KAAK,SAAS,IAAI,SAAS,CAAC,MAAM,KAAK,KAAK;gBAC9D,QAAQ,CAAC,IAAI,GAAG,SAAS,CAAC,GAAG,CAAC;iBAC3B;gBACH,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;gBACxD,IAAI,UAAU;oBACZ,UAAU,CAAC,KAAK,EAAE,CAAC;aACtB;SACF;IACH,CAAC;;AAED;;;GAGG;AACW,4BAAQ,GAAG,CAAC,KAAa,EAAyC,EAAE;IAChF,OAAO,UAAU,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,QAA8C,EAAE,EAAE;QAC9E,OAAO,EAAE,KAAK,EAAE,QAAQ,CAAC,KAAK,EAAE,GAAG,EAAE,QAAQ,CAAC,SAAS,EAAE,CAAC;IAC5D,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;SA3CS,mBAAmB","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module PropertyGrid\n */\n\nimport { PropertyRecord } from \"@itwin/appui-abstract\";\nimport { CommonProps, Orientation } from \"@itwin/core-react\";\nimport { HighlightingComponentProps } from \"../../common/HighlightingComponentProps\";\nimport { matchLinks } from \"../../common/Links\";\nimport { PropertyUpdatedArgs } from \"../../editors/EditorContainer\";\nimport { ActionButtonRenderer } from \"../../properties/renderers/ActionButtonRenderer\";\nimport { PropertyValueRendererManager } from \"../../properties/ValueRendererManager\";\nimport { FilteredType } from \"../dataproviders/filterers/PropertyDataFiltererBase\";\nimport { PropertyCategory } from \"../PropertyDataProvider\";\n\n/** Arguments for the Property Editing event callback\n * @public\n */\nexport interface PropertyEditingArgs {\n /** PropertyRecord being edited */\n propertyRecord: PropertyRecord;\n /** Unique key of currently edited property */\n propertyKey?: string;\n}\n\n/** Arguments for `PropertyGridProps.onPropertyContextMenu` callback\n * @public\n */\nexport interface PropertyGridContextMenuArgs {\n /** PropertyRecord being edited */\n propertyRecord: PropertyRecord;\n /** An event which caused the context menu callback */\n event: React.MouseEvent;\n}\n\n/**\n * Common Property Grid Props to be used by Property Grid Variants\n * @public\n */\nexport interface CommonPropertyGridProps extends CommonProps {\n /** Grid orientation. When not defined, it is chosen automatically based on width of the grid. */\n orientation?: Orientation;\n\n /** Enables/disables property hovering effect */\n isPropertyHoverEnabled?: boolean;\n\n /** Called to show a context menu when properties are right-clicked */\n onPropertyContextMenu?: (args: PropertyGridContextMenuArgs) => void;\n\n /** Enables/disables property selection */\n isPropertySelectionEnabled?: boolean;\n /** Enables/disables property selection with right click */\n isPropertySelectionOnRightClickEnabled?: boolean;\n /** Callback to property selection */\n onPropertySelectionChanged?: (property: PropertyRecord) => void;\n\n /** Enables/disables property editing */\n isPropertyEditingEnabled?: boolean;\n /** Callback for when properties are being edited */\n onPropertyEditing?: (args: PropertyEditingArgs, category: PropertyCategory) => void;\n /** Callback for when properties are updated */\n onPropertyUpdated?: (args: PropertyUpdatedArgs, category: PropertyCategory) => Promise<boolean>;\n\n /** Custom property value renderer manager */\n propertyValueRendererManager?: PropertyValueRendererManager;\n\n /** Indicates whether the orientation is fixed and does not auto-switch to Vertical when the width is too narrow. Defaults to false. */\n isOrientationFixed?: boolean;\n /** The minimum width before the auto-switch to Vertical when the width is too narrow. Defaults to 300. */\n horizontalOrientationMinWidth?: number;\n\n /** Minimum allowed label column width, after which resizing stops */\n minLabelWidth?: number;\n /** Minimum allowed value column width, after which resizing stops */\n minValueWidth?: number;\n /** Fixed action button column width */\n actionButtonWidth?: number;\n\n /**\n * Array of action button renderers. Each renderer is called for each property and can decide\n * to render an action button for the property or not.\n */\n actionButtonRenderers?: ActionButtonRenderer[];\n}\n\n/**\n * Properties for highlighting text in property grid.\n * @public\n */\nexport interface PropertyGridContentHighlightProps extends HighlightingComponentProps {\n /**\n * Specifies what the highlighting should be applied on - category labels, property labels and / or property values.\n * Defaults to \"nowhere\".\n */\n filteredTypes?: FilteredType[];\n}\n\n/** @internal */\nexport class PropertyGridCommons {\n public static getCurrentOrientation(width: number, preferredOrientation?: Orientation, isOrientationFixed?: boolean, horizontalOrientationMinWidth?: number): Orientation {\n const orientation = preferredOrientation ?? Orientation.Horizontal;\n if (isOrientationFixed)\n return orientation;\n\n horizontalOrientationMinWidth = horizontalOrientationMinWidth ?? 300;\n // Switch to Vertical if width too small\n if (width < horizontalOrientationMinWidth)\n return Orientation.Vertical;\n\n return orientation;\n }\n\n /**\n * Helper method to handle link clicks\n * @internal\n */\n public static handleLinkClick(text: string) {\n const linksArray = matchLinks(text);\n if (linksArray.length <= 0)\n return;\n const foundLink = linksArray[0];\n // istanbul ignore else\n if (foundLink && foundLink.url) {\n if (foundLink.schema === \"mailto:\" || foundLink.schema === \"pw:\")\n location.href = foundLink.url;\n else {\n const windowOpen = window.open(foundLink.url, \"_blank\");\n if (windowOpen)\n windowOpen.focus();\n }\n }\n }\n\n /**\n * A helper method to get links from string.\n * @internal\n */\n public static getLinks = (value: string): Array<{ start: number, end: number }> => {\n return matchLinks(value).map((linkInfo: { index: number, lastIndex: number }) => {\n return { start: linkInfo.index, end: linkInfo.lastIndex };\n });\n };\n}\n"]}
|