@itwin/components-react 4.0.0-dev.13 → 4.0.0-dev.15
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 +129 -1
- package/README.md +2 -2
- package/lib/cjs/components-react/UiComponents.js.map +1 -1
- package/lib/cjs/components-react/_target.scss +9 -9
- package/lib/cjs/components-react/common/DateUtils.js.map +1 -1
- package/lib/cjs/components-react/common/DelayedSpinner.js.map +1 -1
- package/lib/cjs/components-react/common/HighlightedText.js.map +1 -1
- package/lib/cjs/components-react/common/HighlightingComponentProps.js.map +1 -1
- package/lib/cjs/components-react/common/IImageLoader.js.map +1 -1
- package/lib/cjs/components-react/common/ImageRenderer.js.map +1 -1
- package/lib/cjs/components-react/common/Links.js.map +1 -1
- package/lib/cjs/components-react/common/PageOptions.js.map +1 -1
- package/lib/cjs/components-react/common/SubscriptionScheduler.js.map +1 -1
- package/lib/cjs/components-react/common/UseAsyncValue.js.map +1 -1
- package/lib/cjs/components-react/common/UseContextWithMandatoryProvider.js.map +1 -1
- package/lib/cjs/components-react/common/UseDebouncedAsyncValue.d.ts +1 -0
- package/lib/cjs/components-react/common/UseDebouncedAsyncValue.d.ts.map +1 -1
- package/lib/cjs/components-react/common/UseDebouncedAsyncValue.js +12 -1
- package/lib/cjs/components-react/common/UseDebouncedAsyncValue.js.map +1 -1
- package/lib/cjs/components-react/common/UseRerender.js.map +1 -1
- package/lib/cjs/components-react/common/countMatchesInString.js.map +1 -1
- package/lib/cjs/components-react/common/selection/SelectionHandler.js.map +1 -1
- package/lib/cjs/components-react/common/selection/SelectionModes.js.map +1 -1
- package/lib/cjs/components-react/converters/BooleanTypeConverter.js.map +1 -1
- package/lib/cjs/components-react/converters/CompositeTypeConverter.js.map +1 -1
- package/lib/cjs/components-react/converters/DateTimeTypeConverter.js.map +1 -1
- package/lib/cjs/components-react/converters/EnumTypeConverter.js.map +1 -1
- package/lib/cjs/components-react/converters/HexadecimalTypeConverter.js.map +1 -1
- package/lib/cjs/components-react/converters/NavigationPropertyTypeConverter.js.map +1 -1
- package/lib/cjs/components-react/converters/NumericTypeConverter.js.map +1 -1
- package/lib/cjs/components-react/converters/PointTypeConverter.js.map +1 -1
- package/lib/cjs/components-react/converters/StringTypeConverter.js.map +1 -1
- package/lib/cjs/components-react/converters/TypeConverter.js.map +1 -1
- package/lib/cjs/components-react/converters/TypeConverterManager.js.map +1 -1
- package/lib/cjs/components-react/converters/valuetypes/ConvertedTypes.js.map +1 -1
- package/lib/cjs/components-react/datepicker/DateField.js.map +1 -1
- package/lib/cjs/components-react/datepicker/DateField.scss +22 -22
- package/lib/cjs/components-react/datepicker/DatePicker.js.map +1 -1
- package/lib/cjs/components-react/datepicker/DatePicker.scss +176 -176
- package/lib/cjs/components-react/datepicker/DatePickerPopupButton.js.map +1 -1
- package/lib/cjs/components-react/datepicker/DatePickerPopupButton.scss +57 -57
- package/lib/cjs/components-react/datepicker/IntlFormatter.js.map +1 -1
- package/lib/cjs/components-react/datepicker/TimeField.js.map +1 -1
- package/lib/cjs/components-react/datepicker/TimeField.scss +76 -76
- package/lib/cjs/components-react/editors/BooleanEditor.js.map +1 -1
- package/lib/cjs/components-react/editors/BooleanEditor.scss +22 -22
- package/lib/cjs/components-react/editors/CustomNumberEditor.js.map +1 -1
- package/lib/cjs/components-react/editors/CustomNumberEditor.scss +20 -20
- package/lib/cjs/components-react/editors/DateTimeEditor.js.map +1 -1
- package/lib/cjs/components-react/editors/DateTimeEditor.scss +9 -9
- package/lib/cjs/components-react/editors/EditorContainer.js.map +1 -1
- package/lib/cjs/components-react/editors/EditorContainer.scss +6 -6
- package/lib/cjs/components-react/editors/EnumButtonGroupEditor.js.map +1 -1
- package/lib/cjs/components-react/editors/EnumButtonGroupEditor.scss +141 -141
- package/lib/cjs/components-react/editors/EnumEditor.js.map +1 -1
- package/lib/cjs/components-react/editors/EnumEditor.scss +22 -22
- package/lib/cjs/components-react/editors/IconEditor.js.map +1 -1
- package/lib/cjs/components-react/editors/IconEditor.scss +16 -16
- package/lib/cjs/components-react/editors/ImageCheckBoxEditor.js.map +1 -1
- package/lib/cjs/components-react/editors/ImageCheckBoxEditor.scss +24 -24
- package/lib/cjs/components-react/editors/NumericInputEditor.js.map +1 -1
- package/lib/cjs/components-react/editors/NumericInputEditor.scss +16 -16
- package/lib/cjs/components-react/editors/PopupButton.js.map +1 -1
- package/lib/cjs/components-react/editors/PopupButton.scss +116 -116
- package/lib/cjs/components-react/editors/PropertyEditorManager.js.map +1 -1
- package/lib/cjs/components-react/editors/SliderEditor.js.map +1 -1
- package/lib/cjs/components-react/editors/SliderEditor.scss +13 -13
- package/lib/cjs/components-react/editors/TextEditor.js.map +1 -1
- package/lib/cjs/components-react/editors/TextEditor.scss +20 -20
- package/lib/cjs/components-react/editors/TextareaEditor.js.map +1 -1
- package/lib/cjs/components-react/editors/TextareaEditor.scss +14 -14
- package/lib/cjs/components-react/editors/ToggleEditor.js.map +1 -1
- package/lib/cjs/components-react/editors/ToggleEditor.scss +23 -23
- package/lib/cjs/components-react/editors/variables.scss +7 -7
- package/lib/cjs/components-react/favorite/FavoritePropertiesRenderer.js.map +1 -1
- package/lib/cjs/components-react/favorite/FavoritePropertyList.js.map +1 -1
- package/lib/cjs/components-react/filter-builder/FilterBuilder.js.map +1 -1
- package/lib/cjs/components-react/filter-builder/FilterBuilderContext.js.map +1 -1
- package/lib/cjs/components-react/filter-builder/FilterBuilderRule.js.map +1 -1
- package/lib/cjs/components-react/filter-builder/FilterBuilderRule.scss +38 -38
- package/lib/cjs/components-react/filter-builder/FilterBuilderRuleGroup.js.map +1 -1
- package/lib/cjs/components-react/filter-builder/FilterBuilderRuleGroup.scss +68 -68
- package/lib/cjs/components-react/filter-builder/FilterBuilderRuleOperator.js.map +1 -1
- package/lib/cjs/components-react/filter-builder/FilterBuilderRuleProperty.js.map +1 -1
- package/lib/cjs/components-react/filter-builder/FilterBuilderRuleValue.js.map +1 -1
- package/lib/cjs/components-react/filter-builder/FilterBuilderState.js.map +1 -1
- package/lib/cjs/components-react/filter-builder/Operators.js.map +1 -1
- package/lib/cjs/components-react/filter-builder/Types.js.map +1 -1
- package/lib/cjs/components-react/filtering/FilteringInput.js.map +1 -1
- package/lib/cjs/components-react/filtering/FilteringInput.scss +58 -58
- package/lib/cjs/components-react/filtering/ResultSelector.js.map +1 -1
- package/lib/cjs/components-react/filtering/ResultSelector.scss +68 -68
- package/lib/cjs/components-react/iconpicker/IconPickerButton.js.map +1 -1
- package/lib/cjs/components-react/iconpicker/IconPickerButton.scss +75 -75
- package/lib/cjs/components-react/inputs/ParsedInput.js.map +1 -1
- package/lib/cjs/components-react/inputs/ParsedInput.scss +23 -23
- package/lib/cjs/components-react/properties/ItemStyle.js.map +1 -1
- package/lib/cjs/components-react/properties/LinkHandler.js.map +1 -1
- package/lib/cjs/components-react/properties/ValueRendererManager.js.map +1 -1
- package/lib/cjs/components-react/properties/renderers/ActionButtonList.js.map +1 -1
- package/lib/cjs/components-react/properties/renderers/ActionButtonList.scss +25 -25
- package/lib/cjs/components-react/properties/renderers/ActionButtonRenderer.js.map +1 -1
- package/lib/cjs/components-react/properties/renderers/CommonPropertyRenderer.js.map +1 -1
- package/lib/cjs/components-react/properties/renderers/NonPrimitivePropertyRenderer.js.map +1 -1
- package/lib/cjs/components-react/properties/renderers/NonPrimitivePropertyRenderer.scss +17 -17
- package/lib/cjs/components-react/properties/renderers/PrimitivePropertyRenderer.js.map +1 -1
- package/lib/cjs/components-react/properties/renderers/PropertyGridColumns.js.map +1 -1
- package/lib/cjs/components-react/properties/renderers/PropertyRenderer.js.map +1 -1
- package/lib/cjs/components-react/properties/renderers/PropertyView.js.map +1 -1
- package/lib/cjs/components-react/properties/renderers/PropertyView.scss +104 -104
- package/lib/cjs/components-react/properties/renderers/label/NonPrimitivePropertyLabelRenderer.js.map +1 -1
- package/lib/cjs/components-react/properties/renderers/label/PrimitivePropertyLabelRenderer.js.map +1 -1
- package/lib/cjs/components-react/properties/renderers/label/PropertyLabelRenderer.js.map +1 -1
- package/lib/cjs/components-react/properties/renderers/label/PropertyLabelRenderer.scss +88 -88
- package/lib/cjs/components-react/properties/renderers/value/ArrayPropertyValueRenderer.js.map +1 -1
- package/lib/cjs/components-react/properties/renderers/value/DoublePropertyValueRenderer.js.map +1 -1
- package/lib/cjs/components-react/properties/renderers/value/MergedPropertyValueRenderer.js.map +1 -1
- package/lib/cjs/components-react/properties/renderers/value/MultilineTextPropertyValueRenderer.js.map +1 -1
- package/lib/cjs/components-react/properties/renderers/value/NavigationPropertyValueRenderer.js.map +1 -1
- package/lib/cjs/components-react/properties/renderers/value/PrimitivePropertyValueRenderer.js.map +1 -1
- package/lib/cjs/components-react/properties/renderers/value/StructPropertyValueRenderer.js.map +1 -1
- package/lib/cjs/components-react/properties/renderers/value/UrlPropertyValueRenderer.js.map +1 -1
- package/lib/cjs/components-react/properties/renderers/value/WithContextStyle.js.map +1 -1
- package/lib/cjs/components-react/properties/renderers/value/table/ArrayValueRenderer.js.map +1 -1
- package/lib/cjs/components-react/properties/renderers/value/table/NonPrimitiveValueRenderer.js.map +1 -1
- package/lib/cjs/components-react/properties/renderers/value/table/StructValueRenderer.js.map +1 -1
- package/lib/cjs/components-react/propertygrid/PropertyCategoryRendererManager.js.map +1 -1
- package/lib/cjs/components-react/propertygrid/PropertyDataProvider.js.map +1 -1
- package/lib/cjs/components-react/propertygrid/SimplePropertyDataProvider.js.map +1 -1
- package/lib/cjs/components-react/propertygrid/component/ColumnResizingPropertyListPropsSupplier.js.map +1 -1
- package/lib/cjs/components-react/propertygrid/component/FlatItemNestedBorderWrapper.js.map +1 -1
- package/lib/cjs/components-react/propertygrid/component/PropertyCategoryBlock.js.map +1 -1
- package/lib/cjs/components-react/propertygrid/component/PropertyGrid.js.map +1 -1
- package/lib/cjs/components-react/propertygrid/component/PropertyGrid.scss +73 -73
- package/lib/cjs/components-react/propertygrid/component/PropertyGridCommons.js.map +1 -1
- package/lib/cjs/components-react/propertygrid/component/PropertyGridEventsRelatedPropsSupplier.js.map +1 -1
- package/lib/cjs/components-react/propertygrid/component/PropertyList.js.map +1 -1
- package/lib/cjs/components-react/propertygrid/component/VirtualizedPropertyGrid.js.map +1 -1
- package/lib/cjs/components-react/propertygrid/component/VirtualizedPropertyGrid.scss +101 -101
- package/lib/cjs/components-react/propertygrid/component/VirtualizedPropertyGridWithDataProvider.js.map +1 -1
- package/lib/cjs/components-react/propertygrid/dataproviders/FilteringDataProvider.js.map +1 -1
- package/lib/cjs/components-react/propertygrid/dataproviders/filterers/CompositePropertyDataFilterer.js.map +1 -1
- package/lib/cjs/components-react/propertygrid/dataproviders/filterers/DisplayValuePropertyDataFilterer.js.map +1 -1
- package/lib/cjs/components-react/propertygrid/dataproviders/filterers/LabelPropertyDataFilterer.js.map +1 -1
- package/lib/cjs/components-react/propertygrid/dataproviders/filterers/PropertyCategoryLabelFilterer.js.map +1 -1
- package/lib/cjs/components-react/propertygrid/dataproviders/filterers/PropertyDataFiltererBase.js.map +1 -1
- package/lib/cjs/components-react/propertygrid/internal/PropertyGridEventHandler.js.map +1 -1
- package/lib/cjs/components-react/propertygrid/internal/PropertyGridHooks.d.ts +2 -0
- package/lib/cjs/components-react/propertygrid/internal/PropertyGridHooks.d.ts.map +1 -1
- package/lib/cjs/components-react/propertygrid/internal/PropertyGridHooks.js +2 -0
- package/lib/cjs/components-react/propertygrid/internal/PropertyGridHooks.js.map +1 -1
- package/lib/cjs/components-react/propertygrid/internal/PropertyGridModel.js.map +1 -1
- package/lib/cjs/components-react/propertygrid/internal/PropertyGridModelChangeEvent.js.map +1 -1
- package/lib/cjs/components-react/propertygrid/internal/PropertyGridModelSource.js.map +1 -1
- package/lib/cjs/components-react/propertygrid/internal/flat-items/FlatGridItem.js.map +1 -1
- package/lib/cjs/components-react/propertygrid/internal/flat-items/MutableCategorizedArrayProperty.js.map +1 -1
- package/lib/cjs/components-react/propertygrid/internal/flat-items/MutableCategorizedPrimitiveProperty.js.map +1 -1
- package/lib/cjs/components-react/propertygrid/internal/flat-items/MutableCategorizedStructProperty.js.map +1 -1
- 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.map +1 -1
- 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.map +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.map +1 -1
- package/lib/cjs/components-react/selectable-content/SelectableContent.js.map +1 -1
- package/lib/cjs/components-react/selectable-content/SelectableContent.scss +20 -20
- package/lib/cjs/components-react/table/TableDataProvider.js.map +1 -1
- package/lib/cjs/components-react/toolbar/Item.js.map +1 -1
- package/lib/cjs/components-react/toolbar/Item.scss +91 -91
- package/lib/cjs/components-react/toolbar/ItemWrapper.js.map +1 -1
- package/lib/cjs/components-react/toolbar/ItemWrapper.scss +10 -10
- package/lib/cjs/components-react/toolbar/Items.js.map +1 -1
- package/lib/cjs/components-react/toolbar/Items.scss +96 -96
- package/lib/cjs/components-react/toolbar/Overflow.js.map +1 -1
- package/lib/cjs/components-react/toolbar/Overflow.scss +57 -57
- package/lib/cjs/components-react/toolbar/OverflowPanel.js.map +1 -1
- package/lib/cjs/components-react/toolbar/OverflowPanel.scss +37 -37
- package/lib/cjs/components-react/toolbar/PopupItem.js.map +1 -1
- package/lib/cjs/components-react/toolbar/PopupItem.scss +88 -88
- package/lib/cjs/components-react/toolbar/PopupItemWithDrag.js.map +1 -1
- package/lib/cjs/components-react/toolbar/PopupItemsPanel.js.map +1 -1
- package/lib/cjs/components-react/toolbar/Toolbar.js.map +1 -1
- package/lib/cjs/components-react/toolbar/Toolbar.scss +18 -18
- package/lib/cjs/components-react/toolbar/ToolbarWithOverflow.js.map +1 -1
- package/lib/cjs/components-react/toolbar/_variables.scss +34 -34
- package/lib/cjs/components-react/toolbar/groupPanel/BackArrow.js.map +1 -1
- package/lib/cjs/components-react/toolbar/groupPanel/BackArrow.scss +44 -44
- package/lib/cjs/components-react/toolbar/groupPanel/Column.js.map +1 -1
- package/lib/cjs/components-react/toolbar/groupPanel/Column.scss +9 -9
- package/lib/cjs/components-react/toolbar/groupPanel/Columns.js.map +1 -1
- package/lib/cjs/components-react/toolbar/groupPanel/Columns.scss +10 -10
- package/lib/cjs/components-react/toolbar/groupPanel/Panel.js.map +1 -1
- package/lib/cjs/components-react/toolbar/groupPanel/Panel.scss +15 -15
- package/lib/cjs/components-react/toolbar/groupPanel/Title.js.map +1 -1
- package/lib/cjs/components-react/toolbar/groupPanel/Title.scss +33 -33
- package/lib/cjs/components-react/toolbar/groupPanel/_variables.scss +16 -16
- package/lib/cjs/components-react/toolbar/groupPanel/tool/Expander.js.map +1 -1
- package/lib/cjs/components-react/toolbar/groupPanel/tool/Expander.scss +29 -29
- package/lib/cjs/components-react/toolbar/groupPanel/tool/Tool.js.map +1 -1
- package/lib/cjs/components-react/toolbar/groupPanel/tool/Tool.scss +117 -117
- package/lib/cjs/components-react/toolbar/groupPanel/tool/_variables.scss +12 -12
- package/lib/cjs/components-react/toolbar/useDragInteraction.js.map +1 -1
- package/lib/cjs/components-react/toolbar/utilities/Direction.js.map +1 -1
- package/lib/cjs/components-react/tree/HighlightingEngine.js.map +1 -1
- package/lib/cjs/components-react/tree/HighlightingEngine.scss +7 -7
- package/lib/cjs/components-react/tree/ImageLoader.js.map +1 -1
- package/lib/cjs/components-react/tree/SimpleTreeDataProvider.js.map +1 -1
- package/lib/cjs/components-react/tree/TreeComponentTestId.js.map +1 -1
- package/lib/cjs/components-react/tree/TreeDataProvider.js.map +1 -1
- package/lib/cjs/components-react/tree/controlled/Observable.js.map +1 -1
- package/lib/cjs/components-react/tree/controlled/TreeActions.js.map +1 -1
- package/lib/cjs/components-react/tree/controlled/TreeEventDispatcher.js.map +1 -1
- package/lib/cjs/components-react/tree/controlled/TreeEventHandler.js.map +1 -1
- package/lib/cjs/components-react/tree/controlled/TreeEvents.js.map +1 -1
- package/lib/cjs/components-react/tree/controlled/TreeHooks.js.map +1 -1
- package/lib/cjs/components-react/tree/controlled/TreeModel.js.map +1 -1
- package/lib/cjs/components-react/tree/controlled/TreeModelSource.js.map +1 -1
- package/lib/cjs/components-react/tree/controlled/TreeNodeLoader.js.map +1 -1
- package/lib/cjs/components-react/tree/controlled/component/ControlledTree.js.map +1 -1
- package/lib/cjs/components-react/tree/controlled/component/ControlledTree.scss +102 -102
- package/lib/cjs/components-react/tree/controlled/component/NodeContent.js.map +1 -1
- package/lib/cjs/components-react/tree/controlled/component/NodeContent.scss +27 -27
- package/lib/cjs/components-react/tree/controlled/component/TreeNodeEditor.js.map +1 -1
- package/lib/cjs/components-react/tree/controlled/component/TreeNodeRenderer.js.map +1 -1
- package/lib/cjs/components-react/tree/controlled/component/TreeRenderer.js.map +1 -1
- package/lib/cjs/components-react/tree/controlled/internal/SparseTree.js.map +1 -1
- package/lib/cjs/components-react/tree/controlled/internal/TreeModelMutator.js.map +1 -1
- package/lib/cjs/components-react/tree/controlled/internal/TreeSelectionManager.js.map +1 -1
- package/lib/cjs/components-react.js.map +1 -1
- package/lib/esm/components-react/UiComponents.js.map +1 -1
- package/lib/esm/components-react/_target.scss +9 -9
- package/lib/esm/components-react/common/DateUtils.js.map +1 -1
- package/lib/esm/components-react/common/DelayedSpinner.js.map +1 -1
- package/lib/esm/components-react/common/HighlightedText.js.map +1 -1
- package/lib/esm/components-react/common/HighlightingComponentProps.js.map +1 -1
- package/lib/esm/components-react/common/IImageLoader.js.map +1 -1
- package/lib/esm/components-react/common/ImageRenderer.js.map +1 -1
- package/lib/esm/components-react/common/Links.js.map +1 -1
- package/lib/esm/components-react/common/PageOptions.js.map +1 -1
- package/lib/esm/components-react/common/SubscriptionScheduler.js.map +1 -1
- package/lib/esm/components-react/common/UseAsyncValue.js.map +1 -1
- package/lib/esm/components-react/common/UseContextWithMandatoryProvider.js.map +1 -1
- package/lib/esm/components-react/common/UseDebouncedAsyncValue.d.ts +1 -0
- package/lib/esm/components-react/common/UseDebouncedAsyncValue.d.ts.map +1 -1
- package/lib/esm/components-react/common/UseDebouncedAsyncValue.js +12 -1
- package/lib/esm/components-react/common/UseDebouncedAsyncValue.js.map +1 -1
- package/lib/esm/components-react/common/UseRerender.js.map +1 -1
- package/lib/esm/components-react/common/countMatchesInString.js.map +1 -1
- package/lib/esm/components-react/common/selection/SelectionHandler.js.map +1 -1
- package/lib/esm/components-react/common/selection/SelectionModes.js.map +1 -1
- package/lib/esm/components-react/converters/BooleanTypeConverter.js.map +1 -1
- package/lib/esm/components-react/converters/CompositeTypeConverter.js.map +1 -1
- package/lib/esm/components-react/converters/DateTimeTypeConverter.js.map +1 -1
- package/lib/esm/components-react/converters/EnumTypeConverter.js.map +1 -1
- package/lib/esm/components-react/converters/HexadecimalTypeConverter.js.map +1 -1
- package/lib/esm/components-react/converters/NavigationPropertyTypeConverter.js.map +1 -1
- package/lib/esm/components-react/converters/NumericTypeConverter.js.map +1 -1
- package/lib/esm/components-react/converters/PointTypeConverter.js.map +1 -1
- package/lib/esm/components-react/converters/StringTypeConverter.js.map +1 -1
- package/lib/esm/components-react/converters/TypeConverter.js.map +1 -1
- package/lib/esm/components-react/converters/TypeConverterManager.js.map +1 -1
- package/lib/esm/components-react/converters/valuetypes/ConvertedTypes.js.map +1 -1
- package/lib/esm/components-react/datepicker/DateField.js.map +1 -1
- package/lib/esm/components-react/datepicker/DateField.scss +22 -22
- package/lib/esm/components-react/datepicker/DatePicker.js.map +1 -1
- package/lib/esm/components-react/datepicker/DatePicker.scss +176 -176
- package/lib/esm/components-react/datepicker/DatePickerPopupButton.js.map +1 -1
- package/lib/esm/components-react/datepicker/DatePickerPopupButton.scss +57 -57
- package/lib/esm/components-react/datepicker/IntlFormatter.js.map +1 -1
- package/lib/esm/components-react/datepicker/TimeField.js.map +1 -1
- package/lib/esm/components-react/datepicker/TimeField.scss +76 -76
- package/lib/esm/components-react/editors/BooleanEditor.js.map +1 -1
- package/lib/esm/components-react/editors/BooleanEditor.scss +22 -22
- package/lib/esm/components-react/editors/CustomNumberEditor.js.map +1 -1
- package/lib/esm/components-react/editors/CustomNumberEditor.scss +20 -20
- package/lib/esm/components-react/editors/DateTimeEditor.js.map +1 -1
- package/lib/esm/components-react/editors/DateTimeEditor.scss +9 -9
- package/lib/esm/components-react/editors/EditorContainer.js.map +1 -1
- package/lib/esm/components-react/editors/EditorContainer.scss +6 -6
- package/lib/esm/components-react/editors/EnumButtonGroupEditor.js.map +1 -1
- package/lib/esm/components-react/editors/EnumButtonGroupEditor.scss +141 -141
- package/lib/esm/components-react/editors/EnumEditor.js.map +1 -1
- package/lib/esm/components-react/editors/EnumEditor.scss +22 -22
- package/lib/esm/components-react/editors/IconEditor.js.map +1 -1
- package/lib/esm/components-react/editors/IconEditor.scss +16 -16
- package/lib/esm/components-react/editors/ImageCheckBoxEditor.js.map +1 -1
- package/lib/esm/components-react/editors/ImageCheckBoxEditor.scss +24 -24
- package/lib/esm/components-react/editors/NumericInputEditor.js.map +1 -1
- package/lib/esm/components-react/editors/NumericInputEditor.scss +16 -16
- package/lib/esm/components-react/editors/PopupButton.js.map +1 -1
- package/lib/esm/components-react/editors/PopupButton.scss +116 -116
- package/lib/esm/components-react/editors/PropertyEditorManager.js.map +1 -1
- package/lib/esm/components-react/editors/SliderEditor.js.map +1 -1
- package/lib/esm/components-react/editors/SliderEditor.scss +13 -13
- package/lib/esm/components-react/editors/TextEditor.js.map +1 -1
- package/lib/esm/components-react/editors/TextEditor.scss +20 -20
- package/lib/esm/components-react/editors/TextareaEditor.js.map +1 -1
- package/lib/esm/components-react/editors/TextareaEditor.scss +14 -14
- package/lib/esm/components-react/editors/ToggleEditor.js.map +1 -1
- package/lib/esm/components-react/editors/ToggleEditor.scss +23 -23
- package/lib/esm/components-react/editors/variables.scss +7 -7
- package/lib/esm/components-react/favorite/FavoritePropertiesRenderer.js.map +1 -1
- package/lib/esm/components-react/favorite/FavoritePropertyList.js.map +1 -1
- package/lib/esm/components-react/filter-builder/FilterBuilder.js.map +1 -1
- package/lib/esm/components-react/filter-builder/FilterBuilderContext.js.map +1 -1
- package/lib/esm/components-react/filter-builder/FilterBuilderRule.js.map +1 -1
- package/lib/esm/components-react/filter-builder/FilterBuilderRule.scss +38 -38
- package/lib/esm/components-react/filter-builder/FilterBuilderRuleGroup.js.map +1 -1
- package/lib/esm/components-react/filter-builder/FilterBuilderRuleGroup.scss +68 -68
- package/lib/esm/components-react/filter-builder/FilterBuilderRuleOperator.js.map +1 -1
- package/lib/esm/components-react/filter-builder/FilterBuilderRuleProperty.js.map +1 -1
- package/lib/esm/components-react/filter-builder/FilterBuilderRuleValue.js.map +1 -1
- package/lib/esm/components-react/filter-builder/FilterBuilderState.js.map +1 -1
- package/lib/esm/components-react/filter-builder/Operators.js.map +1 -1
- package/lib/esm/components-react/filter-builder/Types.js.map +1 -1
- package/lib/esm/components-react/filtering/FilteringInput.js.map +1 -1
- package/lib/esm/components-react/filtering/FilteringInput.scss +58 -58
- package/lib/esm/components-react/filtering/ResultSelector.js.map +1 -1
- package/lib/esm/components-react/filtering/ResultSelector.scss +68 -68
- package/lib/esm/components-react/iconpicker/IconPickerButton.js.map +1 -1
- package/lib/esm/components-react/iconpicker/IconPickerButton.scss +75 -75
- package/lib/esm/components-react/inputs/ParsedInput.js.map +1 -1
- package/lib/esm/components-react/inputs/ParsedInput.scss +23 -23
- package/lib/esm/components-react/properties/ItemStyle.js.map +1 -1
- package/lib/esm/components-react/properties/LinkHandler.js.map +1 -1
- package/lib/esm/components-react/properties/ValueRendererManager.js.map +1 -1
- package/lib/esm/components-react/properties/renderers/ActionButtonList.js.map +1 -1
- package/lib/esm/components-react/properties/renderers/ActionButtonList.scss +25 -25
- package/lib/esm/components-react/properties/renderers/ActionButtonRenderer.js.map +1 -1
- package/lib/esm/components-react/properties/renderers/CommonPropertyRenderer.js.map +1 -1
- package/lib/esm/components-react/properties/renderers/NonPrimitivePropertyRenderer.js.map +1 -1
- package/lib/esm/components-react/properties/renderers/NonPrimitivePropertyRenderer.scss +17 -17
- package/lib/esm/components-react/properties/renderers/PrimitivePropertyRenderer.js.map +1 -1
- package/lib/esm/components-react/properties/renderers/PropertyGridColumns.js.map +1 -1
- package/lib/esm/components-react/properties/renderers/PropertyRenderer.js.map +1 -1
- package/lib/esm/components-react/properties/renderers/PropertyView.js.map +1 -1
- package/lib/esm/components-react/properties/renderers/PropertyView.scss +104 -104
- package/lib/esm/components-react/properties/renderers/label/NonPrimitivePropertyLabelRenderer.js.map +1 -1
- package/lib/esm/components-react/properties/renderers/label/PrimitivePropertyLabelRenderer.js.map +1 -1
- package/lib/esm/components-react/properties/renderers/label/PropertyLabelRenderer.js.map +1 -1
- package/lib/esm/components-react/properties/renderers/label/PropertyLabelRenderer.scss +88 -88
- package/lib/esm/components-react/properties/renderers/value/ArrayPropertyValueRenderer.js.map +1 -1
- package/lib/esm/components-react/properties/renderers/value/DoublePropertyValueRenderer.js.map +1 -1
- package/lib/esm/components-react/properties/renderers/value/MergedPropertyValueRenderer.js.map +1 -1
- package/lib/esm/components-react/properties/renderers/value/MultilineTextPropertyValueRenderer.js.map +1 -1
- package/lib/esm/components-react/properties/renderers/value/NavigationPropertyValueRenderer.js.map +1 -1
- package/lib/esm/components-react/properties/renderers/value/PrimitivePropertyValueRenderer.js.map +1 -1
- package/lib/esm/components-react/properties/renderers/value/StructPropertyValueRenderer.js.map +1 -1
- package/lib/esm/components-react/properties/renderers/value/UrlPropertyValueRenderer.js.map +1 -1
- package/lib/esm/components-react/properties/renderers/value/WithContextStyle.js.map +1 -1
- package/lib/esm/components-react/properties/renderers/value/table/ArrayValueRenderer.js.map +1 -1
- package/lib/esm/components-react/properties/renderers/value/table/NonPrimitiveValueRenderer.js.map +1 -1
- package/lib/esm/components-react/properties/renderers/value/table/StructValueRenderer.js.map +1 -1
- package/lib/esm/components-react/propertygrid/PropertyCategoryRendererManager.js.map +1 -1
- package/lib/esm/components-react/propertygrid/PropertyDataProvider.js.map +1 -1
- package/lib/esm/components-react/propertygrid/SimplePropertyDataProvider.js.map +1 -1
- package/lib/esm/components-react/propertygrid/component/ColumnResizingPropertyListPropsSupplier.js.map +1 -1
- package/lib/esm/components-react/propertygrid/component/FlatItemNestedBorderWrapper.js.map +1 -1
- package/lib/esm/components-react/propertygrid/component/PropertyCategoryBlock.js.map +1 -1
- package/lib/esm/components-react/propertygrid/component/PropertyGrid.js.map +1 -1
- package/lib/esm/components-react/propertygrid/component/PropertyGrid.scss +73 -73
- package/lib/esm/components-react/propertygrid/component/PropertyGridCommons.js.map +1 -1
- package/lib/esm/components-react/propertygrid/component/PropertyGridEventsRelatedPropsSupplier.js.map +1 -1
- package/lib/esm/components-react/propertygrid/component/PropertyList.js.map +1 -1
- package/lib/esm/components-react/propertygrid/component/VirtualizedPropertyGrid.js.map +1 -1
- package/lib/esm/components-react/propertygrid/component/VirtualizedPropertyGrid.scss +101 -101
- package/lib/esm/components-react/propertygrid/component/VirtualizedPropertyGridWithDataProvider.js.map +1 -1
- package/lib/esm/components-react/propertygrid/dataproviders/FilteringDataProvider.js.map +1 -1
- package/lib/esm/components-react/propertygrid/dataproviders/filterers/CompositePropertyDataFilterer.js.map +1 -1
- package/lib/esm/components-react/propertygrid/dataproviders/filterers/DisplayValuePropertyDataFilterer.js.map +1 -1
- package/lib/esm/components-react/propertygrid/dataproviders/filterers/LabelPropertyDataFilterer.js.map +1 -1
- package/lib/esm/components-react/propertygrid/dataproviders/filterers/PropertyCategoryLabelFilterer.js.map +1 -1
- package/lib/esm/components-react/propertygrid/dataproviders/filterers/PropertyDataFiltererBase.js.map +1 -1
- package/lib/esm/components-react/propertygrid/internal/PropertyGridEventHandler.js.map +1 -1
- package/lib/esm/components-react/propertygrid/internal/PropertyGridHooks.d.ts +2 -0
- package/lib/esm/components-react/propertygrid/internal/PropertyGridHooks.d.ts.map +1 -1
- package/lib/esm/components-react/propertygrid/internal/PropertyGridHooks.js +2 -0
- package/lib/esm/components-react/propertygrid/internal/PropertyGridHooks.js.map +1 -1
- package/lib/esm/components-react/propertygrid/internal/PropertyGridModel.js.map +1 -1
- package/lib/esm/components-react/propertygrid/internal/PropertyGridModelChangeEvent.js.map +1 -1
- package/lib/esm/components-react/propertygrid/internal/PropertyGridModelSource.js.map +1 -1
- package/lib/esm/components-react/propertygrid/internal/flat-items/FlatGridItem.js.map +1 -1
- package/lib/esm/components-react/propertygrid/internal/flat-items/MutableCategorizedArrayProperty.js.map +1 -1
- package/lib/esm/components-react/propertygrid/internal/flat-items/MutableCategorizedPrimitiveProperty.js.map +1 -1
- package/lib/esm/components-react/propertygrid/internal/flat-items/MutableCategorizedStructProperty.js.map +1 -1
- 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.map +1 -1
- 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.map +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.map +1 -1
- package/lib/esm/components-react/selectable-content/SelectableContent.js.map +1 -1
- package/lib/esm/components-react/selectable-content/SelectableContent.scss +20 -20
- package/lib/esm/components-react/table/TableDataProvider.js.map +1 -1
- package/lib/esm/components-react/toolbar/Item.js.map +1 -1
- package/lib/esm/components-react/toolbar/Item.scss +91 -91
- package/lib/esm/components-react/toolbar/ItemWrapper.js.map +1 -1
- package/lib/esm/components-react/toolbar/ItemWrapper.scss +10 -10
- package/lib/esm/components-react/toolbar/Items.js.map +1 -1
- package/lib/esm/components-react/toolbar/Items.scss +96 -96
- package/lib/esm/components-react/toolbar/Overflow.js.map +1 -1
- package/lib/esm/components-react/toolbar/Overflow.scss +57 -57
- package/lib/esm/components-react/toolbar/OverflowPanel.js.map +1 -1
- package/lib/esm/components-react/toolbar/OverflowPanel.scss +37 -37
- package/lib/esm/components-react/toolbar/PopupItem.js.map +1 -1
- package/lib/esm/components-react/toolbar/PopupItem.scss +88 -88
- package/lib/esm/components-react/toolbar/PopupItemWithDrag.js.map +1 -1
- package/lib/esm/components-react/toolbar/PopupItemsPanel.js.map +1 -1
- package/lib/esm/components-react/toolbar/Toolbar.js.map +1 -1
- package/lib/esm/components-react/toolbar/Toolbar.scss +18 -18
- package/lib/esm/components-react/toolbar/ToolbarWithOverflow.js.map +1 -1
- package/lib/esm/components-react/toolbar/_variables.scss +34 -34
- package/lib/esm/components-react/toolbar/groupPanel/BackArrow.js.map +1 -1
- package/lib/esm/components-react/toolbar/groupPanel/BackArrow.scss +44 -44
- package/lib/esm/components-react/toolbar/groupPanel/Column.js.map +1 -1
- package/lib/esm/components-react/toolbar/groupPanel/Column.scss +9 -9
- package/lib/esm/components-react/toolbar/groupPanel/Columns.js.map +1 -1
- package/lib/esm/components-react/toolbar/groupPanel/Columns.scss +10 -10
- package/lib/esm/components-react/toolbar/groupPanel/Panel.js.map +1 -1
- package/lib/esm/components-react/toolbar/groupPanel/Panel.scss +15 -15
- package/lib/esm/components-react/toolbar/groupPanel/Title.js.map +1 -1
- package/lib/esm/components-react/toolbar/groupPanel/Title.scss +33 -33
- package/lib/esm/components-react/toolbar/groupPanel/_variables.scss +16 -16
- package/lib/esm/components-react/toolbar/groupPanel/tool/Expander.js.map +1 -1
- package/lib/esm/components-react/toolbar/groupPanel/tool/Expander.scss +29 -29
- package/lib/esm/components-react/toolbar/groupPanel/tool/Tool.js.map +1 -1
- package/lib/esm/components-react/toolbar/groupPanel/tool/Tool.scss +117 -117
- package/lib/esm/components-react/toolbar/groupPanel/tool/_variables.scss +12 -12
- package/lib/esm/components-react/toolbar/useDragInteraction.js.map +1 -1
- package/lib/esm/components-react/toolbar/utilities/Direction.js.map +1 -1
- package/lib/esm/components-react/tree/HighlightingEngine.js.map +1 -1
- package/lib/esm/components-react/tree/HighlightingEngine.scss +7 -7
- package/lib/esm/components-react/tree/ImageLoader.js.map +1 -1
- package/lib/esm/components-react/tree/SimpleTreeDataProvider.js.map +1 -1
- package/lib/esm/components-react/tree/TreeComponentTestId.js.map +1 -1
- package/lib/esm/components-react/tree/TreeDataProvider.js.map +1 -1
- package/lib/esm/components-react/tree/controlled/Observable.js.map +1 -1
- package/lib/esm/components-react/tree/controlled/TreeActions.js.map +1 -1
- package/lib/esm/components-react/tree/controlled/TreeEventDispatcher.js.map +1 -1
- package/lib/esm/components-react/tree/controlled/TreeEventHandler.js.map +1 -1
- package/lib/esm/components-react/tree/controlled/TreeEvents.js.map +1 -1
- package/lib/esm/components-react/tree/controlled/TreeHooks.js.map +1 -1
- package/lib/esm/components-react/tree/controlled/TreeModel.js.map +1 -1
- package/lib/esm/components-react/tree/controlled/TreeModelSource.js.map +1 -1
- package/lib/esm/components-react/tree/controlled/TreeNodeLoader.js.map +1 -1
- package/lib/esm/components-react/tree/controlled/component/ControlledTree.js.map +1 -1
- package/lib/esm/components-react/tree/controlled/component/ControlledTree.scss +102 -102
- package/lib/esm/components-react/tree/controlled/component/NodeContent.js.map +1 -1
- package/lib/esm/components-react/tree/controlled/component/NodeContent.scss +27 -27
- package/lib/esm/components-react/tree/controlled/component/TreeNodeEditor.js.map +1 -1
- package/lib/esm/components-react/tree/controlled/component/TreeNodeRenderer.js.map +1 -1
- package/lib/esm/components-react/tree/controlled/component/TreeRenderer.js.map +1 -1
- package/lib/esm/components-react/tree/controlled/internal/SparseTree.js.map +1 -1
- package/lib/esm/components-react/tree/controlled/internal/TreeModelMutator.js.map +1 -1
- package/lib/esm/components-react/tree/controlled/internal/TreeSelectionManager.js.map +1 -1
- package/lib/esm/components-react.js.map +1 -1
- package/lib/public/locales/en/UiComponents.json +139 -139
- package/package.json +16 -14
- package/ThirdPartyNotices.md +0 -31
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FlatGridItem.js","sourceRoot":"","sources":["../../../../../../src/components-react/propertygrid/internal/flat-items/FlatGridItem.ts"],"names":[],"mappings":";AAAA;;;+FAG+F","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 PropertyGrid\n */\nimport { CategorizedPropertyTypes, FlatGridItemType } from \"./MutableFlatGridItem\";\nimport { PropertyRecord } from \"@itwin/appui-abstract\";\nimport { PropertyCategory } from \"../../PropertyDataProvider\";\n\n/**\n * Base immutable data structure defining common methods and properties for categories and categorized properties\n * @public\n */\nexport interface FlatGridItemBase {\n readonly isExpanded: boolean;\n readonly key: string;\n readonly selectionKey: string;\n readonly parentSelectionKey: string | undefined;\n readonly parentCategorySelectionKey: string | undefined;\n readonly depth: number;\n readonly label: string;\n readonly type: FlatGridItemType;\n readonly lastInNumberOfCategories: number;\n readonly isLastInRootCategory: boolean;\n getDescendantsAndSelf(): FlatGridItem[];\n getVisibleDescendantsAndSelf(): FlatGridItem[];\n getChildren(): FlatGridItem[];\n getLastVisibleDescendantOrSelf(): FlatGridItem;\n}\n\n/**\n * Data structure which describes methods and properties present on immutable [[GridCategoryItem]]\n * @public\n */\nexport interface GridCategoryItem extends FlatGridItemBase {\n readonly type: FlatGridItemType.Category;\n readonly name: string;\n readonly derivedCategory: PropertyCategory;\n}\n\n/**\n * Data structure which describes methods and properties present on immutable [[CategorizedPropertyItem]] objects\n * @public\n */\nexport interface CategorizedPropertyItem extends FlatGridItemBase {\n readonly type: CategorizedPropertyTypes;\n readonly derivedRecord: PropertyRecord;\n readonly parentCategorySelectionKey: string;\n readonly parentSelectionKey: string;\n\n getChildren(): CategorizedPropertyItem[];\n}\n\n/**\n * Type which describes immutable [[GridCategoryItem]] or [[CategorizedPropertyItem]]\n * @public\n */\nexport type FlatGridItem = CategorizedPropertyItem | GridCategoryItem;\n"]}
|
|
1
|
+
{"version":3,"file":"FlatGridItem.js","sourceRoot":"","sources":["../../../../../../src/components-react/propertygrid/internal/flat-items/FlatGridItem.ts"],"names":[],"mappings":";AAAA;;;+FAG+F","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\n/** @packageDocumentation\r\n * @module PropertyGrid\r\n */\r\nimport { CategorizedPropertyTypes, FlatGridItemType } from \"./MutableFlatGridItem\";\r\nimport { PropertyRecord } from \"@itwin/appui-abstract\";\r\nimport { PropertyCategory } from \"../../PropertyDataProvider\";\r\n\r\n/**\r\n * Base immutable data structure defining common methods and properties for categories and categorized properties\r\n * @public\r\n */\r\nexport interface FlatGridItemBase {\r\n readonly isExpanded: boolean;\r\n readonly key: string;\r\n readonly selectionKey: string;\r\n readonly parentSelectionKey: string | undefined;\r\n readonly parentCategorySelectionKey: string | undefined;\r\n readonly depth: number;\r\n readonly label: string;\r\n readonly type: FlatGridItemType;\r\n readonly lastInNumberOfCategories: number;\r\n readonly isLastInRootCategory: boolean;\r\n getDescendantsAndSelf(): FlatGridItem[];\r\n getVisibleDescendantsAndSelf(): FlatGridItem[];\r\n getChildren(): FlatGridItem[];\r\n getLastVisibleDescendantOrSelf(): FlatGridItem;\r\n}\r\n\r\n/**\r\n * Data structure which describes methods and properties present on immutable [[GridCategoryItem]]\r\n * @public\r\n */\r\nexport interface GridCategoryItem extends FlatGridItemBase {\r\n readonly type: FlatGridItemType.Category;\r\n readonly name: string;\r\n readonly derivedCategory: PropertyCategory;\r\n}\r\n\r\n/**\r\n * Data structure which describes methods and properties present on immutable [[CategorizedPropertyItem]] objects\r\n * @public\r\n */\r\nexport interface CategorizedPropertyItem extends FlatGridItemBase {\r\n readonly type: CategorizedPropertyTypes;\r\n readonly derivedRecord: PropertyRecord;\r\n readonly parentCategorySelectionKey: string;\r\n readonly parentSelectionKey: string;\r\n\r\n getChildren(): CategorizedPropertyItem[];\r\n}\r\n\r\n/**\r\n * Type which describes immutable [[GridCategoryItem]] or [[CategorizedPropertyItem]]\r\n * @public\r\n */\r\nexport type FlatGridItem = CategorizedPropertyItem | GridCategoryItem;\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MutableCategorizedArrayProperty.js","sourceRoot":"","sources":["../../../../../../src/components-react/propertygrid/internal/flat-items/MutableCategorizedArrayProperty.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAM/F,+DAA4I;AAG5I;;;GAGG;AACH,MAAa,+BAAgC,SAAQ,gDAA0B;IAI7E,YACE,MAAsB,EACtB,kBAA0B,EAC1B,0BAAkC,EAClC,KAAa,EACb,eAAwC,EACxC,YAAqB,EACrB,oBAA6B;QAE7B,KAAK,CAAC,sCAAgB,CAAC,KAAK,EAAE,MAAM,EAAE,kBAAkB,EAAE,0BAA0B,EAAE,KAAK,EAAE,YAAY,EAAE,oBAAoB,CAAC,CAAC;QACjI,IAAI,CAAC,YAAY,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC,0BAA0B,CAAC;QAChE,MAAM,aAAa,GAAG,KAAK,GAAG,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAC1D,IAAI,CAAC,SAAS,GAAG,MAAM,CAAC,kBAAkB,EAAE,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE;YAChE,MAAM,OAAO,GAAG,GAAG,KAAK,CAAC,QAAQ,CAAC,IAAI,IAAI,KAAK,EAAE,CAAC;YAClD,MAAM,eAAe,GAAG,IAAI,KAAK,GAAG,CAAC,GAAG,CAAC;YACzC,OAAO,eAAe,CAAC,yBAAyB,CAAC,KAAK,EAAE,IAAI,CAAC,YAAY,EAAE,0BAA0B,EAAE,aAAa,EAAE,OAAO,EAAE,eAAe,CAAC,CAAC;QAClJ,CAAC,CAAC,CAAC;IACL,CAAC;IAED,IAAW,IAAI;QACb,OAAO,sCAAgB,CAAC,KAAK,CAAC;IAChC,CAAC;IAEM,WAAW;QAChB,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;IAEe,qBAAqB;QACnC,OAAO,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,KAAK,CAAC,qBAAqB,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,cAAc,EAAE,CAAC;IACnF,CAAC;IAEe,qBAAqB;QACnC,MAAM,WAAW,GAA2B,EAAE,CAAC;QAC/C,IAAI,IAAI,CAAC,UAAU,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE;YACzC,wFAAwF;YACxF,qCAAqC;YACrC,IAAI,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,WAAW,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,4BAA4B,EAAE,CAAC,CAAC,CAAC;SAClG;QACD,OAAO,WAAW,CAAC;IACrB,CAAC;IAEe,4BAA4B;QAC1C,OAAO,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,KAAK,CAAC,4BAA4B,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,qBAAqB,EAAE,CAAC;IACjG,CAAC;CACF;AAhDD,0EAgDC","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 PropertyGrid\n */\nimport { PropertyRecord } from \"@itwin/appui-abstract\";\nimport { FlatGridItemType, IMutableCategorizedPropertyItem, IMutableFlatGridItem, MutableCategorizedProperty } from \"./MutableFlatGridItem\";\nimport { IMutableGridItemFactory } from \"./MutableGridItemFactory\";\n\n/**\n * Mutable wrapper object for PropertyRecord with array valueFormat which provides methods for working with and managing record children hierarchies.\n * @public\n */\nexport class MutableCategorizedArrayProperty extends MutableCategorizedProperty implements IMutableCategorizedPropertyItem {\n private _renderLabel: boolean;\n private _children: IMutableCategorizedPropertyItem[];\n\n public constructor(\n record: PropertyRecord,\n parentSelectionKey: string,\n parentCategorySelectionKey: string,\n depth: number,\n gridItemFactory: IMutableGridItemFactory,\n overrideName?: string,\n overrideDisplayLabel?: string,\n ) {\n super(FlatGridItemType.Array, record, parentSelectionKey, parentCategorySelectionKey, depth, overrideName, overrideDisplayLabel);\n this._renderLabel = !record.property.hideCompositePropertyLabel;\n const childrenDepth = depth + (this._renderLabel ? 1 : 0);\n this._children = record.getChildrenRecords().map((child, index) => {\n const newName = `${child.property.name}_${index}`;\n const newDisplayLabel = `[${index + 1}]`;\n return gridItemFactory.createCategorizedProperty(child, this.selectionKey, parentCategorySelectionKey, childrenDepth, newName, newDisplayLabel);\n });\n }\n\n public get type(): FlatGridItemType.Array {\n return FlatGridItemType.Array;\n }\n\n public getChildren(): IMutableCategorizedPropertyItem[] {\n return this._children;\n }\n\n public override getDescendantsAndSelf() {\n return this._renderLabel ? super.getDescendantsAndSelf() : this.getDescendants();\n }\n\n public override getVisibleDescendants(): IMutableFlatGridItem[] {\n const descendants: IMutableFlatGridItem[] = [];\n if (this.isExpanded || !this._renderLabel) {\n // always render children if not rendering the label, otherwise there's no way to expand\n // this item to make children visible\n this.getChildren().forEach((child) => descendants.push(...child.getVisibleDescendantsAndSelf()));\n }\n return descendants;\n }\n\n public override getVisibleDescendantsAndSelf() {\n return this._renderLabel ? super.getVisibleDescendantsAndSelf() : this.getVisibleDescendants();\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"MutableCategorizedArrayProperty.js","sourceRoot":"","sources":["../../../../../../src/components-react/propertygrid/internal/flat-items/MutableCategorizedArrayProperty.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAM/F,+DAA4I;AAG5I;;;GAGG;AACH,MAAa,+B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,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE;YACzC,wFAAwF;YACxF,qCAAqC;YACrC,IAAI,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,WAAW,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,4BAA4B,EAAE,CAAC,CAAC,CAAC;SAClG;QACD,OAAO,WAAW,CAAC;IACrB,CAAC;IAEe,4BAA4B;QAC1C,OAAO,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,KAAK,CAAC,4BAA4B,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,qBAAqB,EAAE,CAAC;IACjG,CAAC;CACF;AAhDD,0EAgDC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\n/** @packageDocumentation\r\n * @module PropertyGrid\r\n */\r\nimport { PropertyRecord } from \"@itwin/appui-abstract\";\r\nimport { FlatGridItemType, IMutableCategorizedPropertyItem, IMutableFlatGridItem, MutableCategorizedProperty } from \"./MutableFlatGridItem\";\r\nimport { IMutableGridItemFactory } from \"./MutableGridItemFactory\";\r\n\r\n/**\r\n * Mutable wrapper object for PropertyRecord with array valueFormat which provides methods for working with and managing record children hierarchies.\r\n * @public\r\n */\r\nexport class MutableCategorizedArrayProperty extends MutableCategorizedProperty implements IMutableCategorizedPropertyItem {\r\n private _renderLabel: boolean;\r\n private _children: IMutableCategorizedPropertyItem[];\r\n\r\n public constructor(\r\n record: PropertyRecord,\r\n parentSelectionKey: string,\r\n parentCategorySelectionKey: string,\r\n depth: number,\r\n gridItemFactory: IMutableGridItemFactory,\r\n overrideName?: string,\r\n overrideDisplayLabel?: string,\r\n ) {\r\n super(FlatGridItemType.Array, record, parentSelectionKey, parentCategorySelectionKey, depth, overrideName, overrideDisplayLabel);\r\n this._renderLabel = !record.property.hideCompositePropertyLabel;\r\n const childrenDepth = depth + (this._renderLabel ? 1 : 0);\r\n this._children = record.getChildrenRecords().map((child, index) => {\r\n const newName = `${child.property.name}_${index}`;\r\n const newDisplayLabel = `[${index + 1}]`;\r\n return gridItemFactory.createCategorizedProperty(child, this.selectionKey, parentCategorySelectionKey, childrenDepth, newName, newDisplayLabel);\r\n });\r\n }\r\n\r\n public get type(): FlatGridItemType.Array {\r\n return FlatGridItemType.Array;\r\n }\r\n\r\n public getChildren(): IMutableCategorizedPropertyItem[] {\r\n return this._children;\r\n }\r\n\r\n public override getDescendantsAndSelf() {\r\n return this._renderLabel ? super.getDescendantsAndSelf() : this.getDescendants();\r\n }\r\n\r\n public override getVisibleDescendants(): IMutableFlatGridItem[] {\r\n const descendants: IMutableFlatGridItem[] = [];\r\n if (this.isExpanded || !this._renderLabel) {\r\n // always render children if not rendering the label, otherwise there's no way to expand\r\n // this item to make children visible\r\n this.getChildren().forEach((child) => descendants.push(...child.getVisibleDescendantsAndSelf()));\r\n }\r\n return descendants;\r\n }\r\n\r\n public override getVisibleDescendantsAndSelf() {\r\n return this._renderLabel ? super.getVisibleDescendantsAndSelf() : this.getVisibleDescendants();\r\n }\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MutableCategorizedPrimitiveProperty.js","sourceRoot":"","sources":["../../../../../../src/components-react/propertygrid/internal/flat-items/MutableCategorizedPrimitiveProperty.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAM/F,+DAAsH;AAEtH;;;GAGG;AACH,MAAa,mCAAoC,SAAQ,gDAA0B;IACjF,YACE,MAAsB,EACtB,kBAA0B,EAC1B,0BAAkC,EAClC,KAAa,EACb,YAAqB,EACrB,oBAA6B;QAE7B,KAAK,CAAC,sCAAgB,CAAC,SAAS,EAAE,MAAM,EAAE,kBAAkB,EAAE,0BAA0B,EAAE,KAAK,EAAE,YAAY,EAAE,oBAAoB,CAAC,CAAC;IACvI,CAAC;IAED,IAAW,IAAI;QACb,OAAO,sCAAgB,CAAC,SAAS,CAAC;IACpC,CAAC;IAEM,WAAW;QAChB,OAAO,EAAE,CAAC;IACZ,CAAC;CACF;AAnBD,kFAmBC","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 PropertyGrid\n */\nimport { PropertyRecord } from \"@itwin/appui-abstract\";\nimport { FlatGridItemType, IMutableCategorizedPropertyItem, MutableCategorizedProperty } from \"./MutableFlatGridItem\";\n\n/**\n * Mutable wrapper object for PropertyRecord with primitive valueFormat.\n * @public\n */\nexport class MutableCategorizedPrimitiveProperty extends MutableCategorizedProperty implements IMutableCategorizedPropertyItem {\n public constructor(\n record: PropertyRecord,\n parentSelectionKey: string,\n parentCategorySelectionKey: string,\n depth: number,\n overrideName?: string,\n overrideDisplayLabel?: string,\n ) {\n super(FlatGridItemType.Primitive, record, parentSelectionKey, parentCategorySelectionKey, depth, overrideName, overrideDisplayLabel);\n }\n\n public get type(): FlatGridItemType.Primitive {\n return FlatGridItemType.Primitive;\n }\n\n public getChildren(): IMutableCategorizedPropertyItem[] {\n return [];\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"MutableCategorizedPrimitiveProperty.js","sourceRoot":"","sources":["../../../../../../src/components-react/propertygrid/internal/flat-items/MutableCategorizedPrimitiveProperty.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAM/F,+DAAsH;AAEtH;;;GAGG;AACH,MAAa,mCAAoC,SAAQ,gDAA0B;IACjF,YACE,MAAsB,EACtB,kBAA0B,EAC1B,0BAAkC,EAClC,KAAa,EACb,YAAqB,EACrB,oBAA6B;QAE7B,KAAK,CAAC,sCAAgB,CAAC,SAAS,EAAE,MAAM,EAAE,kBAAkB,EAAE,0BAA0B,EAAE,KAAK,EAAE,YAAY,EAAE,oBAAoB,CAAC,CAAC;IACvI,CAAC;IAED,IAAW,IAAI;QACb,OAAO,sCAAgB,CAAC,SAAS,CAAC;IACpC,CAAC;IAEM,WAAW;QAChB,OAAO,EAAE,CAAC;IACZ,CAAC;CACF;AAnBD,kFAmBC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\n/** @packageDocumentation\r\n * @module PropertyGrid\r\n */\r\nimport { PropertyRecord } from \"@itwin/appui-abstract\";\r\nimport { FlatGridItemType, IMutableCategorizedPropertyItem, MutableCategorizedProperty } from \"./MutableFlatGridItem\";\r\n\r\n/**\r\n * Mutable wrapper object for PropertyRecord with primitive valueFormat.\r\n * @public\r\n */\r\nexport class MutableCategorizedPrimitiveProperty extends MutableCategorizedProperty implements IMutableCategorizedPropertyItem {\r\n public constructor(\r\n record: PropertyRecord,\r\n parentSelectionKey: string,\r\n parentCategorySelectionKey: string,\r\n depth: number,\r\n overrideName?: string,\r\n overrideDisplayLabel?: string,\r\n ) {\r\n super(FlatGridItemType.Primitive, record, parentSelectionKey, parentCategorySelectionKey, depth, overrideName, overrideDisplayLabel);\r\n }\r\n\r\n public get type(): FlatGridItemType.Primitive {\r\n return FlatGridItemType.Primitive;\r\n }\r\n\r\n public getChildren(): IMutableCategorizedPropertyItem[] {\r\n return [];\r\n }\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MutableCategorizedStructProperty.js","sourceRoot":"","sources":["../../../../../../src/components-react/propertygrid/internal/flat-items/MutableCategorizedStructProperty.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAM/F,+DAA4I;AAG5I;;;GAGG;AACH,MAAa,gCAAiC,SAAQ,gDAA0B;IAI9E,YACE,MAAsB,EACtB,kBAA0B,EAC1B,0BAAkC,EAClC,KAAa,EACb,eAAwC,EACxC,YAAqB,EACrB,oBAA6B;QAE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AC,YAAY,CAAC,CAAC,CAAC,KAAK,CAAC,4BAA4B,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,qBAAqB,EAAE,CAAC;IACjG,CAAC;CACF;AA9CD,4EA8CC","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 PropertyGrid\n */\nimport { PropertyRecord } from \"@itwin/appui-abstract\";\nimport { FlatGridItemType, IMutableCategorizedPropertyItem, IMutableFlatGridItem, MutableCategorizedProperty } from \"./MutableFlatGridItem\";\nimport { IMutableGridItemFactory } from \"./MutableGridItemFactory\";\n\n/**\n * Mutable wrapper object for PropertyRecord with struct valueFormat which provides methods for working with and managing record children hierarchies.\n * @public\n */\nexport class MutableCategorizedStructProperty extends MutableCategorizedProperty implements IMutableCategorizedPropertyItem {\n private _renderLabel: boolean;\n private _children: IMutableCategorizedPropertyItem[];\n\n public constructor(\n record: PropertyRecord,\n parentSelectionKey: string,\n parentCategorySelectionKey: string,\n depth: number,\n gridItemFactory: IMutableGridItemFactory,\n overrideName?: string,\n overrideDisplayLabel?: string,\n ) {\n super(FlatGridItemType.Struct, record, parentSelectionKey, parentCategorySelectionKey, depth, overrideName, overrideDisplayLabel);\n this._renderLabel = !record.property.hideCompositePropertyLabel;\n const childrenDepth = depth + (this._renderLabel ? 1 : 0);\n this._children = record.getChildrenRecords().map((value) => {\n return gridItemFactory.createCategorizedProperty(value, this.selectionKey, this.parentCategorySelectionKey, childrenDepth);\n });\n }\n\n public get type(): FlatGridItemType.Struct {\n return FlatGridItemType.Struct;\n }\n\n public getChildren(): IMutableCategorizedPropertyItem[] {\n return this._children;\n }\n\n public override getDescendantsAndSelf() {\n return this._renderLabel ? super.getDescendantsAndSelf() : this.getDescendants();\n }\n\n public override getVisibleDescendants(): IMutableFlatGridItem[] {\n const descendants: IMutableFlatGridItem[] = [];\n if (this.isExpanded || !this._renderLabel) {\n // always render children if not rendering the label, otherwise there's no way to expand\n // this item to make children visible\n this.getChildren().forEach((child) => descendants.push(...child.getVisibleDescendantsAndSelf()));\n }\n return descendants;\n }\n\n public override getVisibleDescendantsAndSelf() {\n return this._renderLabel ? super.getVisibleDescendantsAndSelf() : this.getVisibleDescendants();\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"MutableCategorizedStructProperty.js","sourceRoot":"","sources":["../../../../../../src/components-react/propertygrid/internal/flat-items/MutableCategorizedStructProperty.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAM/F,+DAA4I;AAG5I;;;GAGG;AACH,MAAa,gCAAiC,SAAQ,gDAA0B;IAI9E,YACE,MAAsB,EACtB,kBAA0B,EAC1B,0BAAkC,EAClC,KAAa,EACb,eAAwC,EACxC,YAAqB,EACrB,oBAA6B;QAE7B,KAAK,CAAC,sCAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,kBAAkB,EAAE,0BAA0B,EAAE,KAAK,EAAE,YAAY,EAAE,oBAAoB,CAAC,CAAC;QAClI,IAAI,CAAC,YAAY,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC,0BAA0B,CAAC;QAChE,MAAM,aAAa,GAAG,KAAK,GAAG,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAC1D,IAAI,CAAC,SAAS,GAAG,MAAM,CAAC,kBAAkB,EAAE,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE;YACzD,OAAO,eAAe,CAAC,yBAAyB,CAAC,KAAK,EAAE,IAAI,CAAC,YAAY,EAAE,IAAI,CAAC,0BAA0B,EAAE,aAAa,CAAC,CAAC;QAC7H,CAAC,CAAC,CAAC;IACL,CAAC;IAED,IAAW,IAAI;QACb,OAAO,sCAAgB,CAAC,MAAM,CAAC;IACjC,CAAC;IAEM,WAAW;QAChB,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;IAEe,qBAAqB;QACnC,OAAO,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,KAAK,CAAC,qBAAqB,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,cAAc,EAAE,CAAC;IACnF,CAAC;IAEe,qBAAqB;QACnC,MAAM,WAAW,GAA2B,EAAE,CAAC;QAC/C,IAAI,IAAI,CAAC,UAAU,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE;YACzC,wFAAwF;YACxF,qCAAqC;YACrC,IAAI,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,WAAW,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,4BAA4B,EAAE,CAAC,CAAC,CAAC;SAClG;QACD,OAAO,WAAW,CAAC;IACrB,CAAC;IAEe,4BAA4B;QAC1C,OAAO,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,KAAK,CAAC,4BAA4B,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,qBAAqB,EAAE,CAAC;IACjG,CAAC;CACF;AA9CD,4EA8CC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\n/** @packageDocumentation\r\n * @module PropertyGrid\r\n */\r\nimport { PropertyRecord } from \"@itwin/appui-abstract\";\r\nimport { FlatGridItemType, IMutableCategorizedPropertyItem, IMutableFlatGridItem, MutableCategorizedProperty } from \"./MutableFlatGridItem\";\r\nimport { IMutableGridItemFactory } from \"./MutableGridItemFactory\";\r\n\r\n/**\r\n * Mutable wrapper object for PropertyRecord with struct valueFormat which provides methods for working with and managing record children hierarchies.\r\n * @public\r\n */\r\nexport class MutableCategorizedStructProperty extends MutableCategorizedProperty implements IMutableCategorizedPropertyItem {\r\n private _renderLabel: boolean;\r\n private _children: IMutableCategorizedPropertyItem[];\r\n\r\n public constructor(\r\n record: PropertyRecord,\r\n parentSelectionKey: string,\r\n parentCategorySelectionKey: string,\r\n depth: number,\r\n gridItemFactory: IMutableGridItemFactory,\r\n overrideName?: string,\r\n overrideDisplayLabel?: string,\r\n ) {\r\n super(FlatGridItemType.Struct, record, parentSelectionKey, parentCategorySelectionKey, depth, overrideName, overrideDisplayLabel);\r\n this._renderLabel = !record.property.hideCompositePropertyLabel;\r\n const childrenDepth = depth + (this._renderLabel ? 1 : 0);\r\n this._children = record.getChildrenRecords().map((value) => {\r\n return gridItemFactory.createCategorizedProperty(value, this.selectionKey, this.parentCategorySelectionKey, childrenDepth);\r\n });\r\n }\r\n\r\n public get type(): FlatGridItemType.Struct {\r\n return FlatGridItemType.Struct;\r\n }\r\n\r\n public getChildren(): IMutableCategorizedPropertyItem[] {\r\n return this._children;\r\n }\r\n\r\n public override getDescendantsAndSelf() {\r\n return this._renderLabel ? super.getDescendantsAndSelf() : this.getDescendants();\r\n }\r\n\r\n public override getVisibleDescendants(): IMutableFlatGridItem[] {\r\n const descendants: IMutableFlatGridItem[] = [];\r\n if (this.isExpanded || !this._renderLabel) {\r\n // always render children if not rendering the label, otherwise there's no way to expand\r\n // this item to make children visible\r\n this.getChildren().forEach((child) => descendants.push(...child.getVisibleDescendantsAndSelf()));\r\n }\r\n return descendants;\r\n }\r\n\r\n public override getVisibleDescendantsAndSelf() {\r\n return this._renderLabel ? super.getVisibleDescendantsAndSelf() : this.getVisibleDescendants();\r\n }\r\n}\r\n"]}
|
package/lib/cjs/components-react/propertygrid/internal/flat-items/MutableCustomGridCategory.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MutableCustomGridCategory.js","sourceRoot":"","sources":["../../../../../../src/components-react/propertygrid/internal/flat-items/MutableCustomGridCategory.ts"],"names":[],"mappings":";;;AAKA,+DAE+B;AAI/B,gBAAgB;AAChB,MAAa,yBAA0B,SAAQ,iDAA2B;IASxE,YACE,QAA0B,EAC1B,WAAgC,E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;IACxC,CAAC;IAED,IAAoB,wBAAwB,CAAC,KAAa;QACxD,IAAI,CAAC,yBAAyB,GAAG,KAAK,GAAG,CAAC,CAAC;IAC7C,CAAC;IAEM,OAAO;QACZ,OAAO,IAAI,CAAC;IACd,CAAC;IAEM,WAAW;QAChB,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;IAEe,4BAA4B;QAC1C,OAAO,CAAC,IAAI,CAAC,CAAC;IAChB,CAAC;CACF;AAlED,8DAkEC","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*--------------------------------------------------------------------------------------------*/\nimport { PropertyCategory } from \"../../PropertyDataProvider\";\nimport {\n FlatGridItemType, IMutableCategorizedPropertyItem, IMutableFlatGridItem, IMutableGridCategoryItem, MutableFlatPropertyGridItem,\n} from \"./MutableFlatGridItem\";\nimport { CategoryRecordsDict } from \"./MutableGridCategory\";\nimport { IMutableGridItemFactory } from \"./MutableGridItemFactory\";\n\n/** @internal */\nexport class MutableCustomGridCategory extends MutableFlatPropertyGridItem implements IMutableGridCategoryItem {\n private readonly _children: IMutableCategorizedPropertyItem[];\n private readonly _renderer: PropertyCategory[\"renderer\"];\n\n public readonly type = FlatGridItemType.Category as const;\n public readonly label: string;\n public readonly name: string;\n public readonly selectionKey: string;\n\n public constructor(\n category: PropertyCategory,\n recordsDict: CategoryRecordsDict,\n gridItemFactory: IMutableGridItemFactory,\n parentSelectionKey: string | undefined,\n depth: number,\n ) {\n super(depth, parentSelectionKey, parentSelectionKey);\n\n this.name = category.name;\n this.label = category.label;\n this.isExpanded = category.expand;\n this.selectionKey = parentSelectionKey === undefined ? this.name : `${parentSelectionKey}_${this.name}`;\n this._renderer = category.renderer;\n\n // Even though categories are nested and have their own depth, categorized properties depth is counted starting with\n // the parent category.\n const categoryRecords = recordsDict[category.name] ?? [];\n this._children = categoryRecords.map(\n (value) => gridItemFactory.createCategorizedProperty(value, this.selectionKey, this.selectionKey, 0),\n );\n\n this.lastInNumberOfCategories = -1;\n }\n\n public get derivedCategory(): PropertyCategory {\n return {\n name: this.name,\n label: this.label,\n expand: this.isExpanded,\n renderer: this._renderer,\n };\n }\n\n public get isRootCategory(): boolean {\n return this.depth === 0;\n }\n\n public override get lastInNumberOfCategories(): number {\n return this._lastInNumberOfCategories;\n }\n\n public override set lastInNumberOfCategories(value: number) {\n this._lastInNumberOfCategories = value + 1;\n }\n\n public getSelf() {\n return this;\n }\n\n public getChildren(): IMutableFlatGridItem[] {\n return this._children;\n }\n\n public override getVisibleDescendantsAndSelf(): IMutableFlatGridItem[] {\n return [this];\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"MutableCustomGridCategory.js","sourceRoot":"","sources":["../../../../../../src/components-react/propertygrid/internal/flat-items/MutableCustomGridCategory.ts"],"names":[],"mappings":";;;AAKA,+DAE+B;AAI/B,gBAAgB;AAChB,MAAa,yBAA0B,SAAQ,iDAA2B;IASxE,YACE,QAA0B,EAC1B,WAAgC,EAChC,eAAwC,EACxC,kBAAsC,EACtC,KAAa;QAEb,KAAK,CAAC,KAAK,EAAE,kBAAkB,EAAE,kBAAkB,CAAC,CAAC;QAZvC,SAAI,GAAG,sCAAgB,CAAC,QAAiB,CAAC;QAcxD,IAAI,CAAC,IAAI,GAAG,QAAQ,CAAC,IAAI,CAAC;QAC1B,IAAI,CAAC,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC;QAC5B,IAAI,CAAC,UAAU,GAAG,QAAQ,CAAC,MAAM,CAAC;QAClC,IAAI,CAAC,YAAY,GAAG,kBAAkB,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,kBAAkB,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC;QACxG,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC,QAAQ,CAAC;QAEnC,oHAAoH;QACpH,uBAAuB;QACvB,MAAM,eAAe,GAAG,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;QACzD,IAAI,CAAC,SAAS,GAAG,eAAe,CAAC,GAAG,CAClC,CAAC,KAAK,EAAE,EAAE,CAAC,eAAe,CAAC,yBAAyB,CAAC,KAAK,EAAE,IAAI,CAAC,YAAY,EAAE,IAAI,CAAC,YAAY,EAAE,CAAC,CAAC,CACrG,CAAC;QAEF,IAAI,CAAC,wBAAwB,GAAG,CAAC,CAAC,CAAC;IACrC,CAAC;IAED,IAAW,eAAe;QACxB,OAAO;YACL,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,MAAM,EAAE,IAAI,CAAC,UAAU;YACvB,QAAQ,EAAE,IAAI,CAAC,SAAS;SACzB,CAAC;IACJ,CAAC;IAED,IAAW,cAAc;QACvB,OAAO,IAAI,CAAC,KAAK,KAAK,CAAC,CAAC;IAC1B,CAAC;IAED,IAAoB,wBAAwB;QAC1C,OAAO,IAAI,CAAC,yBAAyB,CAAC;IACxC,CAAC;IAED,IAAoB,wBAAwB,CAAC,KAAa;QACxD,IAAI,CAAC,yBAAyB,GAAG,KAAK,GAAG,CAAC,CAAC;IAC7C,CAAC;IAEM,OAAO;QACZ,OAAO,IAAI,CAAC;IACd,CAAC;IAEM,WAAW;QAChB,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;IAEe,4BAA4B;QAC1C,OAAO,CAAC,IAAI,CAAC,CAAC;IAChB,CAAC;CACF;AAlED,8DAkEC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\nimport { PropertyCategory } from \"../../PropertyDataProvider\";\r\nimport {\r\n FlatGridItemType, IMutableCategorizedPropertyItem, IMutableFlatGridItem, IMutableGridCategoryItem, MutableFlatPropertyGridItem,\r\n} from \"./MutableFlatGridItem\";\r\nimport { CategoryRecordsDict } from \"./MutableGridCategory\";\r\nimport { IMutableGridItemFactory } from \"./MutableGridItemFactory\";\r\n\r\n/** @internal */\r\nexport class MutableCustomGridCategory extends MutableFlatPropertyGridItem implements IMutableGridCategoryItem {\r\n private readonly _children: IMutableCategorizedPropertyItem[];\r\n private readonly _renderer: PropertyCategory[\"renderer\"];\r\n\r\n public readonly type = FlatGridItemType.Category as const;\r\n public readonly label: string;\r\n public readonly name: string;\r\n public readonly selectionKey: string;\r\n\r\n public constructor(\r\n category: PropertyCategory,\r\n recordsDict: CategoryRecordsDict,\r\n gridItemFactory: IMutableGridItemFactory,\r\n parentSelectionKey: string | undefined,\r\n depth: number,\r\n ) {\r\n super(depth, parentSelectionKey, parentSelectionKey);\r\n\r\n this.name = category.name;\r\n this.label = category.label;\r\n this.isExpanded = category.expand;\r\n this.selectionKey = parentSelectionKey === undefined ? this.name : `${parentSelectionKey}_${this.name}`;\r\n this._renderer = category.renderer;\r\n\r\n // Even though categories are nested and have their own depth, categorized properties depth is counted starting with\r\n // the parent category.\r\n const categoryRecords = recordsDict[category.name] ?? [];\r\n this._children = categoryRecords.map(\r\n (value) => gridItemFactory.createCategorizedProperty(value, this.selectionKey, this.selectionKey, 0),\r\n );\r\n\r\n this.lastInNumberOfCategories = -1;\r\n }\r\n\r\n public get derivedCategory(): PropertyCategory {\r\n return {\r\n name: this.name,\r\n label: this.label,\r\n expand: this.isExpanded,\r\n renderer: this._renderer,\r\n };\r\n }\r\n\r\n public get isRootCategory(): boolean {\r\n return this.depth === 0;\r\n }\r\n\r\n public override get lastInNumberOfCategories(): number {\r\n return this._lastInNumberOfCategories;\r\n }\r\n\r\n public override set lastInNumberOfCategories(value: number) {\r\n this._lastInNumberOfCategories = value + 1;\r\n }\r\n\r\n public getSelf() {\r\n return this;\r\n }\r\n\r\n public getChildren(): IMutableFlatGridItem[] {\r\n return this._children;\r\n }\r\n\r\n public override getVisibleDescendantsAndSelf(): IMutableFlatGridItem[] {\r\n return [this];\r\n }\r\n}\r\n"]}
|
package/lib/cjs/components-react/propertygrid/internal/flat-items/MutableFlatGridItem.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MutableFlatGridItem.js","sourceRoot":"","sources":["../../../../../../src/components-react/propertygrid/internal/flat-items/MutableFlatGridItem.ts"],"names":[],"mappings":";;;;;;;AAAA;;;+FAG+F;AAC/F;;GAEG;AACH,iCAAkC;AAClC,sDAA8B;AAC9B,0DAAiG;AAGjG;;;;;GAKG;AACH,IAAY,gBAKX;AALD,WAAY,gBAAgB;IAC1B,+DAAQ,CAAA;IACR,iEAAS,CAAA;IACT,yDAAK,CAAA;IACL,2DAAM,CAAA;AACR,CAAC,EALW,gBAAgB,GAAhB,wBAAgB,KAAhB,wBAAgB,QAK3B;AA6BD;;;GAGG;AACH,MAAsB,2BAA2B;IAQ/C,YAA2B,MAAc,EAAU,mBAAuC,EAAU,2BAA+C;QAAxH,WAAM,GAAN,MAAM,CAAQ;QAAU,wBAAmB,GAAnB,mBAAmB,CAAoB;QAAU,gCAA2B,GAA3B,2BAA2B,CAAoB;QAP5I,QAAW,GAAG,IAAI,CAAC;QAEV,QAAG,GAAW,iBAAO,CAAC,QAAQ,EAAE,CAAC;QACvC,gBAAW,GAAY,KAAK,CAAC;QAC7B,8BAAyB,GAAW,CAAC,CAAC;QACtC,0BAAqB,GAAY,KAAK,CAAC;QAG/C,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC;YACjB,MAAM,IAAI,KAAK,CAAC,0BAA0B,CAAC,CAAC;IAChD,CAAC;IAMD,IAAW,KAAK;QACd,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IAED,IAAW,kBAAkB;QAC3B,OAAO,IAAI,CAAC,mBAAmB,CAAC;IAClC,CAAC;IAED,IAAW,0BAA0B;QACnC,OAAO,IAAI,CAAC,2BAA2B,CAAC;IAC1C,CAAC;IAED,IAAW,UAAU;QACnB,OAAO,IAAI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E,YAAY,EAAE,GAAG,QAAQ,EAAE,GAAG,EAAE,GAAG,mBAAmB,EAAE,CAAC;QACvE,MAAM,OAAO,GAAG,YAAY,IAAI,IAAI,CAAC;QACrC,MAAM,eAAe,GAAG,eAAe,IAAI,YAAY,CAAC;QAExD,OAAO,EAAE,GAAG,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,CAAC;IACvE,CAAC;IAED;;OAEG;IACK,iBAAiB,CAAC,MAAsB,EAAE,4BAAiD;QACjG,6DAA6D;QAC7D,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,MAAM,EAAE,GAAG,MAAM,CAAC;QAC9C,MAAM,SAAS,GAAG,IAAI,+BAAc,CAAC,KAAK,EAAE,4BAA4B,CAAC,CAAC;QAE1E,OAAO,MAAM,CAAC,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;IAC1C,CAAC;IAEM,OAAO;QACZ,OAAO,IAAI,CAAC;IACd,CAAC;IAED,IAAoB,0BAA0B;QAC5C,OAAO,KAAK,CAAC,0BAA2B,CAAC;IAC3C,CAAC;IAED,IAAoB,kBAAkB;QACpC,OAAO,KAAK,CAAC,kBAAmB,CAAC;IACnC,CAAC;IAED;;OAEG;IACH,IAAW,YAAY;QACrB,OAAO,IAAI,CAAC,aAAa,CAAC;IAC5B,CAAC;IAED,IAAW,KAAK;QACd,OAAO,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,YAAY,CAAC;IACnD,CAAC;IAED;;OAEG;IACH,IAAW,aAAa;QACtB,OAAO,IAAI,CAAC,cAAc,CAAC;IAC7B,CAAC;CACF;AA1GD,gEA0GC","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 */\nimport { immerable } from \"immer\";\nimport shortid from \"shortid\";\nimport { PropertyDescription, PropertyRecord, PropertyValueFormat } from \"@itwin/appui-abstract\";\nimport { PropertyCategory } from \"../../PropertyDataProvider\";\n\n/**\n * Types of FlatGridItems for differentiating what property FlatGridItem is wrapping.\n * Category for PropertyCategory\n * (Primitive, Array, Struct) for PropertyRecord with valueFormats: (Primitive, Array, Struct)\n * @public\n */\nexport enum FlatGridItemType {\n Category,\n Primitive,\n Array,\n Struct,\n}\n\n/**\n * Type which extracts FlatGridItemTypes relevant for working with CategorizedProperties\n * @public\n */\nexport type CategorizedPropertyTypes = FlatGridItemType.Array | FlatGridItemType.Primitive | FlatGridItemType.Struct;\n\n/**\n * Base mutable data structure defining common methods and properties for both CategorizedProperties and GridCategoryItems\n * @public\n */\nexport interface IMutableFlatPropertyGridItem {\n readonly type: FlatGridItemType;\n readonly key: string;\n readonly selectionKey: string;\n readonly parentSelectionKey: string | undefined;\n readonly parentCategorySelectionKey: string | undefined;\n readonly depth: number;\n readonly label: string;\n lastInNumberOfCategories: number;\n isLastInRootCategory: boolean;\n isExpanded: boolean;\n getDescendantsAndSelf(): IMutableFlatGridItem[];\n getVisibleDescendantsAndSelf(): IMutableFlatGridItem[];\n getChildren(): IMutableFlatGridItem[];\n getLastVisibleDescendantOrSelf(): IMutableFlatGridItem;\n}\n\n/**\n * Base class for all FlatPropertyGrid items\n * @public\n */\nexport abstract class MutableFlatPropertyGridItem implements IMutableFlatPropertyGridItem {\n public [immerable] = true;\n\n public readonly key: string = shortid.generate();\n protected _isExpanded: boolean = false;\n protected _lastInNumberOfCategories: number = 0;\n protected _isLastInRootCategory: boolean = false;\n\n public constructor(private _depth: number, private _parentSelectionKey: string | undefined, private _parentCategorySelectionKey: string | undefined) {\n if (this._depth < 0)\n throw new Error(\"Depth cannot be negative\");\n }\n\n public abstract type: FlatGridItemType;\n public abstract label: string;\n public abstract selectionKey: string;\n\n public get depth() {\n return this._depth;\n }\n\n public get parentSelectionKey() {\n return this._parentSelectionKey;\n }\n\n public get parentCategorySelectionKey() {\n return this._parentCategorySelectionKey;\n }\n\n public get isExpanded() {\n return this._isExpanded;\n }\n\n public set isExpanded(value: boolean) {\n this._isExpanded = value;\n }\n\n public abstract getChildren(): IMutableFlatGridItem[];\n public abstract getSelf(): IMutableFlatGridItem;\n\n protected getDescendants() {\n const descendants: IMutableFlatGridItem[] = [];\n this.getChildren().forEach((child) => descendants.push(...child.getDescendantsAndSelf()));\n\n return descendants;\n }\n\n /**\n * Gets a flat list of all FlatGridItems beneath this flat grid item including itself in depth first visiting order.\n */\n public getDescendantsAndSelf(): IMutableFlatGridItem[] {\n return [this.getSelf(), ...this.getDescendants()];\n }\n\n /**\n * Gets a flat list of visible FlatGridItems beneath this flat grid item.\n */\n public getVisibleDescendants(): IMutableFlatGridItem[] {\n const descendants: IMutableFlatGridItem[] = [];\n if (this.isExpanded)\n this.getChildren().forEach((child) => descendants.push(...child.getVisibleDescendantsAndSelf()));\n return descendants;\n }\n\n /**\n * Gets a flat list of visible FlatGridItems beneath this flat grid item and itself in depth first visiting order.\n */\n public getVisibleDescendantsAndSelf(): IMutableFlatGridItem[] {\n return [this.getSelf(), ...this.getVisibleDescendants()];\n }\n\n /**\n * @returns self if item is not expanded, last visible descendant of this item otherwise.\n */\n public getLastVisibleDescendantOrSelf(): IMutableFlatGridItem {\n if (!this.isExpanded)\n return this.getSelf();\n\n const children = this.getChildren();\n if (children.length < 1)\n return this.getSelf();\n\n return children[children.length - 1].getLastVisibleDescendantOrSelf();\n }\n\n /**\n * Sets lastInNumberOfCategories value and sends it down to this items last child\n * @internal\n */\n public get lastInNumberOfCategories(): number {\n if (this.isExpanded && this.getChildren().length > 0)\n return 0;\n\n return this._lastInNumberOfCategories;\n }\n\n public set lastInNumberOfCategories(value: number) {\n this._lastInNumberOfCategories = value;\n const children = this.getChildren();\n if (children.length < 1)\n return;\n\n children[children.length - 1].lastInNumberOfCategories = value;\n }\n\n /**\n * Gets and sets isLastInRootCategory value and sends it down to this items last child\n * @internal\n */\n public get isLastInRootCategory(): boolean {\n if (this.isExpanded && this.getChildren().length > 0)\n return false;\n\n return this._isLastInRootCategory;\n }\n\n public set isLastInRootCategory(value: boolean) {\n this._isLastInRootCategory = value;\n const children = this.getChildren();\n if (children.length < 1)\n return;\n\n children[children.length - 1].isLastInRootCategory = value;\n }\n}\n\n/**\n * Data structure which describes methods and properties to be held by Mutable GridCategoryItems\n * @public\n */\nexport interface IMutableGridCategoryItem extends IMutableFlatPropertyGridItem {\n type: FlatGridItemType.Category;\n name: string;\n derivedCategory: PropertyCategory;\n isRootCategory: boolean;\n}\n\n/**\n * Data structure which describes methods and properties to be held by Mutable CategorizedPropertyItems\n * @public\n */\nexport interface IMutableCategorizedPropertyItem extends IMutableFlatPropertyGridItem {\n readonly type: CategorizedPropertyTypes;\n readonly derivedRecord: PropertyRecord;\n readonly parentCategorySelectionKey: string;\n readonly parentSelectionKey: string;\n\n getChildren(): IMutableCategorizedPropertyItem[];\n}\n\n/**\n * Type which describes mutable GridCategoryItem or CategorizedProperty\n * @public\n */\nexport type IMutableFlatGridItem = IMutableCategorizedPropertyItem | IMutableGridCategoryItem;\n\n/**\n * Base class for all Mutable CategorizedProperties\n * @public\n */\nexport abstract class MutableCategorizedProperty extends MutableFlatPropertyGridItem implements Partial<IMutableCategorizedPropertyItem> {\n private _derivedRecord: PropertyRecord;\n private _selectionKey: string;\n\n public constructor(\n type: CategorizedPropertyTypes,\n record: PropertyRecord,\n parentSelectionKey: string,\n parentCategorySelectionKey: string,\n depth: number,\n overrideName?: string,\n overrideDisplayLabel?: string,\n ) {\n super(depth, parentSelectionKey, parentCategorySelectionKey);\n\n const recordType = this.valueTypeToFlatGridType(record.value.valueFormat);\n if (recordType !== type) {\n const expectedTypeStr = FlatGridItemType[type];\n const actualTypeStr = FlatGridItemType[recordType];\n throw Error(`Record with incorrect value format passed to property: expected ${expectedTypeStr}, got ${actualTypeStr}`);\n }\n\n const overridenProperty = this.makeOverridenProperty(record.property, overrideName, overrideDisplayLabel);\n this._derivedRecord = this.makeDerivedRecord(record, overridenProperty);\n\n this._selectionKey = `${this.parentSelectionKey}_${this.derivedRecord.property.name}`;\n this._isExpanded = !!record.autoExpand;\n }\n\n public abstract override type: CategorizedPropertyTypes;\n public abstract override getChildren(): IMutableCategorizedPropertyItem[];\n\n /**\n * Maps PropertyRecord valueFormat to FlatGridItemType\n * @param valueType valueFormat to map\n * @returns mapped FlatGridItemType\n */\n private valueTypeToFlatGridType(valueType: PropertyValueFormat) {\n switch (valueType) {\n case PropertyValueFormat.Primitive:\n return FlatGridItemType.Primitive;\n case PropertyValueFormat.Array:\n return FlatGridItemType.Array;\n case PropertyValueFormat.Struct:\n return FlatGridItemType.Struct;\n /* istanbul ignore next */\n default:\n const unhandledType: never = valueType;\n throw Error(`Property Value Format not handled: ${unhandledType}`);\n }\n }\n\n /**\n * Make new property description with overriden fields.\n * @param propertyDescription property description to override.\n * @param overrideName property description name to override.\n * @param overrideDisplay property description display name to override.\n */\n private makeOverridenProperty(propertyDescription: PropertyDescription, overrideName?: string, overrideDisplay?: string): PropertyDescription {\n const { name, displayLabel, ...property } = { ...propertyDescription };\n const newName = overrideName ?? name;\n const newDisplayLabel = overrideDisplay ?? displayLabel;\n\n return { ...property, name: newName, displayLabel: newDisplayLabel };\n }\n\n /**\n * Gets derived property record that has it's property description field overriden\n */\n private makeDerivedRecord(record: PropertyRecord, overridenPropertyDescription: PropertyDescription) {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const { value, property, ...others } = record;\n const newRecord = new PropertyRecord(value, overridenPropertyDescription);\n\n return Object.assign(newRecord, others);\n }\n\n public getSelf(): IMutableCategorizedPropertyItem {\n return this;\n }\n\n public override get parentCategorySelectionKey() {\n return super.parentCategorySelectionKey!;\n }\n\n public override get parentSelectionKey() {\n return super.parentSelectionKey!;\n }\n\n /**\n * Unique selection key made of parent selectionKey and this property name.\n */\n public get selectionKey() {\n return this._selectionKey;\n }\n\n public get label() {\n return this._derivedRecord.property.displayLabel;\n }\n\n /**\n * Record with overriden property description.\n */\n public get derivedRecord() {\n return this._derivedRecord;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"MutableFlatGridItem.js","sourceRoot":"","sources":["../../../../../../src/components-react/propertygrid/internal/flat-items/MutableFlatGridItem.ts"],"names":[],"mappings":";;;;;;;AAAA;;;+FAG+F;AAC/F;;GAEG;AACH,iCAAkC;AAClC,sDAA8B;AAC9B,0DAAiG;AAGjG;;;;;GAKG;AACH,IAAY,gBAKX;AALD,WAAY,gBAAgB;IAC1B,+DAAQ,CAAA;IACR,iEAAS,CAAA;IACT,yDAAK,CAAA;IACL,2DAAM,CAAA;AACR,CAAC,EALW,gBAAgB,GAAhB,wBAAgB,KAAhB,wBAAgB,QAK3B;AA6BD;;;GAGG;AACH,MAAsB,2BAA2B;IAQ/C,YAA2B,MAAc,EAAU,mBAAuC,EAAU,2BAA+C;QAAxH,WAAM,GAAN,MAAM,CAAQ;QAAU,wBAAmB,GAAnB,mBAAmB,CAAoB;QAAU,gCAA2B,GAA3B,2BAA2B,CAAoB;QAP5I,QAAW,GAAG,IAAI,CAAC;QAEV,QAAG,GAAW,iBAAO,CAAC,QAAQ,EAAE,CAAC;QACvC,gBAAW,GAAY,KAAK,CAAC;QAC7B,8BAAyB,GAAW,CAAC,CAAC;QACtC,0BAAqB,GAAY,KAAK,CAAC;QAG/C,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC;YACjB,MAAM,IAAI,KAAK,CAAC,0BAA0B,CAAC,CAAC;IAChD,CAAC;IAMD,IAAW,KAAK;QACd,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IAED,IAAW,kBAAkB;QAC3B,OAAO,IAAI,CAAC,mBAAmB,CAAC;IAClC,CAAC;IAED,IAAW,0BAA0B;QACnC,OAAO,IAAI,CAAC,2BAA2B,CAAC;IAC1C,CAAC;IAED,IAAW,UAAU;QACnB,OAAO,IAAI,CAAC,WAAW,CAAC;IAC1B,CAAC;IAED,IAAW,UAAU,CAAC,KAAc;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AAE,CAAC;QACvE,MAAM,OAAO,GAAG,YAAY,IAAI,IAAI,CAAC;QACrC,MAAM,eAAe,GAAG,eAAe,IAAI,YAAY,CAAC;QAExD,OAAO,EAAE,GAAG,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,CAAC;IACvE,CAAC;IAED;;OAEG;IACK,iBAAiB,CAAC,MAAsB,EAAE,4BAAiD;QACjG,6DAA6D;QAC7D,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,MAAM,EAAE,GAAG,MAAM,CAAC;QAC9C,MAAM,SAAS,GAAG,IAAI,+BAAc,CAAC,KAAK,EAAE,4BAA4B,CAAC,CAAC;QAE1E,OAAO,MAAM,CAAC,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;IAC1C,CAAC;IAEM,OAAO;QACZ,OAAO,IAAI,CAAC;IACd,CAAC;IAED,IAAoB,0BAA0B;QAC5C,OAAO,KAAK,CAAC,0BAA2B,CAAC;IAC3C,CAAC;IAED,IAAoB,kBAAkB;QACpC,OAAO,KAAK,CAAC,kBAAmB,CAAC;IACnC,CAAC;IAED;;OAEG;IACH,IAAW,YAAY;QACrB,OAAO,IAAI,CAAC,aAAa,CAAC;IAC5B,CAAC;IAED,IAAW,KAAK;QACd,OAAO,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,YAAY,CAAC;IACnD,CAAC;IAED;;OAEG;IACH,IAAW,aAAa;QACtB,OAAO,IAAI,CAAC,cAAc,CAAC;IAC7B,CAAC;CACF;AA1GD,gEA0GC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module PropertyGrid\r\n */\r\nimport { immerable } from \"immer\";\r\nimport shortid from \"shortid\";\r\nimport { PropertyDescription, PropertyRecord, PropertyValueFormat } from \"@itwin/appui-abstract\";\r\nimport { PropertyCategory } from \"../../PropertyDataProvider\";\r\n\r\n/**\r\n * Types of FlatGridItems for differentiating what property FlatGridItem is wrapping.\r\n * Category for PropertyCategory\r\n * (Primitive, Array, Struct) for PropertyRecord with valueFormats: (Primitive, Array, Struct)\r\n * @public\r\n */\r\nexport enum FlatGridItemType {\r\n Category,\r\n Primitive,\r\n Array,\r\n Struct,\r\n}\r\n\r\n/**\r\n * Type which extracts FlatGridItemTypes relevant for working with CategorizedProperties\r\n * @public\r\n */\r\nexport type CategorizedPropertyTypes = FlatGridItemType.Array | FlatGridItemType.Primitive | FlatGridItemType.Struct;\r\n\r\n/**\r\n * Base mutable data structure defining common methods and properties for both CategorizedProperties and GridCategoryItems\r\n * @public\r\n */\r\nexport interface IMutableFlatPropertyGridItem {\r\n readonly type: FlatGridItemType;\r\n readonly key: string;\r\n readonly selectionKey: string;\r\n readonly parentSelectionKey: string | undefined;\r\n readonly parentCategorySelectionKey: string | undefined;\r\n readonly depth: number;\r\n readonly label: string;\r\n lastInNumberOfCategories: number;\r\n isLastInRootCategory: boolean;\r\n isExpanded: boolean;\r\n getDescendantsAndSelf(): IMutableFlatGridItem[];\r\n getVisibleDescendantsAndSelf(): IMutableFlatGridItem[];\r\n getChildren(): IMutableFlatGridItem[];\r\n getLastVisibleDescendantOrSelf(): IMutableFlatGridItem;\r\n}\r\n\r\n/**\r\n * Base class for all FlatPropertyGrid items\r\n * @public\r\n */\r\nexport abstract class MutableFlatPropertyGridItem implements IMutableFlatPropertyGridItem {\r\n public [immerable] = true;\r\n\r\n public readonly key: string = shortid.generate();\r\n protected _isExpanded: boolean = false;\r\n protected _lastInNumberOfCategories: number = 0;\r\n protected _isLastInRootCategory: boolean = false;\r\n\r\n public constructor(private _depth: number, private _parentSelectionKey: string | undefined, private _parentCategorySelectionKey: string | undefined) {\r\n if (this._depth < 0)\r\n throw new Error(\"Depth cannot be negative\");\r\n }\r\n\r\n public abstract type: FlatGridItemType;\r\n public abstract label: string;\r\n public abstract selectionKey: string;\r\n\r\n public get depth() {\r\n return this._depth;\r\n }\r\n\r\n public get parentSelectionKey() {\r\n return this._parentSelectionKey;\r\n }\r\n\r\n public get parentCategorySelectionKey() {\r\n return this._parentCategorySelectionKey;\r\n }\r\n\r\n public get isExpanded() {\r\n return this._isExpanded;\r\n }\r\n\r\n public set isExpanded(value: boolean) {\r\n this._isExpanded = value;\r\n }\r\n\r\n public abstract getChildren(): IMutableFlatGridItem[];\r\n public abstract getSelf(): IMutableFlatGridItem;\r\n\r\n protected getDescendants() {\r\n const descendants: IMutableFlatGridItem[] = [];\r\n this.getChildren().forEach((child) => descendants.push(...child.getDescendantsAndSelf()));\r\n\r\n return descendants;\r\n }\r\n\r\n /**\r\n * Gets a flat list of all FlatGridItems beneath this flat grid item including itself in depth first visiting order.\r\n */\r\n public getDescendantsAndSelf(): IMutableFlatGridItem[] {\r\n return [this.getSelf(), ...this.getDescendants()];\r\n }\r\n\r\n /**\r\n * Gets a flat list of visible FlatGridItems beneath this flat grid item.\r\n */\r\n public getVisibleDescendants(): IMutableFlatGridItem[] {\r\n const descendants: IMutableFlatGridItem[] = [];\r\n if (this.isExpanded)\r\n this.getChildren().forEach((child) => descendants.push(...child.getVisibleDescendantsAndSelf()));\r\n return descendants;\r\n }\r\n\r\n /**\r\n * Gets a flat list of visible FlatGridItems beneath this flat grid item and itself in depth first visiting order.\r\n */\r\n public getVisibleDescendantsAndSelf(): IMutableFlatGridItem[] {\r\n return [this.getSelf(), ...this.getVisibleDescendants()];\r\n }\r\n\r\n /**\r\n * @returns self if item is not expanded, last visible descendant of this item otherwise.\r\n */\r\n public getLastVisibleDescendantOrSelf(): IMutableFlatGridItem {\r\n if (!this.isExpanded)\r\n return this.getSelf();\r\n\r\n const children = this.getChildren();\r\n if (children.length < 1)\r\n return this.getSelf();\r\n\r\n return children[children.length - 1].getLastVisibleDescendantOrSelf();\r\n }\r\n\r\n /**\r\n * Sets lastInNumberOfCategories value and sends it down to this items last child\r\n * @internal\r\n */\r\n public get lastInNumberOfCategories(): number {\r\n if (this.isExpanded && this.getChildren().length > 0)\r\n return 0;\r\n\r\n return this._lastInNumberOfCategories;\r\n }\r\n\r\n public set lastInNumberOfCategories(value: number) {\r\n this._lastInNumberOfCategories = value;\r\n const children = this.getChildren();\r\n if (children.length < 1)\r\n return;\r\n\r\n children[children.length - 1].lastInNumberOfCategories = value;\r\n }\r\n\r\n /**\r\n * Gets and sets isLastInRootCategory value and sends it down to this items last child\r\n * @internal\r\n */\r\n public get isLastInRootCategory(): boolean {\r\n if (this.isExpanded && this.getChildren().length > 0)\r\n return false;\r\n\r\n return this._isLastInRootCategory;\r\n }\r\n\r\n public set isLastInRootCategory(value: boolean) {\r\n this._isLastInRootCategory = value;\r\n const children = this.getChildren();\r\n if (children.length < 1)\r\n return;\r\n\r\n children[children.length - 1].isLastInRootCategory = value;\r\n }\r\n}\r\n\r\n/**\r\n * Data structure which describes methods and properties to be held by Mutable GridCategoryItems\r\n * @public\r\n */\r\nexport interface IMutableGridCategoryItem extends IMutableFlatPropertyGridItem {\r\n type: FlatGridItemType.Category;\r\n name: string;\r\n derivedCategory: PropertyCategory;\r\n isRootCategory: boolean;\r\n}\r\n\r\n/**\r\n * Data structure which describes methods and properties to be held by Mutable CategorizedPropertyItems\r\n * @public\r\n */\r\nexport interface IMutableCategorizedPropertyItem extends IMutableFlatPropertyGridItem {\r\n readonly type: CategorizedPropertyTypes;\r\n readonly derivedRecord: PropertyRecord;\r\n readonly parentCategorySelectionKey: string;\r\n readonly parentSelectionKey: string;\r\n\r\n getChildren(): IMutableCategorizedPropertyItem[];\r\n}\r\n\r\n/**\r\n * Type which describes mutable GridCategoryItem or CategorizedProperty\r\n * @public\r\n */\r\nexport type IMutableFlatGridItem = IMutableCategorizedPropertyItem | IMutableGridCategoryItem;\r\n\r\n/**\r\n * Base class for all Mutable CategorizedProperties\r\n * @public\r\n */\r\nexport abstract class MutableCategorizedProperty extends MutableFlatPropertyGridItem implements Partial<IMutableCategorizedPropertyItem> {\r\n private _derivedRecord: PropertyRecord;\r\n private _selectionKey: string;\r\n\r\n public constructor(\r\n type: CategorizedPropertyTypes,\r\n record: PropertyRecord,\r\n parentSelectionKey: string,\r\n parentCategorySelectionKey: string,\r\n depth: number,\r\n overrideName?: string,\r\n overrideDisplayLabel?: string,\r\n ) {\r\n super(depth, parentSelectionKey, parentCategorySelectionKey);\r\n\r\n const recordType = this.valueTypeToFlatGridType(record.value.valueFormat);\r\n if (recordType !== type) {\r\n const expectedTypeStr = FlatGridItemType[type];\r\n const actualTypeStr = FlatGridItemType[recordType];\r\n throw Error(`Record with incorrect value format passed to property: expected ${expectedTypeStr}, got ${actualTypeStr}`);\r\n }\r\n\r\n const overridenProperty = this.makeOverridenProperty(record.property, overrideName, overrideDisplayLabel);\r\n this._derivedRecord = this.makeDerivedRecord(record, overridenProperty);\r\n\r\n this._selectionKey = `${this.parentSelectionKey}_${this.derivedRecord.property.name}`;\r\n this._isExpanded = !!record.autoExpand;\r\n }\r\n\r\n public abstract override type: CategorizedPropertyTypes;\r\n public abstract override getChildren(): IMutableCategorizedPropertyItem[];\r\n\r\n /**\r\n * Maps PropertyRecord valueFormat to FlatGridItemType\r\n * @param valueType valueFormat to map\r\n * @returns mapped FlatGridItemType\r\n */\r\n private valueTypeToFlatGridType(valueType: PropertyValueFormat) {\r\n switch (valueType) {\r\n case PropertyValueFormat.Primitive:\r\n return FlatGridItemType.Primitive;\r\n case PropertyValueFormat.Array:\r\n return FlatGridItemType.Array;\r\n case PropertyValueFormat.Struct:\r\n return FlatGridItemType.Struct;\r\n /* istanbul ignore next */\r\n default:\r\n const unhandledType: never = valueType;\r\n throw Error(`Property Value Format not handled: ${unhandledType}`);\r\n }\r\n }\r\n\r\n /**\r\n * Make new property description with overriden fields.\r\n * @param propertyDescription property description to override.\r\n * @param overrideName property description name to override.\r\n * @param overrideDisplay property description display name to override.\r\n */\r\n private makeOverridenProperty(propertyDescription: PropertyDescription, overrideName?: string, overrideDisplay?: string): PropertyDescription {\r\n const { name, displayLabel, ...property } = { ...propertyDescription };\r\n const newName = overrideName ?? name;\r\n const newDisplayLabel = overrideDisplay ?? displayLabel;\r\n\r\n return { ...property, name: newName, displayLabel: newDisplayLabel };\r\n }\r\n\r\n /**\r\n * Gets derived property record that has it's property description field overriden\r\n */\r\n private makeDerivedRecord(record: PropertyRecord, overridenPropertyDescription: PropertyDescription) {\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n const { value, property, ...others } = record;\r\n const newRecord = new PropertyRecord(value, overridenPropertyDescription);\r\n\r\n return Object.assign(newRecord, others);\r\n }\r\n\r\n public getSelf(): IMutableCategorizedPropertyItem {\r\n return this;\r\n }\r\n\r\n public override get parentCategorySelectionKey() {\r\n return super.parentCategorySelectionKey!;\r\n }\r\n\r\n public override get parentSelectionKey() {\r\n return super.parentSelectionKey!;\r\n }\r\n\r\n /**\r\n * Unique selection key made of parent selectionKey and this property name.\r\n */\r\n public get selectionKey() {\r\n return this._selectionKey;\r\n }\r\n\r\n public get label() {\r\n return this._derivedRecord.property.displayLabel;\r\n }\r\n\r\n /**\r\n * Record with overriden property description.\r\n */\r\n public get derivedRecord() {\r\n return this._derivedRecord;\r\n }\r\n}\r\n"]}
|
package/lib/cjs/components-react/propertygrid/internal/flat-items/MutableGridCategory.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MutableGridCategory.js","sourceRoot":"","sources":["../../../../../../src/components-react/propertygrid/internal/flat-items/MutableGridCategory.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAO/F,+DAAsI;AAWtI;;;GAGG;AACH,MAAa,mBAAoB,SAAQ,iDAA2B;IAKlE,YACE,QAA0B,EAC1B,WAAgC,EAChC,eAAwC,EACxC,kBAA2B,EAC3B,QAAgB,CAAC;QAEjB,KAAK,CAAC,KAAK,EAAE,kBAAkB,EAAE,kBAAkB,CAAC,CAAC;QACrD,IAAI,CAAC,SAAS,GAAG,EAAE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a,CAAC;IAC5B,CAAC;IAED,IAAW,IAAI;QACb,OAAO,sCAAgB,CAAC,QAAQ,CAAC;IACnC,CAAC;IAED,IAAW,IAAI;QACb,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC;IAC7B,CAAC;IAED,IAAW,KAAK;QACd,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC;IAC9B,CAAC;IAED,IAAW,eAAe;QACxB,OAAO,EAAE,GAAG,IAAI,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,CAAC,UAAU,EAAE,CAAC;IACxD,CAAC;IAEM,OAAO;QACZ,OAAO,IAAI,CAAC;IACd,CAAC;IAEM,WAAW;QAChB,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;IAED;;;;;OAKG;IACH,IAAoB,wBAAwB;QAC1C,IAAI,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,WAAW,EAAE,CAAC,MAAM,GAAG,CAAC;YAClD,OAAO,CAAC,CAAC;QAEX,OAAO,IAAI,CAAC,yBAAyB,GAAG,CAAC,CAAC;IAC5C,CAAC;IAED,IAAoB,wBAAwB,CAAC,KAAa;QACxD,KAAK,CAAC,wBAAwB,GAAG,KAAK,GAAG,CAAC,CAAC;IAC7C,CAAC;CACF;AAvFD,kDAuFC","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 PropertyGrid\n */\nimport { PropertyRecord } from \"@itwin/appui-abstract\";\nimport { PropertyCategory } from \"../../PropertyDataProvider\";\nimport { FlatGridItemType, IMutableFlatGridItem, IMutableGridCategoryItem, MutableFlatPropertyGridItem } from \"./MutableFlatGridItem\";\nimport { IMutableGridItemFactory } from \"./MutableGridItemFactory\";\n\n/**\n * Category name to PropertyRecord[] key pair interface used to describe which records belong to which category.\n * @public\n */\nexport interface CategoryRecordsDict {\n [categoryName: string]: PropertyRecord[];\n}\n\n/**\n * Mutable wrapper object for PropertyCategory which provides methods for working with and managing category and record children hierarchies\n * @public\n */\nexport class MutableGridCategory extends MutableFlatPropertyGridItem implements IMutableGridCategoryItem {\n private _children: IMutableFlatGridItem[];\n private _selectionKey: string;\n private _category: PropertyCategory;\n\n constructor(\n category: PropertyCategory,\n recordsDict: CategoryRecordsDict,\n gridItemFactory: IMutableGridItemFactory,\n parentSelectionKey?: string,\n depth: number = 0,\n ) {\n super(depth, parentSelectionKey, parentSelectionKey);\n this._category = { name: category.name, label: category.label, expand: category.expand };\n\n if (parentSelectionKey !== undefined)\n this._selectionKey = `${parentSelectionKey}_${category.name}`;\n else\n this._selectionKey = category.name;\n\n this._isExpanded = category.expand;\n\n // Even though categories are nested and have their own depth, categorized properties depth is counted starting with the parent category.\n const categoryRecords = recordsDict[category.name] ?? [];\n this._children = categoryRecords.map((value) => gridItemFactory.createCategorizedProperty(value, this.selectionKey, this.selectionKey, 0));\n\n const childCategories = category.childCategories ?? [];\n const child = childCategories.map((childCategory) => gridItemFactory.createGridCategory(childCategory, recordsDict, this.selectionKey, this.depth + 1));\n\n this._children.push(...child);\n\n // Assign lastInNumberOfCategories and isLastInRootCategory for entire children hierarchy\n this.lastInNumberOfCategories = 0;\n this.isLastInRootCategory = this.isRootCategory;\n }\n\n /**\n * Category is considered to be root category if its depth is 0\n */\n public get isRootCategory() {\n return this.depth === 0;\n }\n\n public get selectionKey() {\n return this._selectionKey;\n }\n\n public get type(): FlatGridItemType.Category {\n return FlatGridItemType.Category;\n }\n\n public get name() {\n return this._category.name;\n }\n\n public get label() {\n return this._category.label;\n }\n\n public get derivedCategory(): PropertyCategory {\n return { ...this._category, expand: this.isExpanded };\n }\n\n public getSelf() {\n return this;\n }\n\n public getChildren(): IMutableFlatGridItem[] {\n return this._children;\n }\n\n /**\n * Gets and Sets lastInNumberOfCategories.\n * Setter increments set value by one to account self as category.\n * New value is sent down to this items last child\n * @internal\n */\n public override get lastInNumberOfCategories(): number {\n if (this.isExpanded && this.getChildren().length > 0)\n return 0;\n\n return this._lastInNumberOfCategories - 1;\n }\n\n public override set lastInNumberOfCategories(value: number) {\n super.lastInNumberOfCategories = value + 1;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"MutableGridCategory.js","sourceRoot":"","sources":["../../../../../../src/components-react/propertygrid/internal/flat-items/MutableGridCategory.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAO/F,+DAAsI;AAWtI;;;GAGG;AACH,MAAa,mBAAoB,SAAQ,iDAA2B;IAKlE,YACE,QAA0B,EAC1B,WAAgC,EAChC,eAAwC,EACxC,kBAA2B,EAC3B,QAAgB,CAAC;QAEjB,KAAK,CAAC,KAAK,EAAE,kBAAkB,EAAE,kBAAkB,CAAC,CAAC;QACrD,IAAI,CAAC,SAAS,GAAG,EAAE,IAAI,EAAE,QAAQ,CAAC,IAAI,EAAE,KAAK,EAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,CAAC,MAAM,EAAE,CAAC;QAEzF,IAAI,kBAAkB,KAAK,SAAS;YAClC,IAAI,CAAC,aAAa,GAAG,GAAG,kBAAkB,IAAI,QAAQ,CAAC,IAAI,EAAE,CAAC;;YAE9D,IAAI,CAAC,aAAa,GAAG,QAAQ,CAAC,IAAI,CAAC;QAErC,IAAI,CAAC,WAAW,GAAG,QAAQ,CAAC,MAAM,CAAC;QAEnC,yIAAyI;QACzI,MAAM,eAAe,GAAG,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;QACzD,IAAI,CAAC,SAAS,GAAG,eAAe,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,eAAe,CAAC,yBAAyB,CAAC,KAAK,EAAE,IAAI,CAAC,YAAY,EAAE,IAAI,CAAC,YAAY,EAAE,CAAC,CAAC,CAAC,CAAC;QAE3I,MAAM,eAAe,GAAG,QAAQ,CAAC,eAAe,IAAI,EAAE,CA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B,CAAC,KAAa;QACxD,KAAK,CAAC,wBAAwB,GAAG,KAAK,GAAG,CAAC,CAAC;IAC7C,CAAC;CACF;AAvFD,kDAuFC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\n/** @packageDocumentation\r\n * @module PropertyGrid\r\n */\r\nimport { PropertyRecord } from \"@itwin/appui-abstract\";\r\nimport { PropertyCategory } from \"../../PropertyDataProvider\";\r\nimport { FlatGridItemType, IMutableFlatGridItem, IMutableGridCategoryItem, MutableFlatPropertyGridItem } from \"./MutableFlatGridItem\";\r\nimport { IMutableGridItemFactory } from \"./MutableGridItemFactory\";\r\n\r\n/**\r\n * Category name to PropertyRecord[] key pair interface used to describe which records belong to which category.\r\n * @public\r\n */\r\nexport interface CategoryRecordsDict {\r\n [categoryName: string]: PropertyRecord[];\r\n}\r\n\r\n/**\r\n * Mutable wrapper object for PropertyCategory which provides methods for working with and managing category and record children hierarchies\r\n * @public\r\n */\r\nexport class MutableGridCategory extends MutableFlatPropertyGridItem implements IMutableGridCategoryItem {\r\n private _children: IMutableFlatGridItem[];\r\n private _selectionKey: string;\r\n private _category: PropertyCategory;\r\n\r\n constructor(\r\n category: PropertyCategory,\r\n recordsDict: CategoryRecordsDict,\r\n gridItemFactory: IMutableGridItemFactory,\r\n parentSelectionKey?: string,\r\n depth: number = 0,\r\n ) {\r\n super(depth, parentSelectionKey, parentSelectionKey);\r\n this._category = { name: category.name, label: category.label, expand: category.expand };\r\n\r\n if (parentSelectionKey !== undefined)\r\n this._selectionKey = `${parentSelectionKey}_${category.name}`;\r\n else\r\n this._selectionKey = category.name;\r\n\r\n this._isExpanded = category.expand;\r\n\r\n // Even though categories are nested and have their own depth, categorized properties depth is counted starting with the parent category.\r\n const categoryRecords = recordsDict[category.name] ?? [];\r\n this._children = categoryRecords.map((value) => gridItemFactory.createCategorizedProperty(value, this.selectionKey, this.selectionKey, 0));\r\n\r\n const childCategories = category.childCategories ?? [];\r\n const child = childCategories.map((childCategory) => gridItemFactory.createGridCategory(childCategory, recordsDict, this.selectionKey, this.depth + 1));\r\n\r\n this._children.push(...child);\r\n\r\n // Assign lastInNumberOfCategories and isLastInRootCategory for entire children hierarchy\r\n this.lastInNumberOfCategories = 0;\r\n this.isLastInRootCategory = this.isRootCategory;\r\n }\r\n\r\n /**\r\n * Category is considered to be root category if its depth is 0\r\n */\r\n public get isRootCategory() {\r\n return this.depth === 0;\r\n }\r\n\r\n public get selectionKey() {\r\n return this._selectionKey;\r\n }\r\n\r\n public get type(): FlatGridItemType.Category {\r\n return FlatGridItemType.Category;\r\n }\r\n\r\n public get name() {\r\n return this._category.name;\r\n }\r\n\r\n public get label() {\r\n return this._category.label;\r\n }\r\n\r\n public get derivedCategory(): PropertyCategory {\r\n return { ...this._category, expand: this.isExpanded };\r\n }\r\n\r\n public getSelf() {\r\n return this;\r\n }\r\n\r\n public getChildren(): IMutableFlatGridItem[] {\r\n return this._children;\r\n }\r\n\r\n /**\r\n * Gets and Sets lastInNumberOfCategories.\r\n * Setter increments set value by one to account self as category.\r\n * New value is sent down to this items last child\r\n * @internal\r\n */\r\n public override get lastInNumberOfCategories(): number {\r\n if (this.isExpanded && this.getChildren().length > 0)\r\n return 0;\r\n\r\n return this._lastInNumberOfCategories - 1;\r\n }\r\n\r\n public override set lastInNumberOfCategories(value: number) {\r\n super.lastInNumberOfCategories = value + 1;\r\n }\r\n}\r\n"]}
|
package/lib/cjs/components-react/propertygrid/internal/flat-items/MutableGridItemFactory.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MutableGridItemFactory.js","sourceRoot":"","sources":["../../../../../../src/components-react/propertygrid/internal/flat-items/MutableGridItemFactory.ts"],"names":[],"mappings":";;;AAAA;;;+FAG+F;AAC/F;;GAEG;AACH,0DAA4E;AAE5E,uFAAoF;AACpF,+FAA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AM,EAAE,kBAAkB,EAAE,0BAA0B,EAAE,KAAK,EAAE,YAAY,EAAE,oBAAoB,CAAC,CAAC;YACrI,KAAK,oCAAmB,CAAC,MAAM;gBAC7B,OAAO,IAAI,CAAC,oBAAoB,CAAC,MAAM,EAAE,kBAAkB,EAAE,0BAA0B,EAAE,KAAK,EAAE,YAAY,EAAE,oBAAoB,CAAC,CAAC;YACtI,0BAA0B;YAC1B;gBACE,MAAM,mBAAmB,GAAU,WAAW,CAAC;gBAC/C,MAAM,IAAI,KAAK,CAAC,yDAAyD,mBAAmB,EAAE,CAAC,CAAC;SACnG;IACH,CAAC;IAED;;;;;;;OAOG;IACI,kBAAkB,CACvB,QAA0B,EAC1B,WAAgC,EAChC,kBAA2B,EAC3B,KAAc;QAEd,IAAI,QAAQ,CAAC,QAAQ,KAAK,SAAS;YACjC,OAAO,IAAI,qDAAyB,CAAC,QAAQ,EAAE,WAAW,EAAE,IAAI,EAAE,kBAAkB,EAAE,KAAK,IAAI,CAAC,CAAC,CAAC;QAEpG,IAAI,kBAAkB,KAAK,SAAS,IAAI,KAAK,KAAK,SAAS;YACzD,OAAO,IAAI,yCAAmB,CAAC,QAAQ,EAAE,WAAW,EAAE,IAAI,EAAE,kBAAkB,EAAE,KAAK,CAAC,CAAC;QAEzF,OAAO,IAAI,yCAAmB,CAAC,QAAQ,EAAE,WAAW,EAAE,IAAI,CAAC,CAAC;IAC9D,CAAC;CACF;AAzFD,wDAyFC","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 */\nimport { PropertyRecord, PropertyValueFormat } from \"@itwin/appui-abstract\";\nimport { PropertyCategory } from \"../../PropertyDataProvider\";\nimport { MutableCategorizedArrayProperty } from \"./MutableCategorizedArrayProperty\";\nimport { MutableCategorizedPrimitiveProperty } from \"./MutableCategorizedPrimitiveProperty\";\nimport { MutableCategorizedStructProperty } from \"./MutableCategorizedStructProperty\";\nimport { MutableCustomGridCategory } from \"./MutableCustomGridCategory\";\nimport { IMutableCategorizedPropertyItem, IMutableGridCategoryItem } from \"./MutableFlatGridItem\";\nimport { CategoryRecordsDict, MutableGridCategory } from \"./MutableGridCategory\";\n\n/**\n * IMutableGridItemFactory interface for creating MutableGridItem objects\n * @public\n */\nexport interface IMutableGridItemFactory {\n createCategorizedProperty: (\n record: PropertyRecord,\n parentSelectionKey: string,\n parentCategorySelectionKey: string,\n depth: number,\n overrideName?: string,\n overrideDisplayLabel?: string,\n ) => IMutableCategorizedPropertyItem;\n\n createGridCategory: (\n category: PropertyCategory,\n recordsDict: CategoryRecordsDict,\n parentSelectionKey?: string,\n depth?: number,\n ) => IMutableGridCategoryItem;\n}\n\n/**\n * Implementation of IMutableGridItemFactory for creating MutableGridItem objects.\n * @public\n */\nexport class MutableGridItemFactory implements IMutableGridItemFactory {\n protected createPrimitiveProperty(\n record: PropertyRecord,\n parentSelectionKey: string,\n parentCategorySelectionKey: string,\n depth: number,\n overrideName?: string,\n overrideDisplayLabel?: string,\n ) {\n return new MutableCategorizedPrimitiveProperty(record, parentSelectionKey, parentCategorySelectionKey, depth, overrideName, overrideDisplayLabel);\n }\n\n protected createArrayProperty(\n record: PropertyRecord,\n parentSelectionKey: string,\n parentCategorySelectionKey: string,\n depth: number,\n overrideName?: string,\n overrideDisplayLabel?: string,\n ) {\n return new MutableCategorizedArrayProperty(record, parentSelectionKey, parentCategorySelectionKey, depth, this, overrideName, overrideDisplayLabel);\n }\n\n protected createStructProperty(\n record: PropertyRecord,\n parentSelectionKey: string,\n parentCategorySelectionKey: string,\n depth: number,\n overrideName?: string,\n overrideDisplayLabel?: string,\n ) {\n return new MutableCategorizedStructProperty(record, parentSelectionKey, parentCategorySelectionKey, depth, this, overrideName, overrideDisplayLabel);\n }\n\n /**\n * Converts record into FlatGridItem.\n * @param record record to convert to a FlatGridItem.\n * @param parentSelectionKey parent selection key of provided `record`.\n * @param parentCategorySelectionKey parent category selection key of provided `record`.\n * @param depth current depth counting from parent category.\n * @param overrideName property name that overrides original record property name.\n * @param overrideDisplayLabel property display label that overrides original record property display label.\n * @returns converted CategorizedProperty.\n */\n public createCategorizedProperty(\n record: PropertyRecord,\n parentSelectionKey: string,\n parentCategorySelectionKey: string,\n depth: number,\n overrideName?: string,\n overrideDisplayLabel?: string,\n ): IMutableCategorizedPropertyItem {\n const valueFormat = record.value.valueFormat;\n switch (valueFormat) {\n case PropertyValueFormat.Primitive:\n return this.createPrimitiveProperty(record, parentSelectionKey, parentCategorySelectionKey, depth, overrideName, overrideDisplayLabel);\n case PropertyValueFormat.Array:\n return this.createArrayProperty(record, parentSelectionKey, parentCategorySelectionKey, depth, overrideName, overrideDisplayLabel);\n case PropertyValueFormat.Struct:\n return this.createStructProperty(record, parentSelectionKey, parentCategorySelectionKey, depth, overrideName, overrideDisplayLabel);\n /* istanbul ignore next */\n default:\n const unhandledRecordType: never = valueFormat;\n throw new Error(`Unhandled property record type. Was a new type added? ${unhandledRecordType}`);\n }\n }\n\n /**\n * Converts category into GridCategoryItem.\n * @param category PropertyCategory to convert.\n * @param recordsDict dictionary of category records.\n * @param parentSelectionKey parent selection key of this category.\n * @param depth current depth counting from root category.\n * @returns converted GridCategory.\n */\n public createGridCategory(\n category: PropertyCategory,\n recordsDict: CategoryRecordsDict,\n parentSelectionKey?: string,\n depth?: number,\n ): IMutableGridCategoryItem {\n if (category.renderer !== undefined)\n return new MutableCustomGridCategory(category, recordsDict, this, parentSelectionKey, depth ?? 0);\n\n if (parentSelectionKey !== undefined && depth !== undefined)\n return new MutableGridCategory(category, recordsDict, this, parentSelectionKey, depth);\n\n return new MutableGridCategory(category, recordsDict, this);\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"MutableGridItemFactory.js","sourceRoot":"","sources":["../../../../../../src/components-react/propertygrid/internal/flat-items/MutableGridItemFactory.ts"],"names":[],"mappings":";;;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,KAAK,oCAAmB,CAAC,KAAK;gBAC5B,OAAO,IAAI,CAAC,mBAAmB,CAAC,MAAM,EAAE,kBAAkB,EAAE,0BAA0B,EAAE,KAAK,EAAE,YAAY,EAAE,oBAAoB,CAAC,CAAC;YACrI,KAAK,oCAAmB,CAAC,MAAM;gBAC7B,OAAO,IAAI,CAAC,oBAAoB,CAAC,MAAM,EAAE,kBAAkB,EAAE,0BAA0B,EAAE,KAAK,EAAE,YAAY,EAAE,oBAAoB,CAAC,CAAC;YACtI,0BAA0B;YAC1B;gBACE,MAAM,mBAAmB,GAAU,WAAW,CAAC;gBAC/C,MAAM,IAAI,KAAK,CAAC,yDAAyD,mBAAmB,EAAE,CAAC,CAAC;SACnG;IACH,CAAC;IAED;;;;;;;OAOG;IACI,kBAAkB,CACvB,QAA0B,EAC1B,WAAgC,EAChC,kBAA2B,EAC3B,KAAc;QAEd,IAAI,QAAQ,CAAC,QAAQ,KAAK,SAAS;YACjC,OAAO,IAAI,qDAAyB,CAAC,QAAQ,EAAE,WAAW,EAAE,IAAI,EAAE,kBAAkB,EAAE,KAAK,IAAI,CAAC,CAAC,CAAC;QAEpG,IAAI,kBAAkB,KAAK,SAAS,IAAI,KAAK,KAAK,SAAS;YACzD,OAAO,IAAI,yCAAmB,CAAC,QAAQ,EAAE,WAAW,EAAE,IAAI,EAAE,kBAAkB,EAAE,KAAK,CAAC,CAAC;QAEzF,OAAO,IAAI,yCAAmB,CAAC,QAAQ,EAAE,WAAW,EAAE,IAAI,CAAC,CAAC;IAC9D,CAAC;CACF;AAzFD,wDAyFC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module PropertyGrid\r\n */\r\nimport { PropertyRecord, PropertyValueFormat } from \"@itwin/appui-abstract\";\r\nimport { PropertyCategory } from \"../../PropertyDataProvider\";\r\nimport { MutableCategorizedArrayProperty } from \"./MutableCategorizedArrayProperty\";\r\nimport { MutableCategorizedPrimitiveProperty } from \"./MutableCategorizedPrimitiveProperty\";\r\nimport { MutableCategorizedStructProperty } from \"./MutableCategorizedStructProperty\";\r\nimport { MutableCustomGridCategory } from \"./MutableCustomGridCategory\";\r\nimport { IMutableCategorizedPropertyItem, IMutableGridCategoryItem } from \"./MutableFlatGridItem\";\r\nimport { CategoryRecordsDict, MutableGridCategory } from \"./MutableGridCategory\";\r\n\r\n/**\r\n * IMutableGridItemFactory interface for creating MutableGridItem objects\r\n * @public\r\n */\r\nexport interface IMutableGridItemFactory {\r\n createCategorizedProperty: (\r\n record: PropertyRecord,\r\n parentSelectionKey: string,\r\n parentCategorySelectionKey: string,\r\n depth: number,\r\n overrideName?: string,\r\n overrideDisplayLabel?: string,\r\n ) => IMutableCategorizedPropertyItem;\r\n\r\n createGridCategory: (\r\n category: PropertyCategory,\r\n recordsDict: CategoryRecordsDict,\r\n parentSelectionKey?: string,\r\n depth?: number,\r\n ) => IMutableGridCategoryItem;\r\n}\r\n\r\n/**\r\n * Implementation of IMutableGridItemFactory for creating MutableGridItem objects.\r\n * @public\r\n */\r\nexport class MutableGridItemFactory implements IMutableGridItemFactory {\r\n protected createPrimitiveProperty(\r\n record: PropertyRecord,\r\n parentSelectionKey: string,\r\n parentCategorySelectionKey: string,\r\n depth: number,\r\n overrideName?: string,\r\n overrideDisplayLabel?: string,\r\n ) {\r\n return new MutableCategorizedPrimitiveProperty(record, parentSelectionKey, parentCategorySelectionKey, depth, overrideName, overrideDisplayLabel);\r\n }\r\n\r\n protected createArrayProperty(\r\n record: PropertyRecord,\r\n parentSelectionKey: string,\r\n parentCategorySelectionKey: string,\r\n depth: number,\r\n overrideName?: string,\r\n overrideDisplayLabel?: string,\r\n ) {\r\n return new MutableCategorizedArrayProperty(record, parentSelectionKey, parentCategorySelectionKey, depth, this, overrideName, overrideDisplayLabel);\r\n }\r\n\r\n protected createStructProperty(\r\n record: PropertyRecord,\r\n parentSelectionKey: string,\r\n parentCategorySelectionKey: string,\r\n depth: number,\r\n overrideName?: string,\r\n overrideDisplayLabel?: string,\r\n ) {\r\n return new MutableCategorizedStructProperty(record, parentSelectionKey, parentCategorySelectionKey, depth, this, overrideName, overrideDisplayLabel);\r\n }\r\n\r\n /**\r\n * Converts record into FlatGridItem.\r\n * @param record record to convert to a FlatGridItem.\r\n * @param parentSelectionKey parent selection key of provided `record`.\r\n * @param parentCategorySelectionKey parent category selection key of provided `record`.\r\n * @param depth current depth counting from parent category.\r\n * @param overrideName property name that overrides original record property name.\r\n * @param overrideDisplayLabel property display label that overrides original record property display label.\r\n * @returns converted CategorizedProperty.\r\n */\r\n public createCategorizedProperty(\r\n record: PropertyRecord,\r\n parentSelectionKey: string,\r\n parentCategorySelectionKey: string,\r\n depth: number,\r\n overrideName?: string,\r\n overrideDisplayLabel?: string,\r\n ): IMutableCategorizedPropertyItem {\r\n const valueFormat = record.value.valueFormat;\r\n switch (valueFormat) {\r\n case PropertyValueFormat.Primitive:\r\n return this.createPrimitiveProperty(record, parentSelectionKey, parentCategorySelectionKey, depth, overrideName, overrideDisplayLabel);\r\n case PropertyValueFormat.Array:\r\n return this.createArrayProperty(record, parentSelectionKey, parentCategorySelectionKey, depth, overrideName, overrideDisplayLabel);\r\n case PropertyValueFormat.Struct:\r\n return this.createStructProperty(record, parentSelectionKey, parentCategorySelectionKey, depth, overrideName, overrideDisplayLabel);\r\n /* istanbul ignore next */\r\n default:\r\n const unhandledRecordType: never = valueFormat;\r\n throw new Error(`Unhandled property record type. Was a new type added? ${unhandledRecordType}`);\r\n }\r\n }\r\n\r\n /**\r\n * Converts category into GridCategoryItem.\r\n * @param category PropertyCategory to convert.\r\n * @param recordsDict dictionary of category records.\r\n * @param parentSelectionKey parent selection key of this category.\r\n * @param depth current depth counting from root category.\r\n * @returns converted GridCategory.\r\n */\r\n public createGridCategory(\r\n category: PropertyCategory,\r\n recordsDict: CategoryRecordsDict,\r\n parentSelectionKey?: string,\r\n depth?: number,\r\n ): IMutableGridCategoryItem {\r\n if (category.renderer !== undefined)\r\n return new MutableCustomGridCategory(category, recordsDict, this, parentSelectionKey, depth ?? 0);\r\n\r\n if (parentSelectionKey !== undefined && depth !== undefined)\r\n return new MutableGridCategory(category, recordsDict, this, parentSelectionKey, depth);\r\n\r\n return new MutableGridCategory(category, recordsDict, this);\r\n }\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FlatNonPrimitivePropertyRenderer.js","sourceRoot":"","sources":["../../../../../../src/components-react/propertygrid/internal/flat-properties/FlatNonPrimitivePropertyRenderer.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;+FAG+F;AAC/F;;GAEG;AACH,2EAAyE;AACzE,6CAA+B;AAC/B,0DAA4D;AAC5D,iGAA8F;AAE9F,6HAA0H;AAC1H,6EAA0E;AAU1E;;GAEG;AACH,MAAa,gCAAiC,SAAQ,KAAK,CAAC,SAAgD;IAC1G,YAAY,KAA4C;QACtD,KAAK,CAAC,KAAK,CAAC,CAAC;QAGP,gBAAW,GAAG,GAAG,EAAE;YACzB,0BAA0B;YAC1B,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU;gBACxB,IAAI,CAAC,KAAK,CAAC,eAAe,EAAE,CAAC;QACjC,CAAC,CAAC;QAEM,iBAAY,GAAG,GAAG,EAAE;YAC1B,0BAA0B;YAC1B,IAAI,IAAI,CAAC,KAAK,CAAC,UAAU;gBACvB,IAAI,CAAC,KAAK,CAAC,eAAe,EAAE,CAAC;QACjC,CAAC,CAAC;IAZF,CAAC;IAcO,QAAQ,CAAC,KAA4C;QAC3D,MAAM,EAAE,WAAW,EAAE,WAAW,EAAE,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,GAAG,KAAK,CAAC;QAC3E,MAAM,MAAM,GAAG,+CAAsB,CAAC,cAAc,CAAC,WAAW,EAAE,WAAW,EAAE,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,aAAa,CAAC,CAAC;QAE9H,IAAI,YAAY,GAAG,KAAK,CAAC,cAAc,CAAC,QAAQ,CAAC,YAAY,CAAC;QAC9D,IAAI,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,WAAW,KAAK,oCAAmB,CAAC,KAAK;YACtE,YAAY,GAAG,GAAG,YAAY,KAAK,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC;QAEhF,OAAO,CACL,oBAAC,qEAAiC,IAChC,UAAU,EAAE,KAAK,CAAC,UAAU,EAC5B,QAAQ,EAAE,IAAI,CAAC,WAAW,EAC1B,UAAU,EAAE,IAAI,CAAC,YAAY,EAC7B,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,KAAK,IAEjB,YAAY,CACqB,CACrC,CAAC;IACJ,CAAC;IAED,gBAAgB;IACA,MAAM;QACpB,6DAA6D;QAC7D,MAAM,EAAE,WAAW,EAAE,GAAG,KAAK,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC;QAC7C,OAAO,CACL,oBAAC,2BAAY,IACX,YAAY,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,KACnC,KAAK,GACT,CACH,CAAC;IACJ,CAAC;CACF;AAjDD,4EAiDC","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 */\nimport \"../../../properties/renderers/NonPrimitivePropertyRenderer.scss\";\nimport * as React from \"react\";\nimport { PropertyValueFormat } from \"@itwin/appui-abstract\";\nimport { CommonPropertyRenderer } from \"../../../properties/renderers/CommonPropertyRenderer\";\nimport { PrimitiveRendererProps } from \"../../../properties/renderers/PrimitivePropertyRenderer\";\nimport { NonPrimitivePropertyLabelRenderer } from \"../../../properties/renderers/label/NonPrimitivePropertyLabelRenderer\";\nimport { PropertyView } from \"../../../properties/renderers/PropertyView\";\n\n/** Properties of [[FlatNonPrimitivePropertyRenderer]] React component\n * @internal\n */\nexport interface FlatNonPrimitivePropertyRendererProps extends PrimitiveRendererProps {\n isExpanded: boolean;\n onExpandToggled: () => void;\n}\n\n/** React Component that renders flat struct and array properties\n * @internal\n */\nexport class FlatNonPrimitivePropertyRenderer extends React.Component<FlatNonPrimitivePropertyRendererProps> {\n constructor(props: FlatNonPrimitivePropertyRendererProps) {\n super(props);\n }\n\n private _onExpanded = () => {\n /* istanbul ignore else */\n if (!this.props.isExpanded)\n this.props.onExpandToggled();\n };\n\n private _onCollapsed = () => {\n /* istanbul ignore else */\n if (this.props.isExpanded)\n this.props.onExpandToggled();\n };\n\n private getLabel(props: FlatNonPrimitivePropertyRendererProps): React.ReactNode {\n const { orientation, indentation, width, columnRatio, columnInfo } = props;\n const offset = CommonPropertyRenderer.getLabelOffset(indentation, orientation, width, columnRatio, columnInfo?.minLabelWidth);\n\n let displayLabel = props.propertyRecord.property.displayLabel;\n if (props.propertyRecord.value.valueFormat === PropertyValueFormat.Array)\n displayLabel = `${displayLabel} (${props.propertyRecord.value.items.length})`;\n\n return (\n <NonPrimitivePropertyLabelRenderer\n isExpanded={props.isExpanded}\n onExpand={this._onExpanded}\n onCollapse={this._onCollapsed}\n offset={offset}\n renderColon={false}\n >\n {displayLabel}\n </NonPrimitivePropertyLabelRenderer>\n );\n }\n\n /** @internal */\n public override render() {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const { indentation, ...props } = this.props;\n return (\n <PropertyView\n labelElement={this.getLabel(this.props)}\n {...props}\n />\n );\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"FlatNonPrimitivePropertyRenderer.js","sourceRoot":"","sources":["../../../../../../src/components-react/propertygrid/internal/flat-properties/FlatNonPrimitivePropertyRenderer.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;+FA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AE,MAAM,EACd,WAAW,EAAE,KAAK,IAEjB,YAAY,CACqB,CACrC,CAAC;IACJ,CAAC;IAED,gBAAgB;IACA,MAAM;QACpB,6DAA6D;QAC7D,MAAM,EAAE,WAAW,EAAE,GAAG,KAAK,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC;QAC7C,OAAO,CACL,oBAAC,2BAAY,IACX,YAAY,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,KACnC,KAAK,GACT,CACH,CAAC;IACJ,CAAC;CACF;AAjDD,4EAiDC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module PropertyGrid\r\n */\r\nimport \"../../../properties/renderers/NonPrimitivePropertyRenderer.scss\";\r\nimport * as React from \"react\";\r\nimport { PropertyValueFormat } from \"@itwin/appui-abstract\";\r\nimport { CommonPropertyRenderer } from \"../../../properties/renderers/CommonPropertyRenderer\";\r\nimport { PrimitiveRendererProps } from \"../../../properties/renderers/PrimitivePropertyRenderer\";\r\nimport { NonPrimitivePropertyLabelRenderer } from \"../../../properties/renderers/label/NonPrimitivePropertyLabelRenderer\";\r\nimport { PropertyView } from \"../../../properties/renderers/PropertyView\";\r\n\r\n/** Properties of [[FlatNonPrimitivePropertyRenderer]] React component\r\n * @internal\r\n */\r\nexport interface FlatNonPrimitivePropertyRendererProps extends PrimitiveRendererProps {\r\n isExpanded: boolean;\r\n onExpandToggled: () => void;\r\n}\r\n\r\n/** React Component that renders flat struct and array properties\r\n * @internal\r\n */\r\nexport class FlatNonPrimitivePropertyRenderer extends React.Component<FlatNonPrimitivePropertyRendererProps> {\r\n constructor(props: FlatNonPrimitivePropertyRendererProps) {\r\n super(props);\r\n }\r\n\r\n private _onExpanded = () => {\r\n /* istanbul ignore else */\r\n if (!this.props.isExpanded)\r\n this.props.onExpandToggled();\r\n };\r\n\r\n private _onCollapsed = () => {\r\n /* istanbul ignore else */\r\n if (this.props.isExpanded)\r\n this.props.onExpandToggled();\r\n };\r\n\r\n private getLabel(props: FlatNonPrimitivePropertyRendererProps): React.ReactNode {\r\n const { orientation, indentation, width, columnRatio, columnInfo } = props;\r\n const offset = CommonPropertyRenderer.getLabelOffset(indentation, orientation, width, columnRatio, columnInfo?.minLabelWidth);\r\n\r\n let displayLabel = props.propertyRecord.property.displayLabel;\r\n if (props.propertyRecord.value.valueFormat === PropertyValueFormat.Array)\r\n displayLabel = `${displayLabel} (${props.propertyRecord.value.items.length})`;\r\n\r\n return (\r\n <NonPrimitivePropertyLabelRenderer\r\n isExpanded={props.isExpanded}\r\n onExpand={this._onExpanded}\r\n onCollapse={this._onCollapsed}\r\n offset={offset}\r\n renderColon={false}\r\n >\r\n {displayLabel}\r\n </NonPrimitivePropertyLabelRenderer>\r\n );\r\n }\r\n\r\n /** @internal */\r\n public override render() {\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n const { indentation, ...props } = this.props;\r\n return (\r\n <PropertyView\r\n labelElement={this.getLabel(this.props)}\r\n {...props}\r\n />\r\n );\r\n }\r\n}\r\n"]}
|
package/lib/cjs/components-react/propertygrid/internal/flat-properties/FlatPropertyRenderer.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FlatPropertyRenderer.js","sourceRoot":"","sources":["../../../../../../src/components-react/propertygrid/internal/flat-properties/FlatPropertyRenderer.tsx"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,6CAA+B;AAC/B,0DAA4E;AAG5E,sEAAwF;AACxF,iGAA8F;AAC9F,uGAA4H;AAI5H,yFAAsF;AA6BtF;;GAEG;AACI,MAAM,oBAAoB,GAAwC,CAAC,KAAK,EAAE,EAAE;IACjF,MAAM,EACJ,QAAQ,EACR,4BAA4B,EAC5B,S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D,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,IAAI,CAAC,wBAAwB,CAAC,OAAO,IAAI,SAAS,EAAE;YAClD,eAAe,EAAE,CAAC,EAAE,CAAC,CAAC;SACvB;QAED,wBAAwB,CAAC,OAAO,GAAG,SAAS,CAAC;IAC/C,CAAC,CAAC,CAAC;AACL,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 PropertyGrid\n */\n\nimport * as React from \"react\";\nimport { PropertyRecord, PropertyValueFormat } from \"@itwin/appui-abstract\";\nimport { Orientation } from \"@itwin/core-react\";\nimport { HighlightingComponentProps } from \"../../../common/HighlightingComponentProps\";\nimport { EditorContainer, PropertyUpdatedArgs } from \"../../../editors/EditorContainer\";\nimport { CommonPropertyRenderer } from \"../../../properties/renderers/CommonPropertyRenderer\";\nimport { PrimitivePropertyRenderer, PrimitiveRendererProps } from \"../../../properties/renderers/PrimitivePropertyRenderer\";\nimport { SharedRendererProps } from \"../../../properties/renderers/PropertyRenderer\";\nimport { PropertyValueRendererManager } from \"../../../properties/ValueRendererManager\";\nimport { PropertyCategory } from \"../../PropertyDataProvider\";\nimport { FlatNonPrimitivePropertyRenderer } from \"./FlatNonPrimitivePropertyRenderer\";\n\n/** Properties of [[FlatPropertyRenderer]] React component\n * @internal\n */\nexport interface FlatPropertyRendererProps extends SharedRendererProps {\n category?: PropertyCategory;\n /** Custom value renderer */\n propertyValueRendererManager?: PropertyValueRendererManager;\n /** Multiplier of how much the property is indented to the right */\n indentation?: number;\n /** Indicates property is being edited */\n isEditing?: boolean;\n /** Called when property edit is committed. */\n onEditCommit?: (args: PropertyUpdatedArgs, category: PropertyCategory) => void;\n /** Called when property edit is cancelled. */\n onEditCancel?: () => void;\n /** Whether property value is displayed in expanded state. */\n isExpanded: boolean;\n /** Called when toggling between expanded and collapsed property value display state. */\n onExpansionToggled: () => void;\n /** Reports property height changes. */\n onHeightChanged?: (newHeight: number) => void;\n\n highlight?: HighlightingComponentProps & { applyOnLabel: boolean, applyOnValue: boolean };\n\n children?: never;\n}\n\n/** A React component that renders flat properties\n * @internal\n */\nexport const FlatPropertyRenderer: React.FC<FlatPropertyRendererProps> = (props) => {\n const {\n category,\n propertyValueRendererManager,\n isEditing,\n onEditCommit,\n onEditCancel,\n onHeightChanged,\n highlight,\n ...passthroughProps\n } = props;\n\n const valueElementRenderer = () => (\n <DisplayValue\n propertyRecord={passthroughProps.propertyRecord}\n orientation={passthroughProps.orientation}\n columnRatio={passthroughProps.columnRatio}\n width={passthroughProps.width}\n category={category}\n propertyValueRendererManager={propertyValueRendererManager}\n isEditing={isEditing}\n onEditCommit={onEditCommit}\n onEditCancel={onEditCancel}\n isExpanded={passthroughProps.isExpanded}\n onExpansionToggled={passthroughProps.onExpansionToggled}\n onHeightChanged={onHeightChanged}\n highlight={highlight}\n />\n );\n\n const primitiveRendererProps: PrimitiveRendererProps = {\n ...passthroughProps,\n valueElementRenderer,\n indentation: props.indentation,\n };\n switch (props.propertyRecord.value.valueFormat) {\n case PropertyValueFormat.Primitive:\n return (<PrimitivePropertyRenderer highlight={highlight?.applyOnLabel ? highlight : undefined} {...primitiveRendererProps} />);\n\n case PropertyValueFormat.Array:\n // If array is empty, render it as a primitive property\n if (props.propertyRecord.value.items.length === 0)\n return (<PrimitivePropertyRenderer highlight={highlight?.applyOnLabel ? highlight : undefined} {...primitiveRendererProps} />);\n\n // eslint-disable-next-line no-fallthrough\n case PropertyValueFormat.Struct:\n return (\n <FlatNonPrimitivePropertyRenderer\n isExpanded={props.isExpanded}\n onExpandToggled={props.onExpansionToggled}\n {...primitiveRendererProps}\n />\n );\n }\n};\n\ninterface DisplayValueProps {\n isEditing?: boolean;\n propertyRecord: PropertyRecord;\n\n orientation: Orientation;\n columnRatio?: number;\n /** Pass width to rerender component as property grid width changes */\n width?: number;\n indentation?: number;\n propertyValueRendererManager?: PropertyValueRendererManager;\n isExpanded?: boolean;\n onExpansionToggled?: () => void;\n onHeightChanged?: (newHeight: number) => void;\n\n category?: PropertyCategory;\n onEditCancel?: () => void;\n onEditCommit?: (args: PropertyUpdatedArgs, category: PropertyCategory) => void;\n\n highlight?: HighlightingComponentProps & { applyOnLabel: boolean, applyOnValue: boolean };\n}\n\nconst DisplayValue: React.FC<DisplayValueProps> = (props) => {\n useResetHeightOnEdit(props.isEditing, props.onHeightChanged);\n\n if (props.isEditing) {\n const _onEditCommit = (args: PropertyUpdatedArgs) => {\n /* istanbul ignore else */\n if (props.category)\n props.onEditCommit?.(args, props.category);\n };\n\n return (\n <EditorContainer\n propertyRecord={props.propertyRecord}\n onCommit={_onEditCommit}\n onCancel={props.onEditCancel ?? (/* istanbul ignore next */() => { })}\n setFocus={true}\n />\n );\n }\n\n return (\n <>\n {\n CommonPropertyRenderer.createNewDisplayValue(\n props.orientation,\n props.propertyRecord,\n props.indentation,\n props.propertyValueRendererManager,\n props.isExpanded,\n props.onExpansionToggled,\n props.onHeightChanged,\n props.highlight\n )\n }\n </>\n );\n};\n\nfunction useResetHeightOnEdit(isEditing?: boolean, onHeightChanged?: (newHeight: number) => void) {\n const previousEditingStatusRef = React.useRef(isEditing);\n React.useEffect(() => {\n if (!previousEditingStatusRef.current && isEditing) {\n onHeightChanged?.(27);\n }\n\n previousEditingStatusRef.current = isEditing;\n });\n}\n"]}
|
|
1
|
+
{"version":3,"file":"FlatPropertyRenderer.js","sourceRoot":"","sources":["../../../../../../src/components-react/propertygrid/internal/flat-properties/FlatPropertyRenderer.tsx"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,6CAA+B;AAC/B,0DAA4E;AAG5E,sEAAwF;AACxF,iGAA8F;AAC9F,uGAA4H;AAI5H,yFAAsF;AA6BtF;;GAEG;AACI,MAAM,oBAAoB,GAAwC,CAAC,KAAK,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BAAwB,GAAG,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;IACzD,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,IAAI,CAAC,wBAAwB,CAAC,OAAO,IAAI,SAAS,EAAE;YAClD,eAAe,EAAE,CAAC,EAAE,CAAC,CAAC;SACvB;QAED,wBAAwB,CAAC,OAAO,GAAG,SAAS,CAAC;IAC/C,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module PropertyGrid\r\n */\r\n\r\nimport * as React from \"react\";\r\nimport { PropertyRecord, PropertyValueFormat } from \"@itwin/appui-abstract\";\r\nimport { Orientation } from \"@itwin/core-react\";\r\nimport { HighlightingComponentProps } from \"../../../common/HighlightingComponentProps\";\r\nimport { EditorContainer, PropertyUpdatedArgs } from \"../../../editors/EditorContainer\";\r\nimport { CommonPropertyRenderer } from \"../../../properties/renderers/CommonPropertyRenderer\";\r\nimport { PrimitivePropertyRenderer, PrimitiveRendererProps } from \"../../../properties/renderers/PrimitivePropertyRenderer\";\r\nimport { SharedRendererProps } from \"../../../properties/renderers/PropertyRenderer\";\r\nimport { PropertyValueRendererManager } from \"../../../properties/ValueRendererManager\";\r\nimport { PropertyCategory } from \"../../PropertyDataProvider\";\r\nimport { FlatNonPrimitivePropertyRenderer } from \"./FlatNonPrimitivePropertyRenderer\";\r\n\r\n/** Properties of [[FlatPropertyRenderer]] React component\r\n * @internal\r\n */\r\nexport interface FlatPropertyRendererProps extends SharedRendererProps {\r\n category?: PropertyCategory;\r\n /** Custom value renderer */\r\n propertyValueRendererManager?: PropertyValueRendererManager;\r\n /** Multiplier of how much the property is indented to the right */\r\n indentation?: number;\r\n /** Indicates property is being edited */\r\n isEditing?: boolean;\r\n /** Called when property edit is committed. */\r\n onEditCommit?: (args: PropertyUpdatedArgs, category: PropertyCategory) => void;\r\n /** Called when property edit is cancelled. */\r\n onEditCancel?: () => void;\r\n /** Whether property value is displayed in expanded state. */\r\n isExpanded: boolean;\r\n /** Called when toggling between expanded and collapsed property value display state. */\r\n onExpansionToggled: () => void;\r\n /** Reports property height changes. */\r\n onHeightChanged?: (newHeight: number) => void;\r\n\r\n highlight?: HighlightingComponentProps & { applyOnLabel: boolean, applyOnValue: boolean };\r\n\r\n children?: never;\r\n}\r\n\r\n/** A React component that renders flat properties\r\n * @internal\r\n */\r\nexport const FlatPropertyRenderer: React.FC<FlatPropertyRendererProps> = (props) => {\r\n const {\r\n category,\r\n propertyValueRendererManager,\r\n isEditing,\r\n onEditCommit,\r\n onEditCancel,\r\n onHeightChanged,\r\n highlight,\r\n ...passthroughProps\r\n } = props;\r\n\r\n const valueElementRenderer = () => (\r\n <DisplayValue\r\n propertyRecord={passthroughProps.propertyRecord}\r\n orientation={passthroughProps.orientation}\r\n columnRatio={passthroughProps.columnRatio}\r\n width={passthroughProps.width}\r\n category={category}\r\n propertyValueRendererManager={propertyValueRendererManager}\r\n isEditing={isEditing}\r\n onEditCommit={onEditCommit}\r\n onEditCancel={onEditCancel}\r\n isExpanded={passthroughProps.isExpanded}\r\n onExpansionToggled={passthroughProps.onExpansionToggled}\r\n onHeightChanged={onHeightChanged}\r\n highlight={highlight}\r\n />\r\n );\r\n\r\n const primitiveRendererProps: PrimitiveRendererProps = {\r\n ...passthroughProps,\r\n valueElementRenderer,\r\n indentation: props.indentation,\r\n };\r\n switch (props.propertyRecord.value.valueFormat) {\r\n case PropertyValueFormat.Primitive:\r\n return (<PrimitivePropertyRenderer highlight={highlight?.applyOnLabel ? highlight : undefined} {...primitiveRendererProps} />);\r\n\r\n case PropertyValueFormat.Array:\r\n // If array is empty, render it as a primitive property\r\n if (props.propertyRecord.value.items.length === 0)\r\n return (<PrimitivePropertyRenderer highlight={highlight?.applyOnLabel ? highlight : undefined} {...primitiveRendererProps} />);\r\n\r\n // eslint-disable-next-line no-fallthrough\r\n case PropertyValueFormat.Struct:\r\n return (\r\n <FlatNonPrimitivePropertyRenderer\r\n isExpanded={props.isExpanded}\r\n onExpandToggled={props.onExpansionToggled}\r\n {...primitiveRendererProps}\r\n />\r\n );\r\n }\r\n};\r\n\r\ninterface DisplayValueProps {\r\n isEditing?: boolean;\r\n propertyRecord: PropertyRecord;\r\n\r\n orientation: Orientation;\r\n columnRatio?: number;\r\n /** Pass width to rerender component as property grid width changes */\r\n width?: number;\r\n indentation?: number;\r\n propertyValueRendererManager?: PropertyValueRendererManager;\r\n isExpanded?: boolean;\r\n onExpansionToggled?: () => void;\r\n onHeightChanged?: (newHeight: number) => void;\r\n\r\n category?: PropertyCategory;\r\n onEditCancel?: () => void;\r\n onEditCommit?: (args: PropertyUpdatedArgs, category: PropertyCategory) => void;\r\n\r\n highlight?: HighlightingComponentProps & { applyOnLabel: boolean, applyOnValue: boolean };\r\n}\r\n\r\nconst DisplayValue: React.FC<DisplayValueProps> = (props) => {\r\n useResetHeightOnEdit(props.isEditing, props.onHeightChanged);\r\n\r\n if (props.isEditing) {\r\n const _onEditCommit = (args: PropertyUpdatedArgs) => {\r\n /* istanbul ignore else */\r\n if (props.category)\r\n props.onEditCommit?.(args, props.category);\r\n };\r\n\r\n return (\r\n <EditorContainer\r\n propertyRecord={props.propertyRecord}\r\n onCommit={_onEditCommit}\r\n onCancel={props.onEditCancel ?? (/* istanbul ignore next */() => { })}\r\n setFocus={true}\r\n />\r\n );\r\n }\r\n\r\n return (\r\n <>\r\n {\r\n CommonPropertyRenderer.createNewDisplayValue(\r\n props.orientation,\r\n props.propertyRecord,\r\n props.indentation,\r\n props.propertyValueRendererManager,\r\n props.isExpanded,\r\n props.onExpansionToggled,\r\n props.onHeightChanged,\r\n props.highlight\r\n )\r\n }\r\n </>\r\n );\r\n};\r\n\r\nfunction useResetHeightOnEdit(isEditing?: boolean, onHeightChanged?: (newHeight: number) => void) {\r\n const previousEditingStatusRef = React.useRef(isEditing);\r\n React.useEffect(() => {\r\n if (!previousEditingStatusRef.current && isEditing) {\r\n onHeightChanged?.(27);\r\n }\r\n\r\n previousEditingStatusRef.current = isEditing;\r\n });\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectableContent.js","sourceRoot":"","sources":["../../../../src/components-react/selectable-content/SelectableContent.tsx"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F,4CAA4C;AAC5C;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,oCAAkC;AAClC,6CAA+B;AAC/B,wDAA4D;AAwB5D;;;;;GAKG;AACH,SAAgB,2BAA2B,CAAC,KAAuC;IACjF,MAAM,EAAE,0BAA0B,EAAE,GAAG,KAAK,CAAC;IAE7C,MAAM,mBAAmB,GAAG,KAAK,CAAC,WAAW,CAAC,CAAC,QAAgB,EAAQ,EAAE;QACvE,0BAA0B,IAAI,0BAA0B,CAAC,QAAQ,CAAC,CAAC;IACrE,CAAC,EAAE,CAAC,0BAA0B,CAAC,CAAC,CAAC;IAEjC,MAAM,eAAe,GAAG,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,UAAU,CAAC,EAAE,KAAK,KAAK,CAAC,iBAAiB,CAAC,IAAI,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;IAC5H,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE;QACjC,OAAO,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,YAAY,EAAE,EAAE,CAAC,CAAC;YAC3C,KAAK,EAAE,YAAY,CAAC,KAAK;YACzB,KAAK,EAAE,YAAY,CAAC,EAAE;SACvB,CAAC,CAA2B,CAAC;IAChC,CAAC,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC;IAErB,OAAO,CACL,6BAAK,SAAS,EAAC,+BAA+B;QAC5C,6BAAK,SAAS,EAAC,sCAAsC,IAClD,OAAO,CAAC,MAAM,GAAG,CAAC;YACjB,oBAAC,sBAAM,IAAC,QAAQ,EAAE,mBAAmB,EAAE,IAAI,EAAC,OAAO,EACjD,SAAS,EAAC,wCAAwC,gBACtC,KAAK,CAAC,eAAe,EACjC,KAAK,EAAE,eAAe,CAAC,EAAE,EACzB,OAAO,EAAE,OAAO,GAChB,CAEA;QACN,6BAAK,SAAS,EAAC,uCAAuC,IACnD,eAAe,EAAE,MAAM,EAAE,CACtB,CACF,CACP,CAAC;AACJ,CAAC;AAhCD,kEAgCC;AAYD;;;;;GAKG;AACH,SAAgB,iBAAiB,CAAC,KAA6B;IAC7D,MAAM,CAAC,iBAAiB,EAAE,oBAAoB,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,wBAAwB,CAAC,CAAC;IACjG,MAAM,0BAA0B,GAAG,KAAK,CAAC,WAAW,CAAC,CAAC,EAAU,EAAE,EAAE;QAClE,oBAAoB,CAAC,EAAE,CAAC,CAAC;IAC3B,CAAC,EAAE,EAAE,CAAC,CAAC;IACP,OAAO,CACL,oBAAC,2BAA2B,IAAC,iBAAiB,EAAE,iBAAiB,EAAE,0BAA0B,EAAE,0BAA0B,EAAE,eAAe,EAAE,KAAK,CAAC,eAAe,IAC9J,KAAK,CAAC,QAAQ,CACa,CAC/B,CAAC;AACJ,CAAC;AAVD,8CAUC","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/* eslint-disable deprecation/deprecation */\n/** @packageDocumentation\n * @module SelectableContent\n */\n\nimport \"./SelectableContent.scss\";\nimport * as React from \"react\";\nimport { Select, SelectOption } from \"@itwin/itwinui-react\";\n\n/**\n * A definition for content displayed in [[ControlledSelectableContent]] and\n * [[SelectableContent]] components.\n * @public\n */\nexport interface SelectableContentDefinition {\n id: string;\n label: string;\n render: () => React.ReactNode;\n}\n\n/**\n * [[ControlledSelectableContent]] component properties\n * @public\n */\nexport interface ControlledSelectableContentProps {\n selectedContentId: string;\n onSelectedContentIdChanged?: (contentId: string) => void;\n children: SelectableContentDefinition[];\n selectAriaLabel?: string;\n}\n\n/**\n * A fully-controlled component that accepts a list of child components with ids and labels and\n * renders a select box at the top, allowing to choose which of the provided child components\n * should be rendered at the bottom.\n * @public\n */\nexport function ControlledSelectableContent(props: ControlledSelectableContentProps) {\n const { onSelectedContentIdChanged } = props;\n\n const onContentIdSelected = React.useCallback((newValue: string): void => {\n onSelectedContentIdChanged && onSelectedContentIdChanged(newValue);\n }, [onSelectedContentIdChanged]);\n\n const selectedContent = props.children.find((contentDef) => contentDef.id === props.selectedContentId) ?? props.children[0];\n const options = React.useMemo(() => {\n return props.children.map((componentDef) => ({\n label: componentDef.label,\n value: componentDef.id,\n })) as SelectOption<string>[];\n }, [props.children]);\n\n return (\n <div className=\"components-selectable-content\">\n <div className=\"components-selectable-content-header\">\n {options.length > 0 &&\n <Select onChange={onContentIdSelected} size=\"small\"\n className=\"components-selectable-content-selector\"\n aria-label={props.selectAriaLabel}\n value={selectedContent.id}\n options={options}\n />\n }\n </div>\n <div className=\"components-selectable-content-wrapper\">\n {selectedContent?.render()}\n </div>\n </div>\n );\n}\n\n/**\n * [[SelectableContent]] component properties\n * @public\n */\nexport interface SelectableContentProps {\n defaultSelectedContentId: string;\n children: SelectableContentDefinition[];\n selectAriaLabel?: string;\n}\n\n/**\n * An uncontrolled component that accepts a list of child components with ids and labels and\n * renders a select box at the top, allowing to choose which of the provided child components\n * should be rendered at the bottom.\n * @public\n */\nexport function SelectableContent(props: SelectableContentProps) {\n const [selectedContentId, setSelectedContentId] = React.useState(props.defaultSelectedContentId);\n const onSelectedContentIdChanged = React.useCallback((id: string) => {\n setSelectedContentId(id);\n }, []);\n return (\n <ControlledSelectableContent selectedContentId={selectedContentId} onSelectedContentIdChanged={onSelectedContentIdChanged} selectAriaLabel={props.selectAriaLabel}>\n {props.children}\n </ControlledSelectableContent>\n );\n}\n"]}
|
|
1
|
+
{"version":3,"file":"SelectableContent.js","sourceRoot":"","sources":["../../../../src/components-react/selectable-content/SelectableContent.tsx"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F,4CAA4C;AAC5C;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,oCAAkC;AAClC,6CAA+B;AAC/B,wDAA4D;AAwB5D;;;;;GAKG;AACH,SAAgB,2BAA2B,CAAC,KAAuC;IACjF,MAAM,EAAE,0BAA0B,EAAE,GAAG,KAAK,CAAC;IAE7C,MAAM,mBAAmB,GAAG,KAAK,CAAC,WAAW,CAAC,CAAC,QAAgB,EAAQ,EAAE;QACvE,0BAA0B,IAAI,0BAA0B,CAAC,QAAQ,CAAC,CAAC;IACrE,CAAC,EAAE,CAAC,0BAA0B,CAAC,CAAC,CAAC;IAEjC,MAAM,eAAe,GAAG,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,UAAU,CAAC,EAAE,KAAK,KAAK,CAAC,iBAAiB,CAAC,IAAI,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;IAC5H,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE;QACjC,OAAO,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,YAAY,EAAE,EAAE,CAAC,CAAC;YAC3C,KAAK,EAAE,YAAY,CAAC,KAAK;YACzB,KAAK,EAAE,YAAY,CAAC,EAAE;SACvB,CAAC,CAA2B,CAAC;IAChC,CAAC,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC;IAErB,OAAO,CACL,6BAAK,SAAS,EAAC,+BAA+B;QAC5C,6BAAK,SAAS,EAAC,sCAAsC,IAClD,OAAO,CAAC,MAAM,GAAG,CAAC;YACjB,oBAAC,sBAAM,IAAC,QAAQ,EAAE,mBAAmB,EAAE,IAAI,EAAC,OAAO,EACjD,SAAS,EAAC,wCAAwC,gBACtC,KAAK,CAAC,eAAe,EACjC,KAAK,EAAE,eAAe,CAAC,EAAE,EACzB,OAAO,EAAE,OAAO,GAChB,CAEA;QACN,6BAAK,SAAS,EAAC,uCAAuC,IACnD,eAAe,EAAE,MAAM,EAAE,CACtB,CACF,CACP,CAAC;AACJ,CAAC;AAhCD,kEAgCC;AAYD;;;;;GAKG;AACH,SAAgB,iBAAiB,CAAC,KAA6B;IAC7D,MAAM,CAAC,iBAAiB,EAAE,oBAAoB,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,wBAAwB,CAAC,CAAC;IACjG,MAAM,0BAA0B,GAAG,KAAK,CAAC,WAAW,CAAC,CAAC,EAAU,EAAE,EAAE;QAClE,oBAAoB,CAAC,EAAE,CAAC,CAAC;IAC3B,CAAC,EAAE,EAAE,CAAC,CAAC;IACP,OAAO,CACL,oBAAC,2BAA2B,IAAC,iBAAiB,EAAE,iBAAiB,EAAE,0BAA0B,EAAE,0BAA0B,EAAE,eAAe,EAAE,KAAK,CAAC,eAAe,IAC9J,KAAK,CAAC,QAAQ,CACa,CAC/B,CAAC;AACJ,CAAC;AAVD,8CAUC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/* eslint-disable deprecation/deprecation */\r\n/** @packageDocumentation\r\n * @module SelectableContent\r\n */\r\n\r\nimport \"./SelectableContent.scss\";\r\nimport * as React from \"react\";\r\nimport { Select, SelectOption } from \"@itwin/itwinui-react\";\r\n\r\n/**\r\n * A definition for content displayed in [[ControlledSelectableContent]] and\r\n * [[SelectableContent]] components.\r\n * @public\r\n */\r\nexport interface SelectableContentDefinition {\r\n id: string;\r\n label: string;\r\n render: () => React.ReactNode;\r\n}\r\n\r\n/**\r\n * [[ControlledSelectableContent]] component properties\r\n * @public\r\n */\r\nexport interface ControlledSelectableContentProps {\r\n selectedContentId: string;\r\n onSelectedContentIdChanged?: (contentId: string) => void;\r\n children: SelectableContentDefinition[];\r\n selectAriaLabel?: string;\r\n}\r\n\r\n/**\r\n * A fully-controlled component that accepts a list of child components with ids and labels and\r\n * renders a select box at the top, allowing to choose which of the provided child components\r\n * should be rendered at the bottom.\r\n * @public\r\n */\r\nexport function ControlledSelectableContent(props: ControlledSelectableContentProps) {\r\n const { onSelectedContentIdChanged } = props;\r\n\r\n const onContentIdSelected = React.useCallback((newValue: string): void => {\r\n onSelectedContentIdChanged && onSelectedContentIdChanged(newValue);\r\n }, [onSelectedContentIdChanged]);\r\n\r\n const selectedContent = props.children.find((contentDef) => contentDef.id === props.selectedContentId) ?? props.children[0];\r\n const options = React.useMemo(() => {\r\n return props.children.map((componentDef) => ({\r\n label: componentDef.label,\r\n value: componentDef.id,\r\n })) as SelectOption<string>[];\r\n }, [props.children]);\r\n\r\n return (\r\n <div className=\"components-selectable-content\">\r\n <div className=\"components-selectable-content-header\">\r\n {options.length > 0 &&\r\n <Select onChange={onContentIdSelected} size=\"small\"\r\n className=\"components-selectable-content-selector\"\r\n aria-label={props.selectAriaLabel}\r\n value={selectedContent.id}\r\n options={options}\r\n />\r\n }\r\n </div>\r\n <div className=\"components-selectable-content-wrapper\">\r\n {selectedContent?.render()}\r\n </div>\r\n </div>\r\n );\r\n}\r\n\r\n/**\r\n * [[SelectableContent]] component properties\r\n * @public\r\n */\r\nexport interface SelectableContentProps {\r\n defaultSelectedContentId: string;\r\n children: SelectableContentDefinition[];\r\n selectAriaLabel?: string;\r\n}\r\n\r\n/**\r\n * An uncontrolled component that accepts a list of child components with ids and labels and\r\n * renders a select box at the top, allowing to choose which of the provided child components\r\n * should be rendered at the bottom.\r\n * @public\r\n */\r\nexport function SelectableContent(props: SelectableContentProps) {\r\n const [selectedContentId, setSelectedContentId] = React.useState(props.defaultSelectedContentId);\r\n const onSelectedContentIdChanged = React.useCallback((id: string) => {\r\n setSelectedContentId(id);\r\n }, []);\r\n return (\r\n <ControlledSelectableContent selectedContentId={selectedContentId} onSelectedContentIdChanged={onSelectedContentIdChanged} selectAriaLabel={props.selectAriaLabel}>\r\n {props.children}\r\n </ControlledSelectableContent>\r\n );\r\n}\r\n"]}
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
/*---------------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
-
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
-
*--------------------------------------------------------------------------------------------*/
|
|
5
|
-
|
|
6
|
-
.components-selectable-content {
|
|
7
|
-
display: flex;
|
|
8
|
-
flex-direction: column;
|
|
9
|
-
|
|
10
|
-
.components-selectable-content-header {
|
|
11
|
-
.components-selectable-content-selector {
|
|
12
|
-
width: 100%;
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
.components-selectable-content-wrapper {
|
|
17
|
-
flex-grow: 1;
|
|
18
|
-
overflow: hidden;
|
|
19
|
-
}
|
|
20
|
-
}
|
|
1
|
+
/*---------------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
|
|
6
|
+
.components-selectable-content {
|
|
7
|
+
display: flex;
|
|
8
|
+
flex-direction: column;
|
|
9
|
+
|
|
10
|
+
.components-selectable-content-header {
|
|
11
|
+
.components-selectable-content-selector {
|
|
12
|
+
width: 100%;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.components-selectable-content-wrapper {
|
|
17
|
+
flex-grow: 1;
|
|
18
|
+
overflow: hidden;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TableDataProvider.js","sourceRoot":"","sources":["../../../../src/components-react/table/TableDataProvider.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAA8C;AAE9C;;;GAGG;AACH,MAAa,oBAAqB,SAAQ,sBAAmB;CAAI;AAAjE,oDAAiE","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 Table\n */\n\nimport { BeEvent } from \"@itwin/core-bentley\";\n\n/** An event broadcasted on table data changes\n * @deprecated in 3.5. Use the Table component in @itwin/itwinui-react instead, which does not use this class.\n * @public\n */\nexport class TableDataChangeEvent extends BeEvent<() => void> { }\n"]}
|
|
1
|
+
{"version":3,"file":"TableDataProvider.js","sourceRoot":"","sources":["../../../../src/components-react/table/TableDataProvider.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAA8C;AAE9C;;;GAGG;AACH,MAAa,oBAAqB,SAAQ,sBAAmB;CAAI;AAAjE,oDAAiE","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Table\r\n */\r\n\r\nimport { BeEvent } from \"@itwin/core-bentley\";\r\n\r\n/** An event broadcasted on table data changes\r\n * @deprecated in 3.5. Use the Table component in @itwin/itwinui-react instead, which does not use this class.\r\n * @public\r\n */\r\nexport class TableDataChangeEvent extends BeEvent<() => void> { }\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Item.js","sourceRoot":"","sources":["../../../../src/components-react/toolbar/Item.tsx"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,uBAAqB;AACrB,4DAAoC;AACpC,6CAA+B;AA+B/B;;GAEG;AACH,8CAA8C;AACjC,QAAA,iBAAiB,GAAG,KAAK,CAAC,IAAI,CACzC,CAAC,KAA6B,EAAE,EAAE;IAChC,MAAM,SAAS,GAAG,IAAA,oBAAU,EAC1B,gCAAgC,EAChC,KAAK,CAAC,QAAQ,IAAI,mBAAmB,EACrC,KAAK,CAAC,UAAU,IAAI,qBAAqB,EACzC,KAAK,CAAC,SAAS,CAAC,CAAC;IAEnB,OAAO,CACL,gDACgB,KAAK,CAAC,MAAM,oBACX,oBAAoB,8BACT,KAAK,CAAC,aAAa,wBACzB,KAAK,CAAC,YAAY,2BACf,KAAK,CAAC,UAAU,EACvC,QAAQ,EAAE,KAAK,CAAC,UAAU,EAC1B,OAAO,EAAE,KAAK,CAAC,OAAO,EACtB,SAAS,EAAE,KAAK,CAAC,SAAS,EAC1B,SAAS,EAAE,SAAS,EACpB,KAAK,EAAE,KAAK,CAAC,KAAK,EAClB,KAAK,EAAE,KAAK,CAAC,KAAK;QAElB,6BAAK,SAAS,EAAC,iBAAiB,IAC7B,KAAK,CAAC,IAAI,CACP;QACL,KAAK,CAAC,KAAK;YACV,6BAAK,SAAS,EAAC,kBAAkB,IAC9B,KAAK,CAAC,KAAK,CACR,CAED,CACV,CAAC;AACJ,CAAC,CAAC,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 Toolbar\n */\n\nimport \"./Item.scss\";\nimport classnames from \"classnames\";\nimport * as React from \"react\";\nimport { CommonProps } from \"@itwin/core-react\";\n\n/** Properties of [[ToolbarButtonItem]] component.\n * @public\n */\nexport interface ToolbarButtonItemProps extends CommonProps {\n /** button icon. */\n icon?: React.ReactNode;\n /** Describes if item is active. */\n isActive?: boolean;\n /** Describes if the item is disabled. */\n isDisabled?: boolean;\n /** Function called when the item is clicked. */\n onClick?: () => void;\n /** Function called when a key is pressed. */\n onKeyDown?: (e: React.KeyboardEvent) => void;\n /** Title for the item. */\n title: string;\n /** A badge to draw. */\n badge?: React.ReactNode;\n /** If true add a gap before button. Default to false. */\n addGroupSeparator?: boolean;\n /** value added to DOM element as a data attribute to hold name of items provider. If specified in `FrontstageProvider` then this will be undefined */\n providerId?: string;\n /** value added to DOM element as a data attribute, shows 0 is undefined */\n itemPriority?: number;\n /** value added to DOM element as a data attribute */\n groupPriority?: number;\n}\n\n/** Toolbar item component. Used in [[Toolbar]] component.\n * @public\n */\n// eslint-disable-next-line react/display-name\nexport const ToolbarButtonItem = React.memo<React.FC<ToolbarButtonItemProps>>(\n (props: ToolbarButtonItemProps) => {\n const className = classnames(\n \"components-toolbar-button-item\",\n props.isActive && \"components-active\",\n props.isDisabled && \"components-disabled\",\n props.className);\n\n return (\n <button\n data-item-id={props.itemId}\n data-item-type=\"action-tool-button\"\n data-item-group-priority={props.groupPriority}\n data-item-priority={props.itemPriority}\n data-item-provider-id={props.providerId}\n disabled={props.isDisabled} // this is needed to prevent focusing/keyboard access to disabled buttons\n onClick={props.onClick}\n onKeyDown={props.onKeyDown}\n className={className}\n style={props.style}\n title={props.title}\n >\n <div className=\"components-icon\">\n {props.icon}\n </div>\n {props.badge &&\n <div className=\"components-badge\">\n {props.badge}\n </div>\n }\n </button>\n );\n });\n"]}
|
|
1
|
+
{"version":3,"file":"Item.js","sourceRoot":"","sources":["../../../../src/components-react/toolbar/Item.tsx"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,uBAAqB;AACrB,4DAAoC;AACpC,6CAA+B;AA+B/B;;GAEG;AACH,8CAA8C;AACjC,QAAA,iBAAiB,GAAG,KAAK,CAAC,IAAI,CACzC,CAAC,KAA6B,EAAE,EAAE;IAChC,MAAM,SAAS,GAAG,IAAA,oBAAU,EAC1B,gCAAgC,EAChC,KAAK,CAAC,QAAQ,IAAI,mBAAmB,EACrC,KAAK,CAAC,UAAU,IAAI,qBAAqB,EACzC,KAAK,CAAC,SAAS,CAAC,CAAC;IAEnB,OAAO,CACL,gDACgB,KAAK,CAAC,MAAM,oBACX,oBAAoB,8BACT,KAAK,CAAC,aAAa,wBACzB,KAAK,CAAC,YAAY,2BACf,KAAK,CAAC,UAAU,EACvC,QAAQ,EAAE,KAAK,CAAC,UAAU,EAC1B,OAAO,EAAE,KAAK,CAAC,OAAO,EACtB,SAAS,EAAE,KAAK,CAAC,SAAS,EAC1B,SAAS,EAAE,SAAS,EACpB,KAAK,EAAE,KAAK,CAAC,KAAK,EAClB,KAAK,EAAE,KAAK,CAAC,KAAK;QAElB,6BAAK,SAAS,EAAC,iBAAiB,IAC7B,KAAK,CAAC,IAAI,CACP;QACL,KAAK,CAAC,KAAK;YACV,6BAAK,SAAS,EAAC,kBAAkB,IAC9B,KAAK,CAAC,KAAK,CACR,CAED,CACV,CAAC;AACJ,CAAC,CAAC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Toolbar\r\n */\r\n\r\nimport \"./Item.scss\";\r\nimport classnames from \"classnames\";\r\nimport * as React from \"react\";\r\nimport { CommonProps } from \"@itwin/core-react\";\r\n\r\n/** Properties of [[ToolbarButtonItem]] component.\r\n * @public\r\n */\r\nexport interface ToolbarButtonItemProps extends CommonProps {\r\n /** button icon. */\r\n icon?: React.ReactNode;\r\n /** Describes if item is active. */\r\n isActive?: boolean;\r\n /** Describes if the item is disabled. */\r\n isDisabled?: boolean;\r\n /** Function called when the item is clicked. */\r\n onClick?: () => void;\r\n /** Function called when a key is pressed. */\r\n onKeyDown?: (e: React.KeyboardEvent) => void;\r\n /** Title for the item. */\r\n title: string;\r\n /** A badge to draw. */\r\n badge?: React.ReactNode;\r\n /** If true add a gap before button. Default to false. */\r\n addGroupSeparator?: boolean;\r\n /** value added to DOM element as a data attribute to hold name of items provider. If specified in `FrontstageProvider` then this will be undefined */\r\n providerId?: string;\r\n /** value added to DOM element as a data attribute, shows 0 is undefined */\r\n itemPriority?: number;\r\n /** value added to DOM element as a data attribute */\r\n groupPriority?: number;\r\n}\r\n\r\n/** Toolbar item component. Used in [[Toolbar]] component.\r\n * @public\r\n */\r\n// eslint-disable-next-line react/display-name\r\nexport const ToolbarButtonItem = React.memo<React.FC<ToolbarButtonItemProps>>(\r\n (props: ToolbarButtonItemProps) => {\r\n const className = classnames(\r\n \"components-toolbar-button-item\",\r\n props.isActive && \"components-active\",\r\n props.isDisabled && \"components-disabled\",\r\n props.className);\r\n\r\n return (\r\n <button\r\n data-item-id={props.itemId}\r\n data-item-type=\"action-tool-button\"\r\n data-item-group-priority={props.groupPriority}\r\n data-item-priority={props.itemPriority}\r\n data-item-provider-id={props.providerId}\r\n disabled={props.isDisabled} // this is needed to prevent focusing/keyboard access to disabled buttons\r\n onClick={props.onClick}\r\n onKeyDown={props.onKeyDown}\r\n className={className}\r\n style={props.style}\r\n title={props.title}\r\n >\r\n <div className=\"components-icon\">\r\n {props.icon}\r\n </div>\r\n {props.badge &&\r\n <div className=\"components-badge\">\r\n {props.badge}\r\n </div>\r\n }\r\n </button>\r\n );\r\n });\r\n"]}
|