Repeater Field

Schema definition:

import defineField from '@/lib/field/defineField'

defineField({
    id: 'options',
    name: 'List of options',
    type: 'repeater',
    fields: {
        name: {
            name: 'Name',
            type: 'text',
        },
        content: {
            name: 'Content',
            type: 'longText',
            richText: true,
        },
        group: {
            name: 'Group',
            type: 'singleSelect',
            options: [
                { id: 'Group A' },
                { id: 'Group B' },
            ],
        },
    }
})

Format as text

{
    "text": "2 items"
}

Change Details

{
    "prev" : null,
    "next" : [
        { id: "7477591a-836e-4c2b-921d-fb6c4dd3978e", name: "Test", "content": "Lorem ipsum", group: "Group A" },
    ],
    "userId" : "root",
    "supervisorId" : null,
    "operation" : "add",
    "source" : "user",
    "type" : "repeater",
    "time" : "2023-12-26T09:29:50.411Z"
}

TODO: demo repeater field prev next

  • 2 items added
  • 2 items removed