"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.LocatorsParams = void 0;
var tslib_1 = require("tslib");
var react_1 = tslib_1.__importStar(require("react"));
var v_eris_1 = require("v-eris");
var types_color_1 = require("./types.color");
var types_ranges_1 = require("./types.ranges");
require("./types.zoom.scss");
var LocatorsParams = function (props) {
    var className = props.className, config = props.config, value = props.value, onChange = props.onChange, inactive = props.inactive, lang = props.lang, rest = tslib_1.__rest(props, ["className", "config", "value", "onChange", "inactive", "lang"]);
    var _a = (0, react_1.useState)(false), active = _a[0], setActive = _a[1];
    if (!value)
        value = {};
    if (!config)
        config = {};
    var change = function (key, valueArg) {
        var v = tslib_1.__assign({}, config);
        v[key] = valueArg;
        if (!onChange)
            return;
        onChange({ value: v });
    };
    return (react_1.default.createElement(v_eris_1.Card, { header: react_1.default.createElement("span", null,
            react_1.default.createElement(v_eris_1.Icons.sphere, null),
            react_1.default.createElement(v_eris_1.Space, null),
            value.name) },
        react_1.default.createElement(v_eris_1.Row, null,
            lang.get("Types::Locators::SAC:SIC"),
            ": ",
            value.sac + ":" + value.sic,
            react_1.default.createElement(v_eris_1.Space, null)),
        react_1.default.createElement(v_eris_1.Row, null,
            lang.get("Types::Locators::LayerEnabled"),
            ":",
            react_1.default.createElement(v_eris_1.Space, null),
            react_1.default.createElement(v_eris_1.Toggle, { value: config.LayerEnabled, inactive: true })),
        react_1.default.createElement(v_eris_1.Row, null,
            lang.get("Types::Locators::MarksColor"),
            ":",
            react_1.default.createElement(v_eris_1.Space, null),
            react_1.default.createElement(types_color_1.ColorPicker, { value: config.MarksColor, inactive: true })),
        react_1.default.createElement(v_eris_1.Row, null,
            lang.get("Types::Locators::MarksShadow"),
            ":",
            react_1.default.createElement(v_eris_1.Space, null),
            react_1.default.createElement(types_color_1.ColorPicker, { value: config.MarksShadow, inactive: true })),
        react_1.default.createElement(v_eris_1.Row, null,
            lang.get("Types::Locators::Opacity"),
            ":",
            react_1.default.createElement(v_eris_1.Space, null),
            config.Opacity,
            "%"),
        react_1.default.createElement(v_eris_1.Row, null,
            lang.get("Types::Locators::Grid"),
            ":",
            react_1.default.createElement(v_eris_1.Space, null),
            react_1.default.createElement(v_eris_1.Toggle, { value: config.Grid, inactive: true })),
        react_1.default.createElement(v_eris_1.Row, { className: "settings-type-params-tools" },
            react_1.default.createElement(v_eris_1.Text, { success: true, onClick: function () { setActive(true); } }, "Edit")),
        react_1.default.createElement(v_eris_1.Modal, { className: "settings-type-params-modal", bg: true, active: active, onClose: function () {
                setActive(false);
            } },
            react_1.default.createElement(v_eris_1.Card, { header: react_1.default.createElement("span", null, value.name), headerless: true },
                react_1.default.createElement(v_eris_1.Row, null,
                    lang.get("Types::Locators::SAC:SIC"),
                    react_1.default.createElement(v_eris_1.Space, null),
                    value.sac + ":" + value.sic),
                react_1.default.createElement(v_eris_1.Row, null,
                    react_1.default.createElement(v_eris_1.Toggle, { value: config.LayerEnabled, onChange: function (e) { return change("LayerEnabled", e.value); } }),
                    react_1.default.createElement(v_eris_1.Space, null),
                    react_1.default.createElement(v_eris_1.Row, null, lang.get("Types::Locators::LayerEnabled")),
                    react_1.default.createElement(v_eris_1.Space, null)),
                react_1.default.createElement(v_eris_1.Row, null,
                    react_1.default.createElement(v_eris_1.Toggle, { value: config.MarksColorEnabled, onChange: function (e) { return change("MarksColorEnabled", e.value); } }),
                    react_1.default.createElement(v_eris_1.Space, null),
                    react_1.default.createElement(v_eris_1.Row, null,
                        lang.get("Types::Locators::MarksColor"),
                        ":"),
                    react_1.default.createElement(v_eris_1.Space, null),
                    react_1.default.createElement(types_color_1.ColorPicker, { value: config.MarksColor, onChange: function (e) { return change("MarksColor", e.value); } })),
                react_1.default.createElement(v_eris_1.Row, null,
                    react_1.default.createElement(v_eris_1.Toggle, { value: config.MarksShadowEnabled, onChange: function (e) { return change("MarksShadowEnabled", e.value); } }),
                    react_1.default.createElement(v_eris_1.Space, null),
                    react_1.default.createElement(v_eris_1.Row, null,
                        lang.get("Types::Locators::MarksShadow"),
                        ":"),
                    react_1.default.createElement(v_eris_1.Space, null),
                    react_1.default.createElement(types_color_1.ColorPicker, { value: config.MarksShadow, onChange: function (e) { return change("MarksShadow", e.value); } })),
                react_1.default.createElement("div", null,
                    react_1.default.createElement(v_eris_1.Row, null,
                        react_1.default.createElement(v_eris_1.Toggle, { value: config.OpacityEnabled, onChange: function (e) { return change("OpacityEnabled", e.value); } }),
                        react_1.default.createElement(v_eris_1.Space, null),
                        react_1.default.createElement(v_eris_1.Row, null,
                            lang.get("Types::Locators::Opacity"),
                            ":",
                            react_1.default.createElement(v_eris_1.Space, null),
                            react_1.default.createElement("span", null,
                                config.Opacity,
                                "%"),
                            react_1.default.createElement(v_eris_1.Space, null))),
                    react_1.default.createElement(v_eris_1.Row, null,
                        react_1.default.createElement(types_ranges_1.Ranges, { value: config.Opacity, min: 0, max: 100, single: true, onChange: function (e) { return change("Opacity", e.value); } }))),
                react_1.default.createElement(v_eris_1.Row, null,
                    react_1.default.createElement(v_eris_1.Toggle, { value: config.GridEnabled, onChange: function (e) { return change("GridEnabled", e.value); } }),
                    react_1.default.createElement(v_eris_1.Space, null),
                    react_1.default.createElement(v_eris_1.Row, null, lang.get("Types::Locators::Grid")),
                    react_1.default.createElement(v_eris_1.Space, null))))));
};
exports.LocatorsParams = LocatorsParams;
//# sourceMappingURL=types.locators.js.map