"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const color_1 = require("../../../../../client/color");
const field_1 = require("../../../../../client/field");
class Color extends field_1.Field {
    constructor($props, $system) {
        super($props, $system, $system.api.document.createElement('input'), {
            valueKey: 'value',
            defaultStyle: $system.style['color'],
            defaultValue: $system.color,
            defaultAttr: {
                type: 'color',
            },
            parseValue(value) {
                if (value) {
                    value = (0, color_1.nameToColor)(value) ?? value;
                }
                return value;
            },
        });
    }
}
exports.default = Color;
//# sourceMappingURL=Component.js.map