snapshots_test__widgets_ir.snap raw

---
source: crates/guiduck-component-core/tests/snapshots_test.rs
assertion_line: 383
expression: "compile_or_render_errors(source, \"Settings.gdc\")"
---
Ir {
    name: "Settings",
    records: [
        IrRecord {
            name: "Option",
            fields: [
                (
                    "id",
                    I64,
                ),
                (
                    "label",
                    String,
                ),
                (
                    "on",
                    Bool,
                ),
            ],
        },
    ],
    props: [],
    outputs: [],
    states: [
        IrState {
            name: "options",
            ty: ValueTy {
                kind: Record(
                    0,
                ),
                list: true,
            },
            init: List(
                [
                    Record {
                        name: "Option",
                        fields: [
                            (
                                "id",
                                Int(
                                    1,
                                ),
                            ),
                            (
                                "label",
                                Str(
                                    "wifi",
                                ),
                            ),
                            (
                                "on",
                                Bool(
                                    true,
                                ),
                            ),
                        ],
                    },
                    Record {
                        name: "Option",
                        fields: [
                            (
                                "id",
                                Int(
                                    2,
                                ),
                            ),
                            (
                                "label",
                                Str(
                                    "bluetooth",
                                ),
                            ),
                            (
                                "on",
                                Bool(
                                    false,
                                ),
                            ),
                        ],
                    },
                    Record {
                        name: "Option",
                        fields: [
                            (
                                "id",
                                Int(
                                    3,
                                ),
                            ),
                            (
                                "label",
                                Str(
                                    "airplane",
                                ),
                            ),
                            (
                                "on",
                                Bool(
                                    false,
                                ),
                            ),
                        ],
                    },
                ],
            ),
        },
    ],
    handlers: [
        IrHandler {
            name: "set-option",
            payloads: [
                I64,
                Bool,
            ],
            returns: None,
        },
        IrHandler {
            name: "enable-all",
            payloads: [],
            returns: None,
        },
        IrHandler {
            name: "disable-all",
            payloads: [],
            returns: None,
        },
    ],
    nodes: [
        IrNode {
            widget: Widget(
                IrWidgetNode {
                    name: "container",
                    type_path: "::guiduck::core::Container",
                    props: [],
                    events: [],
                    queries: [],
                },
            ),
            classes: [],
            style: StyleIr {
                width: None,
                height: None,
                padding: Some(
                    8.0,
                ),
                gap: Some(
                    6.0,
                ),
                direction: Some(
                    Column,
                ),
                align_items: None,
                justify_content: None,
                align_self: None,
                grow: None,
                shrink: None,
                basis: None,
            },
            events: [],
            autofocus: false,
            enabled: None,
            focused: None,
            tooltip: None,
            accel: None,
            component_props: [],
            component_outputs: [],
            component_key: None,
            control: None,
            children: [
                1,
                4,
            ],
        },
        IrNode {
            widget: Widget(
                IrWidgetNode {
                    name: "container",
                    type_path: "::guiduck::core::Container",
                    props: [],
                    events: [],
                    queries: [],
                },
            ),
            classes: [],
            style: StyleIr {
                width: None,
                height: None,
                padding: None,
                gap: Some(
                    6.0,
                ),
                direction: Some(
                    Row,
                ),
                align_items: None,
                justify_content: None,
                align_self: None,
                grow: None,
                shrink: None,
                basis: None,
            },
            events: [],
            autofocus: false,
            enabled: None,
            focused: None,
            tooltip: None,
            accel: None,
            component_props: [],
            component_outputs: [],
            component_key: None,
            control: None,
            children: [
                2,
                3,
            ],
        },
        IrNode {
            widget: Widget(
                IrWidgetNode {
                    name: "button",
                    type_path: "::guiduck::core::Button",
                    props: [
                        IrWidgetProp {
                            name: "label",
                            setter: "set_label",
                            ty: Scalar(
                                String,
                            ),
                            value: Static(
                                Str(
                                    "all on",
                                ),
                            ),
                        },
                        IrWidgetProp {
                            name: "font-family",
                            setter: "set_family",
                            ty: Scalar(
                                String,
                            ),
                            value: Static(
                                Str(
                                    "DejaVu Sans",
                                ),
                            ),
                        },
                    ],
                    events: [],
                    queries: [],
                },
            ),
            classes: [],
            style: StyleIr {
                width: None,
                height: None,
                padding: None,
                gap: None,
                direction: None,
                align_items: None,
                justify_content: None,
                align_self: None,
                grow: None,
                shrink: None,
                basis: None,
            },
            events: [
                IrEvent {
                    event: Click,
                    handler: "enable-all",
                    args: [],
                },
            ],
            autofocus: false,
            enabled: None,
            focused: None,
            tooltip: None,
            accel: None,
            component_props: [],
            component_outputs: [],
            component_key: None,
            control: None,
            children: [],
        },
        IrNode {
            widget: Widget(
                IrWidgetNode {
                    name: "button",
                    type_path: "::guiduck::core::Button",
                    props: [
                        IrWidgetProp {
                            name: "label",
                            setter: "set_label",
                            ty: Scalar(
                                String,
                            ),
                            value: Static(
                                Str(
                                    "all off",
                                ),
                            ),
                        },
                        IrWidgetProp {
                            name: "font-family",
                            setter: "set_family",
                            ty: Scalar(
                                String,
                            ),
                            value: Static(
                                Str(
                                    "DejaVu Sans",
                                ),
                            ),
                        },
                    ],
                    events: [],
                    queries: [],
                },
            ),
            classes: [],
            style: StyleIr {
                width: None,
                height: None,
                padding: None,
                gap: None,
                direction: None,
                align_items: None,
                justify_content: None,
                align_self: None,
                grow: None,
                shrink: None,
                basis: None,
            },
            events: [
                IrEvent {
                    event: Click,
                    handler: "disable-all",
                    args: [],
                },
            ],
            autofocus: false,
            enabled: None,
            focused: None,
            tooltip: None,
            accel: None,
            component_props: [],
            component_outputs: [],
            component_key: None,
            control: None,
            children: [],
        },
        IrNode {
            widget: For,
            classes: [],
            style: StyleIr {
                width: None,
                height: None,
                padding: None,
                gap: None,
                direction: None,
                align_items: None,
                justify_content: None,
                align_self: None,
                grow: None,
                shrink: None,
                basis: None,
            },
            events: [],
            autofocus: false,
            enabled: None,
            focused: None,
            tooltip: None,
            accel: None,
            component_props: [],
            component_outputs: [],
            component_key: None,
            control: Some(
                For {
                    var: "opt",
                    index: None,
                    list: "options",
                    element: Record(
                        0,
                    ),
                    key: Some(
                        Path(
                            [
                                "opt",
                                "id",
                            ],
                            Span {
                                start: 992,
                                end: 998,
                            },
                        ),
                    ),
                },
            ),
            children: [
                5,
            ],
        },
        IrNode {
            widget: Widget(
                IrWidgetNode {
                    name: "checkbox",
                    type_path: "::guiduck::core::Checkbox",
                    props: [
                        IrWidgetProp {
                            name: "label",
                            setter: "set_label",
                            ty: Scalar(
                                String,
                            ),
                            value: Binding(
                                Path(
                                    [
                                        "opt",
                                        "label",
                                    ],
                                    Span {
                                        start: 1022,
                                        end: 1031,
                                    },
                                ),
                            ),
                        },
                        IrWidgetProp {
                            name: "font-family",
                            setter: "set_family",
                            ty: Scalar(
                                String,
                            ),
                            value: Static(
                                Str(
                                    "DejaVu Sans",
                                ),
                            ),
                        },
                        IrWidgetProp {
                            name: "checked",
                            setter: "set_checked",
                            ty: Scalar(
                                Bool,
                            ),
                            value: Binding(
                                Path(
                                    [
                                        "opt",
                                        "on",
                                    ],
                                    Span {
                                        start: 1084,
                                        end: 1090,
                                    },
                                ),
                            ),
                        },
                    ],
                    events: [],
                    queries: [],
                },
            ),
            classes: [],
            style: StyleIr {
                width: None,
                height: None,
                padding: None,
                gap: None,
                direction: None,
                align_items: None,
                justify_content: None,
                align_self: None,
                grow: None,
                shrink: None,
                basis: None,
            },
            events: [
                IrEvent {
                    event: Toggled,
                    handler: "set-option",
                    args: [
                        Path(
                            [
                                "opt",
                                "id",
                            ],
                            Span {
                                start: 1130,
                                end: 1136,
                            },
                        ),
                        Path(
                            [
                                "payload",
                            ],
                            Span {
                                start: 1137,
                                end: 1144,
                            },
                        ),
                    ],
                },
            ],
            autofocus: false,
            enabled: None,
            focused: None,
            tooltip: None,
            accel: None,
            component_props: [],
            component_outputs: [],
            component_key: None,
            control: None,
            children: [],
        },
    ],
}