kind: Solution
version: v0
router:
  kind: Router
  routes:
    - frame: main
frames:
  main:
    kind: Frame
    layout: 
      kind: ColumnLayout
      widths: [ 500px, 1fr]
      areas: [panel,""]
    contents:
      panel:
        kind: ControlPanel
        controls:
          foodType:
            kind: Dropdown
            label: What do you want to eat?
            value: vegetables
            choices:
              - label: Vegetables or fruits
                value: vegetables
              - label: Meat
                value: meat
          onlyVeggiesWarning:
            kind: Text
            text: Sorry, we serve only vegetarian food
            hideWhen:
               kind: Equal
               control: foodType
               value: vegetables
          veggiesOrFruits:
            kind: Dropdown
            label: Do you prefer veggies of fruits?
            hideWhen:
               kind: Equal
               control: foodType
               value: meat
            choices:
              - label: Fruits 
                value: fruits
              - label: Veggies
                value: veggies
          productSelection:
            kind: Select
            itemHeight: 110
            height: 120
            label: What veggies you like?
            hideWhen:
               kind: Equal
               control: foodType
               value: meat
            disableWhen:
              kind: Falsy
              control: veggiesOrFruits
            choices:
              - label: Eggplant 
                value: eggplant
                kind: Image
                imagePath: eggplant.jpg
              - label: Peppers
                value: pepper
                kind: Image
                imagePath: peppers.jpg
            updateChoicesWhen:
              kind: Match
              control: veggiesOrFruits
              matchValues:
                - value: veggies
                  choices:
                    - label: Eggplant 
                      value: eggplant
                      kind: Image
                      imagePath: eggplant.jpg
                    - label: Peppers
                      value: peppers
                      kind: Image
                      imagePath: peppers.jpg
                - value: fruits
                  choices:
                    - label: Apples 
                      value: apples
                      kind: Image
                      imagePath: apples.jpg
                    - label: Blueberries
                      value: blueberries
                      kind: Image
                      imagePath: blueberry.jpg
          amount:
            kind: Dropdown
            label: Choose amount
            hideWhen:
               kind: Equal
               control: foodType
               value: meat
            disableWhen: 
              kind: Falsy
              control: productSelection
            choices: []
            updateChoicesWhen:
              kind: Match 
              control: productSelection
              matchValues:
              - value: apples
                choices:
                    - label: One
                      value: 1
                    - label: Two
                      value: 2
                    - label: Three
                      value: 3
              - value: peppers
                choices:
                    - label: One
                      value: 1
                    - label: Two
                      value: 2
                    - label: Three
                      value: 3
              - value: eggplant
                choices:
                    - label: Quoter
                      value: quoter
                    - label: Half
                      value: half
                    - label: Whole
                      value: whole
              - value: blueberries
                choices:
                    - label: 100 g
                      value: 100 g
                    - label: 200 g
                      value: 200 g
                    - label: 350 g
                      value: 350 g
                

                
                
