跳到主要内容

ui/build/data-renderer/matrix/matrix.types

ui/build/data-renderer/matrix/matrix.types

Interfaces

MatrixColumn

Defined in: apps/website/.api-docs-entry/ui/build/data-renderer/matrix/matrix.types.d.ts:14

Type Parameters

Type Parameter
TRow extends MatrixRow

Properties

field
field: CollectionField;

Defined in: apps/website/.api-docs-entry/ui/build/data-renderer/matrix/matrix.types.d.ts:17

key
key: Extract<keyof TRow>;

Defined in: apps/website/.api-docs-entry/ui/build/data-renderer/matrix/matrix.types.d.ts:15

label
label: string;

Defined in: apps/website/.api-docs-entry/ui/build/data-renderer/matrix/matrix.types.d.ts:16

placeholder?
optional placeholder?: string;

Defined in: apps/website/.api-docs-entry/ui/build/data-renderer/matrix/matrix.types.d.ts:18

readOnly?
optional readOnly?: boolean;

Defined in: apps/website/.api-docs-entry/ui/build/data-renderer/matrix/matrix.types.d.ts:21

Render this value as immutable display content inside an otherwise editable matrix.

relationOptions?
optional relationOptions?: CollectionRelationOptions<CollectionRecord>;

Defined in: apps/website/.api-docs-entry/ui/build/data-renderer/matrix/matrix.types.d.ts:19

renderer?
optional renderer?: Component<MatrixCellRendererProps<TRow>, {
}, string>;

Defined in: apps/website/.api-docs-entry/ui/build/data-renderer/matrix/matrix.types.d.ts:23

Specialized cell content for references that cannot be represented by one scalar field.

width?
optional width?: number;

Defined in: apps/website/.api-docs-entry/ui/build/data-renderer/matrix/matrix.types.d.ts:24


MatrixRendererBaseProps

Defined in: apps/website/.api-docs-entry/ui/build/data-renderer/matrix/matrix.types.d.ts:35

Type Parameters

Type Parameter
TRow extends MatrixRow

Properties

addRowLabel?
optional addRowLabel?: string;

Defined in: apps/website/.api-docs-entry/ui/build/data-renderer/matrix/matrix.types.d.ts:51

allowRemoveRows?
optional allowRemoveRows?: boolean;

Defined in: apps/website/.api-docs-entry/ui/build/data-renderer/matrix/matrix.types.d.ts:52

bounded?
optional bounded?: boolean;

Defined in: apps/website/.api-docs-entry/ui/build/data-renderer/matrix/matrix.types.d.ts:47

When false, grow with content and let a parent own scrolling (avoids nested scroll traps).

canRemoveRow?
optional canRemoveRow?: (row, index) => boolean;

Defined in: apps/website/.api-docs-entry/ui/build/data-renderer/matrix/matrix.types.d.ts:54

Defaults to allowing remove whenever allowRemoveRows is true.

Parameters
Parameter Type
row TRow
index number
Returns

boolean

class?
optional class?: string;

Defined in: apps/website/.api-docs-entry/ui/build/data-renderer/matrix/matrix.types.d.ts:45

columns
columns: readonly MatrixColumn<TRow>[];

Defined in: apps/website/.api-docs-entry/ui/build/data-renderer/matrix/matrix.types.d.ts:37

disabled?
optional disabled?: boolean;

Defined in: apps/website/.api-docs-entry/ui/build/data-renderer/matrix/matrix.types.d.ts:38

emptyMessage?
optional emptyMessage?: string;

Defined in: apps/website/.api-docs-entry/ui/build/data-renderer/matrix/matrix.types.d.ts:44

extraRowActions?
optional extraRowActions?: Snippet<[MatrixRowActionProps<TRow>]>[];

Defined in: apps/website/.api-docs-entry/ui/build/data-renderer/matrix/matrix.types.d.ts:56

Rendered before the built-in remove control in the sticky actions column.

getRowId?
optional getRowId?: (row, index) => string;

Defined in: apps/website/.api-docs-entry/ui/build/data-renderer/matrix/matrix.types.d.ts:48

Parameters
Parameter Type
row TRow
index number
Returns

string

isRowDisabled?
optional isRowDisabled?: (row, index) => boolean;

Defined in: apps/website/.api-docs-entry/ui/build/data-renderer/matrix/matrix.types.d.ts:50

