hongluan-ui
Version:
Hongluan Component Library for Vue 3
150 lines (147 loc) • 2.81 kB
JavaScript
import '../../../utils/index.mjs';
import { LTR, RTL, VERTICAL } from './defaults.mjs';
import { buildProp } from '../../../utils/vue/props/runtime.mjs';
const itemSize = {
type: [Number, Function],
required: true
};
const estimatedItemSize = {
type: [Number]
};
const cache = {
type: Number,
default: 2
};
const direction = {
type: String,
default: "ltr",
validator: (val) => {
return val === LTR || val === RTL;
}
};
const initScrollOffset = {
type: Number,
default: 0
};
const total = buildProp({
type: Number,
required: true
});
const layout = {
type: String,
default: VERTICAL
};
const virtualizedProps = {
className: {
type: [String, Object, Array],
default: ""
},
containerElement: {
type: [String, Object],
default: "div"
},
containerProps: {
type: Object,
default: () => ({})
},
data: {
type: [Array],
default: () => []
},
direction,
height: buildProp({
type: [String, Number],
required: true
}),
innerElement: {
type: [String, Object],
default: "div"
},
innerElementProps: {
type: Object,
default: () => ({})
},
style: {
type: [Object, String, Array]
},
useIsScrolling: {
type: Boolean,
default: false
},
width: buildProp({
type: [Number, String],
required: false
}),
perfMode: {
type: Boolean,
default: true
},
scrollbarAlwaysOn: {
type: Boolean,
default: false
}
};
const virtualizedListProps = {
cache,
estimatedItemSize,
layout,
initScrollOffset,
total,
itemSize,
...virtualizedProps
};
const scrollbarSize = {
type: Number,
default: 6
};
const startGap = { type: Number, default: 0 };
const endGap = { type: Number, default: 2 };
const virtualizedGridProps = {
columnCache: cache,
columnWidth: itemSize,
estimatedColumnWidth: estimatedItemSize,
estimatedRowHeight: estimatedItemSize,
initScrollLeft: initScrollOffset,
initScrollTop: initScrollOffset,
itemKey: {
type: Function,
default: ({
columnIndex,
rowIndex
}) => `${rowIndex}:${columnIndex}`
},
rowCache: cache,
rowHeight: itemSize,
totalColumn: total,
totalRow: total,
hScrollbarSize: scrollbarSize,
vScrollbarSize: scrollbarSize,
scrollbarStartGap: startGap,
scrollbarEndGap: endGap,
role: String,
...virtualizedProps
};
const virtualizedScrollbarProps = {
alwaysOn: Boolean,
class: String,
layout,
total,
ratio: {
type: Number,
required: true
},
clientSize: {
type: Number,
required: true
},
scrollFrom: {
type: Number,
required: true
},
scrollbarSize,
startGap,
endGap,
visible: Boolean
};
export { virtualizedGridProps, virtualizedListProps, virtualizedProps, virtualizedScrollbarProps };
//# sourceMappingURL=props.mjs.map