import { defineComponent, PropType } from '@vue/composition-api'; import { fixStyle, flexWidth } from '../../utils/dom'; import { HeaderGroup } from '@/lib/components/header/header-group'; import { IndexColumn } from '@/lib/types'; import './index.scss'; import { SCROLL_WIDTH } from '@/lib/constants/dom-fixed'; import {log} from "@/lib/utils/log"; export const GridHeader = defineComponent({ functional: true, name: 'GridHeader', props: { rowHeight: { require: true, type: Number, }, rowLevel: { require: true, type: Number, }, leftWidth: { require: true, type: Number, }, rightWidth: { require: true, type: Number, }, scrollWidth: { require: true, type: Number, }, leftColumns: { require: true, type: Array as PropType, }, rightColumns: { require: true, type: Array as PropType, }, scrollColumns: { require: true, type: Array as PropType, }, scrollLeft: { require: true, type: Number, }, height: { require: true, type: Number, }, }, render(_, { props }) { log('[render] header render'); const { height, rowHeight, rowLevel, scrollLeft, leftColumns, rightColumns, scrollColumns, leftWidth, rightWidth, scrollWidth, } = props; const getGroupStyle = (width: number) => fixStyle({ ...flexWidth(width), height }); return (
{leftColumns.length > 0 ? ( ) : null}
{scrollColumns.length > 0 ? ( ) : null}
{rightColumns.length > 0 ? ( ) : null}
); }, });