const __VLS_props = withDefaults(defineProps(), { loading: false, height: '32rem', rowSelection: 'single' });
const emit = defineEmits();
function value(row, field) { return typeof row === 'object' && row !== null ? row[field] : undefined; }
const __VLS_defaults = { loading: false, height: '32rem', rowSelection: 'single' };
const __VLS_ctx = {
    ...{},
    ...{},
    ...{},
    ...{},
    ...{},
};
let __VLS_components;
let __VLS_intrinsics;
let __VLS_directives;
__VLS_asFunctionalElement1(__VLS_intrinsics.div, __VLS_intrinsics.div)({
    ...{ class: "ks-native-grid" },
    ...{ style: ({ maxHeight: __VLS_ctx.height }) },
    'aria-busy': (__VLS_ctx.loading),
});
/** @type {__VLS_StyleScopedClasses['ks-native-grid']} */ ;
if (__VLS_ctx.loading) {
    __VLS_asFunctionalElement1(__VLS_intrinsics.p, __VLS_intrinsics.p)({
        role: "status",
    });
}
__VLS_asFunctionalElement1(__VLS_intrinsics.table, __VLS_intrinsics.table)({});
__VLS_asFunctionalElement1(__VLS_intrinsics.thead, __VLS_intrinsics.thead)({});
__VLS_asFunctionalElement1(__VLS_intrinsics.tr, __VLS_intrinsics.tr)({});
for (const [column] of __VLS_vFor((__VLS_ctx.columns))) {
    __VLS_asFunctionalElement1(__VLS_intrinsics.th, __VLS_intrinsics.th)({
        key: (column.field),
        scope: "col",
        ...{ style: ({ width: column.width ? `${column.width}px` : undefined, minWidth: column.minWidth ? `${column.minWidth}px` : undefined }) },
    });
    (column.header);
    // @ts-ignore
    [height, loading, loading, columns,];
}
__VLS_asFunctionalElement1(__VLS_intrinsics.tbody, __VLS_intrinsics.tbody)({});
for (const [row, index] of __VLS_vFor((__VLS_ctx.rows))) {
    __VLS_asFunctionalElement1(__VLS_intrinsics.tr, __VLS_intrinsics.tr)({
        ...{ onClick: (...[$event]) => {
                return (__VLS_ctx.emit('row-selected', row));
                // @ts-ignore
                [rows, emit,];
            } },
        ...{ onKeydown: (...[$event]) => {
                return (__VLS_ctx.emit('row-selected', row));
                // @ts-ignore
                [emit,];
            } },
        key: (index),
        tabindex: "0",
    });
    for (const [column] of __VLS_vFor((__VLS_ctx.columns))) {
        __VLS_asFunctionalElement1(__VLS_intrinsics.td, __VLS_intrinsics.td)({
            key: (column.field),
        });
        (column.formatter ? column.formatter(__VLS_ctx.value(row, column.field), row) : __VLS_ctx.value(row, column.field));
        // @ts-ignore
        [columns, value, value,];
    }
    // @ts-ignore
    [];
}
if (!__VLS_ctx.loading && __VLS_ctx.rows.length === 0) {
    __VLS_asFunctionalElement1(__VLS_intrinsics.tr, __VLS_intrinsics.tr)({});
    __VLS_asFunctionalElement1(__VLS_intrinsics.td, __VLS_intrinsics.td)({
        colspan: (__VLS_ctx.columns.length),
    });
}
// @ts-ignore
[loading, columns, rows,];
const __VLS_export = (await import('vue')).defineComponent({
    __typeEmits: {},
    __typeProps: {},
    props: {},
});
export default {};
