@itwin/components-react 3.6.0-dev.7 → 4.0.0-dev.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +26 -1
- package/LICENSE.md +1 -1
- package/lib/cjs/components-react/breadcrumb/Breadcrumb.d.ts +5 -5
- package/lib/cjs/components-react/breadcrumb/Breadcrumb.js +3 -3
- package/lib/cjs/components-react/breadcrumb/Breadcrumb.js.map +1 -1
- package/lib/cjs/components-react/breadcrumb/BreadcrumbDetails.d.ts +2 -2
- package/lib/cjs/components-react/breadcrumb/BreadcrumbDetails.js +1 -1
- package/lib/cjs/components-react/breadcrumb/BreadcrumbDetails.js.map +1 -1
- package/lib/cjs/components-react/breadcrumb/BreadcrumbPath.d.ts +3 -3
- package/lib/cjs/components-react/breadcrumb/BreadcrumbPath.js +2 -2
- package/lib/cjs/components-react/breadcrumb/BreadcrumbPath.js.map +1 -1
- package/lib/cjs/components-react/breadcrumb/BreadcrumbTreeUtils.d.ts +1 -1
- package/lib/cjs/components-react/breadcrumb/BreadcrumbTreeUtils.js +1 -1
- package/lib/cjs/components-react/breadcrumb/BreadcrumbTreeUtils.js.map +1 -1
- package/lib/cjs/components-react/common/UseDebouncedAsyncValue.d.ts +4 -1
- package/lib/cjs/components-react/common/UseDebouncedAsyncValue.d.ts.map +1 -1
- package/lib/cjs/components-react/common/UseDebouncedAsyncValue.js +4 -1
- package/lib/cjs/components-react/common/UseDebouncedAsyncValue.js.map +1 -1
- package/lib/cjs/components-react/common/showhide/ShowHideDialog.d.ts +2 -2
- package/lib/cjs/components-react/common/showhide/ShowHideDialog.js +1 -1
- package/lib/cjs/components-react/common/showhide/ShowHideDialog.js.map +1 -1
- package/lib/cjs/components-react/common/showhide/ShowHideItem.d.ts +2 -2
- package/lib/cjs/components-react/common/showhide/ShowHideItem.js.map +1 -1
- package/lib/cjs/components-react/common/showhide/ShowHideMenu.d.ts +2 -2
- package/lib/cjs/components-react/common/showhide/ShowHideMenu.js +1 -1
- package/lib/cjs/components-react/common/showhide/ShowHideMenu.js.map +1 -1
- package/lib/cjs/components-react/converters/TypeConverterManager.d.ts.map +1 -1
- package/lib/cjs/components-react/converters/TypeConverterManager.js +3 -4
- package/lib/cjs/components-react/converters/TypeConverterManager.js.map +1 -1
- package/lib/cjs/components-react/editors/ThemedEnumEditor.d.ts +3 -3
- package/lib/cjs/components-react/editors/ThemedEnumEditor.js +2 -2
- package/lib/cjs/components-react/editors/ThemedEnumEditor.js.map +1 -1
- package/lib/cjs/components-react/filter-builder/FilterBuilder.d.ts +22 -24
- package/lib/cjs/components-react/filter-builder/FilterBuilder.d.ts.map +1 -1
- package/lib/cjs/components-react/filter-builder/FilterBuilder.js +24 -83
- package/lib/cjs/components-react/filter-builder/FilterBuilder.js.map +1 -1
- package/lib/cjs/components-react/filter-builder/FilterBuilderContext.d.ts +80 -0
- package/lib/cjs/components-react/filter-builder/FilterBuilderContext.d.ts.map +1 -0
- package/lib/cjs/components-react/filter-builder/FilterBuilderContext.js +83 -0
- package/lib/cjs/components-react/filter-builder/FilterBuilderContext.js.map +1 -0
- package/lib/cjs/components-react/filter-builder/FilterBuilderRule.d.ts +14 -3
- package/lib/cjs/components-react/filter-builder/FilterBuilderRule.d.ts.map +1 -1
- package/lib/cjs/components-react/filter-builder/FilterBuilderRule.js +22 -12
- package/lib/cjs/components-react/filter-builder/FilterBuilderRule.js.map +1 -1
- package/lib/cjs/components-react/filter-builder/FilterBuilderRule.scss +4 -0
- package/lib/cjs/components-react/filter-builder/FilterBuilderRuleGroup.d.ts +25 -16
- package/lib/cjs/components-react/filter-builder/FilterBuilderRuleGroup.d.ts.map +1 -1
- package/lib/cjs/components-react/filter-builder/FilterBuilderRuleGroup.js +22 -14
- package/lib/cjs/components-react/filter-builder/FilterBuilderRuleGroup.js.map +1 -1
- package/lib/cjs/components-react/filter-builder/FilterBuilderRuleOperator.d.ts +14 -2
- package/lib/cjs/components-react/filter-builder/FilterBuilderRuleOperator.d.ts.map +1 -1
- package/lib/cjs/components-react/filter-builder/FilterBuilderRuleOperator.js +11 -5
- package/lib/cjs/components-react/filter-builder/FilterBuilderRuleOperator.js.map +1 -1
- package/lib/cjs/components-react/filter-builder/FilterBuilderRuleProperty.d.ts +16 -2
- package/lib/cjs/components-react/filter-builder/FilterBuilderRuleProperty.d.ts.map +1 -1
- package/lib/cjs/components-react/filter-builder/FilterBuilderRuleProperty.js +11 -5
- package/lib/cjs/components-react/filter-builder/FilterBuilderRuleProperty.js.map +1 -1
- package/lib/cjs/components-react/filter-builder/FilterBuilderRuleValue.d.ts +14 -2
- package/lib/cjs/components-react/filter-builder/FilterBuilderRuleValue.d.ts.map +1 -1
- package/lib/cjs/components-react/filter-builder/FilterBuilderRuleValue.js +11 -5
- package/lib/cjs/components-react/filter-builder/FilterBuilderRuleValue.js.map +1 -1
- package/lib/cjs/components-react/filter-builder/FilterBuilderState.d.ts +52 -8
- package/lib/cjs/components-react/filter-builder/FilterBuilderState.d.ts.map +1 -1
- package/lib/cjs/components-react/filter-builder/FilterBuilderState.js +102 -12
- package/lib/cjs/components-react/filter-builder/FilterBuilderState.js.map +1 -1
- package/lib/cjs/components-react/filter-builder/Operators.d.ts +23 -5
- package/lib/cjs/components-react/filter-builder/Operators.d.ts.map +1 -1
- package/lib/cjs/components-react/filter-builder/Operators.js +25 -7
- package/lib/cjs/components-react/filter-builder/Operators.js.map +1 -1
- package/lib/cjs/components-react/filter-builder/Types.d.ts +24 -4
- package/lib/cjs/components-react/filter-builder/Types.d.ts.map +1 -1
- package/lib/cjs/components-react/filter-builder/Types.js +11 -1
- package/lib/cjs/components-react/filter-builder/Types.js.map +1 -1
- package/lib/cjs/components-react/filtering/FilteringInput.js +1 -1
- package/lib/cjs/components-react/filtering/FilteringInput.js.map +1 -1
- package/lib/cjs/components-react/iconpicker/IconPickerButton.d.ts +2 -2
- package/lib/cjs/components-react/iconpicker/IconPickerButton.js +2 -2
- package/lib/cjs/components-react/iconpicker/IconPickerButton.js.map +1 -1
- package/lib/cjs/components-react/properties/LinkHandler.d.ts +2 -2
- package/lib/cjs/components-react/properties/LinkHandler.js +1 -1
- package/lib/cjs/components-react/properties/LinkHandler.js.map +1 -1
- package/lib/cjs/components-react/propertygrid/PropertyCategoryRendererManager.d.ts +3 -3
- package/lib/cjs/components-react/propertygrid/PropertyCategoryRendererManager.js +1 -1
- package/lib/cjs/components-react/propertygrid/PropertyCategoryRendererManager.js.map +1 -1
- package/lib/cjs/components-react/propertygrid/PropertyDataProvider.d.ts +2 -2
- package/lib/cjs/components-react/propertygrid/PropertyDataProvider.js.map +1 -1
- package/lib/cjs/components-react/propertygrid/component/PropertyGrid.d.ts +3 -1
- package/lib/cjs/components-react/propertygrid/component/PropertyGrid.d.ts.map +1 -1
- package/lib/cjs/components-react/propertygrid/component/PropertyGrid.js +1 -0
- package/lib/cjs/components-react/propertygrid/component/PropertyGrid.js.map +1 -1
- package/lib/cjs/components-react/propertygrid/component/PropertyGridCommons.d.ts +5 -10
- package/lib/cjs/components-react/propertygrid/component/PropertyGridCommons.d.ts.map +1 -1
- package/lib/cjs/components-react/propertygrid/component/PropertyGridCommons.js.map +1 -1
- package/lib/cjs/components-react/propertygrid/component/VirtualizedPropertyGrid.d.ts +3 -3
- package/lib/cjs/components-react/propertygrid/component/VirtualizedPropertyGrid.js +1 -1
- package/lib/cjs/components-react/propertygrid/component/VirtualizedPropertyGrid.js.map +1 -1
- package/lib/cjs/components-react/propertygrid/component/VirtualizedPropertyGrid.scss +11 -0
- package/lib/cjs/components-react/propertygrid/component/VirtualizedPropertyGridWithDataProvider.d.ts +2 -2
- package/lib/cjs/components-react/propertygrid/component/VirtualizedPropertyGridWithDataProvider.js +1 -1
- package/lib/cjs/components-react/propertygrid/component/VirtualizedPropertyGridWithDataProvider.js.map +1 -1
- package/lib/cjs/components-react/propertygrid/internal/PropertyGridEventHandler.d.ts +2 -2
- package/lib/cjs/components-react/propertygrid/internal/PropertyGridEventHandler.js +1 -1
- package/lib/cjs/components-react/propertygrid/internal/PropertyGridEventHandler.js.map +1 -1
- package/lib/cjs/components-react/propertygrid/internal/PropertyGridHooks.d.ts +3 -3
- package/lib/cjs/components-react/propertygrid/internal/PropertyGridHooks.js +3 -3
- package/lib/cjs/components-react/propertygrid/internal/PropertyGridHooks.js.map +1 -1
- package/lib/cjs/components-react/propertygrid/internal/PropertyGridModel.d.ts +3 -3
- package/lib/cjs/components-react/propertygrid/internal/PropertyGridModel.js +1 -1
- package/lib/cjs/components-react/propertygrid/internal/PropertyGridModel.js.map +1 -1
- package/lib/cjs/components-react/propertygrid/internal/PropertyGridModelChangeEvent.d.ts +2 -2
- package/lib/cjs/components-react/propertygrid/internal/PropertyGridModelChangeEvent.js +1 -1
- package/lib/cjs/components-react/propertygrid/internal/PropertyGridModelChangeEvent.js.map +1 -1
- package/lib/cjs/components-react/propertygrid/internal/PropertyGridModelSource.d.ts +2 -2
- package/lib/cjs/components-react/propertygrid/internal/PropertyGridModelSource.d.ts.map +1 -1
- package/lib/cjs/components-react/propertygrid/internal/PropertyGridModelSource.js +1 -1
- package/lib/cjs/components-react/propertygrid/internal/PropertyGridModelSource.js.map +1 -1
- package/lib/cjs/components-react/propertygrid/internal/flat-items/FlatGridItem.d.ts +6 -6
- package/lib/cjs/components-react/propertygrid/internal/flat-items/FlatGridItem.d.ts.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.d.ts +1 -1
- package/lib/cjs/components-react/propertygrid/internal/flat-items/MutableCategorizedArrayProperty.js +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.d.ts +1 -1
- package/lib/cjs/components-react/propertygrid/internal/flat-items/MutableCategorizedPrimitiveProperty.js +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.d.ts +1 -1
- package/lib/cjs/components-react/propertygrid/internal/flat-items/MutableCategorizedStructProperty.js +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/MutableFlatGridItem.d.ts +10 -10
- package/lib/cjs/components-react/propertygrid/internal/flat-items/MutableFlatGridItem.js +3 -3
- package/lib/cjs/components-react/propertygrid/internal/flat-items/MutableFlatGridItem.js.map +1 -1
- package/lib/cjs/components-react/propertygrid/internal/flat-items/MutableGridCategory.d.ts +2 -2
- package/lib/cjs/components-react/propertygrid/internal/flat-items/MutableGridCategory.js +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.d.ts +2 -2
- package/lib/cjs/components-react/propertygrid/internal/flat-items/MutableGridItemFactory.js +1 -1
- package/lib/cjs/components-react/propertygrid/internal/flat-items/MutableGridItemFactory.js.map +1 -1
- package/lib/cjs/components-react/propertygrid/internal/flat-properties/FlatPropertyRenderer.d.ts +3 -6
- package/lib/cjs/components-react/propertygrid/internal/flat-properties/FlatPropertyRenderer.d.ts.map +1 -1
- package/lib/cjs/components-react/propertygrid/internal/flat-properties/FlatPropertyRenderer.js.map +1 -1
- package/lib/cjs/components-react/table/SimpleTableDataProvider.d.ts +1 -1
- package/lib/cjs/components-react/table/SimpleTableDataProvider.js +1 -1
- package/lib/cjs/components-react/table/SimpleTableDataProvider.js.map +1 -1
- package/lib/cjs/components-react/table/TableDataProvider.d.ts +8 -8
- package/lib/cjs/components-react/table/TableDataProvider.js +2 -2
- package/lib/cjs/components-react/table/TableDataProvider.js.map +1 -1
- package/lib/cjs/components-react/table/columnfiltering/ColumnFiltering.d.ts +16 -16
- package/lib/cjs/components-react/table/columnfiltering/ColumnFiltering.js +6 -6
- package/lib/cjs/components-react/table/columnfiltering/ColumnFiltering.js.map +1 -1
- package/lib/cjs/components-react/table/component/ColumnDragLayer.d.ts +1 -1
- package/lib/cjs/components-react/table/component/ColumnDragLayer.js +1 -1
- package/lib/cjs/components-react/table/component/ColumnDragLayer.js.map +1 -1
- package/lib/cjs/components-react/table/component/Table.d.ts +9 -9
- package/lib/cjs/components-react/table/component/Table.d.ts.map +1 -1
- package/lib/cjs/components-react/table/component/Table.js +2 -2
- package/lib/cjs/components-react/table/component/Table.js.map +1 -1
- package/lib/cjs/components-react/table/component/TableCell.d.ts +6 -6
- package/lib/cjs/components-react/table/component/TableCell.js +3 -3
- package/lib/cjs/components-react/table/component/TableCell.js.map +1 -1
- package/lib/cjs/components-react/table/component/TableColumn.d.ts +1 -1
- package/lib/cjs/components-react/table/component/TableColumn.js.map +1 -1
- package/lib/cjs/components-react/table/component/dragdrop/BeDragDropContext.d.ts +1 -1
- package/lib/cjs/components-react/table/component/dragdrop/BeDragDropContext.js +1 -1
- package/lib/cjs/components-react/table/component/dragdrop/BeDragDropContext.js.map +1 -1
- package/lib/cjs/components-react/table/component/dragdrop/DragDropDef.d.ts +8 -8
- package/lib/cjs/components-react/table/component/dragdrop/DragDropDef.js +2 -2
- package/lib/cjs/components-react/table/component/dragdrop/DragDropDef.js.map +1 -1
- package/lib/cjs/components-react/table/component/dragdrop/withDragSource.d.ts +2 -2
- package/lib/cjs/components-react/table/component/dragdrop/withDragSource.js +1 -1
- package/lib/cjs/components-react/table/component/dragdrop/withDragSource.js.map +1 -1
- package/lib/cjs/components-react/table/component/dragdrop/withDropTarget.d.ts +2 -2
- package/lib/cjs/components-react/table/component/dragdrop/withDropTarget.js +1 -1
- package/lib/cjs/components-react/table/component/dragdrop/withDropTarget.js.map +1 -1
- package/lib/cjs/components-react/toolbar/Toolbar.d.ts +1 -1
- package/lib/cjs/components-react/toolbar/Toolbar.d.ts.map +1 -1
- package/lib/cjs/components-react/toolbar/Toolbar.js.map +1 -1
- package/lib/cjs/components-react/toolbar/ToolbarWithOverflow.d.ts +2 -2
- package/lib/cjs/components-react/toolbar/ToolbarWithOverflow.d.ts.map +1 -1
- package/lib/cjs/components-react/toolbar/ToolbarWithOverflow.js.map +1 -1
- package/lib/cjs/components-react/tree/TreeDataProvider.d.ts +2 -2
- package/lib/cjs/components-react/tree/TreeDataProvider.d.ts.map +1 -1
- package/lib/cjs/components-react/tree/TreeDataProvider.js.map +1 -1
- package/lib/cjs/components-react/tree/controlled/component/ControlledTree.d.ts +1 -4
- package/lib/cjs/components-react/tree/controlled/component/ControlledTree.d.ts.map +1 -1
- package/lib/cjs/components-react/tree/controlled/component/ControlledTree.js.map +1 -1
- package/lib/cjs/components-react/tree/controlled/component/TreeRenderer.d.ts +2 -5
- package/lib/cjs/components-react/tree/controlled/component/TreeRenderer.d.ts.map +1 -1
- package/lib/cjs/components-react/tree/controlled/component/TreeRenderer.js.map +1 -1
- package/lib/cjs/components-react.d.ts +4 -6
- package/lib/cjs/components-react.d.ts.map +1 -1
- package/lib/cjs/components-react.js +4 -6
- package/lib/cjs/components-react.js.map +1 -1
- package/lib/esm/components-react/breadcrumb/Breadcrumb.d.ts +5 -5
- package/lib/esm/components-react/breadcrumb/Breadcrumb.js +3 -3
- package/lib/esm/components-react/breadcrumb/Breadcrumb.js.map +1 -1
- package/lib/esm/components-react/breadcrumb/BreadcrumbDetails.d.ts +2 -2
- package/lib/esm/components-react/breadcrumb/BreadcrumbDetails.js +1 -1
- package/lib/esm/components-react/breadcrumb/BreadcrumbDetails.js.map +1 -1
- package/lib/esm/components-react/breadcrumb/BreadcrumbPath.d.ts +3 -3
- package/lib/esm/components-react/breadcrumb/BreadcrumbPath.js +2 -2
- package/lib/esm/components-react/breadcrumb/BreadcrumbPath.js.map +1 -1
- package/lib/esm/components-react/breadcrumb/BreadcrumbTreeUtils.d.ts +1 -1
- package/lib/esm/components-react/breadcrumb/BreadcrumbTreeUtils.js +1 -1
- package/lib/esm/components-react/breadcrumb/BreadcrumbTreeUtils.js.map +1 -1
- package/lib/esm/components-react/common/UseDebouncedAsyncValue.d.ts +4 -1
- package/lib/esm/components-react/common/UseDebouncedAsyncValue.d.ts.map +1 -1
- package/lib/esm/components-react/common/UseDebouncedAsyncValue.js +4 -1
- package/lib/esm/components-react/common/UseDebouncedAsyncValue.js.map +1 -1
- package/lib/esm/components-react/common/showhide/ShowHideDialog.d.ts +2 -2
- package/lib/esm/components-react/common/showhide/ShowHideDialog.js +1 -1
- package/lib/esm/components-react/common/showhide/ShowHideDialog.js.map +1 -1
- package/lib/esm/components-react/common/showhide/ShowHideItem.d.ts +2 -2
- package/lib/esm/components-react/common/showhide/ShowHideItem.js.map +1 -1
- package/lib/esm/components-react/common/showhide/ShowHideMenu.d.ts +2 -2
- package/lib/esm/components-react/common/showhide/ShowHideMenu.js +1 -1
- package/lib/esm/components-react/common/showhide/ShowHideMenu.js.map +1 -1
- package/lib/esm/components-react/converters/TypeConverterManager.d.ts.map +1 -1
- package/lib/esm/components-react/converters/TypeConverterManager.js +3 -4
- package/lib/esm/components-react/converters/TypeConverterManager.js.map +1 -1
- package/lib/esm/components-react/editors/ThemedEnumEditor.d.ts +3 -3
- package/lib/esm/components-react/editors/ThemedEnumEditor.js +2 -2
- package/lib/esm/components-react/editors/ThemedEnumEditor.js.map +1 -1
- package/lib/esm/components-react/filter-builder/FilterBuilder.d.ts +22 -24
- package/lib/esm/components-react/filter-builder/FilterBuilder.d.ts.map +1 -1
- package/lib/esm/components-react/filter-builder/FilterBuilder.js +17 -75
- package/lib/esm/components-react/filter-builder/FilterBuilder.js.map +1 -1
- package/lib/esm/components-react/filter-builder/FilterBuilderContext.d.ts +80 -0
- package/lib/esm/components-react/filter-builder/FilterBuilderContext.d.ts.map +1 -0
- package/lib/esm/components-react/filter-builder/FilterBuilderContext.js +60 -0
- package/lib/esm/components-react/filter-builder/FilterBuilderContext.js.map +1 -0
- package/lib/esm/components-react/filter-builder/FilterBuilderRule.d.ts +14 -3
- package/lib/esm/components-react/filter-builder/FilterBuilderRule.d.ts.map +1 -1
- package/lib/esm/components-react/filter-builder/FilterBuilderRule.js +17 -7
- package/lib/esm/components-react/filter-builder/FilterBuilderRule.js.map +1 -1
- package/lib/esm/components-react/filter-builder/FilterBuilderRule.scss +4 -0
- package/lib/esm/components-react/filter-builder/FilterBuilderRuleGroup.d.ts +25 -16
- package/lib/esm/components-react/filter-builder/FilterBuilderRuleGroup.d.ts.map +1 -1
- package/lib/esm/components-react/filter-builder/FilterBuilderRuleGroup.js +15 -7
- package/lib/esm/components-react/filter-builder/FilterBuilderRuleGroup.js.map +1 -1
- package/lib/esm/components-react/filter-builder/FilterBuilderRuleOperator.d.ts +14 -2
- package/lib/esm/components-react/filter-builder/FilterBuilderRuleOperator.d.ts.map +1 -1
- package/lib/esm/components-react/filter-builder/FilterBuilderRuleOperator.js +7 -1
- package/lib/esm/components-react/filter-builder/FilterBuilderRuleOperator.js.map +1 -1
- package/lib/esm/components-react/filter-builder/FilterBuilderRuleProperty.d.ts +16 -2
- package/lib/esm/components-react/filter-builder/FilterBuilderRuleProperty.d.ts.map +1 -1
- package/lib/esm/components-react/filter-builder/FilterBuilderRuleProperty.js +7 -1
- package/lib/esm/components-react/filter-builder/FilterBuilderRuleProperty.js.map +1 -1
- package/lib/esm/components-react/filter-builder/FilterBuilderRuleValue.d.ts +14 -2
- package/lib/esm/components-react/filter-builder/FilterBuilderRuleValue.d.ts.map +1 -1
- package/lib/esm/components-react/filter-builder/FilterBuilderRuleValue.js +7 -1
- package/lib/esm/components-react/filter-builder/FilterBuilderRuleValue.js.map +1 -1
- package/lib/esm/components-react/filter-builder/FilterBuilderState.d.ts +52 -8
- package/lib/esm/components-react/filter-builder/FilterBuilderState.d.ts.map +1 -1
- package/lib/esm/components-react/filter-builder/FilterBuilderState.js +96 -7
- package/lib/esm/components-react/filter-builder/FilterBuilderState.js.map +1 -1
- package/lib/esm/components-react/filter-builder/Operators.d.ts +23 -5
- package/lib/esm/components-react/filter-builder/Operators.d.ts.map +1 -1
- package/lib/esm/components-react/filter-builder/Operators.js +23 -5
- package/lib/esm/components-react/filter-builder/Operators.js.map +1 -1
- package/lib/esm/components-react/filter-builder/Types.d.ts +24 -4
- package/lib/esm/components-react/filter-builder/Types.d.ts.map +1 -1
- package/lib/esm/components-react/filter-builder/Types.js +11 -1
- package/lib/esm/components-react/filter-builder/Types.js.map +1 -1
- package/lib/esm/components-react/filtering/FilteringInput.js +1 -1
- package/lib/esm/components-react/filtering/FilteringInput.js.map +1 -1
- package/lib/esm/components-react/iconpicker/IconPickerButton.d.ts +2 -2
- package/lib/esm/components-react/iconpicker/IconPickerButton.js +2 -2
- package/lib/esm/components-react/iconpicker/IconPickerButton.js.map +1 -1
- package/lib/esm/components-react/properties/LinkHandler.d.ts +2 -2
- package/lib/esm/components-react/properties/LinkHandler.js +1 -1
- package/lib/esm/components-react/properties/LinkHandler.js.map +1 -1
- package/lib/esm/components-react/propertygrid/PropertyCategoryRendererManager.d.ts +3 -3
- package/lib/esm/components-react/propertygrid/PropertyCategoryRendererManager.js +1 -1
- package/lib/esm/components-react/propertygrid/PropertyCategoryRendererManager.js.map +1 -1
- package/lib/esm/components-react/propertygrid/PropertyDataProvider.d.ts +2 -2
- package/lib/esm/components-react/propertygrid/PropertyDataProvider.js.map +1 -1
- package/lib/esm/components-react/propertygrid/component/PropertyGrid.d.ts +3 -1
- package/lib/esm/components-react/propertygrid/component/PropertyGrid.d.ts.map +1 -1
- package/lib/esm/components-react/propertygrid/component/PropertyGrid.js +1 -0
- package/lib/esm/components-react/propertygrid/component/PropertyGrid.js.map +1 -1
- package/lib/esm/components-react/propertygrid/component/PropertyGridCommons.d.ts +5 -10
- package/lib/esm/components-react/propertygrid/component/PropertyGridCommons.d.ts.map +1 -1
- package/lib/esm/components-react/propertygrid/component/PropertyGridCommons.js.map +1 -1
- package/lib/esm/components-react/propertygrid/component/VirtualizedPropertyGrid.d.ts +3 -3
- package/lib/esm/components-react/propertygrid/component/VirtualizedPropertyGrid.js +1 -1
- package/lib/esm/components-react/propertygrid/component/VirtualizedPropertyGrid.js.map +1 -1
- package/lib/esm/components-react/propertygrid/component/VirtualizedPropertyGrid.scss +11 -0
- package/lib/esm/components-react/propertygrid/component/VirtualizedPropertyGridWithDataProvider.d.ts +2 -2
- package/lib/esm/components-react/propertygrid/component/VirtualizedPropertyGridWithDataProvider.js +1 -1
- package/lib/esm/components-react/propertygrid/component/VirtualizedPropertyGridWithDataProvider.js.map +1 -1
- package/lib/esm/components-react/propertygrid/internal/PropertyGridEventHandler.d.ts +2 -2
- package/lib/esm/components-react/propertygrid/internal/PropertyGridEventHandler.js +1 -1
- package/lib/esm/components-react/propertygrid/internal/PropertyGridEventHandler.js.map +1 -1
- package/lib/esm/components-react/propertygrid/internal/PropertyGridHooks.d.ts +3 -3
- package/lib/esm/components-react/propertygrid/internal/PropertyGridHooks.js +3 -3
- package/lib/esm/components-react/propertygrid/internal/PropertyGridHooks.js.map +1 -1
- package/lib/esm/components-react/propertygrid/internal/PropertyGridModel.d.ts +3 -3
- package/lib/esm/components-react/propertygrid/internal/PropertyGridModel.js +1 -1
- package/lib/esm/components-react/propertygrid/internal/PropertyGridModel.js.map +1 -1
- package/lib/esm/components-react/propertygrid/internal/PropertyGridModelChangeEvent.d.ts +2 -2
- package/lib/esm/components-react/propertygrid/internal/PropertyGridModelChangeEvent.js +1 -1
- package/lib/esm/components-react/propertygrid/internal/PropertyGridModelChangeEvent.js.map +1 -1
- package/lib/esm/components-react/propertygrid/internal/PropertyGridModelSource.d.ts +2 -2
- package/lib/esm/components-react/propertygrid/internal/PropertyGridModelSource.d.ts.map +1 -1
- package/lib/esm/components-react/propertygrid/internal/PropertyGridModelSource.js +1 -1
- package/lib/esm/components-react/propertygrid/internal/PropertyGridModelSource.js.map +1 -1
- package/lib/esm/components-react/propertygrid/internal/flat-items/FlatGridItem.d.ts +6 -6
- package/lib/esm/components-react/propertygrid/internal/flat-items/FlatGridItem.d.ts.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.d.ts +1 -1
- package/lib/esm/components-react/propertygrid/internal/flat-items/MutableCategorizedArrayProperty.js +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.d.ts +1 -1
- package/lib/esm/components-react/propertygrid/internal/flat-items/MutableCategorizedPrimitiveProperty.js +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.d.ts +1 -1
- package/lib/esm/components-react/propertygrid/internal/flat-items/MutableCategorizedStructProperty.js +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/MutableFlatGridItem.d.ts +10 -10
- package/lib/esm/components-react/propertygrid/internal/flat-items/MutableFlatGridItem.js +3 -3
- package/lib/esm/components-react/propertygrid/internal/flat-items/MutableFlatGridItem.js.map +1 -1
- package/lib/esm/components-react/propertygrid/internal/flat-items/MutableGridCategory.d.ts +2 -2
- package/lib/esm/components-react/propertygrid/internal/flat-items/MutableGridCategory.js +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.d.ts +2 -2
- package/lib/esm/components-react/propertygrid/internal/flat-items/MutableGridItemFactory.js +1 -1
- package/lib/esm/components-react/propertygrid/internal/flat-items/MutableGridItemFactory.js.map +1 -1
- package/lib/esm/components-react/propertygrid/internal/flat-properties/FlatPropertyRenderer.d.ts +3 -6
- package/lib/esm/components-react/propertygrid/internal/flat-properties/FlatPropertyRenderer.d.ts.map +1 -1
- package/lib/esm/components-react/propertygrid/internal/flat-properties/FlatPropertyRenderer.js.map +1 -1
- package/lib/esm/components-react/table/SimpleTableDataProvider.d.ts +1 -1
- package/lib/esm/components-react/table/SimpleTableDataProvider.js +1 -1
- package/lib/esm/components-react/table/SimpleTableDataProvider.js.map +1 -1
- package/lib/esm/components-react/table/TableDataProvider.d.ts +8 -8
- package/lib/esm/components-react/table/TableDataProvider.js +2 -2
- package/lib/esm/components-react/table/TableDataProvider.js.map +1 -1
- package/lib/esm/components-react/table/columnfiltering/ColumnFiltering.d.ts +16 -16
- package/lib/esm/components-react/table/columnfiltering/ColumnFiltering.js +6 -6
- package/lib/esm/components-react/table/columnfiltering/ColumnFiltering.js.map +1 -1
- package/lib/esm/components-react/table/component/ColumnDragLayer.d.ts +1 -1
- package/lib/esm/components-react/table/component/ColumnDragLayer.js +1 -1
- package/lib/esm/components-react/table/component/ColumnDragLayer.js.map +1 -1
- package/lib/esm/components-react/table/component/Table.d.ts +9 -9
- package/lib/esm/components-react/table/component/Table.d.ts.map +1 -1
- package/lib/esm/components-react/table/component/Table.js +2 -2
- package/lib/esm/components-react/table/component/Table.js.map +1 -1
- package/lib/esm/components-react/table/component/TableCell.d.ts +6 -6
- package/lib/esm/components-react/table/component/TableCell.js +3 -3
- package/lib/esm/components-react/table/component/TableCell.js.map +1 -1
- package/lib/esm/components-react/table/component/TableColumn.d.ts +1 -1
- package/lib/esm/components-react/table/component/TableColumn.js.map +1 -1
- package/lib/esm/components-react/table/component/dragdrop/BeDragDropContext.d.ts +1 -1
- package/lib/esm/components-react/table/component/dragdrop/BeDragDropContext.js +1 -1
- package/lib/esm/components-react/table/component/dragdrop/BeDragDropContext.js.map +1 -1
- package/lib/esm/components-react/table/component/dragdrop/DragDropDef.d.ts +8 -8
- package/lib/esm/components-react/table/component/dragdrop/DragDropDef.js +2 -2
- package/lib/esm/components-react/table/component/dragdrop/DragDropDef.js.map +1 -1
- package/lib/esm/components-react/table/component/dragdrop/withDragSource.d.ts +2 -2
- package/lib/esm/components-react/table/component/dragdrop/withDragSource.js +1 -1
- package/lib/esm/components-react/table/component/dragdrop/withDragSource.js.map +1 -1
- package/lib/esm/components-react/table/component/dragdrop/withDropTarget.d.ts +2 -2
- package/lib/esm/components-react/table/component/dragdrop/withDropTarget.js +1 -1
- package/lib/esm/components-react/table/component/dragdrop/withDropTarget.js.map +1 -1
- package/lib/esm/components-react/toolbar/Toolbar.d.ts +1 -1
- package/lib/esm/components-react/toolbar/Toolbar.d.ts.map +1 -1
- package/lib/esm/components-react/toolbar/Toolbar.js.map +1 -1
- package/lib/esm/components-react/toolbar/ToolbarWithOverflow.d.ts +2 -2
- package/lib/esm/components-react/toolbar/ToolbarWithOverflow.d.ts.map +1 -1
- package/lib/esm/components-react/toolbar/ToolbarWithOverflow.js.map +1 -1
- package/lib/esm/components-react/tree/TreeDataProvider.d.ts +2 -2
- package/lib/esm/components-react/tree/TreeDataProvider.d.ts.map +1 -1
- package/lib/esm/components-react/tree/TreeDataProvider.js.map +1 -1
- package/lib/esm/components-react/tree/controlled/component/ControlledTree.d.ts +1 -4
- package/lib/esm/components-react/tree/controlled/component/ControlledTree.d.ts.map +1 -1
- package/lib/esm/components-react/tree/controlled/component/ControlledTree.js.map +1 -1
- package/lib/esm/components-react/tree/controlled/component/TreeRenderer.d.ts +2 -5
- package/lib/esm/components-react/tree/controlled/component/TreeRenderer.d.ts.map +1 -1
- package/lib/esm/components-react/tree/controlled/component/TreeRenderer.js.map +1 -1
- package/lib/esm/components-react.d.ts +4 -6
- package/lib/esm/components-react.d.ts.map +1 -1
- package/lib/esm/components-react.js +4 -6
- package/lib/esm/components-react.js.map +1 -1
- package/package.json +22 -12
|
@@ -9,7 +9,7 @@ import { PropertyDialogState, PropertyValueRendererManager } from "../../propert
|
|
|
9
9
|
import { CellItem } from "../TableDataProvider";
|
|
10
10
|
/**
|
|
11
11
|
* Properties of the [[TableCell]] React component
|
|
12
|
-
* @deprecated Use the Table component in @itwin/itwinui-react instead, which does not use this interface.
|
|
12
|
+
* @deprecated in 3.0. Use the Table component in @itwin/itwinui-react instead, which does not use this interface.
|
|
13
13
|
* @public
|
|
14
14
|
*/
|
|
15
15
|
export interface TableCellProps extends CommonProps {
|
|
@@ -30,7 +30,7 @@ export interface TableCellProps extends CommonProps {
|
|
|
30
30
|
}
|
|
31
31
|
/**
|
|
32
32
|
* A React component that renders a table cell
|
|
33
|
-
* @deprecated Use the Table component in @itwin/itwinui-react instead, which does not use this class.
|
|
33
|
+
* @deprecated in 3.0. Use the Table component in @itwin/itwinui-react instead, which does not use this class.
|
|
34
34
|
* @public
|
|
35
35
|
*/
|
|
36
36
|
export declare class TableCell extends React.PureComponent<TableCellProps> {
|
|
@@ -38,7 +38,7 @@ export declare class TableCell extends React.PureComponent<TableCellProps> {
|
|
|
38
38
|
render(): JSX.Element;
|
|
39
39
|
}
|
|
40
40
|
/** Properties of the [[TableCellContent]] React component
|
|
41
|
-
* @deprecated Use the Table component in @itwin/itwinui-react instead, which does not use this interface.
|
|
41
|
+
* @deprecated in 3.0. Use the Table component in @itwin/itwinui-react instead, which does not use this interface.
|
|
42
42
|
* @public
|
|
43
43
|
*/
|
|
44
44
|
export interface TableCellContentProps extends CommonProps {
|
|
@@ -61,7 +61,7 @@ interface TableCellContentState {
|
|
|
61
61
|
content: React.ReactNode;
|
|
62
62
|
}
|
|
63
63
|
/** A React component that renders table cell content
|
|
64
|
-
* @deprecated Use the Table component in @itwin/itwinui-react instead, which does not use this class.
|
|
64
|
+
* @deprecated in 3.0. Use the Table component in @itwin/itwinui-react instead, which does not use this class.
|
|
65
65
|
* @public
|
|
66
66
|
*/
|
|
67
67
|
export declare class TableCellContent extends React.PureComponent<TableCellContentProps, TableCellContentState> {
|
|
@@ -81,7 +81,7 @@ export declare class TableCellContent extends React.PureComponent<TableCellConte
|
|
|
81
81
|
render(): React.ReactNode;
|
|
82
82
|
}
|
|
83
83
|
/** Properties for the [[TableIconCellContent]] React component
|
|
84
|
-
* @deprecated Use the Table component in @itwin/itwinui-react instead, which does not use this interface.
|
|
84
|
+
* @deprecated in 3.5. Use the Table component in @itwin/itwinui-react instead, which does not use this interface.
|
|
85
85
|
* @public
|
|
86
86
|
*/
|
|
87
87
|
export interface TableIconCellContentProps {
|
|
@@ -90,7 +90,7 @@ export interface TableIconCellContentProps {
|
|
|
90
90
|
}
|
|
91
91
|
/**
|
|
92
92
|
* A React component that renders table cell content as a Bentley icon
|
|
93
|
-
* @deprecated Use the Table component in @itwin/itwinui-react instead, which does not use this interface.
|
|
93
|
+
* @deprecated in 3.5. Use the Table component in @itwin/itwinui-react instead, which does not use this interface.
|
|
94
94
|
* @public
|
|
95
95
|
*/
|
|
96
96
|
export declare class TableIconCellContent extends React.PureComponent<TableIconCellContentProps> {
|
|
@@ -15,7 +15,7 @@ import { ItemStyleProvider } from "../../properties/ItemStyle";
|
|
|
15
15
|
import { PropertyContainerType, } from "../../properties/ValueRendererManager";
|
|
16
16
|
/**
|
|
17
17
|
* A React component that renders a table cell
|
|
18
|
-
* @deprecated Use the Table component in @itwin/itwinui-react instead, which does not use this class.
|
|
18
|
+
* @deprecated in 3.0. Use the Table component in @itwin/itwinui-react instead, which does not use this class.
|
|
19
19
|
* @public
|
|
20
20
|
*/
|
|
21
21
|
export class TableCell extends React.PureComponent {
|
|
@@ -29,7 +29,7 @@ export class TableCell extends React.PureComponent {
|
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
31
|
/** A React component that renders table cell content
|
|
32
|
-
* @deprecated Use the Table component in @itwin/itwinui-react instead, which does not use this class.
|
|
32
|
+
* @deprecated in 3.0. Use the Table component in @itwin/itwinui-react instead, which does not use this class.
|
|
33
33
|
* @public
|
|
34
34
|
*/
|
|
35
35
|
export class TableCellContent extends React.PureComponent {
|
|
@@ -97,7 +97,7 @@ export class TableCellContent extends React.PureComponent {
|
|
|
97
97
|
}
|
|
98
98
|
/**
|
|
99
99
|
* A React component that renders table cell content as a Bentley icon
|
|
100
|
-
* @deprecated Use the Table component in @itwin/itwinui-react instead, which does not use this interface.
|
|
100
|
+
* @deprecated in 3.5. Use the Table component in @itwin/itwinui-react instead, which does not use this interface.
|
|
101
101
|
* @public
|
|
102
102
|
*/
|
|
103
103
|
export class TableIconCellContent extends React.PureComponent {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TableCell.js","sourceRoot":"","sources":["../../../../../src/components-react/table/component/TableCell.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,4CAA4C;AAC5C;;GAEG;AAEH,OAAO,kBAAkB,CAAC;AAC1B,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAe,IAAI,EAAQ,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAwB,MAAM,+BAA+B,CAAC;AACtF,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EACL,qBAAqB,GACtB,MAAM,uCAAuC,CAAC;AAyB/C;;;;GAIG;AACH,MAAM,OAAO,SAAU,SAAQ,KAAK,CAAC,aAA6B;IAChE,gBAAgB;IACA,MAAM;QAEpB,IAAI,IAAI,CAAC,KAAK,CAAC,gBAAgB,EAAE;YAC/B,OAAO,CACL,6BACE,SAAS,EAAE,UAAU,CAAC,uBAAuB,EAAE,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,EACpE,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK;gBAEvB,oBAAC,eAAe,IACd,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,KACnB,IAAI,CAAC,KAAK,CAAC,gBAAgB,GAC/B,CACE,CACP,CAAC;SACH;QAED,OAAO,CACL,6BACE,SAAS,EAAE,UAAU,CAAC,uBAAuB,EAAE,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,EACpE,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,EACvB,K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AI,CAAC,KAAK,CAAC,CAAC;YAErD,IAAI,IAAI,CAAC,UAAU;gBACjB,IAAI,CAAC,QAAQ,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC;SAC9B;IACH,CAAC;IAED,gBAAgB;IACA,MAAM;QACpB,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC;IAC5B,CAAC;CACF;AAWD;;;;GAIG;AACH,MAAM,OAAO,oBAAqB,SAAQ,KAAK,CAAC,aAAwC;IACtF,gBAAgB;IACA,MAAM;QACpB,OAAO,oBAAC,IAAI,IAAC,QAAQ,EAAE,IAAI,CAAC,KAAK,CAAC,QAAQ,GAAI,CAAC;IACjD,CAAC;CACF","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 Table\r\n */\r\n\r\nimport \"./TableCell.scss\";\r\nimport classnames from \"classnames\";\r\nimport * as React from \"react\";\r\nimport { CommonProps, Icon, Omit } from \"@itwin/core-react\";\r\nimport { EditorContainer, EditorContainerProps } from \"../../editors/EditorContainer\";\r\nimport { ItemStyleProvider } from \"../../properties/ItemStyle\";\r\nimport {\r\n PropertyContainerType, PropertyDialogState, PropertyValueRendererContext, PropertyValueRendererManager,\r\n} from \"../../properties/ValueRendererManager\";\r\nimport { CellItem } from \"../TableDataProvider\";\r\n\r\n/**\r\n * Properties of the [[TableCell]] React component\r\n * @deprecated Use the Table component in @itwin/itwinui-react instead, which does not use this interface.\r\n * @public\r\n */\r\nexport interface TableCellProps extends CommonProps {\r\n /** Additional class name for the cell container */\r\n className?: string;\r\n /** Title of the cell container */\r\n title: string;\r\n /** Cell content */\r\n children?: React.ReactNode;\r\n /** Click event callback */\r\n onClick?: (e: React.MouseEvent) => void;\r\n /** MouseMove event callback */\r\n onMouseMove?: (e: React.MouseEvent) => void;\r\n /** MouseDown event callback */\r\n onMouseDown?: (e: React.MouseEvent) => void;\r\n /** Properties for [[EditorContainer]]. Activates cell editing and provides properties to the container */\r\n cellEditingProps?: Omit<EditorContainerProps, \"title\">;\r\n}\r\n\r\n/**\r\n * A React component that renders a table cell\r\n * @deprecated Use the Table component in @itwin/itwinui-react instead, which does not use this class.\r\n * @public\r\n */\r\nexport class TableCell extends React.PureComponent<TableCellProps> {\r\n /** @internal */\r\n public override render() {\r\n\r\n if (this.props.cellEditingProps) {\r\n return (\r\n <div\r\n className={classnames(\"components-table-cell\", this.props.className)}\r\n style={this.props.style}\r\n >\r\n <EditorContainer\r\n title={this.props.title}\r\n {...this.props.cellEditingProps}\r\n />\r\n </div>\r\n );\r\n }\r\n\r\n return (\r\n <div\r\n className={classnames(\"components-table-cell\", this.props.className)}\r\n style={this.props.style}\r\n title={this.props.title}\r\n onClick={this.props.onClick}\r\n onMouseMove={this.props.onMouseMove}\r\n onMouseDown={this.props.onMouseDown}\r\n role=\"presentation\"\r\n >\r\n {this.props.children}\r\n </div>\r\n );\r\n }\r\n}\r\n\r\n/** Properties of the [[TableCellContent]] React component\r\n * @deprecated Use the Table component in @itwin/itwinui-react instead, which does not use this interface.\r\n * @public\r\n */\r\nexport interface TableCellContentProps extends CommonProps {\r\n /** Indicates, whether container cell is selected or not */\r\n isSelected: boolean;\r\n /** Props for the item that will be rendered */\r\n cellItem: CellItem;\r\n /** Height of the component */\r\n height?: number;\r\n /** Callback to DialogOpen event */\r\n onDialogOpen?: (state: PropertyDialogState) => void;\r\n /** Property value renderer manager */\r\n propertyValueRendererManager: PropertyValueRendererManager;\r\n}\r\n\r\n/** State of the [[TableCellContent]] React component\r\n * @internal @deprecated\r\n */\r\ninterface TableCellContentState {\r\n /** Rendered content */\r\n content: React.ReactNode;\r\n}\r\n\r\n/** A React component that renders table cell content\r\n * @deprecated Use the Table component in @itwin/itwinui-react instead, which does not use this class.\r\n * @public\r\n */\r\nexport class TableCellContent extends React.PureComponent<TableCellContentProps, TableCellContentState> {\r\n /** @internal */\r\n public override readonly state: TableCellContentState = {\r\n content: <div className={this.props.className} style={this.getStyle(this.props.cellItem, this.props.isSelected, this.props.height)} />,\r\n };\r\n\r\n private _isMounted = false;\r\n\r\n private getStyle(cellItem: CellItem, isSelected: boolean, height?: number): React.CSSProperties {\r\n return {\r\n ...ItemStyleProvider.createStyle(cellItem.style ? cellItem.style : {}, isSelected),\r\n textAlign: cellItem.alignment,\r\n height,\r\n lineHeight: `${height}px`, // Centers text vertically\r\n ...this.props.style,\r\n };\r\n }\r\n\r\n private async renderContent(props: TableCellContentProps) {\r\n const style = this.getStyle(props.cellItem, props.isSelected, props.height);\r\n\r\n if (!props.cellItem.record)\r\n return <div className={this.props.className} style={style} />;\r\n\r\n const rendererContext: PropertyValueRendererContext = {\r\n containerType: PropertyContainerType.Table,\r\n onDialogOpen: this.props.onDialogOpen,\r\n style,\r\n // TODO: Enable, when table gets refactored. Explanation in ./../table/NonPrimitiveValueRenderer\r\n // onPopupShow: this._onPopupShow,\r\n // onPopupHide: this._onPopupHide,\r\n };\r\n\r\n return this.props.propertyValueRendererManager.render(props.cellItem.record, rendererContext);\r\n }\r\n\r\n private doPropsDiffer(props1: TableCellContentProps, props2: TableCellContentProps) {\r\n return props1.cellItem !== props2.cellItem\r\n || props1.isSelected !== props2.isSelected\r\n || props1.onDialogOpen !== props2.onDialogOpen\r\n || props1.propertyValueRendererManager !== props2.propertyValueRendererManager;\r\n }\r\n\r\n /** @internal */\r\n public override async componentDidMount() {\r\n this._isMounted = true;\r\n const content = await this.renderContent(this.props);\r\n\r\n // istanbul ignore else\r\n if (this._isMounted)\r\n this.setState({ content });\r\n }\r\n\r\n /** @internal */\r\n public override componentWillUnmount() {\r\n this._isMounted = false;\r\n }\r\n\r\n /** @internal */\r\n public override async componentDidUpdate(prevProps: TableCellContentProps) {\r\n if (this.doPropsDiffer(prevProps, this.props)) {\r\n const content = await this.renderContent(this.props);\r\n\r\n if (this._isMounted)\r\n this.setState({ content });\r\n }\r\n }\r\n\r\n /** @internal */\r\n public override render() {\r\n return this.state.content;\r\n }\r\n}\r\n\r\n/** Properties for the [[TableIconCellContent]] React component\r\n * @deprecated Use the Table component in @itwin/itwinui-react instead, which does not use this interface.\r\n * @public\r\n */\r\nexport interface TableIconCellContentProps {\r\n /** Icon name */\r\n iconName: string;\r\n}\r\n\r\n/**\r\n * A React component that renders table cell content as a Bentley icon\r\n * @deprecated Use the Table component in @itwin/itwinui-react instead, which does not use this interface.\r\n * @public\r\n */\r\nexport class TableIconCellContent extends React.PureComponent<TableIconCellContentProps> {\r\n /** @internal */\r\n public override render() {\r\n return <Icon iconSpec={this.props.iconName} />;\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"TableCell.js","sourceRoot":"","sources":["../../../../../src/components-react/table/component/TableCell.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,4CAA4C;AAC5C;;GAEG;AAEH,OAAO,kBAAkB,CAAC;AAC1B,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAe,IAAI,EAAQ,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAwB,MAAM,+BAA+B,CAAC;AACtF,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EACL,qBAAqB,GACtB,MAAM,uCAAuC,CAAC;AAyB/C;;;;GAIG;AACH,MAAM,OAAO,SAAU,SAAQ,KAAK,CAAC,aAA6B;IAChE,gBAAgB;IACA,MAAM;QAEpB,IAAI,IAAI,CAAC,KAAK,CAAC,gBAAgB,EAAE;YAC/B,OAAO,CACL,6BACE,SAAS,EAAE,UAAU,CAAC,uBAAuB,EAAE,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,EACpE,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK;gBAEvB,oBAAC,eAAe,IACd,KA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;IACA,oBAAoB;QAClC,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC;IAC1B,CAAC;IAED,gBAAgB;IACA,KAAK,CAAC,kBAAkB,CAAC,SAAgC;QACvE,IAAI,IAAI,CAAC,aAAa,CAAC,SAAS,EAAE,IAAI,CAAC,KAAK,CAAC,EAAE;YAC7C,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YAErD,IAAI,IAAI,CAAC,UAAU;gBACjB,IAAI,CAAC,QAAQ,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC;SAC9B;IACH,CAAC;IAED,gBAAgB;IACA,MAAM;QACpB,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC;IAC5B,CAAC;CACF;AAWD;;;;GAIG;AACH,MAAM,OAAO,oBAAqB,SAAQ,KAAK,CAAC,aAAwC;IACtF,gBAAgB;IACA,MAAM;QACpB,OAAO,oBAAC,IAAI,IAAC,QAAQ,EAAE,IAAI,CAAC,KAAK,CAAC,QAAQ,GAAI,CAAC;IACjD,CAAC;CACF","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 Table\r\n */\r\n\r\nimport \"./TableCell.scss\";\r\nimport classnames from \"classnames\";\r\nimport * as React from \"react\";\r\nimport { CommonProps, Icon, Omit } from \"@itwin/core-react\";\r\nimport { EditorContainer, EditorContainerProps } from \"../../editors/EditorContainer\";\r\nimport { ItemStyleProvider } from \"../../properties/ItemStyle\";\r\nimport {\r\n PropertyContainerType, PropertyDialogState, PropertyValueRendererContext, PropertyValueRendererManager,\r\n} from \"../../properties/ValueRendererManager\";\r\nimport { CellItem } from \"../TableDataProvider\";\r\n\r\n/**\r\n * Properties of the [[TableCell]] React component\r\n * @deprecated in 3.0. Use the Table component in @itwin/itwinui-react instead, which does not use this interface.\r\n * @public\r\n */\r\nexport interface TableCellProps extends CommonProps {\r\n /** Additional class name for the cell container */\r\n className?: string;\r\n /** Title of the cell container */\r\n title: string;\r\n /** Cell content */\r\n children?: React.ReactNode;\r\n /** Click event callback */\r\n onClick?: (e: React.MouseEvent) => void;\r\n /** MouseMove event callback */\r\n onMouseMove?: (e: React.MouseEvent) => void;\r\n /** MouseDown event callback */\r\n onMouseDown?: (e: React.MouseEvent) => void;\r\n /** Properties for [[EditorContainer]]. Activates cell editing and provides properties to the container */\r\n cellEditingProps?: Omit<EditorContainerProps, \"title\">;\r\n}\r\n\r\n/**\r\n * A React component that renders a table cell\r\n * @deprecated in 3.0. Use the Table component in @itwin/itwinui-react instead, which does not use this class.\r\n * @public\r\n */\r\nexport class TableCell extends React.PureComponent<TableCellProps> {\r\n /** @internal */\r\n public override render() {\r\n\r\n if (this.props.cellEditingProps) {\r\n return (\r\n <div\r\n className={classnames(\"components-table-cell\", this.props.className)}\r\n style={this.props.style}\r\n >\r\n <EditorContainer\r\n title={this.props.title}\r\n {...this.props.cellEditingProps}\r\n />\r\n </div>\r\n );\r\n }\r\n\r\n return (\r\n <div\r\n className={classnames(\"components-table-cell\", this.props.className)}\r\n style={this.props.style}\r\n title={this.props.title}\r\n onClick={this.props.onClick}\r\n onMouseMove={this.props.onMouseMove}\r\n onMouseDown={this.props.onMouseDown}\r\n role=\"presentation\"\r\n >\r\n {this.props.children}\r\n </div>\r\n );\r\n }\r\n}\r\n\r\n/** Properties of the [[TableCellContent]] React component\r\n * @deprecated in 3.0. Use the Table component in @itwin/itwinui-react instead, which does not use this interface.\r\n * @public\r\n */\r\nexport interface TableCellContentProps extends CommonProps {\r\n /** Indicates, whether container cell is selected or not */\r\n isSelected: boolean;\r\n /** Props for the item that will be rendered */\r\n cellItem: CellItem;\r\n /** Height of the component */\r\n height?: number;\r\n /** Callback to DialogOpen event */\r\n onDialogOpen?: (state: PropertyDialogState) => void;\r\n /** Property value renderer manager */\r\n propertyValueRendererManager: PropertyValueRendererManager;\r\n}\r\n\r\n/** State of the [[TableCellContent]] React component\r\n * @internal @deprecated\r\n */\r\ninterface TableCellContentState {\r\n /** Rendered content */\r\n content: React.ReactNode;\r\n}\r\n\r\n/** A React component that renders table cell content\r\n * @deprecated in 3.0. Use the Table component in @itwin/itwinui-react instead, which does not use this class.\r\n * @public\r\n */\r\nexport class TableCellContent extends React.PureComponent<TableCellContentProps, TableCellContentState> {\r\n /** @internal */\r\n public override readonly state: TableCellContentState = {\r\n content: <div className={this.props.className} style={this.getStyle(this.props.cellItem, this.props.isSelected, this.props.height)} />,\r\n };\r\n\r\n private _isMounted = false;\r\n\r\n private getStyle(cellItem: CellItem, isSelected: boolean, height?: number): React.CSSProperties {\r\n return {\r\n ...ItemStyleProvider.createStyle(cellItem.style ? cellItem.style : {}, isSelected),\r\n textAlign: cellItem.alignment,\r\n height,\r\n lineHeight: `${height}px`, // Centers text vertically\r\n ...this.props.style,\r\n };\r\n }\r\n\r\n private async renderContent(props: TableCellContentProps) {\r\n const style = this.getStyle(props.cellItem, props.isSelected, props.height);\r\n\r\n if (!props.cellItem.record)\r\n return <div className={this.props.className} style={style} />;\r\n\r\n const rendererContext: PropertyValueRendererContext = {\r\n containerType: PropertyContainerType.Table,\r\n onDialogOpen: this.props.onDialogOpen,\r\n style,\r\n // TODO: Enable, when table gets refactored. Explanation in ./../table/NonPrimitiveValueRenderer\r\n // onPopupShow: this._onPopupShow,\r\n // onPopupHide: this._onPopupHide,\r\n };\r\n\r\n return this.props.propertyValueRendererManager.render(props.cellItem.record, rendererContext);\r\n }\r\n\r\n private doPropsDiffer(props1: TableCellContentProps, props2: TableCellContentProps) {\r\n return props1.cellItem !== props2.cellItem\r\n || props1.isSelected !== props2.isSelected\r\n || props1.onDialogOpen !== props2.onDialogOpen\r\n || props1.propertyValueRendererManager !== props2.propertyValueRendererManager;\r\n }\r\n\r\n /** @internal */\r\n public override async componentDidMount() {\r\n this._isMounted = true;\r\n const content = await this.renderContent(this.props);\r\n\r\n // istanbul ignore else\r\n if (this._isMounted)\r\n this.setState({ content });\r\n }\r\n\r\n /** @internal */\r\n public override componentWillUnmount() {\r\n this._isMounted = false;\r\n }\r\n\r\n /** @internal */\r\n public override async componentDidUpdate(prevProps: TableCellContentProps) {\r\n if (this.doPropsDiffer(prevProps, this.props)) {\r\n const content = await this.renderContent(this.props);\r\n\r\n if (this._isMounted)\r\n this.setState({ content });\r\n }\r\n }\r\n\r\n /** @internal */\r\n public override render() {\r\n return this.state.content;\r\n }\r\n}\r\n\r\n/** Properties for the [[TableIconCellContent]] React component\r\n * @deprecated in 3.5. Use the Table component in @itwin/itwinui-react instead, which does not use this interface.\r\n * @public\r\n */\r\nexport interface TableIconCellContentProps {\r\n /** Icon name */\r\n iconName: string;\r\n}\r\n\r\n/**\r\n * A React component that renders table cell content as a Bentley icon\r\n * @deprecated in 3.5. Use the Table component in @itwin/itwinui-react instead, which does not use this interface.\r\n * @public\r\n */\r\nexport class TableIconCellContent extends React.PureComponent<TableIconCellContentProps> {\r\n /** @internal */\r\n public override render() {\r\n return <Icon iconSpec={this.props.iconName} />;\r\n }\r\n}\r\n"]}
|
|
@@ -6,7 +6,7 @@ import { DistinctValueCollection, FilterableColumn, FilterableTable } from "../c
|
|
|
6
6
|
import { FilterableColumnBase } from "../columnfiltering/FilterableColumnBase";
|
|
7
7
|
import { ColumnDescription, TableDataProvider } from "../TableDataProvider";
|
|
8
8
|
/** ReactDataGrid.Column with additional properties
|
|
9
|
-
* @deprecated Use the Table component in @itwin/itwinui-react instead, which does not use this interface.
|
|
9
|
+
* @deprecated in 3.0. Use the Table component in @itwin/itwinui-react instead, which does not use this interface.
|
|
10
10
|
* @public
|
|
11
11
|
*/
|
|
12
12
|
export interface ReactDataGridColumn extends ReactDataGrid.Column<any> {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TableColumn.js","sourceRoot":"","sources":["../../../../../src/components-react/table/component/TableColumn.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,4CAA4C;AAC5C;;GAEG;AAGH,OAAO,EAAE,uBAAuB,EAAqC,MAAM,oCAAoC,CAAC;AAChH,OAAO,EAAE,oBAAoB,EAAE,MAAM,yCAAyC,CAAC;AAgB/E;;GAEG;AACH,MAAM,OAAO,WAAY,SAAQ,oBAAoB;IAEnD,YAAY,eAAgC,EAAE,iBAAoC,EAAkB,mBAAwC;QAC1I,KAAK,CAAC,eAAe,EAAE,iBAAiB,CAAC,CAAC;QADwD,wBAAmB,GAAnB,mBAAmB,CAAqB;IAE5I,CAAC;IAED,IAAW,GAAG,KAAa,OAAO,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC;IAMzD;;OAEG;IACI,KAAK,CAAC,iBAAiB,CAAC,iBAA0B;QACvD,IAAI,IAAI,CAAC,YAAY,IAAI,IAAI,CAAC,YAAY,CAAC,iBAAiB;YAC1D,OAAO,IAAI,CAAC,YAAY,CAAC,iBAAiB,CAAC,IAAI,CAAC,GAAG,EAAE,iBAAiB,CAAC,CAAC;QAC1E,OAAO,IAAI,uBAAuB,EAAE,CAAC;IACvC,CAAC;CACF","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 Table\r\n */\r\n\r\nimport ReactDataGrid from \"react-data-grid\";\r\nimport { DistinctValueCollection, FilterableColumn, FilterableTable } from \"../columnfiltering/ColumnFiltering\";\r\nimport { FilterableColumnBase } from \"../columnfiltering/FilterableColumnBase\";\r\nimport { ColumnDescription, TableDataProvider } from \"../TableDataProvider\";\r\n\r\n// cSpell:ignore columnfiltering\r\n\r\n/** ReactDataGrid.Column with additional properties\r\n * @deprecated Use the Table component in @itwin/itwinui-react instead, which does not use this interface.\r\n * @public\r\n */\r\nexport interface ReactDataGridColumn extends ReactDataGrid.Column<any> {\r\n /** Indicates whether the display value for the cell is treated as an icon spec. */\r\n icon?: boolean;\r\n /* Table column filtering info */\r\n filterableColumn?: FilterableColumn;\r\n}\r\n\r\n/** Table Column used by the [[Table]] component\r\n * @internal\r\n */\r\nexport class TableColumn extends FilterableColumnBase {\r\n\r\n constructor(filterableTable: FilterableTable, columnDescription: ColumnDescription, public readonly reactDataGridColumn: ReactDataGridColumn) {\r\n super(filterableTable, columnDescription);\r\n }\r\n\r\n public get key(): string { return this.filterMemberKey; }\r\n\r\n public dataProvider?: TableDataProvider;\r\n\r\n public distinctValueCollection?: DistinctValueCollection;\r\n\r\n /** Gets the distinct values for a column.\r\n * @return The distinct values.\r\n */\r\n public async getDistinctValues(maximumValueCount?: number): Promise<DistinctValueCollection> {\r\n if (this.dataProvider && this.dataProvider.getDistinctValues)\r\n return this.dataProvider.getDistinctValues(this.key, maximumValueCount);\r\n return new DistinctValueCollection();\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"TableColumn.js","sourceRoot":"","sources":["../../../../../src/components-react/table/component/TableColumn.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,4CAA4C;AAC5C;;GAEG;AAGH,OAAO,EAAE,uBAAuB,EAAqC,MAAM,oCAAoC,CAAC;AAChH,OAAO,EAAE,oBAAoB,EAAE,MAAM,yCAAyC,CAAC;AAgB/E;;GAEG;AACH,MAAM,OAAO,WAAY,SAAQ,oBAAoB;IAEnD,YAAY,eAAgC,EAAE,iBAAoC,EAAkB,mBAAwC;QAC1I,KAAK,CAAC,eAAe,EAAE,iBAAiB,CAAC,CAAC;QADwD,wBAAmB,GAAnB,mBAAmB,CAAqB;IAE5I,CAAC;IAED,IAAW,GAAG,KAAa,OAAO,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC;IAMzD;;OAEG;IACI,KAAK,CAAC,iBAAiB,CAAC,iBAA0B;QACvD,IAAI,IAAI,CAAC,YAAY,IAAI,IAAI,CAAC,YAAY,CAAC,iBAAiB;YAC1D,OAAO,IAAI,CAAC,YAAY,CAAC,iBAAiB,CAAC,IAAI,CAAC,GAAG,EAAE,iBAAiB,CAAC,CAAC;QAC1E,OAAO,IAAI,uBAAuB,EAAE,CAAC;IACvC,CAAC;CACF","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 Table\r\n */\r\n\r\nimport ReactDataGrid from \"react-data-grid\";\r\nimport { DistinctValueCollection, FilterableColumn, FilterableTable } from \"../columnfiltering/ColumnFiltering\";\r\nimport { FilterableColumnBase } from \"../columnfiltering/FilterableColumnBase\";\r\nimport { ColumnDescription, TableDataProvider } from \"../TableDataProvider\";\r\n\r\n// cSpell:ignore columnfiltering\r\n\r\n/** ReactDataGrid.Column with additional properties\r\n * @deprecated in 3.0. Use the Table component in @itwin/itwinui-react instead, which does not use this interface.\r\n * @public\r\n */\r\nexport interface ReactDataGridColumn extends ReactDataGrid.Column<any> {\r\n /** Indicates whether the display value for the cell is treated as an icon spec. */\r\n icon?: boolean;\r\n /* Table column filtering info */\r\n filterableColumn?: FilterableColumn;\r\n}\r\n\r\n/** Table Column used by the [[Table]] component\r\n * @internal\r\n */\r\nexport class TableColumn extends FilterableColumnBase {\r\n\r\n constructor(filterableTable: FilterableTable, columnDescription: ColumnDescription, public readonly reactDataGridColumn: ReactDataGridColumn) {\r\n super(filterableTable, columnDescription);\r\n }\r\n\r\n public get key(): string { return this.filterMemberKey; }\r\n\r\n public dataProvider?: TableDataProvider;\r\n\r\n public distinctValueCollection?: DistinctValueCollection;\r\n\r\n /** Gets the distinct values for a column.\r\n * @return The distinct values.\r\n */\r\n public async getDistinctValues(maximumValueCount?: number): Promise<DistinctValueCollection> {\r\n if (this.dataProvider && this.dataProvider.getDistinctValues)\r\n return this.dataProvider.getDistinctValues(this.key, maximumValueCount);\r\n return new DistinctValueCollection();\r\n }\r\n}\r\n"]}
|
|
@@ -5,7 +5,7 @@ import * as React from "react";
|
|
|
5
5
|
/**
|
|
6
6
|
* Context component for DragDrop API. All DragSources and DropTargets used in the application must be contained in this component.
|
|
7
7
|
* @beta
|
|
8
|
-
* @deprecated
|
|
8
|
+
* @deprecated in 2.x.
|
|
9
9
|
*/
|
|
10
10
|
export declare function BeDragDropContext(props: {
|
|
11
11
|
children?: React.ReactNode;
|
|
@@ -11,7 +11,7 @@ import { HTML5Backend } from "react-dnd-html5-backend";
|
|
|
11
11
|
/**
|
|
12
12
|
* Context component for DragDrop API. All DragSources and DropTargets used in the application must be contained in this component.
|
|
13
13
|
* @beta
|
|
14
|
-
* @deprecated
|
|
14
|
+
* @deprecated in 2.x.
|
|
15
15
|
*/
|
|
16
16
|
export function BeDragDropContext(props) {
|
|
17
17
|
return React.createElement(DndProvider, { backend: HTML5Backend }, props.children);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BeDragDropContext.js","sourceRoot":"","sources":["../../../../../../src/components-react/table/component/dragdrop/BeDragDropContext.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAEvD;;;;GAIG;AACH,MAAM,UAAU,iBAAiB,CAAC,KAAqC;IACrE,OAAO,oBAAC,WAAW,IAAC,OAAO,EAAE,YAAY,IAAG,KAAK,CAAC,QAAQ,CAAe,CAAC;AAC5E,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 DragDrop\r\n */\r\n\r\nimport * as React from \"react\";\r\nimport { DndProvider } from \"react-dnd\";\r\nimport { HTML5Backend } from \"react-dnd-html5-backend\";\r\n\r\n/**\r\n * Context component for DragDrop API. All DragSources and DropTargets used in the application must be contained in this component.\r\n * @beta\r\n * @deprecated
|
|
1
|
+
{"version":3,"file":"BeDragDropContext.js","sourceRoot":"","sources":["../../../../../../src/components-react/table/component/dragdrop/BeDragDropContext.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAEvD;;;;GAIG;AACH,MAAM,UAAU,iBAAiB,CAAC,KAAqC;IACrE,OAAO,oBAAC,WAAW,IAAC,OAAO,EAAE,YAAY,IAAG,KAAK,CAAC,QAAQ,CAAe,CAAC;AAC5E,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 DragDrop\r\n */\r\n\r\nimport * as React from \"react\";\r\nimport { DndProvider } from \"react-dnd\";\r\nimport { HTML5Backend } from \"react-dnd-html5-backend\";\r\n\r\n/**\r\n * Context component for DragDrop API. All DragSources and DropTargets used in the application must be contained in this component.\r\n * @beta\r\n * @deprecated in 2.x.\r\n */\r\nexport function BeDragDropContext(props: { children?: React.ReactNode }) {\r\n return <DndProvider backend={HTML5Backend}>{props.children}</DndProvider>;\r\n}\r\n"]}
|
|
@@ -5,7 +5,7 @@ import * as React from "react";
|
|
|
5
5
|
import { CommonProps } from "@itwin/core-react";
|
|
6
6
|
/** Enum for different DropEffects.
|
|
7
7
|
* @beta
|
|
8
|
-
* @deprecated
|
|
8
|
+
* @deprecated in 2.x.
|
|
9
9
|
*/
|
|
10
10
|
export declare enum DropEffects {
|
|
11
11
|
None = 0,
|
|
@@ -15,7 +15,7 @@ export declare enum DropEffects {
|
|
|
15
15
|
}
|
|
16
16
|
/** Enum for status of current drag/drop item
|
|
17
17
|
* @beta
|
|
18
|
-
* @deprecated
|
|
18
|
+
* @deprecated in 2.x.
|
|
19
19
|
*/
|
|
20
20
|
export declare enum DropStatus {
|
|
21
21
|
None = 0,
|
|
@@ -25,7 +25,7 @@ export declare enum DropStatus {
|
|
|
25
25
|
}
|
|
26
26
|
/** Properties and callbacks for the withDragSource Higher-Order Component.
|
|
27
27
|
* @beta
|
|
28
|
-
* @deprecated
|
|
28
|
+
* @deprecated in 2.x.
|
|
29
29
|
*/
|
|
30
30
|
export interface DropTargetProps<DragDropObject = any> {
|
|
31
31
|
/**
|
|
@@ -42,7 +42,7 @@ export interface DropTargetProps<DragDropObject = any> {
|
|
|
42
42
|
}
|
|
43
43
|
/** Properties and callbacks for the withDragSource Higher-Order Component.
|
|
44
44
|
* @beta
|
|
45
|
-
* @deprecated
|
|
45
|
+
* @deprecated in 2.x.
|
|
46
46
|
*/
|
|
47
47
|
export interface DragSourceProps<DragDropObject = any> {
|
|
48
48
|
/** Triggered when DragSource has begun a drag. */
|
|
@@ -66,7 +66,7 @@ export interface DragSourceProps<DragDropObject = any> {
|
|
|
66
66
|
}
|
|
67
67
|
/** Base DragDropArguments interface, used by both DragSourceArguments and DragTargetArguments.
|
|
68
68
|
* @beta
|
|
69
|
-
* @deprecated
|
|
69
|
+
* @deprecated in 2.x.
|
|
70
70
|
*/
|
|
71
71
|
export interface DragDropArguments<DragDropObject = any> {
|
|
72
72
|
/** Arbitrary data being transferred. Actual data structure determined by the return value of the onDragSourceBegin callback. */
|
|
@@ -124,14 +124,14 @@ export interface DragDropArguments<DragDropObject = any> {
|
|
|
124
124
|
}
|
|
125
125
|
/** Properties for DragLayer components
|
|
126
126
|
* @beta
|
|
127
|
-
* @deprecated
|
|
127
|
+
* @deprecated in 2.x.
|
|
128
128
|
*/
|
|
129
129
|
export interface DragLayerProps<DragDropObject = any> extends CommonProps {
|
|
130
130
|
args?: DragSourceArguments<DragDropObject>;
|
|
131
131
|
}
|
|
132
132
|
/** Interface for arguments supplied to DragSource callbacks, including onDragSourceBegin, and onDragSourceEnd, as well as to the DragLayers as a prop.
|
|
133
133
|
* @beta
|
|
134
|
-
* @deprecated
|
|
134
|
+
* @deprecated in 2.x.
|
|
135
135
|
*/
|
|
136
136
|
export interface DragSourceArguments<DragDropObject = any> extends DragDropArguments<DragDropObject> {
|
|
137
137
|
/** Parent object, using the data structure relevant to object being used.
|
|
@@ -143,7 +143,7 @@ export interface DragSourceArguments<DragDropObject = any> extends DragDropArgum
|
|
|
143
143
|
}
|
|
144
144
|
/** Interface for arguments supplied to DropTarget callbacks, including onDropTargetOver, onDropTargetDrop, and canDropTargetDrop.
|
|
145
145
|
* @beta
|
|
146
|
-
* @deprecated
|
|
146
|
+
* @deprecated in 2.x.
|
|
147
147
|
*/
|
|
148
148
|
export interface DropTargetArguments<DragDropObject = any> extends DragSourceArguments<DragDropObject> {
|
|
149
149
|
/** Object that is being dropped onto, using the data structure relevant to object being used.
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
/** Enum for different DropEffects.
|
|
9
9
|
* @beta
|
|
10
|
-
* @deprecated
|
|
10
|
+
* @deprecated in 2.x.
|
|
11
11
|
*/
|
|
12
12
|
export var DropEffects;
|
|
13
13
|
(function (DropEffects) {
|
|
@@ -18,7 +18,7 @@ export var DropEffects;
|
|
|
18
18
|
})(DropEffects || (DropEffects = {}));
|
|
19
19
|
/** Enum for status of current drag/drop item
|
|
20
20
|
* @beta
|
|
21
|
-
* @deprecated
|
|
21
|
+
* @deprecated in 2.x.
|
|
22
22
|
*/
|
|
23
23
|
export var DropStatus;
|
|
24
24
|
(function (DropStatus) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DragDropDef.js","sourceRoot":"","sources":["../../../../../../src/components-react/table/component/dragdrop/DragDropDef.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAKH;;;GAGG;AACH,MAAM,CAAN,IAAY,WAKX;AALD,WAAY,WAAW;IACrB,6CAAQ,CAAA;IACR,6CAAa,CAAA;IACb,6CAAa,CAAA;IACb,6CAAa,CAAA;AACf,CAAC,EALW,WAAW,KAAX,WAAW,QAKtB;AAED;;;GAGG;AACH,MAAM,CAAN,IAAY,UAKX;AALD,WAAY,UAAU;IACpB,2CAAQ,CAAA;IACR,uCAAE,CAAA;IACF,2CAAI,CAAA;IACJ,+CAAM,CAAA;AACR,CAAC,EALW,UAAU,KAAV,UAAU,QAKrB","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 DragDrop\r\n */\r\n\r\nimport * as React from \"react\";\r\nimport { CommonProps } from \"@itwin/core-react\";\r\n\r\n/** Enum for different DropEffects.\r\n * @beta\r\n * @deprecated
|
|
1
|
+
{"version":3,"file":"DragDropDef.js","sourceRoot":"","sources":["../../../../../../src/components-react/table/component/dragdrop/DragDropDef.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAKH;;;GAGG;AACH,MAAM,CAAN,IAAY,WAKX;AALD,WAAY,WAAW;IACrB,6CAAQ,CAAA;IACR,6CAAa,CAAA;IACb,6CAAa,CAAA;IACb,6CAAa,CAAA;AACf,CAAC,EALW,WAAW,KAAX,WAAW,QAKtB;AAED;;;GAGG;AACH,MAAM,CAAN,IAAY,UAKX;AALD,WAAY,UAAU;IACpB,2CAAQ,CAAA;IACR,uCAAE,CAAA;IACF,2CAAI,CAAA;IACJ,+CAAM,CAAA;AACR,CAAC,EALW,UAAU,KAAV,UAAU,QAKrB","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 DragDrop\r\n */\r\n\r\nimport * as React from \"react\";\r\nimport { CommonProps } from \"@itwin/core-react\";\r\n\r\n/** Enum for different DropEffects.\r\n * @beta\r\n * @deprecated in 2.x.\r\n */\r\nexport enum DropEffects {\r\n None = 0,\r\n Copy = 1 << 0,\r\n Move = 1 << 1,\r\n Link = 1 << 2,\r\n}\r\n\r\n/** Enum for status of current drag/drop item\r\n * @beta\r\n * @deprecated in 2.x.\r\n */\r\nexport enum DropStatus {\r\n None = 0,\r\n Ok,\r\n Drop,\r\n Cancel,\r\n}\r\n\r\n/** Properties and callbacks for the withDragSource Higher-Order Component.\r\n * @beta\r\n * @deprecated in 2.x.\r\n */\r\nexport interface DropTargetProps<DragDropObject = any> {\r\n /**\r\n * Triggered when item is dropped on wrapped component.\r\n * Return value is passed to the DragSource's onDragSourceEnd callback.\r\n */\r\n onDropTargetDrop?: (args: DropTargetArguments<DragDropObject>) => DropTargetArguments<DragDropObject>; // eslint-disable-line deprecation/deprecation\r\n /** Triggered when item is dragged over wrapped component. */\r\n onDropTargetOver?: (args: DropTargetArguments<DragDropObject>) => void; // eslint-disable-line deprecation/deprecation\r\n /** Determines whether item may be dropped on DropTarget. */\r\n canDropTargetDrop?: (args: DropTargetArguments<DragDropObject>) => boolean; // eslint-disable-line deprecation/deprecation\r\n /** List of allowed object types */\r\n objectTypes?: Array<string | symbol> | (() => Array<string | symbol>);\r\n}\r\n\r\n/** Properties and callbacks for the withDragSource Higher-Order Component.\r\n * @beta\r\n * @deprecated in 2.x.\r\n */\r\nexport interface DragSourceProps<DragDropObject = any> {\r\n /** Triggered when DragSource has begun a drag. */\r\n onDragSourceBegin?: (data: DragSourceArguments<DragDropObject>) => DragSourceArguments<DragDropObject>; // eslint-disable-line deprecation/deprecation\r\n /**\r\n * Triggered when a DragSource drag has ended.\r\n * Callback is always called after an onDragSourceBegin callback, regardless of whether the drag was successful.\r\n */\r\n onDragSourceEnd?: (data: DragSourceArguments<DragDropObject>) => void; // eslint-disable-line deprecation/deprecation\r\n /**\r\n * Specifies the DragSource type.\r\n * data parameter is non-null when data is trickled down from dragged component.\r\n */\r\n objectType?: ((data?: DragDropObject) => string | symbol) | string | symbol;\r\n /**\r\n * Specifies a default DragLayer component to display as a drag preview.\r\n * This property is dependent on the DragDropLayerManager in appui-react. The DragLayer is ultimately rendered using the DragDropLayerRendererComponent, which must exist within the app that is used.\r\n * Component may be overridden if another DragLayer is registered for the given type using the DragDropLayerManager in appui-react.\r\n */\r\n defaultDragLayer?: React.ComponentType<DragLayerProps<DragDropObject>>; // eslint-disable-line deprecation/deprecation\r\n}\r\n\r\n/** Base DragDropArguments interface, used by both DragSourceArguments and DragTargetArguments.\r\n * @beta\r\n * @deprecated in 2.x.\r\n */\r\nexport interface DragDropArguments<DragDropObject = any> {\r\n /** Arbitrary data being transferred. Actual data structure determined by the return value of the onDragSourceBegin callback. */\r\n dataObject: DragDropObject;\r\n /** Drop Effect of current drag */\r\n dropEffect: DropEffects; // eslint-disable-line deprecation/deprecation\r\n /** Status of current drop */\r\n dropStatus: DropStatus; // eslint-disable-line deprecation/deprecation\r\n /** Current mouse position. */\r\n clientOffset: { x: number, y: number };\r\n /** Mouse position at beginning of drag. */\r\n initialClientOffset: { x: number, y: number };\r\n /**\r\n * Current mouse position, offset by the difference between initial mouse position and initial dragSource offset.\r\n * Useful for preserving apparent anchor point of mouse to dragSource while rendering a dragPreview.\r\n */\r\n sourceClientOffset?: { x: number, y: number };\r\n /** Position of top left corner of current dragSource, measured at beginning of drag. */\r\n initialSourceClientOffset?: { x: number, y: number };\r\n /** DOMRect object of dragSource.\r\n * Not available in canDropTargetDrop.\r\n */\r\n dragRect?: DOMRect;\r\n /** DOMRect object of current dropTarget, if available.\r\n * Not available in canDropTargetDrop.\r\n */\r\n dropRect?: DOMRect;\r\n /** determines whether item is dropped on same structure as the drag source, or a different structure.\r\n * Passed from OnDropTargetDrop for use in OnDragSourceEnd\r\n * Used primarily for cases where the dataProvider object needs to differentiate a moveItem method with a subsequent removeItem then addItem.\r\n */\r\n local?: boolean;\r\n /** specifies the row to be dropped onto.\r\n * Populated by consumers for trickle down arguments.\r\n * Specifically used where further information is needed within a given dataProvider structure. Ie. insertRow(rowIndex, rowItem) type methods.\r\n */\r\n row?: number;\r\n /** specifies the col to be dropped onto.\r\n * Populated by consumers for trickle down arguments.\r\n * Specifically used where further information is needed within a given dataProvider structure. Ie. dataProvider.insertCol(colIndex, colItem) type methods.\r\n */\r\n col?: number;\r\n}\r\n\r\n/** Properties for DragLayer components\r\n * @beta\r\n * @deprecated in 2.x.\r\n */\r\nexport interface DragLayerProps<DragDropObject = any> extends CommonProps {\r\n args?: DragSourceArguments<DragDropObject>; // eslint-disable-line deprecation/deprecation\r\n}\r\n\r\n/** Interface for arguments supplied to DragSource callbacks, including onDragSourceBegin, and onDragSourceEnd, as well as to the DragLayers as a prop.\r\n * @beta\r\n * @deprecated in 2.x.\r\n */\r\nexport interface DragSourceArguments<DragDropObject = any> extends DragDropArguments<DragDropObject> { // eslint-disable-line deprecation/deprecation\r\n /** Parent object, using the data structure relevant to object being used.\r\n * Object populated by consumer for use as trickle down arguments.\r\n * Specifically used where further information is needed within a given dataProvider structure. Ie. dataProvider.removeChild(parentObject, child) type methods.\r\n */\r\n parentObject?: DragDropObject;\r\n defaultDragLayer?: React.ComponentType<DragLayerProps<DragDropObject>>; // eslint-disable-line deprecation/deprecation\r\n}\r\n\r\n/** Interface for arguments supplied to DropTarget callbacks, including onDropTargetOver, onDropTargetDrop, and canDropTargetDrop.\r\n * @beta\r\n * @deprecated in 2.x.\r\n */\r\nexport interface DropTargetArguments<DragDropObject = any> extends DragSourceArguments<DragDropObject> { // eslint-disable-line deprecation/deprecation\r\n /** Object that is being dropped onto, using the data structure relevant to object being used.\r\n * Object populated by consumer for use as trickle down arguments.\r\n * Specifically used where further information is needed within a given dataProvider structure. Ie. dataProvider.addChild(dropLocation, child) type methods.\r\n */\r\n dropLocation?: DragDropObject; // Where to attach\r\n}\r\n"]}
|
|
@@ -6,7 +6,7 @@ import { ConnectDragPreview, ConnectDragSource, DndComponentClass } from "react-
|
|
|
6
6
|
import { DragSourceProps, DropEffects } from "./DragDropDef";
|
|
7
7
|
/** React properties for withDragSource Higher-Order Component
|
|
8
8
|
* @beta
|
|
9
|
-
* @deprecated
|
|
9
|
+
* @deprecated in 2.x.
|
|
10
10
|
*/
|
|
11
11
|
export interface WithDragSourceProps<DragDropObject = any> {
|
|
12
12
|
/** Properties and callbacks for DragSource. */
|
|
@@ -36,7 +36,7 @@ export interface WithDragSourceProps<DragDropObject = any> {
|
|
|
36
36
|
* HOC (Higher-Order Component) that transforms wrapped component into a DragSource.
|
|
37
37
|
* @param Component component to wrap.
|
|
38
38
|
* @beta
|
|
39
|
-
* @deprecated
|
|
39
|
+
* @deprecated in 2.x.
|
|
40
40
|
*/
|
|
41
41
|
export declare const withDragSource: <ComponentProps extends {}, DragDropObject = any>(Component: React.ComponentType<ComponentProps>) => DndComponentClass<typeof React.Component, ComponentProps & WithDragSourceProps<DragDropObject>>;
|
|
42
42
|
//# sourceMappingURL=withDragSource.d.ts.map
|
|
@@ -21,7 +21,7 @@ function getEmptyImage() {
|
|
|
21
21
|
* HOC (Higher-Order Component) that transforms wrapped component into a DragSource.
|
|
22
22
|
* @param Component component to wrap.
|
|
23
23
|
* @beta
|
|
24
|
-
* @deprecated
|
|
24
|
+
* @deprecated in 2.x.
|
|
25
25
|
*/
|
|
26
26
|
// istanbul ignore next
|
|
27
27
|
export const withDragSource = (
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withDragSource.js","sourceRoot":"","sources":["../../../../../../src/components-react/table/component/dragdrop/withDragSource.tsx"],"names":[],"mappings":"AAAA;;;+FAG+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,GAAQ;YAChC,iBAAiB,EAAE,WAAW,CAAC,IAAI;YACnC,cAAc,EAAE,WAAW,CAAC,IAAI;YAChC,aAAa,EAAE,WAAW,CAAC,IAAI,EAAE,8CAA8C;SAC/E;YAoDK,CAAC;AACZ,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 DragDrop\r\n */\r\nimport * as React from \"react\";\r\nimport { ConnectDragPreview, ConnectDragSource, DndComponentClass, DragSource } from \"react-dnd\";\r\nimport { DragSourceArguments, DragSourceProps, DropEffects, DropStatus, DropTargetArguments } from \"./DragDropDef\";\r\n\r\n/** React properties for withDragSource Higher-Order Component\r\n * @beta\r\n * @deprecated\r\n */\r\nexport interface WithDragSourceProps<DragDropObject = any> {\r\n /** Properties and callbacks for DragSource. */\r\n dragProps: DragSourceProps<DragDropObject>; // eslint-disable-line deprecation/deprecation\r\n /** Style properties for dropTarget wrapper element */\r\n dragStyle?: React.CSSProperties;\r\n /** Which dropEffect dragSource should default to. */\r\n defaultDropEffect?: DropEffects; // eslint-disable-line deprecation/deprecation\r\n /** Which dropEffect dragSource should be used when ctrl button is pressed during start of drag. */\r\n ctrlDropEffect?: DropEffects; // eslint-disable-line deprecation/deprecation\r\n /** Which dropEffect dragSource should be used when alt button is pressed during start of drag. */\r\n altDropEffect?: DropEffects; // eslint-disable-line deprecation/deprecation\r\n /** @internal */\r\n connectDragSource?: ConnectDragSource;\r\n /** @internal */\r\n connectDragPreview?: ConnectDragPreview;\r\n /** @internal */\r\n isDragging?: boolean;\r\n /** @internal */\r\n canDrag?: boolean;\r\n /** @internal */\r\n item?: DragDropObject;\r\n /** @internal */\r\n type?: string | symbol | null;\r\n}\r\n\r\n/** @internal */\r\ninterface WithDragSourceState {\r\n ctrlKey: boolean;\r\n altKey: boolean;\r\n}\r\nlet emptyImage: HTMLImageElement | undefined;\r\n\r\nfunction getEmptyImage(): HTMLImageElement {\r\n if (!emptyImage) {\r\n emptyImage = new Image();\r\n emptyImage.src =\r\n \"data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==\";\r\n }\r\n return emptyImage;\r\n}\r\n\r\n/**\r\n * HOC (Higher-Order Component) that transforms wrapped component into a DragSource.\r\n * @param Component component to wrap.\r\n * @beta\r\n * @deprecated\r\n */\r\n// istanbul ignore next\r\nexport const withDragSource = <ComponentProps extends {}, DragDropObject = any>(\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n Component: React.ComponentType<ComponentProps>,\r\n): DndComponentClass<typeof React.Component, ComponentProps & WithDragSourceProps<DragDropObject>> => { // eslint-disable-line deprecation/deprecation\r\n type Props = ComponentProps & WithDragSourceProps<DragDropObject>; // eslint-disable-line deprecation/deprecation\r\n return DragSource((props: Props) => {\r\n if (props.dragProps.objectType) {\r\n if (typeof props.dragProps.objectType === \"function\")\r\n return props.dragProps.objectType();\r\n else\r\n return props.dragProps.objectType;\r\n }\r\n return \"\";\r\n }, {\r\n beginDrag(props, _monitor, component) {\r\n let dropEffect = props.defaultDropEffect || DropEffects.Move; // eslint-disable-line deprecation/deprecation\r\n if (component.state.ctrlKey) {\r\n dropEffect = props.ctrlDropEffect || DropEffects.Copy; // eslint-disable-line deprecation/deprecation\r\n } else if (component.state.altKey) {\r\n dropEffect = props.altDropEffect || DropEffects.Link; // eslint-disable-line deprecation/deprecation\r\n }\r\n let dragRect: DOMRect = new DOMRect();\r\n const componentElement = component.rootElement;\r\n if (componentElement) {\r\n dragRect = componentElement.getBoundingClientRect();\r\n }\r\n const obj: DragSourceArguments<DragDropObject> = { // eslint-disable-line deprecation/deprecation\r\n dataObject: {} as DragDropObject,\r\n dropEffect,\r\n dropStatus: DropStatus.None, // eslint-disable-line deprecation/deprecation\r\n dragRect,\r\n defaultDragLayer: props.dragProps.defaultDragLayer,\r\n clientOffset: { x: dragRect.left || 0, y: dragRect.top || 0 },\r\n initialClientOffset: { x: dragRect.left || 0, y: dragRect.top || 0 },\r\n };\r\n if (props.dragProps.onDragSourceBegin) return props.dragProps.onDragSourceBegin(obj);\r\n return obj;\r\n },\r\n endDrag(props, monitor, component) {\r\n let dragRect: DOMRect = new DOMRect();\r\n const componentElement = component && component.rootElement;\r\n if (componentElement) {\r\n dragRect = componentElement.getBoundingClientRect();\r\n }\r\n // eslint-disable-next-line deprecation/deprecation\r\n const obj: DropTargetArguments<DragDropObject> = monitor.getDropResult() as DropTargetArguments<DragDropObject> || // if onDropTargetDrop returns a value\r\n // eslint-disable-next-line deprecation/deprecation\r\n monitor.getItem() as DropTargetArguments<DragDropObject> || // otherwise, get current drag item.\r\n { // fallback\r\n dataObject: {},\r\n dropEffect: DropEffects.None, // eslint-disable-line deprecation/deprecation\r\n dropStatus: DropStatus.None, // eslint-disable-line deprecation/deprecation\r\n dragRect,\r\n clientOffset: { x: 0, y: 0 },\r\n initialClientOffset: { x: 0, y: 0 },\r\n sourceClientOffset: { x: 0, y: 0 },\r\n initialSourceClientOffset: { x: 0, y: 0 },\r\n };\r\n const {\r\n dataObject,\r\n dropEffect, dropStatus, dropRect,\r\n initialClientOffset, initialSourceClientOffset,\r\n local, row, col } = obj;\r\n\r\n const clientOffset = monitor.getClientOffset() || obj.clientOffset;\r\n const sourceClientOffset = monitor.getSourceClientOffset() || obj.sourceClientOffset;\r\n const dragObj: DragSourceArguments<DragDropObject> = { // eslint-disable-line deprecation/deprecation\r\n dataObject,\r\n dropEffect, dropStatus, dropRect, dragRect,\r\n clientOffset, initialClientOffset, sourceClientOffset, initialSourceClientOffset,\r\n local, row, col,\r\n };\r\n if (props.dragProps.onDragSourceEnd)\r\n props.dragProps.onDragSourceEnd(dragObj);\r\n },\r\n }, (connect, monitor) => {\r\n return {\r\n connectDragSource: connect.dragSource(),\r\n connectDragPreview: connect.dragPreview(),\r\n isDragging: monitor.isDragging(),\r\n canDrag: monitor.canDrag(),\r\n item: monitor.getItem(),\r\n type: monitor.getItemType(),\r\n };\r\n })(class DragSourceWrapper extends React.Component<any, WithDragSourceState> {\r\n public rootElement: HTMLDivElement | null = null;\r\n public override readonly state: WithDragSourceState = {\r\n ctrlKey: false,\r\n altKey: false,\r\n };\r\n public static defaultProps: any = {\r\n defaultDropEffect: DropEffects.Move, // eslint-disable-line deprecation/deprecation\r\n ctrlDropEffect: DropEffects.Copy, // eslint-disable-line deprecation/deprecation\r\n altDropEffect: DropEffects.Link, // eslint-disable-line deprecation/deprecation\r\n };\r\n public override render() {\r\n const {\r\n dragProps, connectDragSource, connectDragPreview, // eslint-disable-line @typescript-eslint/no-unused-vars\r\n isDragging, canDrag, item, type,\r\n defaultDropEffect, ctrlDropEffect, altDropEffect,\r\n dragStyle, // eslint-disable-line @typescript-eslint/no-unused-vars\r\n ...props } = this.props as WithDragSourceProps<DragDropObject>; // eslint-disable-line deprecation/deprecation\r\n const p = {\r\n item,\r\n type,\r\n isDragging,\r\n canDrag,\r\n };\r\n const effectMap: { [key: number]: string } = {\r\n [DropEffects.Move]: \"move\", // eslint-disable-line deprecation/deprecation\r\n [DropEffects.Copy]: \"copy\", // eslint-disable-line deprecation/deprecation\r\n [DropEffects.Link]: \"link\", // eslint-disable-line deprecation/deprecation\r\n };\r\n\r\n const defaultEffect = effectMap[defaultDropEffect as number];\r\n const ctrlEffect = effectMap[ctrlDropEffect as number];\r\n const altEffect = effectMap[altDropEffect as number];\r\n\r\n const dropEffect = this.state.ctrlKey ? ctrlEffect || \"copy\" : this.state.altKey ? altEffect || \"link\" : defaultEffect || \"move\";\r\n return connectDragSource!(\r\n <div className=\"drag-source-wrapper\" data-testid=\"drag-source-wrapper\" ref={(el) => { this.rootElement = el; }} style={this.props.dragStyle}>\r\n <Component {...props} {...(p as any)} />\r\n </div>,\r\n { dropEffect },\r\n );\r\n }\r\n public override componentDidMount() {\r\n if (this.props.connectDragPreview) {\r\n this.props.connectDragPreview(getEmptyImage() as any, { captureDraggingState: true });\r\n }\r\n window.addEventListener(\"keydown\", this.handleKeyChange);\r\n window.addEventListener(\"keyup\", this.handleKeyChange);\r\n }\r\n public override componentWillUnmount() {\r\n window.removeEventListener(\"keydown\", this.handleKeyChange);\r\n window.removeEventListener(\"keyup\", this.handleKeyChange);\r\n }\r\n public handleKeyChange = (event: any) => {\r\n const { ctrlKey, altKey } = event;\r\n if (this.state.ctrlKey !== ctrlKey) {\r\n this.setState({ ctrlKey });\r\n }\r\n if (this.state.altKey !== altKey) {\r\n this.setState({ altKey });\r\n }\r\n };\r\n }) as any;\r\n};\r\n"]}
|
|
1
|
+
{"version":3,"file":"withDragSource.js","sourceRoot":"","sources":["../../../../../../src/components-react/table/component/dragdrop/withDragSource.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AACH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAA4D,UAAU,EAAE,MAAM,WAAW,CAAC;AACjG,OAAO,EAAwC,WAAW,EAAE,UAAU,EAAuB,MAAM,eAAe,CAAC;AAoCnH,IAAI,UAAwC,CAAC;AAE7C,SAAS,aAAa;IACpB,IAAI,CAAC,UAAU,EAAE;QACf,UAAU,GAAG,IAAI,KAAK,EAAE,CAAC;QACzB,UAAU,CAAC,GAAG;YACZ,4EAA4E,CAAC;KAChF;IACD,OAAO,UAAU,CAAC;AACpB,CAAC;AAED;;;;;GAKG;AACH,uBAAuB;AACvB,MAAM,CAAC,MAAM,cAAc,GAAG;AAC5B,gEAAgE;AAChE,SAA8C,EACmD,EAAE;;IAEnG,OAAO,UAAU,CAAC,CAAC,KAAY,EAAE,EAAE;QACjC,IAAI,KAAK,CAAC,SAAS,CAAC,UAAU,EAAE;YAC9B,IAAI,OAAO,KAAK,CAAC,SAAS,CAAC,UAAU,KAAK,UAAU;gBAClD,OAAO,KAAK,CAAC,SAAS,CAAC,UAAU,EAAE,CAAC;;gBAEpC,OAAO,KAAK,CAAC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I,CAAC,KAAK,CAAC,kBAAkB,EAAE;oBACjC,IAAI,CAAC,KAAK,CAAC,kBAAkB,CAAC,aAAa,EAAS,EAAE,EAAE,oBAAoB,EAAE,IAAI,EAAE,CAAC,CAAC;iBACvF;gBACD,MAAM,CAAC,gBAAgB,CAAC,SAAS,EAAE,IAAI,CAAC,eAAe,CAAC,CAAC;gBACzD,MAAM,CAAC,gBAAgB,CAAC,OAAO,EAAE,IAAI,CAAC,eAAe,CAAC,CAAC;YACzD,CAAC;YACe,oBAAoB;gBAClC,MAAM,CAAC,mBAAmB,CAAC,SAAS,EAAE,IAAI,CAAC,eAAe,CAAC,CAAC;gBAC5D,MAAM,CAAC,mBAAmB,CAAC,OAAO,EAAE,IAAI,CAAC,eAAe,CAAC,CAAC;YAC5D,CAAC;SAUF;QAxDe,eAAY,GAAQ;YAChC,iBAAiB,EAAE,WAAW,CAAC,IAAI;YACnC,cAAc,EAAE,WAAW,CAAC,IAAI;YAChC,aAAa,EAAE,WAAW,CAAC,IAAI,EAAE,8CAA8C;SAC/E;YAoDK,CAAC;AACZ,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 DragDrop\r\n */\r\nimport * as React from \"react\";\r\nimport { ConnectDragPreview, ConnectDragSource, DndComponentClass, DragSource } from \"react-dnd\";\r\nimport { DragSourceArguments, DragSourceProps, DropEffects, DropStatus, DropTargetArguments } from \"./DragDropDef\";\r\n\r\n/** React properties for withDragSource Higher-Order Component\r\n * @beta\r\n * @deprecated in 2.x.\r\n */\r\nexport interface WithDragSourceProps<DragDropObject = any> {\r\n /** Properties and callbacks for DragSource. */\r\n dragProps: DragSourceProps<DragDropObject>; // eslint-disable-line deprecation/deprecation\r\n /** Style properties for dropTarget wrapper element */\r\n dragStyle?: React.CSSProperties;\r\n /** Which dropEffect dragSource should default to. */\r\n defaultDropEffect?: DropEffects; // eslint-disable-line deprecation/deprecation\r\n /** Which dropEffect dragSource should be used when ctrl button is pressed during start of drag. */\r\n ctrlDropEffect?: DropEffects; // eslint-disable-line deprecation/deprecation\r\n /** Which dropEffect dragSource should be used when alt button is pressed during start of drag. */\r\n altDropEffect?: DropEffects; // eslint-disable-line deprecation/deprecation\r\n /** @internal */\r\n connectDragSource?: ConnectDragSource;\r\n /** @internal */\r\n connectDragPreview?: ConnectDragPreview;\r\n /** @internal */\r\n isDragging?: boolean;\r\n /** @internal */\r\n canDrag?: boolean;\r\n /** @internal */\r\n item?: DragDropObject;\r\n /** @internal */\r\n type?: string | symbol | null;\r\n}\r\n\r\n/** @internal */\r\ninterface WithDragSourceState {\r\n ctrlKey: boolean;\r\n altKey: boolean;\r\n}\r\nlet emptyImage: HTMLImageElement | undefined;\r\n\r\nfunction getEmptyImage(): HTMLImageElement {\r\n if (!emptyImage) {\r\n emptyImage = new Image();\r\n emptyImage.src =\r\n \"data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==\";\r\n }\r\n return emptyImage;\r\n}\r\n\r\n/**\r\n * HOC (Higher-Order Component) that transforms wrapped component into a DragSource.\r\n * @param Component component to wrap.\r\n * @beta\r\n * @deprecated in 2.x.\r\n */\r\n// istanbul ignore next\r\nexport const withDragSource = <ComponentProps extends {}, DragDropObject = any>(\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n Component: React.ComponentType<ComponentProps>,\r\n): DndComponentClass<typeof React.Component, ComponentProps & WithDragSourceProps<DragDropObject>> => { // eslint-disable-line deprecation/deprecation\r\n type Props = ComponentProps & WithDragSourceProps<DragDropObject>; // eslint-disable-line deprecation/deprecation\r\n return DragSource((props: Props) => {\r\n if (props.dragProps.objectType) {\r\n if (typeof props.dragProps.objectType === \"function\")\r\n return props.dragProps.objectType();\r\n else\r\n return props.dragProps.objectType;\r\n }\r\n return \"\";\r\n }, {\r\n beginDrag(props, _monitor, component) {\r\n let dropEffect = props.defaultDropEffect || DropEffects.Move; // eslint-disable-line deprecation/deprecation\r\n if (component.state.ctrlKey) {\r\n dropEffect = props.ctrlDropEffect || DropEffects.Copy; // eslint-disable-line deprecation/deprecation\r\n } else if (component.state.altKey) {\r\n dropEffect = props.altDropEffect || DropEffects.Link; // eslint-disable-line deprecation/deprecation\r\n }\r\n let dragRect: DOMRect = new DOMRect();\r\n const componentElement = component.rootElement;\r\n if (componentElement) {\r\n dragRect = componentElement.getBoundingClientRect();\r\n }\r\n const obj: DragSourceArguments<DragDropObject> = { // eslint-disable-line deprecation/deprecation\r\n dataObject: {} as DragDropObject,\r\n dropEffect,\r\n dropStatus: DropStatus.None, // eslint-disable-line deprecation/deprecation\r\n dragRect,\r\n defaultDragLayer: props.dragProps.defaultDragLayer,\r\n clientOffset: { x: dragRect.left || 0, y: dragRect.top || 0 },\r\n initialClientOffset: { x: dragRect.left || 0, y: dragRect.top || 0 },\r\n };\r\n if (props.dragProps.onDragSourceBegin) return props.dragProps.onDragSourceBegin(obj);\r\n return obj;\r\n },\r\n endDrag(props, monitor, component) {\r\n let dragRect: DOMRect = new DOMRect();\r\n const componentElement = component && component.rootElement;\r\n if (componentElement) {\r\n dragRect = componentElement.getBoundingClientRect();\r\n }\r\n // eslint-disable-next-line deprecation/deprecation\r\n const obj: DropTargetArguments<DragDropObject> = monitor.getDropResult() as DropTargetArguments<DragDropObject> || // if onDropTargetDrop returns a value\r\n // eslint-disable-next-line deprecation/deprecation\r\n monitor.getItem() as DropTargetArguments<DragDropObject> || // otherwise, get current drag item.\r\n { // fallback\r\n dataObject: {},\r\n dropEffect: DropEffects.None, // eslint-disable-line deprecation/deprecation\r\n dropStatus: DropStatus.None, // eslint-disable-line deprecation/deprecation\r\n dragRect,\r\n clientOffset: { x: 0, y: 0 },\r\n initialClientOffset: { x: 0, y: 0 },\r\n sourceClientOffset: { x: 0, y: 0 },\r\n initialSourceClientOffset: { x: 0, y: 0 },\r\n };\r\n const {\r\n dataObject,\r\n dropEffect, dropStatus, dropRect,\r\n initialClientOffset, initialSourceClientOffset,\r\n local, row, col } = obj;\r\n\r\n const clientOffset = monitor.getClientOffset() || obj.clientOffset;\r\n const sourceClientOffset = monitor.getSourceClientOffset() || obj.sourceClientOffset;\r\n const dragObj: DragSourceArguments<DragDropObject> = { // eslint-disable-line deprecation/deprecation\r\n dataObject,\r\n dropEffect, dropStatus, dropRect, dragRect,\r\n clientOffset, initialClientOffset, sourceClientOffset, initialSourceClientOffset,\r\n local, row, col,\r\n };\r\n if (props.dragProps.onDragSourceEnd)\r\n props.dragProps.onDragSourceEnd(dragObj);\r\n },\r\n }, (connect, monitor) => {\r\n return {\r\n connectDragSource: connect.dragSource(),\r\n connectDragPreview: connect.dragPreview(),\r\n isDragging: monitor.isDragging(),\r\n canDrag: monitor.canDrag(),\r\n item: monitor.getItem(),\r\n type: monitor.getItemType(),\r\n };\r\n })(class DragSourceWrapper extends React.Component<any, WithDragSourceState> {\r\n public rootElement: HTMLDivElement | null = null;\r\n public override readonly state: WithDragSourceState = {\r\n ctrlKey: false,\r\n altKey: false,\r\n };\r\n public static defaultProps: any = {\r\n defaultDropEffect: DropEffects.Move, // eslint-disable-line deprecation/deprecation\r\n ctrlDropEffect: DropEffects.Copy, // eslint-disable-line deprecation/deprecation\r\n altDropEffect: DropEffects.Link, // eslint-disable-line deprecation/deprecation\r\n };\r\n public override render() {\r\n const {\r\n dragProps, connectDragSource, connectDragPreview, // eslint-disable-line @typescript-eslint/no-unused-vars\r\n isDragging, canDrag, item, type,\r\n defaultDropEffect, ctrlDropEffect, altDropEffect,\r\n dragStyle, // eslint-disable-line @typescript-eslint/no-unused-vars\r\n ...props } = this.props as WithDragSourceProps<DragDropObject>; // eslint-disable-line deprecation/deprecation\r\n const p = {\r\n item,\r\n type,\r\n isDragging,\r\n canDrag,\r\n };\r\n const effectMap: { [key: number]: string } = {\r\n [DropEffects.Move]: \"move\", // eslint-disable-line deprecation/deprecation\r\n [DropEffects.Copy]: \"copy\", // eslint-disable-line deprecation/deprecation\r\n [DropEffects.Link]: \"link\", // eslint-disable-line deprecation/deprecation\r\n };\r\n\r\n const defaultEffect = effectMap[defaultDropEffect as number];\r\n const ctrlEffect = effectMap[ctrlDropEffect as number];\r\n const altEffect = effectMap[altDropEffect as number];\r\n\r\n const dropEffect = this.state.ctrlKey ? ctrlEffect || \"copy\" : this.state.altKey ? altEffect || \"link\" : defaultEffect || \"move\";\r\n return connectDragSource!(\r\n <div className=\"drag-source-wrapper\" data-testid=\"drag-source-wrapper\" ref={(el) => { this.rootElement = el; }} style={this.props.dragStyle}>\r\n <Component {...props} {...(p as any)} />\r\n </div>,\r\n { dropEffect },\r\n );\r\n }\r\n public override componentDidMount() {\r\n if (this.props.connectDragPreview) {\r\n this.props.connectDragPreview(getEmptyImage() as any, { captureDraggingState: true });\r\n }\r\n window.addEventListener(\"keydown\", this.handleKeyChange);\r\n window.addEventListener(\"keyup\", this.handleKeyChange);\r\n }\r\n public override componentWillUnmount() {\r\n window.removeEventListener(\"keydown\", this.handleKeyChange);\r\n window.removeEventListener(\"keyup\", this.handleKeyChange);\r\n }\r\n public handleKeyChange = (event: any) => {\r\n const { ctrlKey, altKey } = event;\r\n if (this.state.ctrlKey !== ctrlKey) {\r\n this.setState({ ctrlKey });\r\n }\r\n if (this.state.altKey !== altKey) {\r\n this.setState({ altKey });\r\n }\r\n };\r\n }) as any;\r\n};\r\n"]}
|
|
@@ -6,7 +6,7 @@ import { ConnectDropTarget, DndComponentClass } from "react-dnd";
|
|
|
6
6
|
import { DropTargetProps } from "./DragDropDef";
|
|
7
7
|
/** React properties for withDropTarget Higher-Order Component
|
|
8
8
|
* @beta
|
|
9
|
-
* @deprecated
|
|
9
|
+
* @deprecated in 2.x.
|
|
10
10
|
*/
|
|
11
11
|
export interface WithDropTargetProps<DragDropObject = any> {
|
|
12
12
|
/** Properties and callbacks for DropTarget */
|
|
@@ -30,7 +30,7 @@ export interface WithDropTargetProps<DragDropObject = any> {
|
|
|
30
30
|
* HOC (Higher-Order Component) that transforms wrapped component into a DropTarget.
|
|
31
31
|
* @param Component component to wrap.
|
|
32
32
|
* @beta
|
|
33
|
-
* @deprecated
|
|
33
|
+
* @deprecated in 2.x.
|
|
34
34
|
*/
|
|
35
35
|
export declare const withDropTarget: <ComponentProps extends {}, DragDropObject = any>(Component: React.ComponentType<ComponentProps>) => DndComponentClass<typeof React.Component, ComponentProps & WithDropTargetProps<DragDropObject>>;
|
|
36
36
|
//# sourceMappingURL=withDropTarget.d.ts.map
|
|
@@ -11,7 +11,7 @@ import { DropTarget } from "react-dnd";
|
|
|
11
11
|
* HOC (Higher-Order Component) that transforms wrapped component into a DropTarget.
|
|
12
12
|
* @param Component component to wrap.
|
|
13
13
|
* @beta
|
|
14
|
-
* @deprecated
|
|
14
|
+
* @deprecated in 2.x.
|
|
15
15
|
*/
|
|
16
16
|
// istanbul ignore next
|
|
17
17
|
export const withDropTarget = (
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withDropTarget.js","sourceRoot":"","sources":["../../../../../../src/components-react/table/component/dragdrop/withDropTarget.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AACH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAwC,UAAU,EAAE,MAAM,WAAW,CAAC;AA2B7E;;;;;GAKG;AACH,uBAAuB;AACvB,MAAM,CAAC,MAAM,cAAc,GAAG;AAC5B,gEAAgE;AAChE,SAA8C,EACmD,EAAE;IAEnG,OAAO,UAAU,CAAC,CAAC,KAAY,EAA0B,EAAE;QACzD,IAAI,KAAK,CAAC,SAAS,CAAC,WAAW,EAAE;YAC/B,IAAI,OAAO,KAAK,CAAC,SAAS,CAAC,WAAW,KAAK,UAAU;gBACnD,OAAO,KAAK,CAAC,SAAS,CAAC,WAAW,EAAE,CAAC;;gBAErC,OAAO,KAAK,CAAC,SAAS,CAAC,WA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AAM,CAAC,GAAG;gBACR,IAAI;gBACJ,IAAI;gBACJ,MAAM;gBACN,OAAO;aACR,CAAC;YACF,OAAO,iBAAkB,CACvB,6BAAK,SAAS,EAAC,qBAAqB,iBAAa,qBAAqB,EAAC,GAAG,EAAE,CAAC,EAAE,EAAE,EAAE,GAAG,IAAI,CAAC,WAAW,GAAG,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,SAAS;gBACzI,oBAAC,SAAS,OAAK,KAAK,KAAO,CAAS,GAAI,CACpC,CACP,CAAC;QACJ,CAAC;KACF,CAAQ,CAAC;AACZ,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 DragDrop\r\n */\r\nimport * as React from \"react\";\r\nimport { ConnectDropTarget, DndComponentClass, DropTarget } from \"react-dnd\";\r\nimport { DragSourceArguments, DropTargetArguments, DropTargetProps } from \"./DragDropDef\";\r\n\r\n/** React properties for withDropTarget Higher-Order Component\r\n * @beta\r\n * @deprecated\r\n */\r\nexport interface WithDropTargetProps<DragDropObject = any> {\r\n /** Properties and callbacks for DropTarget */\r\n dropProps: DropTargetProps<DragDropObject>; // eslint-disable-line deprecation/deprecation\r\n /** Whether to propagate to parent DropTargets. */\r\n shallow?: boolean;\r\n /** Style properties for dropTarget wrapper element */\r\n dropStyle?: React.CSSProperties;\r\n\r\n /** @internal */\r\n connectDropTarget?: ConnectDropTarget;\r\n /** @internal */\r\n isOver?: boolean;\r\n /** @internal */\r\n canDrop?: boolean;\r\n /** @internal */\r\n item?: DragDropObject;\r\n /** @internal */\r\n type?: string | symbol;\r\n}\r\n\r\n/**\r\n * HOC (Higher-Order Component) that transforms wrapped component into a DropTarget.\r\n * @param Component component to wrap.\r\n * @beta\r\n * @deprecated\r\n */\r\n// istanbul ignore next\r\nexport const withDropTarget = <ComponentProps extends {}, DragDropObject = any>(\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n Component: React.ComponentType<ComponentProps>,\r\n): DndComponentClass<typeof React.Component, ComponentProps & WithDropTargetProps<DragDropObject>> => { // eslint-disable-line deprecation/deprecation\r\n type Props = ComponentProps & WithDropTargetProps<DragDropObject>; // eslint-disable-line deprecation/deprecation\r\n return DropTarget((props: Props): Array<string | symbol> => {\r\n if (props.dropProps.objectTypes) {\r\n if (typeof props.dropProps.objectTypes === \"function\")\r\n return props.dropProps.objectTypes();\r\n else\r\n return props.dropProps.objectTypes;\r\n }\r\n return [];\r\n }, {\r\n drop(props, monitor, component) {\r\n const dragSourceArgs = monitor.getItem() as DragSourceArguments<DragDropObject>; // eslint-disable-line deprecation/deprecation\r\n if (monitor.isOver({ shallow: props.shallow || false })) {\r\n let dropRect: DOMRect = new DOMRect();\r\n const componentElement = component.rootElement;\r\n if (componentElement) {\r\n dropRect = componentElement.getBoundingClientRect();\r\n }\r\n\r\n const clientOffset = monitor.getClientOffset() || dragSourceArgs.clientOffset;\r\n const initialClientOffset = monitor.getInitialClientOffset() || dragSourceArgs.initialClientOffset;\r\n const sourceClientOffset = monitor.getSourceClientOffset() || dragSourceArgs.sourceClientOffset;\r\n const initialSourceClientOffset = monitor.getInitialSourceClientOffset() || dragSourceArgs.initialSourceClientOffset;\r\n\r\n const dropTargetArgs: DropTargetArguments<DragDropObject> = { // eslint-disable-line deprecation/deprecation\r\n ...dragSourceArgs,\r\n row: undefined, // clear stale row/col values to be set while propagating back down\r\n col: undefined,\r\n dropRect,\r\n clientOffset,\r\n initialClientOffset,\r\n sourceClientOffset,\r\n initialSourceClientOffset,\r\n };\r\n if (props.dropProps.onDropTargetDrop)\r\n return props.dropProps.onDropTargetDrop(dropTargetArgs);\r\n }\r\n return;\r\n },\r\n hover(props, monitor, component) {\r\n if (monitor.isOver({ shallow: props.shallow || false }) && props.dropProps.onDropTargetOver) {\r\n const dragSourceArgs = monitor.getItem() as DragSourceArguments<DragDropObject>; // eslint-disable-line deprecation/deprecation\r\n let dropRect: DOMRect = new DOMRect();\r\n const componentElement = component.rootElement;\r\n if (componentElement) {\r\n dropRect = componentElement.getBoundingClientRect();\r\n }\r\n\r\n const clientOffset = monitor.getClientOffset() || dragSourceArgs.clientOffset;\r\n const initialClientOffset = monitor.getInitialClientOffset() || dragSourceArgs.initialClientOffset;\r\n const sourceClientOffset = monitor.getSourceClientOffset() || dragSourceArgs.sourceClientOffset;\r\n const initialSourceClientOffset = monitor.getInitialSourceClientOffset() || dragSourceArgs.initialSourceClientOffset;\r\n\r\n const dropTargetArgs: DropTargetArguments<DragDropObject> = { // eslint-disable-line deprecation/deprecation\r\n ...dragSourceArgs,\r\n row: undefined, // clear stale row/col values to be set while propagating back down\r\n col: undefined,\r\n dropRect,\r\n clientOffset,\r\n initialClientOffset,\r\n sourceClientOffset,\r\n initialSourceClientOffset,\r\n };\r\n props.dropProps.onDropTargetOver(dropTargetArgs);\r\n }\r\n },\r\n canDrop(props, monitor) {\r\n if (monitor.isOver({ shallow: props.shallow || false }) && props.dropProps.canDropTargetDrop) {\r\n const dragSourceArgs = monitor.getItem() as DragSourceArguments<DragDropObject>; // eslint-disable-line deprecation/deprecation\r\n const clientOffset = monitor.getClientOffset() || dragSourceArgs.clientOffset;\r\n const initialClientOffset = monitor.getInitialClientOffset() || dragSourceArgs.initialClientOffset;\r\n const sourceClientOffset = monitor.getSourceClientOffset() || dragSourceArgs.sourceClientOffset;\r\n const initialSourceClientOffset = monitor.getInitialSourceClientOffset() || dragSourceArgs.initialSourceClientOffset;\r\n\r\n const dropTargetArgs: DropTargetArguments<DragDropObject> = { // eslint-disable-line deprecation/deprecation\r\n ...dragSourceArgs,\r\n clientOffset,\r\n initialClientOffset,\r\n sourceClientOffset,\r\n initialSourceClientOffset,\r\n };\r\n return props.dropProps.canDropTargetDrop(dropTargetArgs);\r\n }\r\n return true;\r\n },\r\n }, (connect, monitor) => {\r\n return {\r\n connectDropTarget: connect.dropTarget(),\r\n isOver: monitor.isOver({ shallow: true }),\r\n canDrop: monitor.canDrop(),\r\n item: monitor.getItem(),\r\n type: monitor.getItemType() || undefined,\r\n };\r\n })(class WithDropTarget extends React.Component<any> {\r\n public rootElement: HTMLDivElement | null = null;\r\n public override render() {\r\n const {\r\n dropProps, shallow, // eslint-disable-line @typescript-eslint/no-unused-vars\r\n connectDropTarget,\r\n isOver, canDrop, item, type,\r\n dropStyle, // eslint-disable-line @typescript-eslint/no-unused-vars\r\n ...props } = this.props as WithDropTargetProps<DragDropObject>; // eslint-disable-line deprecation/deprecation\r\n\r\n const p = {\r\n item,\r\n type,\r\n isOver,\r\n canDrop,\r\n };\r\n return connectDropTarget!(\r\n <div className=\"drop-target-wrapper\" data-testid=\"drop-target-wrapper\" ref={(el) => { this.rootElement = el; }} style={this.props.dropStyle}>\r\n <Component {...props} {...(p as any)} />\r\n </div>,\r\n );\r\n }\r\n }) as any;\r\n};\r\n"]}
|
|
1
|
+
{"version":3,"file":"withDropTarget.js","sourceRoot":"","sources":["../../../../../../src/components-react/table/component/dragdrop/withDropTarget.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AACH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAwC,UAAU,EAAE,MAAM,WAAW,CAAC;AA2B7E;;;;;GAKG;AACH,uBAAuB;AACvB,MAAM,CAAC,MAAM,cAAc,GAAG;AAC5B,gEAAgE;AAChE,SAA8C,EACmD,EAAE;IAEnG,OAAO,UAAU,CAAC,CAAC,KAAY,EAA0B,EAAE;QACzD,IAAI,KAAK,CAAC,SAAS,CAAC,WAAW,EAAE;YAC/B,IAAI,OAAO,KAAK,CAAC,SAAS,CAAC,WAAW,KAAK,UAAU;gBACnD,OAAO,KAAK,CAAC,SAAS,CAAC,WAAW,EAAE,CAAC;;gBAErC,OAAO,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC;SAC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AAG;gBACR,IAAI;gBACJ,IAAI;gBACJ,MAAM;gBACN,OAAO;aACR,CAAC;YACF,OAAO,iBAAkB,CACvB,6BAAK,SAAS,EAAC,qBAAqB,iBAAa,qBAAqB,EAAC,GAAG,EAAE,CAAC,EAAE,EAAE,EAAE,GAAG,IAAI,CAAC,WAAW,GAAG,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,SAAS;gBACzI,oBAAC,SAAS,OAAK,KAAK,KAAO,CAAS,GAAI,CACpC,CACP,CAAC;QACJ,CAAC;KACF,CAAQ,CAAC;AACZ,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 DragDrop\r\n */\r\nimport * as React from \"react\";\r\nimport { ConnectDropTarget, DndComponentClass, DropTarget } from \"react-dnd\";\r\nimport { DragSourceArguments, DropTargetArguments, DropTargetProps } from \"./DragDropDef\";\r\n\r\n/** React properties for withDropTarget Higher-Order Component\r\n * @beta\r\n * @deprecated in 2.x.\r\n */\r\nexport interface WithDropTargetProps<DragDropObject = any> {\r\n /** Properties and callbacks for DropTarget */\r\n dropProps: DropTargetProps<DragDropObject>; // eslint-disable-line deprecation/deprecation\r\n /** Whether to propagate to parent DropTargets. */\r\n shallow?: boolean;\r\n /** Style properties for dropTarget wrapper element */\r\n dropStyle?: React.CSSProperties;\r\n\r\n /** @internal */\r\n connectDropTarget?: ConnectDropTarget;\r\n /** @internal */\r\n isOver?: boolean;\r\n /** @internal */\r\n canDrop?: boolean;\r\n /** @internal */\r\n item?: DragDropObject;\r\n /** @internal */\r\n type?: string | symbol;\r\n}\r\n\r\n/**\r\n * HOC (Higher-Order Component) that transforms wrapped component into a DropTarget.\r\n * @param Component component to wrap.\r\n * @beta\r\n * @deprecated in 2.x.\r\n */\r\n// istanbul ignore next\r\nexport const withDropTarget = <ComponentProps extends {}, DragDropObject = any>(\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n Component: React.ComponentType<ComponentProps>,\r\n): DndComponentClass<typeof React.Component, ComponentProps & WithDropTargetProps<DragDropObject>> => { // eslint-disable-line deprecation/deprecation\r\n type Props = ComponentProps & WithDropTargetProps<DragDropObject>; // eslint-disable-line deprecation/deprecation\r\n return DropTarget((props: Props): Array<string | symbol> => {\r\n if (props.dropProps.objectTypes) {\r\n if (typeof props.dropProps.objectTypes === \"function\")\r\n return props.dropProps.objectTypes();\r\n else\r\n return props.dropProps.objectTypes;\r\n }\r\n return [];\r\n }, {\r\n drop(props, monitor, component) {\r\n const dragSourceArgs = monitor.getItem() as DragSourceArguments<DragDropObject>; // eslint-disable-line deprecation/deprecation\r\n if (monitor.isOver({ shallow: props.shallow || false })) {\r\n let dropRect: DOMRect = new DOMRect();\r\n const componentElement = component.rootElement;\r\n if (componentElement) {\r\n dropRect = componentElement.getBoundingClientRect();\r\n }\r\n\r\n const clientOffset = monitor.getClientOffset() || dragSourceArgs.clientOffset;\r\n const initialClientOffset = monitor.getInitialClientOffset() || dragSourceArgs.initialClientOffset;\r\n const sourceClientOffset = monitor.getSourceClientOffset() || dragSourceArgs.sourceClientOffset;\r\n const initialSourceClientOffset = monitor.getInitialSourceClientOffset() || dragSourceArgs.initialSourceClientOffset;\r\n\r\n const dropTargetArgs: DropTargetArguments<DragDropObject> = { // eslint-disable-line deprecation/deprecation\r\n ...dragSourceArgs,\r\n row: undefined, // clear stale row/col values to be set while propagating back down\r\n col: undefined,\r\n dropRect,\r\n clientOffset,\r\n initialClientOffset,\r\n sourceClientOffset,\r\n initialSourceClientOffset,\r\n };\r\n if (props.dropProps.onDropTargetDrop)\r\n return props.dropProps.onDropTargetDrop(dropTargetArgs);\r\n }\r\n return;\r\n },\r\n hover(props, monitor, component) {\r\n if (monitor.isOver({ shallow: props.shallow || false }) && props.dropProps.onDropTargetOver) {\r\n const dragSourceArgs = monitor.getItem() as DragSourceArguments<DragDropObject>; // eslint-disable-line deprecation/deprecation\r\n let dropRect: DOMRect = new DOMRect();\r\n const componentElement = component.rootElement;\r\n if (componentElement) {\r\n dropRect = componentElement.getBoundingClientRect();\r\n }\r\n\r\n const clientOffset = monitor.getClientOffset() || dragSourceArgs.clientOffset;\r\n const initialClientOffset = monitor.getInitialClientOffset() || dragSourceArgs.initialClientOffset;\r\n const sourceClientOffset = monitor.getSourceClientOffset() || dragSourceArgs.sourceClientOffset;\r\n const initialSourceClientOffset = monitor.getInitialSourceClientOffset() || dragSourceArgs.initialSourceClientOffset;\r\n\r\n const dropTargetArgs: DropTargetArguments<DragDropObject> = { // eslint-disable-line deprecation/deprecation\r\n ...dragSourceArgs,\r\n row: undefined, // clear stale row/col values to be set while propagating back down\r\n col: undefined,\r\n dropRect,\r\n clientOffset,\r\n initialClientOffset,\r\n sourceClientOffset,\r\n initialSourceClientOffset,\r\n };\r\n props.dropProps.onDropTargetOver(dropTargetArgs);\r\n }\r\n },\r\n canDrop(props, monitor) {\r\n if (monitor.isOver({ shallow: props.shallow || false }) && props.dropProps.canDropTargetDrop) {\r\n const dragSourceArgs = monitor.getItem() as DragSourceArguments<DragDropObject>; // eslint-disable-line deprecation/deprecation\r\n const clientOffset = monitor.getClientOffset() || dragSourceArgs.clientOffset;\r\n const initialClientOffset = monitor.getInitialClientOffset() || dragSourceArgs.initialClientOffset;\r\n const sourceClientOffset = monitor.getSourceClientOffset() || dragSourceArgs.sourceClientOffset;\r\n const initialSourceClientOffset = monitor.getInitialSourceClientOffset() || dragSourceArgs.initialSourceClientOffset;\r\n\r\n const dropTargetArgs: DropTargetArguments<DragDropObject> = { // eslint-disable-line deprecation/deprecation\r\n ...dragSourceArgs,\r\n clientOffset,\r\n initialClientOffset,\r\n sourceClientOffset,\r\n initialSourceClientOffset,\r\n };\r\n return props.dropProps.canDropTargetDrop(dropTargetArgs);\r\n }\r\n return true;\r\n },\r\n }, (connect, monitor) => {\r\n return {\r\n connectDropTarget: connect.dropTarget(),\r\n isOver: monitor.isOver({ shallow: true }),\r\n canDrop: monitor.canDrop(),\r\n item: monitor.getItem(),\r\n type: monitor.getItemType() || undefined,\r\n };\r\n })(class WithDropTarget extends React.Component<any> {\r\n public rootElement: HTMLDivElement | null = null;\r\n public override render() {\r\n const {\r\n dropProps, shallow, // eslint-disable-line @typescript-eslint/no-unused-vars\r\n connectDropTarget,\r\n isOver, canDrop, item, type,\r\n dropStyle, // eslint-disable-line @typescript-eslint/no-unused-vars\r\n ...props } = this.props as WithDropTargetProps<DragDropObject>; // eslint-disable-line deprecation/deprecation\r\n\r\n const p = {\r\n item,\r\n type,\r\n isOver,\r\n canDrop,\r\n };\r\n return connectDropTarget!(\r\n <div className=\"drop-target-wrapper\" data-testid=\"drop-target-wrapper\" ref={(el) => { this.rootElement = el; }} style={this.props.dropStyle}>\r\n <Component {...props} {...(p as any)} />\r\n </div>,\r\n );\r\n }\r\n }) as any;\r\n};\r\n"]}
|
|
@@ -13,7 +13,7 @@ import { ToolbarOpacitySetting, ToolbarPanelAlignment } from "./ToolbarWithOverf
|
|
|
13
13
|
export interface ToolbarProps extends CommonProps, NoChildrenProps {
|
|
14
14
|
/** Describes to which direction the popup panels are expanded. Defaults to: [[Direction.Bottom]] */
|
|
15
15
|
expandsTo?: Direction;
|
|
16
|
-
/**
|
|
16
|
+
/** Definitions for items of the toolbar. Items are expected to be already sorted by group and item. */
|
|
17
17
|
items: CommonToolbarItem[];
|
|
18
18
|
/** Describes how expanded panels are aligned. Defaults to: [[ToolbarPanelAlignment.Start]] */
|
|
19
19
|
panelAlignment?: ToolbarPanelAlignment;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Toolbar.d.ts","sourceRoot":"","sources":["../../../../src/components-react/toolbar/Toolbar.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,gBAAgB,CAAC;AAExB,OAAO,KAAK,KAAK,MAAM,OAAO,C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EAC1B,IAAI,EAAC,cAAc;gBAEnB,oBAAC,YAAY,IACX,SAAS,EAAC,kBAAkB,EAC5B,SAAS,EAAE,SAAS,IAEnB,cAAc,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC,6BAAK,GAAG,EAAE,KAAK,EAAE,SAAS,EAAE,GAAG,gBAAgB,IAAI,mBAAmB,CAAC,KAAK,CAAC,EAAE,IAAG,KAAK,CAAO,CAAC,CACxH,CACX,CAEoB,CACgB,CACjD,CAAC;AACJ,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 \"./Toolbar.scss\";\r\nimport classnames from \"classnames\";\r\nimport * as React from \"react\";\r\nimport {\r\n CommonToolbarItem, OnItemExecutedFunc,\r\n} from \"@itwin/appui-abstract\";\r\nimport { CommonProps, NoChildrenProps } from \"@itwin/core-react\";\r\nimport { ToolbarItems } from \"./Items\";\r\nimport { Direction, OrthogonalDirection, OrthogonalDirectionHelpers } from \"./utilities/Direction\";\r\nimport { getToolbarDirection, ToolbarItemComponent, ToolbarItemContext, ToolbarOpacitySetting, ToolbarPanelAlignment, ToolbarWithOverflowDirectionContext } from \"./ToolbarWithOverflow\";\r\n\r\n/** Properties of [[Toolbar]] component.\r\n * @public\r\n */\r\nexport interface ToolbarProps extends CommonProps, NoChildrenProps {\r\n /** Describes to which direction the popup panels are expanded. Defaults to: [[Direction.Bottom]] */\r\n expandsTo?: Direction;\r\n /**
|
|
1
|
+
{"version":3,"file":"Toolbar.js","sourceRoot":"","sources":["../../../../src/components-react/toolbar/Toolbar.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,gBAAgB,CAAC;AACxB,OAAO,UAAU,MAAM,YAAY,CA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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 \"./Toolbar.scss\";\r\nimport classnames from \"classnames\";\r\nimport * as React from \"react\";\r\nimport {\r\n CommonToolbarItem, OnItemExecutedFunc,\r\n} from \"@itwin/appui-abstract\";\r\nimport { CommonProps, NoChildrenProps } from \"@itwin/core-react\";\r\nimport { ToolbarItems } from \"./Items\";\r\nimport { Direction, OrthogonalDirection, OrthogonalDirectionHelpers } from \"./utilities/Direction\";\r\nimport { getToolbarDirection, ToolbarItemComponent, ToolbarItemContext, ToolbarOpacitySetting, ToolbarPanelAlignment, ToolbarWithOverflowDirectionContext } from \"./ToolbarWithOverflow\";\r\n\r\n/** Properties of [[Toolbar]] component.\r\n * @public\r\n */\r\nexport interface ToolbarProps extends CommonProps, NoChildrenProps {\r\n /** Describes to which direction the popup panels are expanded. Defaults to: [[Direction.Bottom]] */\r\n expandsTo?: Direction;\r\n /** Definitions for items of the toolbar. Items are expected to be already sorted by group and item. */\r\n items: CommonToolbarItem[];\r\n /** Describes how expanded panels are aligned. Defaults to: [[ToolbarPanelAlignment.Start]] */\r\n panelAlignment?: ToolbarPanelAlignment;\r\n /** Use Drag Interaction to open popups with nest action buttons */\r\n useDragInteraction?: boolean;\r\n /** Determines whether to use mouse proximity to alter the opacity of the toolbar */\r\n toolbarOpacitySetting?: ToolbarOpacitySetting;\r\n /** Optional function to call on any item execution */\r\n onItemExecuted?: OnItemExecutedFunc;\r\n /** Optional function to call on any KeyDown events processed by toolbar */\r\n onKeyDown?: (e: React.KeyboardEvent) => void;\r\n}\r\n\r\nfunction getItemWrapperClass(child: React.ReactNode) {\r\n // istanbul ignore else\r\n if (React.isValidElement(child)) {\r\n if (child.props && child.props.addGroupSeparator)\r\n return \"components-toolbar-button-add-gap-before\";\r\n }\r\n return \"\";\r\n}\r\n\r\n/** Component that displays tool settings as a bar across the top of the content view.\r\n * @public\r\n */\r\nexport function Toolbar(props: ToolbarProps) {\r\n const expandsTo = props.expandsTo ? props.expandsTo : Direction.Bottom;\r\n const useDragInteraction = !!props.useDragInteraction;\r\n const panelAlignment = props.panelAlignment ? props.panelAlignment : ToolbarPanelAlignment.Start;\r\n const [popupPanelCount, setPopupPanelCount] = React.useState(0);\r\n\r\n const handlePopupPanelOpenClose = React.useCallback((isOpening: boolean) => {\r\n // use setTimeout to avoid warning about setting state in Toolbar from render method of PopupItem/PopupItemWithDrag\r\n setTimeout(() => {\r\n setPopupPanelCount((prev) => {\r\n const nextCount = isOpening ? (prev + 1) : (prev - 1);\r\n // eslint-disable-next-line no-console\r\n // console.log(`new popup count = ${nextCount}`);\r\n return nextCount < 0 ? /* istanbul ignore next */ 0 : nextCount;\r\n });\r\n });\r\n }, []);\r\n\r\n const availableNodes = React.useMemo<React.ReactNode[]>(() => {\r\n return props.items.map((item, index) => {\r\n let addGroupSeparator = false;\r\n if (index > 0)\r\n addGroupSeparator = item.groupPriority !== props.items[index - 1].groupPriority;\r\n return (\r\n <ToolbarItemComponent\r\n key={item.id}\r\n item={item}\r\n addGroupSeparator={!!addGroupSeparator}\r\n />\r\n );\r\n });\r\n }, [props.items]);\r\n\r\n const direction = getToolbarDirection(expandsTo);\r\n const className = classnames(\r\n \"components-toolbar-overflow-sizer\",\r\n OrthogonalDirectionHelpers.getCssClassName(direction),\r\n props.className);\r\n\r\n // needed to construct DOM structure identical to ToolbarWithOverflow so same css can be applied.\r\n const wrapperClassName = classnames(\r\n \"components-toolbar-item-container\",\r\n OrthogonalDirectionHelpers.getCssClassName(direction),\r\n );\r\n\r\n return (\r\n <ToolbarWithOverflowDirectionContext.Provider value={\r\n {\r\n expandsTo, direction, overflowExpandsTo: Direction.Right, panelAlignment, useDragInteraction,\r\n toolbarOpacitySetting: props.toolbarOpacitySetting ? props.toolbarOpacitySetting : ToolbarOpacitySetting.Proximity,\r\n overflowDirection: OrthogonalDirection.Horizontal,\r\n openPopupCount: popupPanelCount, onPopupPanelOpenClose: handlePopupPanelOpenClose, overflowDisplayActive: false,\r\n onItemExecuted: props.onItemExecuted ? props.onItemExecuted : /* istanbul ignore next */ () => { },\r\n onKeyDown: props.onKeyDown ? props.onKeyDown : /* istanbul ignore next */ (_e: React.KeyboardEvent) => { },\r\n }\r\n }>\r\n <ToolbarItemContext.Provider\r\n value={{\r\n hasOverflow: false,\r\n useHeight: false,\r\n onResize: /* istanbul ignore next */ () => { },\r\n }}\r\n >\r\n {(availableNodes.length > 0) &&\r\n <div\r\n className={className}\r\n style={props.style}\r\n onKeyDown={props.onKeyDown}\r\n role=\"presentation\"\r\n >\r\n <ToolbarItems\r\n className=\"components-items\"\r\n direction={direction}\r\n >\r\n {availableNodes.map((child, index) => <div key={index} className={`${wrapperClassName} ${getItemWrapperClass(child)}`}>{child}</div>)}\r\n </ToolbarItems>\r\n </div>\r\n }\r\n </ToolbarItemContext.Provider>\r\n </ToolbarWithOverflowDirectionContext.Provider >\r\n );\r\n}\r\n"]}
|