import { CollectionFieldInterface } from "../../data-source/collection-field-interface/CollectionFieldInterface.mjs";
import { dataSource, defaultProps, operators } from "./properties/index.mjs";
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 SelectFieldInterface extends CollectionFieldInterface {
    schemaInitialize(schema, param) {
        let { block } = param;
        const props = schema['x-component-props'] = schema['x-component-props'] || {};
        props.style = {
            ...props.style || {},
            width: '100%'
        };
        if ([
            'Table',
            'Kanban'
        ].includes(block)) props['ellipsis'] = true;
    }
    constructor(...args){
        super(...args), _define_property(this, "name", 'select'), _define_property(this, "type", 'object'), _define_property(this, "group", 'choices'), _define_property(this, "order", 2), _define_property(this, "title", '{{t("Single select")}}'), _define_property(this, "sortable", true), _define_property(this, "default", {
            type: 'string',
            uiSchema: {
                type: 'string',
                'x-component': 'Select',
                enum: []
            }
        }), _define_property(this, "availableTypes", [
            'string',
            'bigInt',
            'boolean'
        ]), _define_property(this, "hasDefaultValue", true), _define_property(this, "properties", {
            ...defaultProps,
            'uiSchema.enum': dataSource
        }), _define_property(this, "filterable", {
            operators: operators.enumType
        }), _define_property(this, "titleUsable", true);
    }
}
export { SelectFieldInterface };
