Kepler.gl is a powerful open source geospatial analysis tool for large-scale data sets.
chore: Child support and type exports for FeatureActionPanel (#2070)
Igor Dykhta217b89e7aadf
diff --git a/src/components/src/common/action-panel.tsx b/src/components/src/common/action-panel.tsxindex 6fdab5697..97b6df8b7 100644--- a/src/components/src/common/action-panel.tsx+++ b/src/components/src/common/action-panel.tsx@@ -112,6 +112,7 @@ const StyledCheckedbox = styled(Checkbox)``;const renderChildren = (child: ReactNode, index: number) =>+ child &&React.isValidElement<any>(child) &&React.cloneElement(child, {onClick: () => {diff --git a/src/components/src/editor/feature-action-panel.tsx b/src/components/src/editor/feature-action-panel.tsxindex 42c6aa9e3..fb871bf47 100644--- a/src/components/src/editor/feature-action-panel.tsx+++ b/src/components/src/editor/feature-action-panel.tsx@@ -53,9 +53,10 @@ export interface FeatureActionPanelProps {} | null;layers: Layer[];currentFilter?: Filter;- onToggleLayer: (l: Layer) => void;+ onToggleLayer: (layer: Layer) => void;onDeleteFeature: () => void;- onClose: () => void;+ onClose?: () => void;+ children?: React.ReactNode;}export function PureFeatureActionPanelFactory(): React.FC<FeatureActionPanelProps> {@@ -67,7 +68,8 @@ export function PureFeatureActionPanelFactory(): React.FC<FeatureActionPanelProplayers,currentFilter,onToggleLayer,- onDeleteFeature+ onDeleteFeature,+ children}: FeatureActionPanelProps) => {const [copied, setCopied] = useState(false);const {layerId = []} = currentFilter || {};@@ -128,6 +130,7 @@ export function PureFeatureActionPanelFactory(): React.FC<FeatureActionPanelPropIcon={copied ? Checkmark : Copy}onClick={copyGeometry}/>+ {children}<ActionPanelItemlabel={intl.formatMessage({id: 'tooltip.delete', defaultMessage: 'Delete'})}className="delete-panel-item"