msyavuz commented on code in PR #34507:
URL: https://github.com/apache/superset/pull/34507#discussion_r2252015958
##########
superset-frontend/packages/superset-ui-core/src/components/DropdownContainer/index.tsx:
##########
@@ -17,96 +17,23 @@
* under the License.
*/
import {
- CSSProperties,
cloneElement,
forwardRef,
- ReactElement,
RefObject,
useEffect,
useImperativeHandle,
useLayoutEffect,
useMemo,
useState,
useRef,
- ReactNode,
useCallback,
} from 'react';
import { Global } from '@emotion/react';
import { css, t, useTheme, usePrevious } from '@superset-ui/core';
import { useResizeDetector } from 'react-resize-detector';
import { Badge, Icons, Button, Tooltip, Popover } from '..';
-/**
- * Container item.
- */
-export interface DropdownItem {
- /**
- * String that uniquely identifies the item.
- */
- id: string;
- /**
- * The element to be rendered.
- */
- element: ReactElement;
-}
-
-/**
- * Horizontal container that displays overflowed items in a dropdown.
- * It shows an indicator of how many items are currently overflowing.
- */
-export interface DropdownContainerProps {
- /**
- * Array of items. The id property is used to uniquely identify
- * the elements when rendering or dealing with event handlers.
- */
- items: DropdownItem[];
- /**
- * Event handler called every time an element moves between
- * main container and dropdown.
- */
- onOverflowingStateChange?: (overflowingState: {
- notOverflowed: string[];
- overflowed: string[];
- }) => void;
- /**
- * Option to customize the content of the dropdown.
- */
- dropdownContent?: (overflowedItems: DropdownItem[]) => ReactElement;
- /**
- * Dropdown ref.
- */
- dropdownRef?: RefObject<HTMLDivElement>;
- /**
- * Dropdown additional style properties.
- */
- dropdownStyle?: CSSProperties;
- /**
- * Displayed count in the dropdown trigger.
- */
- dropdownTriggerCount?: number;
- /**
- * Icon of the dropdown trigger.
- */
- dropdownTriggerIcon?: ReactElement;
- /**
- * Text of the dropdown trigger.
- */
- dropdownTriggerText?: string;
- /**
- * Text of the dropdown trigger tooltip
- */
- dropdownTriggerTooltip?: ReactNode | null;
- /**
- * Main container additional style properties.
- */
- style?: CSSProperties;
- /**
- * Force render popover content before it's first opened
- */
- forceRender?: boolean;
-}
-
-export type DropdownRef = HTMLDivElement & { open: () => void };
Review Comment:
Bycatch: these types were duplicated for some reason in here and in types
file
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]