import PropTypes from 'prop-types';
import { ADD_CHICKLET } from '../../constants';

export const dProps = {
  selectBehavior: ADD_CHICKLET,
  isDisabled: false,
  autoComplete: {
    pageRows: 10,
  },
  events: {},
  chicklets: {
    sortable: false,
    fullwidth: false,
    insertAtBeginning: false,
    buttons: {
      ascDesc: { visible: false },
      info: { visible: false },
      remove: { visible: true },
    },
    events: {},
    container: { visible: true },
    clearAll: { visible: true },
  },
};

export const pTypes = {
  theme: PropTypes.oneOfType([
    PropTypes.object,
    PropTypes.func,
  ]),
  itemHandler: PropTypes.func,
  selectBehavior: PropTypes.string,
  kdFilterModel: PropTypes.object,
  valuesLimit: PropTypes.number,

  events: PropTypes.shape({
    onSelect: PropTypes.func,
    onChange: PropTypes.func,
  }),

  mainSelector: PropTypes.shape({
    visible: PropTypes.bool,
    selected: PropTypes.string,
  }),

  chicklets: PropTypes.shape({
    sortable: PropTypes.bool,
    fullwidth: PropTypes.bool,
    insertAtBeginning: PropTypes.bool,
    prefix: PropTypes.string,
    labelHandler: PropTypes.func,
    buttons: PropTypes.shape({
      ascDesc: PropTypes.shape({ visible: PropTypes.bool }),
      info: PropTypes.shape({ visible: PropTypes.bool }),
      remove: PropTypes.shape({ visible: PropTypes.bool }),
    }),

    events: PropTypes.shape({
      onClick: PropTypes.func,
      onClose: PropTypes.func,
      onDrop: PropTypes.func,
    }),

    container: PropTypes.shape({
      visible: PropTypes.bool,
    }),

    clearAll: PropTypes.shape({
      visible: PropTypes.bool,
      label: PropTypes.string,
      onClick: PropTypes.func,
    }),
  }),
};
