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

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

@Injectable()
export class BciCorePicklistIntl {
  /** 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 = 'No items to display. <br> Add items by drag & drop, or click on the add icons.'; // TODO Restore: dropOverlayPlaceholder = 'Drop items here';

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

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

  /** 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_CORE_PICKLIST_INTL_PROVIDER = {
  provide: BciCorePicklistIntl,
  useClass: BciCorePicklistIntl,
};
