* feature: enable reordering of hasMany relationship and select fields using config * update: correct docs for select, and relationship field for sortable config * update: move sortable to admin config, and rename it to isSortable, apply grab, and grabbing classes while drag, and drop
71 lines
1.3 KiB
TypeScript
71 lines
1.3 KiB
TypeScript
import type { CollectionConfig } from '../../../../src/collections/config/types';
|
|
|
|
const SelectFields: CollectionConfig = {
|
|
slug: 'select-fields',
|
|
fields: [
|
|
{
|
|
name: 'select',
|
|
type: 'select',
|
|
admin: {
|
|
isClearable: true,
|
|
},
|
|
options: [
|
|
{
|
|
label: 'Value One',
|
|
value: 'one',
|
|
},
|
|
{
|
|
label: 'Value Two',
|
|
value: 'two',
|
|
},
|
|
{
|
|
label: 'Value Three',
|
|
value: 'three',
|
|
},
|
|
],
|
|
},
|
|
{
|
|
name: 'selectHasMany',
|
|
hasMany: true,
|
|
type: 'select',
|
|
admin: {
|
|
isClearable: true,
|
|
isSortable: true,
|
|
},
|
|
options: [
|
|
{
|
|
label: 'Value One',
|
|
value: 'one',
|
|
},
|
|
{
|
|
label: 'Value Two',
|
|
value: 'two',
|
|
},
|
|
{
|
|
label: 'Value Three',
|
|
value: 'three',
|
|
},
|
|
{
|
|
label: 'Value Four',
|
|
value: 'four',
|
|
},
|
|
{
|
|
label: 'Value Five',
|
|
value: 'five',
|
|
},
|
|
{
|
|
label: 'Value Six',
|
|
value: 'six',
|
|
},
|
|
],
|
|
},
|
|
],
|
|
};
|
|
|
|
export const selectsDoc = {
|
|
select: 'one',
|
|
selectHasMany: ['two', 'four'],
|
|
};
|
|
|
|
export default SelectFields;
|