Trilium Frontend API
    Preparing search index...

    Interface OptionsClipboard

    interface OptionsClipboard {
        clipboard?: boolean | "copy" | "paste";
        clipboardCopyConfig?: boolean | AdditionalExportOptions;
        clipboardCopyFormatter?:
            | "table"
            | ((type: "html" | "plain", output: string) => string);
        clipboardCopyHeader?: boolean;
        clipboardCopyRowRange?: RowRangeLookup;
        clipboardCopyStyled?: boolean;
        clipboardPasteAction?: "update" | "replace" | "range" | "insert";
        clipboardPasteParser?: string | ((clipboard: any) => any[]);
        groupHeaderClipboard?:
            | (
                (
                    value: any,
                    count: number,
                    data: any,
                    group: GroupComponent,
                ) => string
            )
            | ((value: any, count: number, data: any) => string)[];
        groupHeaderHtmlOutput?:
            | (
                (
                    value: any,
                    count: number,
                    data: any,
                    group: GroupComponent,
                ) => string
            )
            | ((value: any, count: number, data: any) => string)[];
    }

    Hierarchy (View Summary)

    Index

    Properties

    clipboard?: boolean | "copy" | "paste"

    You can enable clipboard functionality using the clipboard config option. It can take one of four possible values: true - enable clipboard copy and paste "copy" - enable only copy functionality "paste" - enable only paste functionality false - disable all clipboard functionality (default)

    clipboardCopyConfig?: boolean | AdditionalExportOptions

    By default Tabulator includes column headers, row groups and column calculations in the clipboard output.

    You can choose to remove column headers groups, row groups or column calculations from the output data by setting the values in the clipboardCopyConfig option in the table definition:

    clipboardCopyFormatter?:
        | "table"
        | ((type: "html" | "plain", output: string) => string)

    You can alter the finished output to the clipboard using the clipboardCopyFormatter callback. The callback function receives two arguments, the first is a string representing the type of content to be formatted (either "plain" or "html" depending on the type of data entering the clipboard). The second argument is the string that is about to be inserted into the clipboard. The function and should return a string that will be inserted into the clipboard.

    clipboardCopyHeader?: boolean

    By default Tabulator will include the column header titles in any clipboard data, this can be turned off by passing a value of false to the clipboardCopyHeader property:

    clipboardCopyRowRange?: RowRangeLookup

    The clipboardCopyRowRange option takes a Row Range Lookup value and allows you to choose which rows are included in the clipboard output:

    clipboardCopyStyled?: boolean

    By default Tabulator will copy some of the tables styling along with the data to give a better visual appearance when pasted into other documents.

    If you want to only copy the un-styled data then you should set the clipboardCopyStyled option to false in the table options object:

    clipboardPasteAction?: "update" | "replace" | "range" | "insert"

    Once the data has been parsed into row data, it will be passed to a paste action to be added to the table. There are three inbuilt paste actions:

    insert - Inserts data into the table using the addRows function (default) update - Updates data in the table using the updateOrAddData function replace - replaces all data in the table using the setData function

    clipboardPasteParser?: string | ((clipboard: any) => any[])

    Tabulator has one built in paste parser, that is designed to take a table formatted text string from the clipboard and turn it into row data. it breaks the data into rows on a newline character \n and breaks the rows down to columns on a tab character \t. It will then attempt to work out which columns in the data correspond to columns in the table. It tries three different ways to achieve this. First it checks the values of all columns in the first row of data to see if they match the titles of columns in the table. If any of the columns don't match it then tries the same approach but with the column fields. If either of those options match, Tabulator will map those columns to the incoming data and import it into rows. If there is no match then Tabulator will assume the columns in the data are in the same order as the visible columns in the table and import them that way.

    The inbuilt parser will reject any clipboard data that does not contain at least one row and two columns, in that case the clipboardPasteError will be triggered.

    If you extend the clipboard module to add your own parser, you can set it to be used as default with the clipboardPasteParser property. Built-in parsers are "table" and "range".

    groupHeaderClipboard?:
        | (
            (value: any, count: number, data: any, group: GroupComponent) => string
        )
        | ((value: any, count: number, data: any) => string)[]

    When copying to clipboard you may want to apply a different group header from the one usually used in the table. You can now do this using the groupHeaderClipboard table option, which takes the same inputs as the standard groupHeader property.

    groupHeaderHtmlOutput?:
        | (
            (value: any, count: number, data: any, group: GroupComponent) => string
        )
        | ((value: any, count: number, data: any) => string)[]

    When the getHtml function is called you may want to apply a different group header from the one usually used in the table. You can now do this using the groupHeaderHtmlOutput table option, which takes the same inputs as the standard groupHeader property.