import * as React from "react"; import { FormContext } from "../LajiForm"; import { FieldProps, JSONSchemaArray, JSONSchemaObject } from "../../types"; export declare const colIsLoading: (col: SortCol) => boolean; interface SortCol { name: string; /** * Undefined if shouldn't sort at all. */ descending?: boolean; /** * Compare function provided by the compare strategy. It can be asynchronously set. * If it returns undefined, comparison will fallback to the default algorithm. */ compare?: (a: any, b: any, sortCol: SortCol, schema: any) => number | undefined; /** * The chosen compare strategy object. */ compareStrategy: CompareStrategy; loading?: boolean; } interface State { uiSchema?: any; sortCols: SortCol[]; } type DefaultCompareStrategy = { strategy: "default"; noDescending?: boolean; }; type TaxonomicCompareStrategy = { strategy: "taxonomic"; noDescending?: boolean; valueField?: string; query: { informalGroupsFilter?: string; onlyFinnish?: boolean; }; }; type CompareStrategy = DefaultCompareStrategy | TaxonomicCompareStrategy; /** * Sorts date according to selected columns. This component provides only the sorting logic, * a child component must handle the UI for selecting the sort columns. * * Can be used only if items are objects (non-objects don't have UUIDs which are used for * keeping the original order intact upon changes); */ export default class SortArrayField extends React.Component>, State> { state: State; sortTimeIdToSortedIdx: Record; /** * Id-to-idx mapping when the sorting was touched. Used to sorting newly items where they are put, instead of sorting them according to the sort cols. */ sortTimeIdToOrigIdx: Record; constructor(props: FieldProps>); componentDidUpdate(): void; /** * Sort cols might be retrieved from settings JSON, which doesn't hold the 'compare' fn. We add the fn * asynchronously when the component updates according to the comparison strategy name. */ syncColumns(): void; getUiShema(props: FieldProps>, { sortCols }: State, sortedData: any[]): { "ui:options": any; "ui:ArrayFieldTemplate"?: React.ComponentType> | undefined; "ui:ArrayFieldDescriptionTemplate"?: React.ComponentType> | undefined; "ui:ArrayFieldItemTemplate"?: React.ComponentType> | undefined; "ui:ArrayFieldTitleTemplate"?: React.ComponentType> | undefined; "ui:BaseInputTemplate"?: React.ComponentType> | undefined; "ui:DescriptionFieldTemplate"?: React.ComponentType> | undefined; "ui:ErrorListTemplate"?: React.ComponentType> | undefined; "ui:FieldErrorTemplate"?: React.ComponentType> | undefined; "ui:FieldHelpTemplate"?: React.ComponentType> | undefined; "ui:FieldTemplate"?: React.ComponentType> | undefined; "ui:ObjectFieldTemplate"?: React.ComponentType> | undefined; "ui:TitleFieldTemplate"?: React.ComponentType> | undefined; "ui:UnsupportedFieldTemplate"?: React.ComponentType> | undefined; "ui:WrapIfAdditionalTemplate"?: React.ComponentType> | undefined; "ui:classNames"?: string | undefined; "ui:style"?: React.StyleHTMLAttributes | undefined; "ui:title"?: string | undefined; "ui:description"?: string | undefined; "ui:placeholder"?: string | undefined; "ui:help"?: string | undefined; "ui:autofocus"?: boolean | undefined; "ui:autocomplete"?: AutoFill | undefined; "ui:disabled"?: boolean | undefined; "ui:emptyValue"?: any; "ui:enumDisabled"?: (string | number | boolean)[] | undefined; "ui:hideError"?: boolean | undefined; "ui:readonly"?: boolean | undefined; "ui:order"?: string[] | undefined; "ui:addable"?: boolean | undefined; "ui:orderable"?: boolean | undefined; "ui:removable"?: boolean | undefined; "ui:inline"?: boolean | undefined; "ui:inputType"?: string | undefined; "ui:label"?: boolean | undefined; "ui:rows"?: number | undefined; "ui:submitButtonOptions"?: import("@rjsf/utils").UISchemaSubmitButtonOptions | undefined; "ui:widget"?: string | import("@rjsf/utils").Widget | undefined; "ui:duplicateKeySuffixSeparator"?: string | undefined; "ui:rootFieldId"?: string; "ui:field"?: string | import("@rjsf/utils").Field | undefined; "ui:fieldReplacesAnyOrOneOf"?: boolean; }; getSortableColumns(props: FieldProps>): string[] | undefined; getNextComponentProps(props: any, state: State): { uiSchema: { "ui:options": any; "ui:ArrayFieldTemplate"?: React.ComponentType> | undefined; "ui:ArrayFieldDescriptionTemplate"?: React.ComponentType> | undefined; "ui:ArrayFieldItemTemplate"?: React.ComponentType> | undefined; "ui:ArrayFieldTitleTemplate"?: React.ComponentType> | undefined; "ui:BaseInputTemplate"?: React.ComponentType> | undefined; "ui:DescriptionFieldTemplate"?: React.ComponentType> | undefined; "ui:ErrorListTemplate"?: React.ComponentType> | undefined; "ui:FieldErrorTemplate"?: React.ComponentType> | undefined; "ui:FieldHelpTemplate"?: React.ComponentType> | undefined; "ui:FieldTemplate"?: React.ComponentType> | undefined; "ui:ObjectFieldTemplate"?: React.ComponentType> | undefined; "ui:TitleFieldTemplate"?: React.ComponentType> | undefined; "ui:UnsupportedFieldTemplate"?: React.ComponentType> | undefined; "ui:WrapIfAdditionalTemplate"?: React.ComponentType> | undefined; "ui:classNames"?: string | undefined; "ui:style"?: React.StyleHTMLAttributes | undefined; "ui:title"?: string | undefined; "ui:description"?: string | undefined; "ui:placeholder"?: string | undefined; "ui:help"?: string | undefined; "ui:autofocus"?: boolean | undefined; "ui:autocomplete"?: AutoFill | undefined; "ui:disabled"?: boolean | undefined; "ui:emptyValue"?: any; "ui:enumDisabled"?: (string | number | boolean)[] | undefined; "ui:hideError"?: boolean | undefined; "ui:readonly"?: boolean | undefined; "ui:order"?: string[] | undefined; "ui:addable"?: boolean | undefined; "ui:orderable"?: boolean | undefined; "ui:removable"?: boolean | undefined; "ui:inline"?: boolean | undefined; "ui:inputType"?: string | undefined; "ui:label"?: boolean | undefined; "ui:rows"?: number | undefined; "ui:submitButtonOptions"?: import("@rjsf/utils").UISchemaSubmitButtonOptions | undefined; "ui:widget"?: string | import("@rjsf/utils").Widget | undefined; "ui:duplicateKeySuffixSeparator"?: string | undefined; "ui:rootFieldId"?: string; "ui:field"?: string | import("@rjsf/utils").Field | undefined; "ui:fieldReplacesAnyOrOneOf"?: boolean; }; formData: any[]; onChange: (formData: any[]) => void; }; updateSortCol(sortCol: SortCol): void; setSortCols(sortCols: SortCol[]): void; onSortToggle(name: string): void; onChange: (formData: any[]) => void; render(): JSX.Element; } export {};