"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.RangePicker = void 0;
const react_1 = __importDefault(require("react"));
const cn_ui_1 = require("@cainiaofe/cn-ui");
const { connect, useFieldSchema } = cn_ui_1.formilyReact;
exports.RangePicker = 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, 'RangePicker');
    const fieldName = String((fieldSchema === null || fieldSchema === void 0 ? void 0 : fieldSchema.name) || '');
    // 如果低码组件不存在，使用 cn-ui 的组件作为回退
    if (!(ComponentUI === null || ComponentUI === void 0 ? void 0 : ComponentUI.formComponent)) {
        return (react_1.default.createElement(cn_ui_1.CnRangeDatePickerPro, { ...props, defaultVisible: true, className: "cn-ai-table-schema-field__item--full-width", popupContainer: fieldName ? document.getElementById(fieldName) : undefined }));
    }
    const FormComponent = ComponentUI.formComponent;
    return (react_1.default.createElement(FormComponent, { ...props, defaultVisible: true, className: "cn-ai-table-schema-field__item--full-width", popupContainer: fieldName ? document.getElementById(fieldName) : undefined }));
});
exports.RangePicker.displayName = 'CnRangeDatePickerPro';
