function _define_property(obj, key, value) {
    if (key in obj) Object.defineProperty(obj, key, {
        value: value,
        enumerable: true,
        configurable: true,
        writable: true
    });
    else obj[key] = value;
    return obj;
}
class CollectionFieldInterface {
    addComponentOption(componentOption) {
        if (!this.componentOptions) {
            var _this_default_uiSchema, _this_default, _this_default_uiSchema1, _this_default1;
            this.componentOptions = [];
            const xComponent = null === (_this_default = this.default) || void 0 === _this_default ? void 0 : null === (_this_default_uiSchema = _this_default.uiSchema) || void 0 === _this_default_uiSchema ? void 0 : _this_default_uiSchema['x-component'];
            const componentProps = null === (_this_default1 = this.default) || void 0 === _this_default1 ? void 0 : null === (_this_default_uiSchema1 = _this_default1.uiSchema) || void 0 === _this_default_uiSchema1 ? void 0 : _this_default_uiSchema1['x-component-props'];
            if (xComponent) this.componentOptions = [
                {
                    label: xComponent.split('.').pop(),
                    value: xComponent,
                    useProps () {
                        return componentProps || {};
                    }
                }
            ];
        }
        this.componentOptions.push(componentOption);
    }
    constructor(collectionFieldInterfaceManager){
        _define_property(this, "collectionFieldInterfaceManager", void 0);
        _define_property(this, "name", void 0);
        _define_property(this, "group", void 0);
        _define_property(this, "title", void 0);
        _define_property(this, "description", void 0);
        _define_property(this, "order", void 0);
        _define_property(this, "default", void 0);
        _define_property(this, "sortable", void 0);
        _define_property(this, "availableTypes", void 0);
        _define_property(this, "componentOptions", void 0);
        _define_property(this, "supportDataSourceType", void 0);
        _define_property(this, "notSupportDataSourceType", void 0);
        _define_property(this, "hasDefaultValue", void 0);
        _define_property(this, "isAssociation", void 0);
        _define_property(this, "operators", void 0);
        _define_property(this, "filterable", void 0);
        _define_property(this, "titleUsable", void 0);
        this.collectionFieldInterfaceManager = collectionFieldInterfaceManager;
    }
}
export { CollectionFieldInterface };
