Skip to content

Commit

Permalink
Add multiple choice enum binding to Vue
Browse files Browse the repository at this point in the history
  • Loading branch information
sdirix committed May 12, 2022
1 parent 896dec9 commit dcca16f
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion packages/vue/vue/src/jsonFormsCompositions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ import {
mapStateToOneOfEnumCellProps,
StatePropsOfJsonFormsRenderer,
createId,
removeId
removeId,
mapStateToMultiEnumControlProps,
mapDispatchToMultiEnumProps
} from '@jsonforms/core';
import {
CompType,
Expand Down Expand Up @@ -289,6 +291,16 @@ export const useJsonFormsOneOfControl = (props: ControlProps) => {
return useControl(props, mapStateToOneOfProps, mapDispatchToControlProps);
};

/**
* Provides bindings for 'Control' elements which resolve to multiple choice enums.
*
* Access bindings via the provided reactive `control` object.
* Dispatch changes via the provided `handleChange` method.
*/
export const useJsonFormsMultiEnumControl = (props: ControlProps) => {
return useControl(props, mapStateToMultiEnumControlProps, mapDispatchToMultiEnumProps);
};

export interface LayoutProps extends RendererProps {
uischema: Layout;
}
Expand Down

0 comments on commit dcca16f

Please sign in to comment.