@typeolymp/ui-components 1.19.39 → 1.19.40
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/index.es.js +18 -6
- package/build/index.es.js.map +1 -1
- package/build/index.js +18 -6
- package/build/index.js.map +1 -1
- package/package.json +1 -1
package/build/index.js
CHANGED
|
@@ -14957,22 +14957,31 @@ var Dropdown = function (_a) {
|
|
|
14957
14957
|
? setIsVisible(false)
|
|
14958
14958
|
: null;
|
|
14959
14959
|
}, [isVisible, dropwdownRef]);
|
|
14960
|
+
var handleScroll = React$3.useCallback(function () { return setIsVisible(false); }, []);
|
|
14960
14961
|
React$3.useEffect(function () {
|
|
14961
14962
|
document.addEventListener("mousedown", handleClickOutside);
|
|
14963
|
+
document.addEventListener("scroll", handleScroll);
|
|
14962
14964
|
return function () {
|
|
14963
14965
|
document.removeEventListener("mousedown", handleClickOutside);
|
|
14966
|
+
document.removeEventListener("scroll", handleScroll);
|
|
14964
14967
|
};
|
|
14965
|
-
}, [handleClickOutside]);
|
|
14968
|
+
}, [handleClickOutside, handleScroll]);
|
|
14966
14969
|
var triggerDropdown = React$3.useCallback(function () {
|
|
14967
14970
|
if (props.disabled)
|
|
14968
14971
|
return;
|
|
14969
14972
|
var el = document.getElementById(triggerId);
|
|
14970
14973
|
if (el) {
|
|
14971
|
-
var _a = el.getBoundingClientRect(), bottom = _a.bottom, left = _a.left;
|
|
14974
|
+
var _a = el.getBoundingClientRect(), bottom = _a.bottom, top_1 = _a.top, left = _a.left;
|
|
14972
14975
|
var width = el.offsetWidth;
|
|
14973
|
-
var
|
|
14974
|
-
var
|
|
14975
|
-
|
|
14976
|
+
var xPosition = left + width > window.innerWidth / 2 ? "right" : "left";
|
|
14977
|
+
var yPosition = window.innerHeight - (bottom + yOffset) <
|
|
14978
|
+
dropwdownRef.current.offsetHeight
|
|
14979
|
+
? "top"
|
|
14980
|
+
: "bottom";
|
|
14981
|
+
var y = yPosition === "bottom"
|
|
14982
|
+
? bottom + yOffset
|
|
14983
|
+
: top_1 - dropwdownRef.current.offsetHeight - yOffset - 4;
|
|
14984
|
+
var x = xPosition === "left"
|
|
14976
14985
|
? left
|
|
14977
14986
|
: left + width - dropwdownRef.current.offsetWidth;
|
|
14978
14987
|
setPosition({ x: x, y: y });
|
|
@@ -17620,7 +17629,10 @@ var InputField = function (props) {
|
|
|
17620
17629
|
return (jsxRuntime.jsxs(Container$h, { children: [jsxRuntime.jsx(Label$9, __assign$2({ as: "label", htmlFor: props.name }, { children: props.label })), jsxRuntime.jsx(Spacer, { vertical: 5 }), jsxRuntime.jsx(Input, { defaultValue: props.defaultValue, autoComplete: props.autoComplete, autoFocus: props.autoFocus, disabled: props.disabled, placeholder: props.placeholder, id: props.name, onChange: onChange, onBlur: onBlur }), props.tips && (jsxRuntime.jsxs("div", __assign$2({ style: { marginLeft: "5px" } }, { children: [jsxRuntime.jsx(Spacer, { vertical: 5 }), props.tips.map(function (tip, index) { return (jsxRuntime.jsxs(Paragraph, __assign$2({ size: "small", weight: "regular" }, { children: ["\u2022 ", tip] }), "".concat(tip, "-").concat(index))); })] })))] }));
|
|
17621
17630
|
};
|
|
17622
17631
|
|
|
17623
|
-
var Container$g = styled__default["default"].div(templateObject_1$s || (templateObject_1$s = __makeTemplateObject$1(["\n min-width: 74px;\n width:
|
|
17632
|
+
var Container$g = styled__default["default"].div(templateObject_1$s || (templateObject_1$s = __makeTemplateObject$1(["\n min-width: 74px;\n max-width: ", ";\n min-height: 74px;\n max-height: 74px;\n background-color: ", ";\n box-sizing: border-box;\n\n border: 4px solid;\n border-radius: 6px;\n border-color: ", ";\n\n padding: 8px 24px;\n margin-right: 6px;\n margin-left: 6px;\n margin-bottom: ", ";\n\n display: flex;\n justify-content: center;\n align-items: center;\n\n position: relative;\n text-transform: uppercase;\n\n h1 {\n color: ", ";\n }\n\n > svg {\n fill: ", ";\n }\n"], ["\n min-width: 74px;\n max-width: ", ";\n min-height: 74px;\n max-height: 74px;\n background-color: ", ";\n box-sizing: border-box;\n\n border: 4px solid;\n border-radius: 6px;\n border-color: ", ";\n\n padding: 8px 24px;\n margin-right: 6px;\n margin-left: 6px;\n margin-bottom: ", ";\n\n display: flex;\n justify-content: center;\n align-items: center;\n\n position: relative;\n text-transform: uppercase;\n\n h1 {\n color: ", ";\n }\n\n > svg {\n fill: ", ";\n }\n"])), function (_a) {
|
|
17633
|
+
var char = _a.char;
|
|
17634
|
+
return (char.length === 1 ? "74px" : "");
|
|
17635
|
+
}, function (_a) {
|
|
17624
17636
|
var status = _a.status, color = _a.color;
|
|
17625
17637
|
switch (status) {
|
|
17626
17638
|
case "passed":
|