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

import { BciCorePicklistResponsibility } from "./bci-core-picklist.types";


/** Defines a picklist item. */
export interface BciCorePicklistItem {
  /** Label of the item. */
  label: string;

  /** Value assigned to this element. */
  value: any;

  /** Whether the item is selected. */
  selected: boolean;

  /** Whether the item is actively dragged. */
  dragging: boolean;
}

/** Selection status of all elements in the picklist. */
export interface CoreSelectionState {
  /** Whether some source items are selected. */
  sourceItemsSelected: boolean;

  /** Whether some target items are selected. */
  targetItemsSelected: boolean;
}

/** Possible drag states of a {@link CoreDragInstance drag instance}. */
export enum CoreDragState {
  Idle,
  Dragging,
}

/** Describes a drag/drop operation. */
export interface CoreDragInstance {
  state: CoreDragState;
  source: BciCorePicklistResponsibility | 'none';
  draggedItems: BciCorePicklistItem[];
}
