Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions packages/vue/vue/src/jsonFormsCompositions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import {
JsonFormsCellRendererRegistryEntry,
defaultMapStateToEnumCellProps,
mapStateToDispatchCellProps,
mapStateToOneOfEnumCellProps,
StatePropsOfJsonFormsRenderer,
createId,
removeId
Expand Down Expand Up @@ -395,6 +396,22 @@ export const useJsonFormsEnumCell = (props: ControlProps) => {
return { cell: control, ...other };
};

/**
* Provides bindings for 'oneOf' enum cell elements. Cells are meant to show simple inputs,
* for example without error validation, within a larger structure like tables.
*
* Access bindings via the provided reactive 'cell' object.
* Dispatch changes via the provided `handleChange` method.
*/
export const useJsonFormsOneOfEnumCell = (props: ControlProps) => {
const { control, ...other } = useControl(
props,
mapStateToOneOfEnumCellProps,
mapDispatchToControlProps
);
return { cell: control, ...other };
};

/**
* Provides bindings for a cell dispatcher. Cells are meant to show simple inputs,
* for example without error validation, within a larger structure like tables.
Expand Down