"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const Element_1 = require("../../../../../Class/Element");
const FileList_1 = require("../../../../../wrap/FileList");
const _ids_1 = require("../../../../_ids");
const globalComponent_1 = require("../../../../globalComponent");
class FileField extends Element_1.Element_ {
    constructor(system) {
        super({
            i: ['value', 'style', 'attr'],
            o: ['files'],
        }, {}, system, _ids_1.ID_FILE_FIELD);
        this._defaultState = {
            value: '',
        };
        (0, globalComponent_1.listenGlobalComponent)(system, this.__global_id, (component) => {
            component.$element.addEventListener('_change', async (event) => {
                const { files } = component.$element;
                const files_ = (0, FileList_1.wrapFileList)(files, this.__system);
                this._output.files.push(files_);
            });
        });
    }
}
exports.default = FileField;
//# sourceMappingURL=index.js.map