import { ADD_CHICKLET } from '../../constants';
import { PropTypes } from 'react';

export const dProps = {
  theme: {},
  selectBehavior: ADD_CHICKLET,
  isDisabled: false,
  api: {
    pageRows: 10,
  },
  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,

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

  api: PropTypes.shape({
    url: PropTypes.string,
    key: PropTypes.string,
    pageRows: PropTypes.number,
  }),

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

    optionValues: PropTypes.shape({
      selectOption: PropTypes.shape({
        visible: PropTypes.bool,
        label: PropTypes.string,
      }),
      anyOption: PropTypes.shape({
        visible: PropTypes.bool,
        label: PropTypes.string,
      }),
      customOptions: PropTypes.array,
      userSpecifiedOption: PropTypes.shape({
        visible: PropTypes.bool,
        label: 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 }),
    }),

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

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

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