"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const field_1 = require("../../../../../client/field");
class FileField extends field_1.Field {
    constructor($props, $system) {
        const defaultStyle = $system.style['filefield'];
        super($props, $system, $system.api.document.createElement('input'), {
            valueKey: 'value',
            eventKey: 'files',
            emit: false,
            defaultStyle,
            defaultValue: '',
            defaultAttr: {
                type: 'file',
                multiple: 'true',
            },
            processValue: (files) => {
                const names = [];
                for (const file of files) {
                    const { lastModified, name, size, type } = file;
                    names.push({ lastModified, name, size, type });
                }
                return names;
            },
        });
    }
    setSelectionRange(start, end, direction) {
        this.$element.setSelectionRange(start, end, direction);
    }
}
exports.default = FileField;
//# sourceMappingURL=Component.js.map