@carbon/ibm-products
Version:
Carbon for IBM Products
84 lines • 3.06 kB
TypeScript
/**
* Copyright IBM Corp. 2024
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/
import React, { PropsWithChildren, ReactNode, Ref } from 'react';
import PropTypes from 'prop-types';
import { CarbonIconType } from '@carbon/react/icons';
import { Condition, Action, Option, ConfigType } from '../ConditionBuilder.types';
interface ConditionBuilderItemProps extends PropsWithChildren {
className?: string;
label?: string | Option | Option[];
renderIcon?: CarbonIconType;
title?: string;
showToolTip?: boolean;
popOverClassName?: string;
type?: string;
description?: string;
condition?: Action & Condition;
config?: ConfigType;
renderChildren?: (ref: Ref<HTMLDivElement | null>, closePopover: () => void) => ReactNode;
onChange?: (val: string) => void;
tabIndex?: number;
onMouseEnter?: (e: React.MouseEvent<HTMLButtonElement>) => void;
onMouseLeave?: (e: React.MouseEvent<HTMLButtonElement>) => void;
onFocus?: React.FocusEventHandler<HTMLButtonElement>;
onBlur?: React.FocusEventHandler<HTMLButtonElement>;
}
export declare const ConditionBuilderItem: {
({ children, className, label, renderIcon, title, type, showToolTip, condition, popOverClassName, config, renderChildren, onChange, description, ...rest }: ConditionBuilderItemProps): React.JSX.Element;
propTypes: {
/**
* provide the contents of the popover
*/
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
/**
* Provide an optional class to be applied to the containing node.
*/
className: PropTypes.Requireable<string>;
/**
* current condition state object
*/
condition: PropTypes.Requireable<object>;
/**
* this is the config object again the current property from inputConfig
*/
config: PropTypes.Requireable<object>;
/**
* text to be displayed in the field
*/
label: PropTypes.Requireable<NonNullable<string | object>>;
/**
* callback to update the current condition of the state tree
*/
onChange: PropTypes.Requireable<(...args: any[]) => any>;
/**
* class name for popover
*/
popOverClassName: PropTypes.Requireable<string>;
/**
* callback prop that returns the jsx for children
*/
renderChildren: PropTypes.Requireable<(...args: any[]) => any>;
/**
* Optional prop to allow overriding the icon rendering.
*/
renderIcon: PropTypes.Requireable<object>;
/**
* show tool tip
*/
showToolTip: PropTypes.Requireable<boolean>;
/**
* title of the popover
*/
title: PropTypes.Requireable<string>;
/**
* input type
*/
type: PropTypes.Requireable<string>;
};
};
export {};
//# sourceMappingURL=ConditionBuilderItem.d.ts.map