{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "jsonforms-oneof-enum-cell",
  "description": "JSONForms select cell for oneOf enum fields inside array table layouts.",
  "dependencies": [
    "@jsonforms/core",
    "@jsonforms/react"
  ],
  "registryDependencies": [
    "select"
  ],
  "files": [
    {
      "path": "registry/forms/renderers/cells/oneof-enum-cell.tsx",
      "content": "import { isOneOfEnumControl, rankWith } from '@jsonforms/core';\nimport { withJsonFormsOneOfEnumCellProps } from '@jsonforms/react';\n\nimport {\n    Select,\n    SelectContent,\n    SelectItem,\n    SelectTrigger,\n    SelectValue,\n} from '~/components/ui/select';\n\ninterface OneOfEnumCellProps {\n    data: any;\n    handleChange: (path: string, value: any) => void;\n    path: string;\n    enabled: boolean;\n    options?: { value: any; label: string }[];\n}\n\nconst OneOfEnumCell = ({ data, handleChange, path, enabled, options = [] }: OneOfEnumCellProps) => (\n    <Select\n        value={data !== undefined ? String(data) : ''}\n        onValueChange={value => handleChange(path, value)}\n        disabled={!enabled}\n    >\n        <SelectTrigger className=\"h-8 text-xs\">\n            <SelectValue />\n        </SelectTrigger>\n        <SelectContent>\n            {options.map(opt => (\n                <SelectItem key={String(opt.value)} value={String(opt.value)} className=\"text-xs\">\n                    {opt.label}\n                </SelectItem>\n            ))}\n        </SelectContent>\n    </Select>\n);\n\nexport const oneOfEnumCellTester = rankWith(2, isOneOfEnumControl);\nexport default withJsonFormsOneOfEnumCellProps(OneOfEnumCell as any);",
      "type": "registry:component",
      "target": "components/forms/renderers/cells/oneof-enum-cell.tsx"
    }
  ],
  "type": "registry:component"
}