How to use the searchkit.SearchkitComponent.translationsPropType function in searchkit

To help you get started, we’ve selected a few searchkit examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github searchkit / searchkit-demo / src / app / src / playground / components / Pagination.tsx View on Github external
pageScope?: number // Number of page to show before/after the current number
  listComponent?: any
}

export class Pagination extends SearchkitComponent {
  accessor:PaginationAccessor


  static translations:any = {
    "pagination.previous":"Previous",
    "pagination.next":"Next"
  }
  translations = Pagination.translations

  static propTypes = defaults({
    translations:SearchkitComponent.translationsPropType(
      Pagination.translations
    ),
    showNumbers:React.PropTypes.bool,
    pageScope: React.PropTypes.number,
    listComponent: React.PropTypes.any,
  }, SearchkitComponent.propTypes)

  static defaultProps = {
    listComponent: Toggle
  }

  defineAccessor() {
    return new PaginationAccessor("p")
  }

  getCurrentPage():number {
github searchkit / searchkit-demo / src / app / src / playground / components / RefinementListFilter.tsx View on Github external
include?: Array | string
  exclude?: Array | string
  collapsable?: boolean
  showCount?: boolean
}

export class RefinementListFilter extends SearchkitComponent {
  accessor: FacetAccessor

  static propTypes = defaults({
    field: React.PropTypes.string.isRequired,
    operator: React.PropTypes.oneOf(["AND", "OR"]),
    size: React.PropTypes.number,
    title: React.PropTypes.string.isRequired,
    id: React.PropTypes.string.isRequired,
    translations: SearchkitComponent.translationsPropType(
        FacetAccessor.translations
    ),
    orderKey: React.PropTypes.string,
    orderDirection: React.PropTypes.oneOf(["asc", "desc"]),
    include: React.PropTypes.oneOfType([
        React.PropTypes.string, React.PropTypes.array
    ]),
    exclude: React.PropTypes.oneOfType([
        React.PropTypes.string, React.PropTypes.array
    ]),
    collapsable: React.PropTypes.bool,
    showCount: React.PropTypes.bool,
  }, SearchkitComponent.propTypes)

  static defaultProps = {
    listComponent: CheckboxItemList,
github CRUKorg / cruk-searchkit / src / components / display / no-results / CRUKSearchkitNoResults.jsx View on Github external
'NoHits.SearchWithoutFilters': 'Search for {query} without filters',
    'NoHits.Error': "Sorry, we're having technical issues. Please check your internet connection and try again.",
    'NoHits.ResetSearch': 'Reset Search'
  }

  translations = CRUKSearchkitNoResults.translations

  static propTypes = defaults({
    suggestionsField:React.PropTypes.string,
    errorComponent: React.PropTypes.func,
    component: React.PropTypes.func,
    noResultsLabel: React.PropTypes.object,
    noResultsTitle: React.PropTypes.string,
    noResultsBody: React.PropTypes.object,
    errorMessage: React.PropTypes.string,
    translations:SearchkitComponent.translationsPropType(
      CRUKSearchkitNoResults.translations
    )
  }, SearchkitComponent.propTypes)

  static defaultProps = {
    errorComponent: CRUKSearchkitNoResultsErrorDisplay,
    component: CRUKSearchkitNoResultsDisplay
  }

  componentWillMount(){
    super.componentWillMount()
    this.noFiltersAccessor = this.searchkit.addAccessor(
      new NoFiltersHitCountAccessor()
    )
    if(this.props.suggestionsField){
      this.suggestionsAccessor = this.searchkit.addAccessor(
github searchkit / searchkit-demo / src / app / src / playground / components / CheckboxFilter.tsx View on Github external
label: string
  containerComponent?: ReactComponentType
  listComponent?: ReactComponentType
  collapsable?: boolean
  showCount?: boolean
}

export class CheckboxFilter extends SearchkitComponent {
  accessor: CheckboxFilterAccessor

  static propTypes = defaults({
    id: React.PropTypes.string.isRequired,
    title: React.PropTypes.string.isRequired,
    label: React.PropTypes.string.isRequired,
    filter: React.PropTypes.object.isRequired,
    translations: SearchkitComponent.translationsPropType(
        CheckboxFilterAccessor.translations
    ),
    collapsable: React.PropTypes.bool,
    showCount: React.PropTypes.bool,
  }, SearchkitComponent.propTypes)

  static defaultProps = {
    listComponent: CheckboxItemList,
    containerComponent: Panel,
    collapsable: false,
    showCount: true
  }

  constructor(props){
    super(props)
    this.toggleFilter = this.toggleFilter.bind(this)