pipeline cards, context menus, presets, settings overhaul
rewrote pipeline as draggable card strip with per-rule config popovers, added right-click menus to pipeline cards, sidebar tree, and file list, preset import/export with BRU format support, new rules (hash, swap, truncate, sanitize, padding, randomize, text editor, folder name, transliterate), settings dialog with all sections, overlay collision containment, tooltips on icon buttons, empty pipeline default
This commit is contained in:
36
ui/src/components/pipeline/configs/PaddingConfig.tsx
Normal file
36
ui/src/components/pipeline/configs/PaddingConfig.tsx
Normal file
@@ -0,0 +1,36 @@
|
||||
import { useRuleStore } from "@/stores/ruleStore";
|
||||
import { Input } from "@/components/ui/input";
|
||||
import { NumberInput } from "@/components/ui/number-input";
|
||||
import { Checkbox } from "@/components/ui/checkbox";
|
||||
import type { PaddingConfig as PaddingConfigType } from "@/types/rules";
|
||||
|
||||
export function PaddingConfig({ ruleId }: { ruleId: string }) {
|
||||
const rule = useRuleStore((s) => s.pipeline.find((r) => r.id === ruleId))?.config as PaddingConfigType | undefined;
|
||||
const updateRule = useRuleStore((s) => s.updateRule);
|
||||
if (!rule) return null;
|
||||
const update = (changes: Partial<PaddingConfigType>) => updateRule(ruleId, changes);
|
||||
|
||||
return (
|
||||
<div className="flex flex-col gap-3 text-sm">
|
||||
<div className="grid grid-cols-2 gap-2">
|
||||
<label className="flex flex-col gap-1">
|
||||
<span className="text-xs text-muted-foreground">Width</span>
|
||||
<NumberInput value={rule.width} onChange={(v) => update({ width: v })} min={1} />
|
||||
</label>
|
||||
<label className="flex flex-col gap-1">
|
||||
<span className="text-xs text-muted-foreground">Pad character</span>
|
||||
<Input
|
||||
value={rule.pad_char}
|
||||
onChange={(e) => update({ pad_char: e.target.value.slice(0, 1) || "0" })}
|
||||
maxLength={1}
|
||||
className="h-8 text-xs font-mono text-center"
|
||||
/>
|
||||
</label>
|
||||
</div>
|
||||
<label className="flex items-center gap-1.5 cursor-pointer text-xs">
|
||||
<Checkbox checked={rule.pad_all} onCheckedChange={(c) => update({ pad_all: !!c })} />
|
||||
Pad all numbers (not just first)
|
||||
</label>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user