This commit is contained in:
dev.daminik00 2025-09-26 20:51:08 +02:00
parent da92fe28c8
commit 0b10a09497
6 changed files with 4002 additions and 28 deletions

View File

@ -478,28 +478,34 @@ export function BuilderSidebar() {
</select> </select>
</label> </label>
<div className="flex flex-col gap-2"> {selectedScreen.template === "list" ? (
<span className="text-sm font-medium text-muted-foreground">Варианты ответа</span> <div className="flex flex-col gap-2">
<div className="flex flex-col gap-2 rounded-lg border border-border/60 p-3"> <span className="text-sm font-medium text-muted-foreground">Варианты ответа</span>
{selectedScreen.list.options.map((option) => { <div className="flex flex-col gap-2 rounded-lg border border-border/60 p-3">
const condition = rule.conditions[0]; {selectedScreen.list.options.map((option) => {
const isChecked = condition.optionIds?.includes(option.id) ?? false; const condition = rule.conditions[0];
return ( const isChecked = condition.optionIds?.includes(option.id) ?? false;
<label key={option.id} className="flex items-center gap-2 text-sm"> return (
<input <label key={option.id} className="flex items-center gap-2 text-sm">
type="checkbox" <input
checked={isChecked} type="checkbox"
onChange={() => handleRuleOptionToggle(selectedScreen.id, ruleIndex, option.id)} checked={isChecked}
/> onChange={() => handleRuleOptionToggle(selectedScreen.id, ruleIndex, option.id)}
<span> />
{option.label} <span>
<span className="text-muted-foreground"> ({option.id})</span> {option.label}
</span> <span className="text-muted-foreground"> ({option.id})</span>
</label> </span>
); </label>
})} );
})}
</div>
</div> </div>
</div> ) : (
<div className="flex flex-col gap-2 rounded-lg border border-border/60 bg-muted/20 p-3 text-xs text-muted-foreground">
Навигационные правила с вариантами ответа доступны только для экранов со списком.
</div>
)}
<label className="flex flex-col gap-2"> <label className="flex flex-col gap-2">
<span className="text-sm font-medium text-muted-foreground">Следующий экран</span> <span className="text-sm font-medium text-muted-foreground">Следующий экран</span>

View File

@ -65,8 +65,7 @@ export function FormScreenConfig({ screen, onUpdate }: FormScreenConfigProps) {
</span> </span>
<Button <Button
variant="ghost" variant="ghost"
size="sm" className="h-8 px-3 text-xs text-destructive"
className="text-destructive"
onClick={() => removeField(index)} onClick={() => removeField(index)}
> >
Удалить Удалить

View File

@ -76,7 +76,9 @@ export function InfoScreenConfig({ screen, onUpdate }: InfoScreenConfigProps) {
<select <select
className="rounded-lg border border-border bg-background px-2 py-1" className="rounded-lg border border-border bg-background px-2 py-1"
value={infoScreen.icon?.size ?? "lg"} value={infoScreen.icon?.size ?? "lg"}
onChange={(event) => handleIconChange("size", event.target.value)} onChange={(event) =>
handleIconChange("size", event.target.value as "sm" | "md" | "lg" | "xl")
}
> >
<option value="sm">Маленький</option> <option value="sm">Маленький</option>
<option value="md">Средний</option> <option value="md">Средний</option>

View File

@ -159,7 +159,7 @@ export function ListScreenConfig({ screen, onUpdate }: ListScreenConfigProps) {
<div className="space-y-3"> <div className="space-y-3">
<div className="flex items-center justify-between"> <div className="flex items-center justify-between">
<h4 className="text-sm font-semibold text-foreground">Настройка вариантов</h4> <h4 className="text-sm font-semibold text-foreground">Настройка вариантов</h4>
<Button variant="outline" size="sm" className="h-8 px-3" onClick={handleAddOption}> <Button variant="outline" className="h-8 px-3 text-xs" onClick={handleAddOption}>
<Plus className="mr-1 h-4 w-4" /> Добавить <Plus className="mr-1 h-4 w-4" /> Добавить
</Button> </Button>
</div> </div>
@ -195,8 +195,7 @@ export function ListScreenConfig({ screen, onUpdate }: ListScreenConfigProps) {
</button> </button>
<Button <Button
variant="ghost" variant="ghost"
size="sm" className="h-8 px-3 text-xs text-destructive"
className="text-destructive"
onClick={() => handleRemoveOption(index)} onClick={() => handleRemoveOption(index)}
> >
<Trash2 className="h-4 w-4" /> <Trash2 className="h-4 w-4" />

View File

@ -370,7 +370,10 @@ function ActionButtonControls({ label, value, onChange }: ActionButtonControlsPr
export function TemplateConfig({ screen, onUpdate }: TemplateConfigProps) { export function TemplateConfig({ screen, onUpdate }: TemplateConfigProps) {
const { template } = screen; const { template } = screen;
const handleTitleChange = (value: TypographyVariant) => { const handleTitleChange = (value: TypographyVariant | undefined) => {
if (!value) {
return;
}
onUpdate({ title: value }); onUpdate({ title: value });
}; };

File diff suppressed because it is too large Load Diff