{"version":3,"file":"props.mjs","names":[],"sources":["../../../../../../packages/components/virtual-list/src/props.ts"],"sourcesContent":["import {\n  buildProp,\n  buildProps,\n  definePropType,\n  mutable,\n} from '@element-plus/utils'\nimport { VERTICAL } from './defaults'\n\nimport type { ExtractPropTypes, ExtractPublicPropTypes, StyleValue } from 'vue'\nimport type { ClassValue } from '@element-plus/utils'\nimport type { GridItemKeyGetter, ItemSize } from './types'\n\nconst itemSize = buildProp({\n  type: definePropType<number | ItemSize>([Number, Function]),\n  required: true,\n} as const)\n\nconst estimatedItemSize = buildProp({\n  type: Number,\n} as const)\n\nconst cache = buildProp({\n  type: Number,\n  default: 2,\n} as const)\n\nconst direction = buildProp({\n  type: String,\n  values: ['ltr', 'rtl'],\n  default: 'ltr',\n} as const)\n\nconst initScrollOffset = buildProp({\n  type: Number,\n  default: 0,\n} as const)\n\nconst total = buildProp({\n  type: Number,\n  required: true,\n} as const)\n\nconst layout = buildProp({\n  type: String,\n  values: ['horizontal', 'vertical'],\n  default: VERTICAL,\n} as const)\n\nexport const virtualizedProps = buildProps({\n  className: {\n    type: definePropType<ClassValue>([String, Array, Object, Boolean]),\n    default: '',\n  },\n\n  containerElement: {\n    type: definePropType<string | Element>([String, Object]),\n    default: 'div',\n  },\n\n  data: {\n    type: definePropType<any[]>(Array),\n    default: () => mutable([] as const),\n  },\n\n  /**\n   * @description controls the horizontal direction.\n   */\n  direction,\n\n  height: {\n    type: [String, Number],\n    required: true,\n  },\n\n  innerElement: {\n    type: [String, Object],\n    default: 'div',\n  },\n\n  innerProps: {\n    type: definePropType<Record<string, unknown>>(Object),\n    default: () => ({}),\n  },\n\n  style: {\n    type: definePropType<StyleValue>([Object, String, Array, Boolean]),\n    default: undefined,\n  },\n\n  useIsScrolling: Boolean,\n\n  width: {\n    type: [Number, String],\n    required: false,\n  },\n\n  innerWidth: {\n    type: [Number, String],\n    required: false,\n  },\n\n  perfMode: {\n    type: Boolean,\n    default: true,\n  },\n  scrollbarAlwaysOn: Boolean,\n} as const)\n\nexport const virtualizedListProps = buildProps({\n  /**\n   * @description describes how many items should be pre rendered to the head\n   * and the tail of the window\n   */\n  cache,\n\n  estimatedItemSize,\n\n  /**\n   * @description controls the list's orientation\n   */\n  layout,\n\n  initScrollOffset,\n\n  /**\n   * @description describes the total number of the list.\n   */\n  total,\n\n  itemSize,\n  ...virtualizedProps,\n} as const)\n\nconst scrollbarSize = {\n  type: Number,\n  default: 6,\n} as const\n\nconst startGap = { type: Number, default: 0 } as const\nconst endGap = { type: Number, default: 2 } as const\n\nexport const virtualizedGridProps = buildProps({\n  columnCache: cache,\n  columnWidth: itemSize,\n  estimatedColumnWidth: estimatedItemSize,\n  estimatedRowHeight: estimatedItemSize,\n  initScrollLeft: initScrollOffset,\n  initScrollTop: initScrollOffset,\n  itemKey: {\n    type: definePropType<GridItemKeyGetter>(Function),\n    default: ({\n      columnIndex,\n      rowIndex,\n    }: {\n      columnIndex: number\n      rowIndex: number\n    }) => `${rowIndex}:${columnIndex}`,\n  },\n  rowCache: cache,\n  rowHeight: itemSize,\n  totalColumn: total,\n  totalRow: total,\n  hScrollbarSize: scrollbarSize,\n  vScrollbarSize: scrollbarSize,\n  scrollbarStartGap: startGap,\n  scrollbarEndGap: endGap,\n  role: String,\n  ...virtualizedProps,\n} as const)\n\nexport const virtualizedScrollbarProps = buildProps({\n  alwaysOn: Boolean,\n  class: {\n    type: definePropType<ClassValue>([String, Array, Object, Boolean]),\n    default: '',\n  },\n  layout,\n  total,\n  ratio: {\n    type: Number,\n    required: true,\n  },\n  clientSize: {\n    type: Number,\n    required: true,\n  },\n  scrollFrom: {\n    type: Number,\n    required: true,\n  },\n  scrollbarSize,\n  startGap,\n  endGap,\n\n  visible: Boolean,\n} as const)\n\nexport type VirtualizedProps = ExtractPropTypes<typeof virtualizedProps>\nexport type VirtualizedPropsPublic = ExtractPublicPropTypes<\n  typeof virtualizedProps\n>\nexport type VirtualizedListProps = ExtractPropTypes<typeof virtualizedListProps>\nexport type VirtualizedListPropsPublic = ExtractPublicPropTypes<\n  typeof virtualizedListProps\n>\nexport type VirtualizedGridProps = ExtractPropTypes<typeof virtualizedGridProps>\nexport type VirtualizedGridPropsPublic = ExtractPublicPropTypes<\n  typeof virtualizedGridProps\n>\n\nexport type VirtualizedScrollbarProps = ExtractPropTypes<\n  typeof virtualizedScrollbarProps\n>\nexport type VirtualizedScrollbarPropsPublic = ExtractPublicPropTypes<\n  typeof virtualizedScrollbarProps\n>\n"],"mappings":";;;;AAYA,MAAM,WAAW,UAAU;CACzB,MAAM,eAAkC,CAAC,QAAQ,QAAQ,CAAC;CAC1D,UAAU;AACZ,CAAU;AAEV,MAAM,oBAAoB,UAAU,EAClC,MAAM,OACR,CAAU;AAEV,MAAM,QAAQ,UAAU;CACtB,MAAM;CACN,SAAS;AACX,CAAU;AAEV,MAAM,YAAY,UAAU;CAC1B,MAAM;CACN,QAAQ,CAAC,OAAO,KAAK;CACrB,SAAS;AACX,CAAU;AAEV,MAAM,mBAAmB,UAAU;CACjC,MAAM;CACN,SAAS;AACX,CAAU;AAEV,MAAM,QAAQ,UAAU;CACtB,MAAM;CACN,UAAU;AACZ,CAAU;AAEV,MAAM,SAAS,UAAU;CACvB,MAAM;CACN,QAAQ,CAAC,cAAc,UAAU;CACjC,SAAS;AACX,CAAU;AAEV,MAAa,mBAAmB,WAAW;CACzC,WAAW;EACT,MAAM,eAA2B;GAAC;GAAQ;GAAO;GAAQ;EAAO,CAAC;EACjE,SAAS;CACX;CAEA,kBAAkB;EAChB,MAAM,eAAiC,CAAC,QAAQ,MAAM,CAAC;EACvD,SAAS;CACX;CAEA,MAAM;EACJ,MAAM,eAAsB,KAAK;EACjC,eAAe,QAAQ,CAAC,CAAU;CACpC;;;;CAKA;CAEA,QAAQ;EACN,MAAM,CAAC,QAAQ,MAAM;EACrB,UAAU;CACZ;CAEA,cAAc;EACZ,MAAM,CAAC,QAAQ,MAAM;EACrB,SAAS;CACX;CAEA,YAAY;EACV,MAAM,eAAwC,MAAM;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