{"version":3,"file":"props.mjs","sources":["../../../../../../packages/components/virtual-list/src/props.ts"],"sourcesContent":["import {\r\n  buildProp,\r\n  buildProps,\r\n  definePropType,\r\n  mutable,\r\n} from '@sgui-plus/utils'\r\nimport { VERTICAL } from './defaults'\r\n\r\nimport type { ExtractPropTypes } from 'vue'\r\nimport type { StyleValue } from '@sgui-plus/utils/types'\r\nimport type { ItemSize } from './types'\r\n\r\nconst itemSize = buildProp({\r\n  type: definePropType<number | ItemSize>([Number, Function]),\r\n  required: true,\r\n} as const)\r\n\r\nconst estimatedItemSize = buildProp({\r\n  type: Number,\r\n} as const)\r\n\r\nconst cache = buildProp({\r\n  type: Number,\r\n  default: 2,\r\n} as const)\r\n\r\nconst direction = buildProp({\r\n  type: String,\r\n  values: ['ltr', 'rtl'],\r\n  default: 'ltr',\r\n} as const)\r\n\r\nconst initScrollOffset = buildProp({\r\n  type: Number,\r\n  default: 0,\r\n} as const)\r\n\r\nconst total = buildProp({\r\n  type: Number,\r\n  required: true,\r\n} as const)\r\n\r\nconst layout = buildProp({\r\n  type: String,\r\n  values: ['horizontal', 'vertical'],\r\n  default: VERTICAL,\r\n} as const)\r\n\r\nexport const virtualizedProps = buildProps({\r\n  className: {\r\n    type: String,\r\n    default: '',\r\n  },\r\n\r\n  containerElement: {\r\n    type: definePropType<string | Element>([String, Object]),\r\n    default: 'div',\r\n  },\r\n\r\n  data: {\r\n    type: definePropType<any[]>(Array),\r\n    default: () => mutable([] as const),\r\n  },\r\n\r\n  /**\r\n   * @description controls the horizontal direction.\r\n   */\r\n  direction,\r\n\r\n  height: {\r\n    type: [String, Number],\r\n    required: true,\r\n  },\r\n\r\n  innerElement: {\r\n    type: [String, Object],\r\n    default: 'div',\r\n  },\r\n\r\n  style: {\r\n    type: definePropType<StyleValue>([Object, String, Array]),\r\n  },\r\n\r\n  useIsScrolling: {\r\n    type: Boolean,\r\n    default: false,\r\n  },\r\n\r\n  width: {\r\n    type: [Number, String],\r\n    required: false,\r\n  },\r\n\r\n  perfMode: {\r\n    type: Boolean,\r\n    default: true,\r\n  },\r\n  scrollbarAlwaysOn: {\r\n    type: Boolean,\r\n    default: false,\r\n  },\r\n} as const)\r\n\r\nexport const virtualizedListProps = buildProps({\r\n  /**\r\n   * @description describes how many items should be pre rendered to the head\r\n   * and the tail of the window\r\n   */\r\n  cache,\r\n\r\n  estimatedItemSize,\r\n\r\n  /**\r\n   * @description controls the list's orientation\r\n   */\r\n  layout,\r\n\r\n  initScrollOffset,\r\n\r\n  /**\r\n   * @description describes the total number of the list.\r\n   */\r\n  total,\r\n\r\n  itemSize,\r\n  ...virtualizedProps,\r\n} as const)\r\n\r\nexport const virtualizedGridProps = buildProps({\r\n  columnCache: cache,\r\n  columnWidth: itemSize,\r\n  estimatedColumnWidth: estimatedItemSize,\r\n  estimatedRowHeight: estimatedItemSize,\r\n  initScrollLeft: initScrollOffset,\r\n  initScrollTop: initScrollOffset,\r\n  rowCache: cache,\r\n  rowHeight: itemSize,\r\n  totalColumn: total,\r\n  totalRow: total,\r\n  ...virtualizedProps,\r\n} as const)\r\n\r\nexport const virtualizedScrollbarProps = buildProps({\r\n  layout,\r\n  total,\r\n  ratio: {\r\n    type: Number,\r\n    required: true,\r\n  },\r\n  clientSize: {\r\n    type: Number,\r\n    required: true,\r\n  },\r\n  scrollFrom: {\r\n    type: Number,\r\n    required: true,\r\n  },\r\n  visible: Boolean,\r\n} as const)\r\n\r\nexport type VirtualizedProps = ExtractPropTypes<typeof virtualizedProps>\r\nexport type VirtualizedListProps = ExtractPropTypes<typeof virtualizedListProps>\r\nexport type VirtualizedGridProps = ExtractPropTypes<typeof virtualizedGridProps>\r\n\r\nexport type VirtualizedScrollbarProps = ExtractPropTypes<\r\n  typeof virtualizedScrollbarProps\r\n>\r\n"],"names":[],"mappings":";;;;;AAOA,MAAM,QAAQ,GAAG,SAAS,CAAC;AAC3B,EAAE,IAAI,EAAE,cAAc,CAAC,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;AAC1C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