{
  "type": "component",
  "meta": {
    "docsUrl": "https://v1.quasar.dev/vue-components/virtual-scroll"
  },
  "props": {
    "virtual-scroll-horizontal": {
      "type": "Boolean",
      "desc": "Make virtual list work in horizontal mode",
      "category": "behavior"
    },
    "virtual-scroll-slice-size": {
      "type": "Number",
      "desc": "Number of options to render in the virtual list",
      "default": "30",
      "examples": [
        ":virtual-scroll-slice-size=\"60\""
      ],
      "category": "virtual-scroll"
    },
    "virtual-scroll-item-size": {
      "type": "Number",
      "desc": "Default size in pixels (height if vertical, width if horizontal) of an option; This value is used for rendering the initial list; Try to use a value close to the minimum size of an item",
      "default": "24",
      "examples": [
        ":virtual-scroll-item-size=\"48\""
      ],
      "category": "virtual-scroll"
    },
    "virtual-scroll-sticky-size-start": {
      "type": "Number",
      "desc": "Size in pixels (height if vertical, width if horizontal) of the sticky part (if using one) at the start of the list; A correct value will improve scroll precision",
      "default": "0",
      "examples": [
        ":virtual-scroll-sticky-size-start=\"48\""
      ],
      "category": "virtual-scroll"
    },
    "virtual-scroll-sticky-size-end": {
      "type": "Number",
      "desc": "Size in pixels (height if vertical, width if horizontal) of the sticky part (if using one) at the end of the list; A correct value will improve scroll precision",
      "default": "0",
      "examples": [
        ":virtual-scroll-sticky-size-end=\"48\""
      ],
      "category": "virtual-scroll"
    },
    "type": {
      "type": "String",
      "desc": "The type of content: list (default) or table",
      "default": "list",
      "values": [
        "list",
        "table"
      ],
      "category": "content"
    },
    "items": {
      "type": "Array",
      "desc": "Available list items that will be passed to the scoped slot; For best performance freeze the list of items; Required if 'itemsFn' is not supplied",
      "default": "[]",
      "examples": [
        ":items=\"[ 'BMW', 'Samsung Phone' ]\"",
        ":items=\"[ { label: 'BMW', value: 'car' }, { label: 'Samsung Phone', value: 'phone' } ]\""
      ],
      "category": "content"
    },
    "items-size": {
      "type": "Number",
      "desc": "Number of available items in the list; Required and used only if 'itemsFn' is provided",
      "default": "void 0",
      "examples": [
        ":items-size=\"100000\"",
        ":items-size=\"500\""
      ],
      "category": "content"
    },
    "items-fn": {
      "type": "Function",
      "desc": "Function to return the scope for the items to be displayed; Should return an array for items starting from 'from' index for size length; For best performance, reference it from your scope and do not define it inline",
      "params": {
        "from": {
          "type": "Number",
          "desc": "Index of the first item (0 based)",
          "examples": [
            15
          ]
        },
        "size": {
          "type": "Number",
          "desc": "Number of items to return",
          "examples": [
            38
          ]
        }
      },
      "returns": {
        "type": "Array",
        "desc": "List of scope for items to be displayed"
      },
      "examples": [
        ":items-fn=\"(from, size) => { const items = []; for (let i = 0; i < size; i++) { items.push('Item ' + i) }; return items }\""
      ],
      "category": "content"
    },
    "scroll-target": {
      "type": [
        "Element",
        "String"
      ],
      "desc": "CSS selector or DOM element to be used as a custom scroll container instead of the auto detected one",
      "examples": [
        ":scroll-target=\"$refs.scrollTarget\"",
        "scroll-target=\".scroll-target-class\"",
        "scroll-target=\"#scroll-target-id\"",
        "scroll-target=\"body\""
      ],
      "category": "behavior",
      "addedIn": "v1.8.0"
    }
  },
  "slots": {
    "before": {
      "desc": "Template slot for the elements that should be rendered before the list; Suggestion: thead before a table"
    },
    "after": {
      "desc": "Template slot for the elements that should be rendered after the list; Suggestion: tfoot after a table"
    }
  },
  "scopedSlots": {
    "default": {
      "desc": "Template slot for defining the list item; Suggestion: QItem",
      "scope": {
        "index": {
          "type": "Number",
          "desc": "Item index in the options list",
          "examples": [
            0
          ]
        },
        "item": {
          "type": "Any",
          "desc": "Item data -- its value is taken from 'options' prop"
        }
      }
    }
  },
  "events": {
    "virtual-scroll": {
      "desc": "Emitted when the virtual scroll occurs",
      "params": {
        "details": {
          "type": "Object",
          "desc": "Object of properties on the new scroll position",
          "definition": {
            "index": {
              "type": "Number",
              "desc": "Index of the list item that was scrolled into view (0 based)",
              "examples": [
                30
              ]
            },
            "from": {
              "type": "Number",
              "desc": "The index of the first list item that is rendered (0 based)",
              "examples": [
                10
              ]
            },
            "to": {
              "type": "Number",
              "desc": "The index of the last list item that is rendered (0 based)",
              "examples": [
                50
              ]
            },
            "direction": {
              "type": "String",
              "desc": "Direction of change",
              "values": [
                "increase",
                "decrease"
              ]
            },
            "ref": {
              "type": "Object",
              "desc": "Vue reference to the QVirtualList which triggered the event",
              "addedIn": "v1.8.4"
            }
          }
        }
      }
    }
  },
  "methods": {
    "scrollTo": {
      "desc": "Scroll the virtual scroll list to the item with the specified index (0 based)",
      "params": {
        "index": {
          "type": [
            "String",
            "Number"
          ],
          "desc": "The index of the list item (0 based)",
          "required": true,
          "examples": [
            "1",
            23
          ]
        }
      }
    },
    "reset": {
      "desc": "Resets the computations; Needed for custom edge-cases"
    },
    "refresh": {
      "desc": "Refreshes the list; Use it after appending items",
      "params": {
        "index": {
          "type": [
            "String",
            "Number"
          ],
          "desc": "The index of the list item to scroll to after refresh (0 based); If it's not specified the scroll position is not changed; Use a negative value to keep scroll position",
          "examples": [
            "1",
            23,
            -1
          ]
        }
      },
      "addedIn": "v1.8.4"
    }
  }
}