7780d16101d53cc24b4f4201888a837b83c67ef79a09e3134522a8b5d238017c05014c317b1cdceb56b688958526aea9636cf3e11cb25b2c83d90e857fe4fb 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. import { VERTICAL } from './defaults.mjs';
  2. import { buildProp, buildProps, definePropType } from '../../../utils/vue/props/runtime.mjs';
  3. import { mutable } from '../../../utils/typescript.mjs';
  4. const itemSize = buildProp({
  5. type: definePropType([Number, Function]),
  6. required: true
  7. });
  8. const estimatedItemSize = buildProp({
  9. type: Number
  10. });
  11. const cache = buildProp({
  12. type: Number,
  13. default: 2
  14. });
  15. const direction = buildProp({
  16. type: String,
  17. values: ["ltr", "rtl"],
  18. default: "ltr"
  19. });
  20. const initScrollOffset = buildProp({
  21. type: Number,
  22. default: 0
  23. });
  24. const total = buildProp({
  25. type: Number,
  26. required: true
  27. });
  28. const layout = buildProp({
  29. type: String,
  30. values: ["horizontal", "vertical"],
  31. default: VERTICAL
  32. });
  33. const virtualizedProps = buildProps({
  34. className: {
  35. type: String,
  36. default: ""
  37. },
  38. containerElement: {
  39. type: definePropType([String, Object]),
  40. default: "div"
  41. },
  42. data: {
  43. type: definePropType(Array),
  44. default: () => mutable([])
  45. },
  46. direction,
  47. height: {
  48. type: [String, Number],
  49. required: true
  50. },
  51. innerElement: {
  52. type: [String, Object],
  53. default: "div"
  54. },
  55. style: {
  56. type: definePropType([Object, String, Array])
  57. },
  58. useIsScrolling: Boolean,
  59. width: {
  60. type: [Number, String],
  61. required: false
  62. },
  63. perfMode: {
  64. type: Boolean,
  65. default: true
  66. },
  67. scrollbarAlwaysOn: Boolean
  68. });
  69. const virtualizedListProps = buildProps({
  70. cache,
  71. estimatedItemSize,
  72. layout,
  73. initScrollOffset,
  74. total,
  75. itemSize,
  76. ...virtualizedProps
  77. });
  78. const scrollbarSize = {
  79. type: Number,
  80. default: 6
  81. };
  82. const startGap = { type: Number, default: 0 };
  83. const endGap = { type: Number, default: 2 };
  84. const virtualizedGridProps = buildProps({
  85. columnCache: cache,
  86. columnWidth: itemSize,
  87. estimatedColumnWidth: estimatedItemSize,
  88. estimatedRowHeight: estimatedItemSize,
  89. initScrollLeft: initScrollOffset,
  90. initScrollTop: initScrollOffset,
  91. itemKey: {
  92. type: definePropType(Function),
  93. default: ({
  94. columnIndex,
  95. rowIndex
  96. }) => `${rowIndex}:${columnIndex}`
  97. },
  98. rowCache: cache,
  99. rowHeight: itemSize,
  100. totalColumn: total,
  101. totalRow: total,
  102. hScrollbarSize: scrollbarSize,
  103. vScrollbarSize: scrollbarSize,
  104. scrollbarStartGap: startGap,
  105. scrollbarEndGap: endGap,
  106. role: String,
  107. ...virtualizedProps
  108. });
  109. const virtualizedScrollbarProps = buildProps({
  110. alwaysOn: Boolean,
  111. class: String,
  112. layout,
  113. total,
  114. ratio: {
  115. type: Number,
  116. required: true
  117. },
  118. clientSize: {
  119. type: Number,
  120. required: true
  121. },
  122. scrollFrom: {
  123. type: Number,
  124. required: true
  125. },
  126. scrollbarSize,
  127. startGap,
  128. endGap,
  129. visible: Boolean
  130. });
  131. export { virtualizedGridProps, virtualizedListProps, virtualizedProps, virtualizedScrollbarProps };
  132. //# sourceMappingURL=props.mjs.map