(function (factory) {
    if (typeof module === "object" && typeof module.exports === "object") {
        var v = factory(require, exports);
        if (v !== undefined) module.exports = v;
    }
    else if (typeof define === "function" && define.amd) {
        define(["require", "exports", "tslib", "styled-components", "../DropdownList", "../../../Pallette/ZIndex"], factory);
    }
})(function (require, exports) {
    "use strict";
    Object.defineProperty(exports, "__esModule", { value: true });
    exports.DropdownListStyled = void 0;
    var tslib_1 = require("tslib");
    var styled_components_1 = (0, tslib_1.__importStar)(require("styled-components"));
    var DropdownList_1 = (0, tslib_1.__importDefault)(require("../DropdownList"));
    var ZIndex_1 = require("../../../Pallette/ZIndex");
    var MARGIN = 8;
    var getDirectionStyles = function (_a) {
        var direction = _a.direction, anchorRect = _a.anchorRect, dropdownRect = _a.dropdownRect;
        switch (direction) {
            case "top":
                return (0, styled_components_1.css)(templateObject_1 || (templateObject_1 = (0, tslib_1.__makeTemplateObject)(["\n        left: ", "px;\n        top: ", "px;\n      "], ["\n        left: ", "px;\n        top: ", "px;\n      "])), anchorRect.left +
                    anchorRect.width / 2 -
                    dropdownRect.width / 2, anchorRect.top - MARGIN - dropdownRect.height);
            case "bottom":
                return (0, styled_components_1.css)(templateObject_2 || (templateObject_2 = (0, tslib_1.__makeTemplateObject)(["\n        top: ", "px;\n        left: ", "px;\n      "], ["\n        top: ", "px;\n        left: ", "px;\n      "])), anchorRect.bottom + MARGIN, anchorRect.left +
                    anchorRect.width / 2 -
                    dropdownRect.width / 2);
            case "bottomRight":
                return (0, styled_components_1.css)(templateObject_3 || (templateObject_3 = (0, tslib_1.__makeTemplateObject)(["\n        top: ", "px;\n        left: ", "px;\n      "], ["\n        top: ", "px;\n        left: ", "px;\n      "])), anchorRect.bottom + MARGIN, anchorRect.right - dropdownRect.width);
            case "bottomLeft":
                return (0, styled_components_1.css)(templateObject_4 || (templateObject_4 = (0, tslib_1.__makeTemplateObject)(["\n        top: ", "px;\n        left: ", "px;\n      "], ["\n        top: ", "px;\n        left: ", "px;\n      "])), anchorRect.bottom + MARGIN, anchorRect.left);
            case "topLeft":
                return (0, styled_components_1.css)(templateObject_5 || (templateObject_5 = (0, tslib_1.__makeTemplateObject)(["\n        top: ", "px;\n        left: ", "px;\n      "], ["\n        top: ", "px;\n        left: ", "px;\n      "])), anchorRect.top - MARGIN - dropdownRect.height, anchorRect.left);
            case "topRight":
                return (0, styled_components_1.css)(templateObject_6 || (templateObject_6 = (0, tslib_1.__makeTemplateObject)(["\n        top: ", "px;\n        left: ", "px;\n      "], ["\n        top: ", "px;\n        left: ", "px;\n      "])), anchorRect.top - MARGIN - dropdownRect.height, anchorRect.right - dropdownRect.width);
            case "right":
                return (0, styled_components_1.css)(templateObject_7 || (templateObject_7 = (0, tslib_1.__makeTemplateObject)(["\n        top: ", "px;\n        left: ", "px;\n      "], ["\n        top: ", "px;\n        left: ", "px;\n      "])), anchorRect.height / 2 -
                    dropdownRect.height / 2 +
                    anchorRect.top, anchorRect.left + MARGIN + anchorRect.width);
            case "left":
                return (0, styled_components_1.css)(templateObject_8 || (templateObject_8 = (0, tslib_1.__makeTemplateObject)(["\n        left: ", "px;\n        top: ", "px;\n      "], ["\n        left: ", "px;\n        top: ", "px;\n      "])), anchorRect.left - MARGIN - dropdownRect.width, anchorRect.height / 2 -
                    dropdownRect.height / 2 +
                    anchorRect.top);
            default:
                return (0, styled_components_1.css)(templateObject_9 || (templateObject_9 = (0, tslib_1.__makeTemplateObject)([""], [""])));
        }
    };
    exports.DropdownListStyled = (0, styled_components_1.default)(DropdownList_1.default)(templateObject_10 || (templateObject_10 = (0, tslib_1.__makeTemplateObject)(["\n  position: absolute;\n  overflow-y: auto;\n  max-height: ", "px;\n  height: ", ";\n\n  &.dropdown-transition {\n    &-enter {\n      opacity: 0;\n    }\n    &-enter-done {\n      opacity: 1;\n    }\n    &-exit {\n      opacity: 1;\n    }\n    &-exit-active {\n      opacity: 0;\n    }\n  }\n\n  z-index: ", ";\n  ", ";\n"], ["\n  position: absolute;\n  overflow-y: auto;\n  max-height: ", "px;\n  height: ", ";\n\n  &.dropdown-transition {\n    &-enter {\n      opacity: 0;\n    }\n    &-enter-done {\n      opacity: 1;\n    }\n    &-exit {\n      opacity: 1;\n    }\n    &-exit-active {\n      opacity: 0;\n    }\n  }\n\n  z-index: ", ";\n  ", ";\n"])), function (_a) {
        var maxHeight = _a.maxHeight;
        return maxHeight;
    }, function (_a) {
        var height = _a.height;
        return height || "max-content";
    }, ZIndex_1.ZINDEX.tooltip, getDirectionStyles);
    var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9, templateObject_10;
});
