import { type Snippet } from 'svelte'; import type { CombiTableColumn } from '../combitabletypes'; type Props = { /** * The primary key value for this row. Only needed for delete, edit, add */ pk?: string | number; /** * URL to call to save edits to existing row. * * If not given, editing is not activated */ editUrl?: string; /** * URL to call to save a new row. * * If not given, adding rows is not activated */ addUrl?: string; /** * URL to call to start adding a new row (without an existing row loaded). * {@link SearchUrl} is used to add a back link to this. * * If not given, adding rows is not activated */ newUrl?: string; /** * URL to call to delete a row. * * If not given, deleting rows is not activated */ deleteUrl?: string; /** * Page to go to after deleting this row. Default `/` */ deleteNextPage?: string; /** * Bind to a variable to tell this component if it is adding an new * row rather than editing an existing one */ isAdd?: boolean; /** * Page to go to after saving a page. Default current page. */ saveNextPage?: ((rec: { [key: string]: any; }) => string); /** * If true, enable persistance - temporarily saving data from one * table while adding an entry to a related table */ persistance?: boolean; /** * Bind to this to find out when the table has unsaved data */ dirty?: boolean; /** * Pass this if you have data not managed but detailsfieldset that * may have a dirty state */ extraDirty?: boolean | (() => boolean); /** * Set this if you want to be able to disable/reenable all * editinng */ updateDisabled?: boolean; /** * Extra buttons to place after along side the navigation buttons */ extraButtons?: { label: string; action: () => undefined; }[]; /** * Run this before a button click. * * Keys can be Save, Cancel, New, Delete or labels for extraButtons. * If the function returns false, the operation is cancelled. */ beforeButtonClick?: { [key: string]: () => boolean | Promise; }; /** * Run this after a button click. * * Keys can be Save, Cancel, New, Delete or labels for extraButtons */ afterButtonClick?: { [key: string]: () => void; }; /** * If true, cancel button is always active. Otherwise (the default) * it is only active when dirty */ cancelAlwaysActive?: boolean; /** * If true, cancel button is always active. Otherwise (the default) * it is only active when dirty */ saveActive?: boolean; /** * Run after cancelling edit */ afterCancel?: () => Promise; /** * Default en */ lang?: string; /** * Override the Save, Cancel, New and Delete button names */ buttonLabels?: { [key: string]: string; }; /** * If true, autoamtic validation before saving will be skipped */ skipValidation?: boolean; children: Snippet; }; /** * Groups a set of {@link DetailsField}s with add, delete, edit * functionality */ declare const DetailsFieldSet: import("svelte").Component { value: any; col: CombiTableColumn; }, setFn: (value: any) => void, setOriginalFn: (value: any) => void) => void; registerGetFieldError: (fn: (lang?: string) => string | undefined) => void; registerIsDirty: (fn: () => boolean) => void; registerSetUpdateDisabled: (fn: (val: boolean) => void) => void; registerResetValue: (fn: () => void) => void; registerPersist: (fn: () => void) => void; updateDirty: () => void; showError: (errors: string[] | string) => void; showInfo: (info: string) => void; showInfoThenLoad: (info: string) => void; newItemWithPersistanceLink: (url: URL, fromCol?: string, toCol?: string) => Promise; }, "isAdd" | "dirty">; type DetailsFieldSet = ReturnType; export default DetailsFieldSet;