/* eslint-disable @typescript-eslint/no-explicit-any */ import DragDropContainer from "./DragDropContext"; import { DragDropContext, Droppable, Draggable } from "react-beautiful-dnd"; import React from "react"; import { ChooserColumn } from "../../../data/setting"; import FactoryRenderer from "../../../../../Renderer"; export type ColumnChooserViewProps = { popupChooserRef: any; allColumns: ChooserColumn[]; selectedColumns: ChooserColumn[]; searchInput: string; onFieldAddOrRemove: (id: number) => void; excludeIncludeToCard: (id: number) => void; toggleFreeze: (id: number) => void; onChooserApply: () => void; onChooserRestore: () => void; onChooserClose: () => void; onFieldDragEnd: (result: any) => void; setSearchInput: (searchKey: string) => void; }; const ColumnChooserView: React.FC = (props) => { return (
{/* The title is an

carrying the theme's own `qo-h3` and no type of its own — see the heading note in scss/index.scss. The
beside it is the action group, and it stays. */}

Column Chooser

props.setSearchInput((value ?? "") as string) } // Plain Kendo font-icon span, not the ICON widget: that widget // renders a Kendo
{props.allColumns.length === 0 && (

No fields found

)} {props.allColumns.map((column) => ( { if (column.primary !== true) { props.onFieldAddOrRemove(column.id); } }} /> ))}

{props.selectedColumns.length > 0 ? `${props.selectedColumns.length} Column(s) Selected` : `No fields selected`}

{(provided: any) => (
{props.selectedColumns.map((column, index) => column.primary ? ( ) : ( {(provided: any) => (
)}
), )} {provided.placeholder}
)}

); }; export default ColumnChooserView;