import * as __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__ from "react/jsx-runtime";
import * as __WEBPACK_EXTERNAL_MODULE_react__ from "react";
import * as __WEBPACK_EXTERNAL_MODULE__tachybase_schema__ from "@tachybase/schema";
import * as __WEBPACK_EXTERNAL_MODULE__ctrl_tinycolor__ from "@ctrl/tinycolor";
import * as __WEBPACK_EXTERNAL_MODULE__dnd_kit_core__ from "@dnd-kit/core";
import * as __WEBPACK_EXTERNAL_MODULE_classnames__ from "classnames";
import * as __WEBPACK_EXTERNAL_MODULE_lodash__ from "lodash";
import * as __WEBPACK_EXTERNAL_MODULE__builtins_index_mjs__ from "../__builtins__/index.mjs";
import * as __WEBPACK_EXTERNAL_MODULE__index_mjs__ from "../../../index.mjs";
import * as __WEBPACK_EXTERNAL_MODULE__block_provider_index_mjs__ from "../../../block-provider/index.mjs";
import * as __WEBPACK_EXTERNAL_MODULE__common_dnd_context_index_mjs__ from "../../common/dnd-context/index.mjs";
import * as __WEBPACK_EXTERNAL_MODULE__Grid_style_mjs__ from "./Grid.style.mjs";
const GridRowContext = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react__.createContext)({});
GridRowContext.displayName = 'GridRowContext';
const GridColContext = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react__.createContext)({});
GridColContext.displayName = 'GridColContext';
const GridContext = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react__.createContext)({});
GridContext.displayName = 'GridContext';
const breakRemoveOnGrid = (s)=>'Grid' === s['x-component'];
const breakRemoveOnRow = (s)=>'Grid.Row' === s['x-component'];
const MemorizedRecursionField = /*#__PURE__*/ __WEBPACK_EXTERNAL_MODULE_react__["default"].memo(__WEBPACK_EXTERNAL_MODULE__tachybase_schema__.RecursionField);
MemorizedRecursionField.displayName = 'MemorizedRecursionField';
const ColDivider = (props)=>{
    var _dndContext_active_data_current_schema, _dndContext_active_data_current, _dndContext_active;
    const { token } = (0, __WEBPACK_EXTERNAL_MODULE__builtins_index_mjs__.useToken)();
    const dragIdRef = (0, __WEBPACK_EXTERNAL_MODULE_react__.useRef)(null);
    const { isOver, setNodeRef } = (0, __WEBPACK_EXTERNAL_MODULE__dnd_kit_core__.useDroppable)({
        id: props.id,
        data: props.data
    });
    const { dn, designable } = (0, __WEBPACK_EXTERNAL_MODULE__index_mjs__.useDesignable)();
    const dividerRef = (0, __WEBPACK_EXTERNAL_MODULE_react__.useRef)();
    const droppableStyle = (0, __WEBPACK_EXTERNAL_MODULE_react__.useMemo)(()=>{
        if (!isOver) return {};
        return {
            backgroundColor: new __WEBPACK_EXTERNAL_MODULE__ctrl_tinycolor__.TinyColor(token.colorSettings).setAlpha(0.1).toHex8String()
        };
    }, [
        isOver
    ]);
    const dndContext = (0, __WEBPACK_EXTERNAL_MODULE__dnd_kit_core__.useDndContext)();
    const activeSchema = null === (_dndContext_active = dndContext.active) || void 0 === _dndContext_active ? void 0 : null === (_dndContext_active_data_current = _dndContext_active.data.current) || void 0 === _dndContext_active_data_current ? void 0 : null === (_dndContext_active_data_current_schema = _dndContext_active_data_current.schema) || void 0 === _dndContext_active_data_current_schema ? void 0 : _dndContext_active_data_current_schema.parent;
    const blocksLength = activeSchema ? Object.keys(activeSchema.properties).length : 0;
    let visible = true;
    if (1 === blocksLength) {
        if (props.first) visible = activeSchema !== props.cols[0];
        else {
            const currentSchema = props.cols[props.index];
            const downSchema = props.cols[props.index + 1];
            visible = activeSchema !== currentSchema && downSchema !== activeSchema;
        }
    }
    const prevSchema = props.cols[props.index];
    const nextSchema = props.cols[props.index + 1];
    const { attributes, listeners, setNodeRef: setDraggableNodeRef, isDragging } = (0, __WEBPACK_EXTERNAL_MODULE__dnd_kit_core__.useDraggable)({
        disabled: props.first || props.last || !designable,
        id: props.id,
        data: {
            dividerRef,
            prevSchema,
            nextSchema
        }
    });
    const [clientWidths, setClientWidths] = (0, __WEBPACK_EXTERNAL_MODULE_react__.useState)([
        0,
        0
    ]);
    (0, __WEBPACK_EXTERNAL_MODULE__dnd_kit_core__.useDndMonitor)({
        onDragStart (event) {
            var _event_active_data_current_dividerRef;
            if ((null === (_event_active_data_current_dividerRef = event.active.data.current.dividerRef) || void 0 === _event_active_data_current_dividerRef ? void 0 : _event_active_data_current_dividerRef.current) !== dividerRef.current) return;
            dragIdRef.current = event.active.id;
            const el = dividerRef.current;
            const prev = el.previousElementSibling;
            const next = el.nextElementSibling;
            setClientWidths([
                prev.clientWidth,
                next.clientWidth
            ]);
        },
        onDragMove (event) {
            if (!isDragging) return;
            if (dragIdRef.current === event.active.id) dragIdRef.current = dragIdRef.current + '_move';
            const el = dividerRef.current;
            const prev = el.previousElementSibling;
            const next = el.nextElementSibling;
            prev.style.width = "".concat(clientWidths[0] + event.delta.x, "px");
            next.style.width = "".concat(clientWidths[1] - event.delta.x, "px");
        },
        onDragEnd (event) {
            var _dragIdRef_current;
            if (!dragIdRef.current) return;
            if (null === (_dragIdRef_current = dragIdRef.current) || void 0 === _dragIdRef_current ? void 0 : _dragIdRef_current.startsWith(event.active.id)) {
                if (!dragIdRef.current.endsWith('_move')) return;
            }
            if (clientWidths[0] <= 0 || clientWidths[1] <= 0) return;
            setClientWidths([
                0,
                0
            ]);
            if (!prevSchema || !nextSchema) return;
            const el = dividerRef.current;
            const prev = el.previousElementSibling;
            const next = el.nextElementSibling;
            prevSchema['x-component-props'] = prevSchema['x-component-props'] || {};
            nextSchema['x-component-props'] = nextSchema['x-component-props'] || {};
            const dividerWidth = el.clientWidth * (props.cols.length + 1) / props.cols.length;
            const preWidth = (100 * (prev.getBoundingClientRect().width + dividerWidth) / el.parentElement.clientWidth).toFixed(2);
            const nextWidth = (100 * (next.getBoundingClientRect().width + dividerWidth) / el.parentElement.clientWidth).toFixed(2);
            __WEBPACK_EXTERNAL_MODULE_lodash__["default"].set(prevSchema, 'x-component-props.width', preWidth);
            __WEBPACK_EXTERNAL_MODULE_lodash__["default"].set(nextSchema, 'x-component-props.width', nextWidth);
            dn.emit('batchPatch', {
                schemas: [
                    {
                        ['x-uid']: prevSchema['x-uid'],
                        'x-component-props': {
                            ...prevSchema['x-component-props']
                        }
                    },
                    {
                        ['x-uid']: nextSchema['x-uid'],
                        'x-component-props': {
                            ...nextSchema['x-component-props']
                        }
                    }
                ]
            });
        }
    });
    return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)("div", {
        ref: (el)=>{
            if (visible) {
                setNodeRef(el);
                dividerRef.current = el;
            }
        },
        className: (0, __WEBPACK_EXTERNAL_MODULE_classnames__["default"])('tb-col-divider', 'ColDivider'),
        style: droppableStyle,
        children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)("div", {
            ref: setDraggableNodeRef,
            ...listeners,
            ...attributes,
            tabIndex: -1,
            className: props.first || props.last || !designable ? null : 'DraggableNode'
        })
    });
};
const RowDivider = (props)=>{
    var _dndContext_active_data_current_schema, _dndContext_active_data_current, _dndContext_active;
    const { token } = (0, __WEBPACK_EXTERNAL_MODULE__builtins_index_mjs__.useToken)();
    const { isOver, setNodeRef } = (0, __WEBPACK_EXTERNAL_MODULE__dnd_kit_core__.useDroppable)({
        id: props.id,
        data: props.data
    });
    const [active, setActive] = (0, __WEBPACK_EXTERNAL_MODULE_react__.useState)(false);
    const droppableStyle = (0, __WEBPACK_EXTERNAL_MODULE_react__.useMemo)(()=>{
        if (!isOver) return {
            zIndex: active ? 1000 : -1
        };
        return {
            zIndex: active ? 1000 : -1,
            backgroundColor: new __WEBPACK_EXTERNAL_MODULE__ctrl_tinycolor__.TinyColor(token.colorSettings).setAlpha(0.1).toHex8String()
        };
    }, [
        active,
        isOver
    ]);
    const dndContext = (0, __WEBPACK_EXTERNAL_MODULE__dnd_kit_core__.useDndContext)();
    const currentSchema = props.rows[props.index];
    const activeSchema = null === (_dndContext_active = dndContext.active) || void 0 === _dndContext_active ? void 0 : null === (_dndContext_active_data_current = _dndContext_active.data.current) || void 0 === _dndContext_active_data_current ? void 0 : null === (_dndContext_active_data_current_schema = _dndContext_active_data_current.schema) || void 0 === _dndContext_active_data_current_schema ? void 0 : _dndContext_active_data_current_schema.parent.parent;
    const colsLength = null == activeSchema ? void 0 : activeSchema.mapProperties((schema)=>'Grid.Col' === schema['x-component']).filter(Boolean).length;
    let visible = true;
    if (1 === colsLength) {
        if (props.first) visible = activeSchema !== props.rows[0];
        else {
            const downSchema = props.rows[props.index + 1];
            visible = activeSchema !== currentSchema && downSchema !== activeSchema;
        }
    }
    (0, __WEBPACK_EXTERNAL_MODULE__dnd_kit_core__.useDndMonitor)({
        onDragStart (event) {
            setActive(true);
        },
        onDragMove (event) {},
        onDragOver (event) {},
        onDragEnd (event) {
            setActive(false);
        },
        onDragCancel (event) {
            setActive(false);
        }
    });
    return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)("span", {
        ref: visible ? setNodeRef : null,
        className: (0, __WEBPACK_EXTERNAL_MODULE_classnames__["default"])('tb-row-divider', 'RowDivider'),
        style: droppableStyle
    });
};
const wrapRowSchema = (schema)=>{
    const row = new __WEBPACK_EXTERNAL_MODULE__tachybase_schema__.Schema({
        type: 'void',
        name: "row_".concat((0, __WEBPACK_EXTERNAL_MODULE__tachybase_schema__.uid)()),
        'x-uid': (0, __WEBPACK_EXTERNAL_MODULE__tachybase_schema__.uid)(),
        'x-component': 'Grid.Row'
    });
    const col = row.addProperty((0, __WEBPACK_EXTERNAL_MODULE__tachybase_schema__.uid)(), {
        type: 'void',
        'x-uid': (0, __WEBPACK_EXTERNAL_MODULE__tachybase_schema__.uid)(),
        'x-component': 'Grid.Col'
    });
    if (__WEBPACK_EXTERNAL_MODULE__tachybase_schema__.Schema.isSchemaInstance(schema)) schema.parent = col;
    col.addProperty(schema.name, schema);
    return row;
};
const wrapColSchema = (schema)=>{
    const s = new __WEBPACK_EXTERNAL_MODULE__tachybase_schema__.Schema({
        type: 'void',
        name: "col_".concat((0, __WEBPACK_EXTERNAL_MODULE__tachybase_schema__.uid)()),
        'x-uid': (0, __WEBPACK_EXTERNAL_MODULE__tachybase_schema__.uid)(),
        'x-component': 'Grid.Col'
    });
    if (__WEBPACK_EXTERNAL_MODULE__tachybase_schema__.Schema.isSchemaInstance(schema)) schema.parent = s;
    s.addProperty(schema.name, schema);
    return s;
};
const useRowProperties = ()=>{
    const fieldSchema = (0, __WEBPACK_EXTERNAL_MODULE__tachybase_schema__.useFieldSchema)();
    return (0, __WEBPACK_EXTERNAL_MODULE_react__.useMemo)(()=>fieldSchema.reduceProperties((buf, s)=>{
            if ('Grid.Row' === s['x-component'] && !s['x-hidden']) buf.push(s);
            return buf;
        }, []), [
        Object.keys(fieldSchema.properties || {}).join(',')
    ]);
};
const useColProperties = ()=>{
    const fieldSchema = (0, __WEBPACK_EXTERNAL_MODULE__tachybase_schema__.useFieldSchema)();
    return (0, __WEBPACK_EXTERNAL_MODULE_react__.useMemo)(()=>fieldSchema.reduceProperties((buf, s)=>{
            if ('Grid.Col' === s['x-component'] && !s['x-hidden']) buf.push(s);
            return buf;
        }, []), [
        Object.keys(fieldSchema.properties || {}).join(',')
    ]);
};
const DndWrapper = (props)=>{
    if (false === props.dndContext) return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.Fragment, {
        children: props.children
    });
    return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE__common_dnd_context_index_mjs__.DndContext, {
        ...props.dndContext,
        children: props.children
    });
};
const useGridContext = ()=>(0, __WEBPACK_EXTERNAL_MODULE_react__.useContext)(GridContext);
const useGridRowContext = ()=>(0, __WEBPACK_EXTERNAL_MODULE_react__.useContext)(GridRowContext);
const Grid = (0, __WEBPACK_EXTERNAL_MODULE__tachybase_schema__.observer)((props)=>{
    const { distributed, showDivider = true } = props;
    const gridRef = (0, __WEBPACK_EXTERNAL_MODULE_react__.useRef)(null);
    const field = (0, __WEBPACK_EXTERNAL_MODULE__tachybase_schema__.useField)();
    const fieldSchema = (0, __WEBPACK_EXTERNAL_MODULE__tachybase_schema__.useFieldSchema)();
    const { render } = (0, __WEBPACK_EXTERNAL_MODULE__index_mjs__.useSchemaInitializerRender)(fieldSchema['x-initializer'], fieldSchema['x-initializer-props']);
    const InitializerComponent = (props)=>render(props);
    const addr = field.address.toString();
    const rows = useRowProperties();
    const { setPrintContent } = (0, __WEBPACK_EXTERNAL_MODULE__index_mjs__.useFormBlockContext)();
    const { wrapSSR, componentCls, hashId } = (0, __WEBPACK_EXTERNAL_MODULE__Grid_style_mjs__["default"])();
    const distributedValue = void 0 === distributed ? (null == fieldSchema ? void 0 : fieldSchema.parent['x-component']) === 'Page' || (null == fieldSchema ? void 0 : fieldSchema.parent['x-component']) === 'Tabs.TabPane' : distributed;
    (0, __WEBPACK_EXTERNAL_MODULE_react__.useEffect)(()=>{
        gridRef.current && (null == setPrintContent || setPrintContent(gridRef.current));
    }, [
        gridRef.current
    ]);
    return wrapSSR(/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(GridContext.Provider, {
        value: {
            ref: gridRef,
            fieldSchema,
            renderSchemaInitializer: render,
            InitializerComponent,
            showDivider
        },
        children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsxs)("div", {
            className: "tb-grid ".concat(componentCls, " ").concat(hashId),
            style: {
                position: 'relative'
            },
            ref: gridRef,
            children: [
                /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsxs)(DndWrapper, {
                    dndContext: props.dndContext,
                    children: [
                        showDivider ? /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(RowDivider, {
                            rows: rows,
                            first: true,
                            id: "".concat(addr, "_0"),
                            data: {
                                breakRemoveOn: breakRemoveOnGrid,
                                wrapSchema: wrapRowSchema,
                                insertAdjacent: 'afterBegin',
                                schema: fieldSchema
                            }
                        }) : null,
                        rows.map((schema, index)=>/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsxs)(__WEBPACK_EXTERNAL_MODULE_react__["default"].Fragment, {
                                children: [
                                    distributedValue ? /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE__index_mjs__.SchemaComponent, {
                                        name: schema.name,
                                        schema: schema,
                                        distributed: true
                                    }) : /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(MemorizedRecursionField, {
                                        name: schema.name,
                                        schema: schema
                                    }),
                                    showDivider ? /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(RowDivider, {
                                        rows: rows,
                                        index: index,
                                        id: "".concat(addr, "_").concat(index + 1),
                                        data: {
                                            breakRemoveOn: breakRemoveOnGrid,
                                            wrapSchema: wrapRowSchema,
                                            insertAdjacent: 'afterEnd',
                                            schema
                                        }
                                    }) : null
                                ]
                            }, index))
                    ]
                }),
                render()
            ]
        })
    }));
}, {
    displayName: 'Grid'
});
Grid.Row = (0, __WEBPACK_EXTERNAL_MODULE__tachybase_schema__.observer)(()=>{
    const field = (0, __WEBPACK_EXTERNAL_MODULE__tachybase_schema__.useField)();
    const fieldSchema = (0, __WEBPACK_EXTERNAL_MODULE__tachybase_schema__.useFieldSchema)();
    const addr = field.address.toString();
    const cols = useColProperties();
    const { showDivider } = useGridContext();
    const { type } = (0, __WEBPACK_EXTERNAL_MODULE__block_provider_index_mjs__.useFormBlockType)();
    return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(GridRowContext.Provider, {
        value: {
            schema: fieldSchema,
            cols
        },
        children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsxs)("div", {
            className: (0, __WEBPACK_EXTERNAL_MODULE_classnames__["default"])('tb-grid-row', 'CardRow', {
                showDivider
            }),
            children: [
                showDivider && /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(ColDivider, {
                    cols: cols,
                    first: true,
                    id: "".concat(addr, "_0"),
                    data: {
                        breakRemoveOn: breakRemoveOnRow,
                        wrapSchema: wrapColSchema,
                        insertAdjacent: 'afterBegin',
                        schema: fieldSchema
                    }
                }),
                cols.map((schema, index)=>/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsxs)(__WEBPACK_EXTERNAL_MODULE_react__["default"].Fragment, {
                        children: [
                            /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE__tachybase_schema__.RecursionField, {
                                name: schema.name,
                                schema: schema,
                                mapProperties: (schema)=>{
                                    if ('update' === type) schema.default = null;
                                    return schema;
                                }
                            }),
                            showDivider && /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(ColDivider, {
                                cols: cols,
                                index: index,
                                last: index === cols.length - 1,
                                id: "".concat(addr, "_").concat(index + 1),
                                data: {
                                    breakRemoveOn: breakRemoveOnRow,
                                    wrapSchema: wrapColSchema,
                                    insertAdjacent: 'afterEnd',
                                    schema
                                }
                            })
                        ]
                    }, index))
            ]
        })
    });
}, {
    displayName: 'Grid.Row'
});
Grid.Col = (0, __WEBPACK_EXTERNAL_MODULE__tachybase_schema__.observer)((props)=>{
    var _schema_xcomponentprops;
    const { cols = [] } = (0, __WEBPACK_EXTERNAL_MODULE_react__.useContext)(GridRowContext);
    const { showDivider } = useGridContext();
    const schema = (0, __WEBPACK_EXTERNAL_MODULE__tachybase_schema__.useFieldSchema)();
    const field = (0, __WEBPACK_EXTERNAL_MODULE__tachybase_schema__.useField)();
    const { token } = (0, __WEBPACK_EXTERNAL_MODULE__builtins_index_mjs__.useToken)();
    const style = (0, __WEBPACK_EXTERNAL_MODULE_react__.useMemo)(()=>{
        let width = '';
        if (null == cols ? void 0 : cols.length) {
            var _schema_xcomponentprops;
            const w = (null == schema ? void 0 : null === (_schema_xcomponentprops = schema['x-component-props']) || void 0 === _schema_xcomponentprops ? void 0 : _schema_xcomponentprops['width']) || 100 / cols.length;
            width = "calc(".concat(w, "% - ").concat(token.marginLG, "px *  ").concat((showDivider ? cols.length + 1 : 0) / cols.length, ")");
        }
        return {
            width
        };
    }, [
        null == cols ? void 0 : cols.length,
        null == schema ? void 0 : null === (_schema_xcomponentprops = schema['x-component-props']) || void 0 === _schema_xcomponentprops ? void 0 : _schema_xcomponentprops['width']
    ]);
    const { isOver, setNodeRef } = (0, __WEBPACK_EXTERNAL_MODULE__dnd_kit_core__.useDroppable)({
        id: field.address.toString(),
        data: {
            insertAdjacent: 'beforeEnd',
            schema,
            wrapSchema: (s)=>s
        }
    });
    const [active, setActive] = (0, __WEBPACK_EXTERNAL_MODULE_react__.useState)(false);
    const droppableStyle = (0, __WEBPACK_EXTERNAL_MODULE_react__.useMemo)(()=>{
        if (!isOver) return {
            height: '100%'
        };
        return {
            background: "linear-gradient(to top,  ".concat(new __WEBPACK_EXTERNAL_MODULE__ctrl_tinycolor__.TinyColor(token.colorSettings).setAlpha(0.1).toHex8String(), " 20%, transparent 20%)"),
            borderTopRightRadius: '10px',
            borderTopLeftRadius: '10px',
            height: '100%'
        };
    }, [
        active,
        isOver
    ]);
    (0, __WEBPACK_EXTERNAL_MODULE__dnd_kit_core__.useDndMonitor)({
        onDragStart (event) {
            setActive(true);
        },
        onDragMove (event) {},
        onDragOver (event) {},
        onDragEnd (event) {
            setActive(false);
        },
        onDragCancel (event) {
            setActive(false);
        }
    });
    return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(GridColContext.Provider, {
        value: {
            cols,
            schema
        },
        children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)("div", {
            ref: setNodeRef,
            style: {
                ...style,
                ...droppableStyle
            },
            className: (0, __WEBPACK_EXTERNAL_MODULE_classnames__["default"])('tb-grid-col  CardCol'),
            children: props.children
        })
    });
}, {
    displayName: 'Grid.Row'
});
Grid.wrap = (schema)=>({
        type: 'void',
        'x-component': 'Grid.Row',
        properties: {
            [(0, __WEBPACK_EXTERNAL_MODULE__tachybase_schema__.uid)()]: {
                type: 'void',
                'x-component': 'Grid.Col',
                properties: {
                    [schema.name || (0, __WEBPACK_EXTERNAL_MODULE__tachybase_schema__.uid)()]: schema
                }
            }
        }
    });
export { Grid, GridRowContext, useGridContext, useGridRowContext };
