import { formilyReact } from '@cainiaofe/cn-ui';
import React from 'react';
import { mapStatus } from '../../mapStatus.js';
import { isV2PropsValid } from '../../../index.js';
const { connect, useFieldSchema, mapProps } = formilyReact;
export const CascaderSelect = connect((props) => {
    var _a, _b, _c;
    const fieldSchema = useFieldSchema();
    const ComponentUI = (_c = (_b = (_a = window === null || window === void 0 ? void 0 : window.cnLowCodeUtils) === null || _a === void 0 ? void 0 : _a.filterItem) === null || _b === void 0 ? void 0 : _b.getRunTimeItem) === null || _c === void 0 ? void 0 : _c.call(_b, 'CascaderSelect');
    if (!(ComponentUI === null || ComponentUI === void 0 ? void 0 : ComponentUI.formComponent)) {
        return null;
    }
    const isV2Valid = isV2PropsValid();
    const FormComponent = ComponentUI.formComponent;
    return (React.createElement(FormComponent, { ...props, className: "cn-ai-table-schema-field__item--full-width", popupContainer: document.getElementById(fieldSchema === null || fieldSchema === void 0 ? void 0 : fieldSchema.name), popupProps: {
            v2: isV2Valid && true,
        } }));
}, mapProps(mapStatus, {
    dataSource: true,
}));
CascaderSelect.displayName = 'CnCascaderSelect';