When true, the row’s cells are non-editable (remove still follows canRemoveRow).

Parameters
Parameter Type
row TRow
index number
Returns

boolean

onChange?
optional onChange?: (rows) => void;

Defined in: apps/website/.api-docs-entry/ui/build/data-renderer/matrix/matrix.types.d.ts:57

Parameters
Parameter Type
rows TRow[]
Returns

void

readonly?
optional readonly?: boolean;

Defined in: apps/website/.api-docs-entry/ui/build/data-renderer/matrix/matrix.types.d.ts:43

Display-only: every cell renders its display branch instead of a muted disabled control. disabled keeps the controls on screen, greyed; a readonly form renders the values.

rows
rows: TRow[];

Defined in: apps/website/.api-docs-entry/ui/build/data-renderer/matrix/matrix.types.d.ts:36


MatrixRow

Defined in: apps/website/.api-docs-entry/ui/build/data-renderer/matrix/matrix.types.d.ts:4

Properties

id?
readonly optional id?: string;

Defined in: apps/website/.api-docs-entry/ui/build/data-renderer/matrix/matrix.types.d.ts:5


MatrixRowActionProps

Defined in: apps/website/.api-docs-entry/ui/build/data-renderer/matrix/matrix.types.d.ts:26

Type Parameters

Type Parameter Default type
TRow extends MatrixRow MatrixRow

Properties

disabled
disabled: boolean;

Defined in: apps/website/.api-docs-entry/ui/build/data-renderer/matrix/matrix.types.d.ts:31

Whole matrix is disabled (e.g. form readonly / saving).

hovered
hovered: boolean;

Defined in: apps/website/.api-docs-entry/ui/build/data-renderer/matrix/matrix.types.d.ts:29

index
index: number;

Defined in: apps/website/.api-docs-entry/ui/build/data-renderer/matrix/matrix.types.d.ts:28

row
row: TRow;

Defined in: apps/website/.api-docs-entry/ui/build/data-renderer/matrix/matrix.types.d.ts:27

rowDisabled
rowDisabled: boolean;

Defined in: apps/website/.api-docs-entry/ui/build/data-renderer/matrix/matrix.types.d.ts:33

This row’s datatype cells are non-editable via isRowDisabled.

Type Aliases

MatrixCellRendererProps

type MatrixCellRendererProps<TRow> = Omit<FieldRendererProps, "row" | "disabled" | "onValueChange" | "onRowChange"> & object;

Defined in: apps/website/.api-docs-entry/ui/build/data-renderer/matrix/matrix.types.d.ts:8

Type Declaration

disabled
disabled: boolean;
onRowChange
onRowChange: (patch) => void;
Parameters
Parameter Type
patch Record<string, unknown>
Returns

void

onValueChange
onValueChange: (value) => void;
Parameters
Parameter Type
value unknown
Returns

void

row
row: TRow;

Type Parameters

Type Parameter Default type
TRow extends MatrixRow MatrixRow

MatrixRendererAddRowsProps

type MatrixRendererAddRowsProps<TRow> =
  | {
  addRowDisabled?: boolean;
  allowAddRows?: boolean;
  createRow: () => TRow;
}
  | {
  addRowDisabled?: never;
  allowAddRows: false;
  createRow?: never;
};

Defined in: apps/website/.api-docs-entry/ui/build/data-renderer/matrix/matrix.types.d.ts:59

Type Parameters

Type Parameter
TRow extends MatrixRow

Union Members

Type Literal
{
  addRowDisabled?: boolean;
  allowAddRows?: boolean;
  createRow: () => TRow;
}
addRowDisabled?
optional addRowDisabled?: boolean;
allowAddRows?
optional allowAddRows?: boolean;

A boolean so a caller can gate it (allowAddRows={!disabled}); true unless false.

createRow
createRow: () => TRow;
Returns

TRow


Type Literal
{
  addRowDisabled?: never;
  allowAddRows: false;
  createRow?: never;
}

MatrixRendererProps

type MatrixRendererProps<TRow> = MatrixRendererBaseProps<TRow> & MatrixRendererAddRowsProps<TRow>;

Defined in: apps/website/.api-docs-entry/ui/build/data-renderer/matrix/matrix.types.d.ts:69

Type Parameters

Type Parameter
TRow extends MatrixRow