wix-style-react
Version:
wix-style-react
59 lines • 2.33 kB
TypeScript
export default EditableSelector;
declare class EditableSelector extends React.PureComponent<any, any, any> {
static propTypes: {
/** Applied as data-hook HTML attribute that can be used in the tests */
dataHook: PropTypes.Requireable<string>;
/** The editable selector's title */
title: PropTypes.Requireable<string>;
/** Specifies the type of the toggle */
toggleType: PropTypes.Requireable<string>;
/** Text for the add new row button */
newRowLabel: PropTypes.Requireable<string>;
/** Text for the edit button */
editButtonText: PropTypes.Requireable<string>;
/** New option added callback function */
onOptionAdded: PropTypes.Requireable<(...args: any[]) => any>;
/** Option edited callback function */
onOptionEdit: PropTypes.Requireable<(...args: any[]) => any>;
/** Option deleted callback function */
onOptionDelete: PropTypes.Requireable<(...args: any[]) => any>;
/** Option toggled callback function */
onOptionToggle: PropTypes.Requireable<(...args: any[]) => any>;
/** Array of objects:
* * `title` - the title of the option.
* * `isSelected` - whether this option is selected or not.
*/
options: PropTypes.Requireable<(PropTypes.InferProps<{
title: PropTypes.Validator<string>;
isSelected: PropTypes.Requireable<boolean>;
}> | null | undefined)[]>;
};
static defaultProps: {
toggleType: string;
newRowLabel: string;
editButtonText: string;
};
constructor(props: any);
constructor(props: any, context: any);
state: {
addingNewRow: boolean;
editingRow: null;
};
_addNewRow: () => void;
_editItem: (index: any) => void;
_deleteItem: (index: any) => void;
_onNewOptionApprove: ({ newTitle, index }: {
newTitle: any;
index: any;
}) => void;
_onNewOptionCancel: () => void;
_onOptionToggle: (id: any) => void;
_renderInput: (title: any, index: any) => React.JSX.Element;
render(): React.JSX.Element;
}
declare namespace EditableSelector {
let displayName: string;
}
import React from 'react';
import PropTypes from 'prop-types';
//# sourceMappingURL=EditableSelector.d.ts.map