/*
 * Copyright (C) 2018 Robert Bosch GmbH Copyright (C) 2018 Robert Bosch Manufacturing Solutions GmbH, Germany. All rights reserved.
 */

import { Injectable } from '@angular/core';
import { Subject } from 'rxjs';

@Injectable()
export class BciPicklistIntl {
  /** A label for the button that adds all selected source items to the target list. */
  addSelection = 'Add selection';

  /** A label for the button that removes all selected target items from the target list. */
  removeSelection = 'Remove selection';

  /** A label for the button that adds all source items to the target list. */
  addAll = 'Add all';

  /** A label for the button that clears the target list. */
  removeAll = 'Remove all';

  /** A label for the button that selects all items in the source/target list. */
  selectAll = 'Select all';

  /** A label for the button that deselects all items in the source/target list. */
  deselectAll = 'Deselect all';

  /** A label for the drop placeholder. */
  dropPlaceholder = 'Drop items here'; // TODO Restore: dropOverlayPlaceholder = 'Drop items here';

  /** A placeholder for the source text search input field. */
  sourceFilterPlaceholder = 'Search';

  /** A placeholder for the target text search input field. */
  targetFilterPlaceholder = 'Search';

  /** Use this to notify the component on labels that have changed since initialization. */
  readonly changes = new Subject<void>();

  dragPreviewItemLabel = (numItems: number) => {
    const plural = numItems > 1 ? 's' : '';
    return `${numItems} more item${plural} selected`;
  };
}

export const BCI_PICKLIST_INTL_PROVIDER = {
  provide: BciPicklistIntl,
  useClass: BciPicklistIntl,
};
