sa_calendar:
  namespace: "Organisms/TM - Alterations/Calendar"
  use: "@organisms/tm-sa/sa-calendar/calendar.twig"
  label: Calendar
  description: Calendar
  libraries:
    - sa_calendar_lib:
        js:
          ../behaviors/sa-calendar.js: { }
        css:
          component:
            ../styles/sa-calendar.css: { weight: 10 }

  fields:
    calendar_start:
      type: text
      label: Calendar start
      preview: "2021-06-01"
    calendar_end:
      type: text
      label: Calendar end
      preview: "2021-06-30"
    prev_from:
      type: text
      label: Prev from
      preview: "2021-05-01"
    prev_to:
      type: text
      label: Prev to
      preview: "2021-05-30"
    next_from:
      type: text
      label: Next from
      preview: "2021-07-01"
    next_to:
      type: text
      label: Next to
      preview: "2021-07-30"

    alterations:
      type: object
      label: Alterations
      description: List of alterations
      preview:
      - url: "/travel-information/service-alterations/liverpool-street-colchester-late-night-only-3"
        label: "Liverpool Street to Colchester (Late Night Only)"
        start_date: "Mon, 07/06/2021"
        end_date: "Fri, 11/06/2021"
        location: "Witham to Colchester (Late Night Only)"
        nid: "358574"
      - url: "/travel-information/service-alterations/service-reductions"
        label: "Service Reductions"
        start_date: "Wed, 03/05/2021"
        end_date: "Sat, 20/05/2021"
        location: "GA Network"
        nid: "358579"
      - url: "/travel-information/service-alterations/service-reductions"
        label: "London to Norwich (Late Night Only)"
        start_date: "Wed, 23/06/2021"
        end_date: "Sat, 25/06/2021"
        location: "Ipswich to Norwich (Late Night Only)"
        nid: "358589"
      - url: "https://www.train-operator.co.uk/travel-information/service-alterations/liverpool-street-shenfield-including-london-ipswich-intercity"
        label: "Liverpool Street to Shenfield including London-Ipswich Intercity Services LATE NOTICE ITEM"
        start_date: "Thu, 24/06/2021"
        end_date: "Sun, 25/06/2021"
        location: "Liverpool Street to Shenfield including London-Ipswich Intercity Services LATE NOTICE ITEM"
        nid: "358591"
  settings:
    btn_prev_class:
      type: textfield
      label: Button previous class
      default_value: 'btn btn-btn-lg btn-outline-default'
      preview: 'btn btn-btn-lg btn-outline-default'
    btn_next_class:
      type: textfield
      label: Button previous class
      default_value: 'btn btn-btn-lg btn-outline-default'
      preview: 'btn btn-btn-lg btn-outline-default'

sa_calendar_table:
  namespace: "Organisms/TM - Alterations/Calendar"
  use: "@organisms/tm-sa/sa-calendar/calendar-table.twig"
  label: Calendar table
  description: Calendar table

  fields:
    title:
      type: text
      label: Title
      preview: Alterations for month

    alterations:
      type: object
      label: Alterations
      description: List of alterations
      preview:
        - url: "/travel-information/service-alterations/liverpool-street-colchester-late-night-only-3"
          label: "Liverpool Street to Colchester (Late Night Only)"
          start_date: "Mon, 07/06/2021"
          end_date: "Fri, 11/06/2021"
          location: "Witham to Colchester (Late Night Only)"
          nid: "358574"
        - url: "/travel-information/service-alterations/service-reductions"
          label: "Service Reductions"
          start_date: "Wed, 03/05/2021"
          end_date: "Sat, 20/05/2021"
          location: "GA Network"
          nid: "358579"
        - url: "/travel-information/service-alterations/service-reductions"
          label: "London to Norwich (Late Night Only)"
          start_date: "Wed, 23/06/2021"
          end_date: "Sat, 25/06/2021"
          location: "Ipswich to Norwich (Late Night Only)"
          nid: "358589"
        - url: "https://www.train-operator.co.uk/travel-information/service-alterations/liverpool-street-shenfield-including-london-ipswich-intercity"
          label: "Liverpool Street to Shenfield including London-Ipswich Intercity Services LATE NOTICE ITEM"
          start_date: "Thu, 24/06/2021"
          end_date: "Sun, 25/06/2021"
          location: "Liverpool Street to Shenfield including London-Ipswich Intercity Services LATE NOTICE ITEM"
          nid: "358591"

  settings:
    hide:
      type: boolean
      label: Hide rows
      default_value: true
      preview: false
    tid:
      type: select
      label: Table type
      default_value: calendar
      preview: long_term
      options:
        long-term: Long term
        calendar: Calendar
