wix-style-react
Version:
wix-style-react
65 lines • 2.82 kB
TypeScript
export default Breadcrumbs;
/**
* a way to visualise current navigation path
*/
declare class Breadcrumbs extends React.PureComponent<any, any, any> {
static displayName: string;
static propTypes: {
/** Describes each breadcrumbs item:
* - `id` (required) - gives an item numeric identifier
* - `value` (required) - sets the item label to be shown on breadcrumbs
* - `link` - stores a link which user is directed to after clicking on an item
* - `customElement` - contains and renders a custom component or `<a>` link instead of an item value
* - `disabled` - disables an item
*/
items: PropTypes.Validator<(PropTypes.InferProps<{
id: PropTypes.Validator<NonNullable<NonNullable<string | number | null | undefined>>>;
value: PropTypes.Validator<NonNullable<PropTypes.ReactNodeLike>>;
link: PropTypes.Requireable<string>;
customElement: PropTypes.Requireable<any>;
disabled: PropTypes.Requireable<boolean>;
}> | null | undefined)[]>;
/** Defines a function which is called when a user clicks on an item */
onClick: PropTypes.Requireable<(...args: any[]) => any>;
/** Defines which breadcrumbs item is currently active */
activeId: PropTypes.Requireable<NonNullable<string | number | null | undefined>>;
/** Controls the component size */
size: PropTypes.Requireable<string>;
/** Sets the maximum width of each item value in px. Longer items get truncated with ellipsis. */
itemMaxWidth: PropTypes.Requireable<NonNullable<string | number | null | undefined>>;
/** Controls the component appearance */
theme: PropTypes.Requireable<string>;
/** Applies a data-hook HTML attribute to be used in the tests */
dataHook: PropTypes.Requireable<string>;
};
static defaultProps: {
size: string;
theme: string;
itemMaxWidth: string;
onClick: () => void;
};
constructor(props: any);
constructor(props: any, context: any);
_createItem({ item, isActive, onClick, maxWidth, id }: {
item: any;
isActive: any;
onClick: any;
maxWidth: any;
id: any;
}): React.JSX.Element;
_getIsActive: (item: any) => boolean;
_handleItemClick: (item: any) => () => any;
_getItemWrapperDataAttributes: ({ position, item }: {
position: any;
item: any;
}) => {
[DATA_ATTRIBUTES.DATA_ACTIVE]: boolean;
[DATA_ATTRIBUTES.DATA_POSITION_ID]: any;
'data-hook': string;
};
render(): React.JSX.Element;
}
import React from 'react';
import { DATA_ATTRIBUTES } from './constnats';
import PropTypes from 'prop-types';
//# sourceMappingURL=Breadcrumbs.d.ts.map