Jesús Pérez a963adbf5b
Some checks failed
CI / Lint (bash) (push) Has been cancelled
CI / Lint (markdown) (push) Has been cancelled
CI / Lint (nickel) (push) Has been cancelled
CI / Lint (nushell) (push) Has been cancelled
CI / Lint (rust) (push) Has been cancelled
CI / Benchmark (push) Has been cancelled
CI / Security Audit (push) Has been cancelled
CI / License Compliance (push) Has been cancelled
CI / Code Coverage (push) Has been cancelled
CI / Test (macos-latest) (push) Has been cancelled
CI / Test (ubuntu-latest) (push) Has been cancelled
CI / Test (windows-latest) (push) Has been cancelled
CI / Build (macos-latest) (push) Has been cancelled
CI / Build (ubuntu-latest) (push) Has been cancelled
CI / Build (windows-latest) (push) Has been cancelled
feat(forms): migrate all form definitions and configs to Nickel (.ncl)
Replace all TOML form definitions in examples/ and config/ with
  type-checked Nickel equivalents. Update cli_loader to prefer .ncl
  (via nickel export) over .toml in config search order.
  TOML support retained as fallback — no breaking change.

  - El loader usa nickel export --format json + serde_json como puente — evita reimplementar un parser Nickel en Rust y aprovecha el binario ya existente.
  - El orden de búsqueda .ncl > .toml permite migración incremental: cualquier config vieja sigue funcionando sin tocarla.
  - Los contratos Nickel (| default, | String) en los configs sustituyen la validación que antes era implícita en el parsing TOML — el error llega antes (en nickel export) con mensajes más descriptivos.
2026-03-08 23:20:50 +00:00
..
2026-01-11 22:35:49 +00:00

Advanced Features

Examples showcasing conditional logic, dynamic fields, and complex forms.

Files

Conditional Logic

  • conditional_form.toml - Fields that show/hide based on conditions
  • conditional_sections.toml - Sections visible based on form state
  • conditional_required_demo.rs - Programmatic example with conditional validation

Dynamic Display

  • display_items_demo.toml - Complex item rendering and formatting

Usage

TOML Forms (CLI/Web)

# CLI
cargo run --example conditional_form

# Web
cargo run -p typedialog-web -- --config conditional_form.toml
```text

### Rust Examples (with full control)
```bash
cargo run --example conditional_required_demo
```text

## Features Demonstrated

- **Conditional visibility** - Show/hide fields based on other fields
- **Conditional requirements** - Change validation rules dynamically
- **Section collapsing** - Organize complex forms hierarchically
- **Custom display logic** - Complex field rendering
- **State management** - Track form state and dependencies

## Patterns

### Conditional Field Example
```toml
[fields.experience]
type = "select"
label = "Experience Level"
options = ["Junior", "Senior"]

[fields.years]
type = "number"
label = "Years of Experience"
visible_when = { experience = "Senior" }
required_when = { experience = "Senior" }
```text

### Conditional Section Example
```toml
[sections.advanced_options]
visible_when = { show_advanced = true }

[sections.advanced_options.fields.custom_setting]
type = "text"
```text