-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor templates and add next variants
- Loading branch information
Showing
40 changed files
with
695 additions
and
185 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
apps/web/src/core/FormBuilder/MoreInfo/FieldKinds/StringFieldKind.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1 @@ | ||
export { mainTemplate } from "./main"; | ||
export { stringInputTemplate } from "./string-input"; | ||
export { dateInputTemplate } from "./date-input"; | ||
export { booleanInputTemplate } from "./boolean-input"; | ||
export { selectInputTemplate } from "./select-input"; | ||
export { radioInputTemplate } from "./radio-input"; | ||
export { comboboxInputTemplate } from "./combobox-input"; | ||
export { numberInputTemplate } from "./number-input"; | ||
export { textareaInputTemplate } from "./textarea-input"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
packages/core/src/codegen/templates/next/boolean/checkbox.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
export const checkbox = ` | ||
<FormField | ||
control={form.control} | ||
name="{{key}}" | ||
render={({ field }) => ( | ||
<FormItem> | ||
<FormControl> | ||
<div className="flex items-center space-x-2"> | ||
<ShadcnCheckbox value={field.value}id={f.key} onClick={(e)=>console.log("elick",field.value)} onChange={(e)=>console.log("eeeez",e)} /> | ||
<label | ||
htmlFor={f.key} | ||
className="font-medium text-sm leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70" | ||
> | ||
{{label}} | ||
</label> | ||
</div> | ||
</FormControl> | ||
<FormDescription>{{description}}</FormDescription> | ||
<FormMessage /> | ||
</FormItem> | ||
)} | ||
/> | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { checkbox } from "./checkbox"; | ||
import { switchTemplate } from "./switch"; | ||
export const booleanTemplates = { | ||
checkbox, | ||
switchTemplate, | ||
}; |
18 changes: 18 additions & 0 deletions
18
packages/core/src/codegen/templates/next/boolean/switch.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
export const switchTemplate = ` | ||
<FormField | ||
control={form.control} | ||
name="{{key}}" | ||
render={({ field }) => ( | ||
<FormItem className="flex flex-row items-center justify-between rounded-lg border p-4"> | ||
<div className=""> | ||
<FormLabel className="text-base">{{label}}</FormLabel> | ||
<FormDescription>{{description}}</FormDescription> | ||
</div> | ||
<FormControl> | ||
<Switch {...field} /> | ||
</FormControl> | ||
<FormMessage /> | ||
</FormItem> | ||
)} | ||
/> | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.