mirror of
https://github.com/johndoe6345789/low-code-react-app-b.git
synced 2026-04-25 06:04:54 +00:00
Merge pull request #150 from johndoe6345789/codex/update-json-ui-components-and-registry-u03e4j
Add DatePicker and FileUpload to JSON UI types, registry and defaults
This commit is contained in:
@@ -147,7 +147,8 @@
|
||||
"id": "birthdate-input",
|
||||
"type": "DatePicker",
|
||||
"props": {
|
||||
"placeholder": "Select a date"
|
||||
"placeholder": "Select a date",
|
||||
"disabled": false
|
||||
},
|
||||
"dataBinding": "formData.birthDate",
|
||||
"events": {
|
||||
@@ -207,7 +208,9 @@
|
||||
"id": "resume-upload",
|
||||
"type": "FileUpload",
|
||||
"props": {
|
||||
"accept": ".pdf,.doc,.docx"
|
||||
"accept": ".pdf,.doc,.docx",
|
||||
"multiple": false,
|
||||
"maxSize": 10485760
|
||||
},
|
||||
"events": {
|
||||
"onFilesSelected": {
|
||||
|
||||
@@ -119,6 +119,20 @@
|
||||
"icon": "NumberCircleOne",
|
||||
"defaultProps": { "placeholder": "0", "min": 0 }
|
||||
},
|
||||
{
|
||||
"type": "DatePicker",
|
||||
"label": "Date Picker",
|
||||
"category": "input",
|
||||
"icon": "Calendar",
|
||||
"defaultProps": { "placeholder": "Pick a date" }
|
||||
},
|
||||
{
|
||||
"type": "FileUpload",
|
||||
"label": "File Upload",
|
||||
"category": "input",
|
||||
"icon": "Upload",
|
||||
"defaultProps": { "multiple": false }
|
||||
},
|
||||
{
|
||||
"type": "Heading",
|
||||
"label": "Heading",
|
||||
|
||||
@@ -78,6 +78,7 @@ const buildRegistryFromNames = (
|
||||
}
|
||||
|
||||
const jsonRegistryEntries = jsonRegistry.components ?? []
|
||||
const atomComponentMap = AtomComponents as Record<string, ComponentType<any>>
|
||||
const deprecatedComponentInfo = jsonRegistryEntries.reduce<Record<string, DeprecatedComponentInfo>>(
|
||||
(acc, entry) => {
|
||||
const entryName = entry.export ?? entry.name ?? entry.type
|
||||
@@ -174,8 +175,10 @@ export const shadcnComponents: UIComponentRegistry = {
|
||||
export const atomComponents: UIComponentRegistry = {
|
||||
...buildRegistryFromNames(
|
||||
atomRegistryNames,
|
||||
AtomComponents as Record<string, ComponentType<any>>
|
||||
atomComponentMap
|
||||
),
|
||||
DatePicker: atomComponentMap.DatePicker,
|
||||
FileUpload: atomComponentMap.FileUpload,
|
||||
CircularProgress,
|
||||
Divider,
|
||||
ProgressBar,
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
export type ComponentType =
|
||||
| 'div' | 'section' | 'article' | 'header' | 'footer' | 'main'
|
||||
| 'Button' | 'Card' | 'CardHeader' | 'CardTitle' | 'CardDescription' | 'CardContent' | 'CardFooter'
|
||||
| 'Input' | 'TextArea' | 'Textarea' | 'Select' | 'Checkbox' | 'Radio' | 'Switch' | 'Slider' | 'NumberInput'
|
||||
| 'DatePicker' | 'FileUpload'
|
||||
| 'Input' | 'TextArea' | 'Textarea' | 'Select' | 'Checkbox' | 'Radio' | 'Switch' | 'Slider' | 'NumberInput' | 'DatePicker' | 'FileUpload'
|
||||
| 'Badge' | 'Progress' | 'Separator' | 'Tabs' | 'TabsContent' | 'TabsList' | 'TabsTrigger' | 'Dialog'
|
||||
| 'Text' | 'Heading' | 'Label' | 'List' | 'Grid' | 'Stack' | 'Flex' | 'Container'
|
||||
| 'Link' | 'Breadcrumb' | 'Image' | 'Avatar' | 'Code' | 'Tag' | 'Spinner' | 'Skeleton'
|
||||
|
||||
Reference in New Issue
Block a user