@typeolymp/ui-components 1.19.17 → 1.19.18
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/components/atoms/Input/index.d.ts +1 -0
- package/build/index.es.js +45 -5
- package/build/index.es.js.map +1 -1
- package/build/index.js +45 -5
- package/build/index.js.map +1 -1
- package/package.json +1 -1
package/build/index.js
CHANGED
|
@@ -4317,14 +4317,50 @@ var StyledParagraph = styled__default["default"].p(templateObject_1$P || (templa
|
|
|
4317
4317
|
var templateObject_1$P;
|
|
4318
4318
|
|
|
4319
4319
|
var Container$q = styled__default["default"].div(templateObject_1$O || (templateObject_1$O = __makeTemplateObject$1(["\n width: 100%;\n"], ["\n width: 100%;\n"])));
|
|
4320
|
-
var InputIconWrapper = styled__default["default"].div(templateObject_2$B || (templateObject_2$B = __makeTemplateObject$1(["\n position: relative;\n width: 100%;\n\n input {\n padding-right: 43px;\n }\n\n input[type=\"date\"] {\n color: ", ";\n }\n\n div {\n position: absolute;\n height: 24px;\n right:
|
|
4320
|
+
var InputIconWrapper = styled__default["default"].div(templateObject_2$B || (templateObject_2$B = __makeTemplateObject$1(["\n position: relative;\n width: 100%;\n\n input {\n padding-right: 43px;\n }\n\n input[type=\"date\"] {\n color: ", ";\n }\n\n div {\n position: absolute;\n height: 24px;\n right: ", ";\n top: ", ";\n }\n\n svg {\n cursor: ", ";\n width: ", ";\n }\n"], ["\n position: relative;\n width: 100%;\n\n input {\n padding-right: 43px;\n }\n\n input[type=\"date\"] {\n color: ", ";\n }\n\n div {\n position: absolute;\n height: 24px;\n right: ", ";\n top: ", ";\n }\n\n svg {\n cursor: ", ";\n width: ", ";\n }\n"])), function (_a) {
|
|
4321
4321
|
var isChanged = _a.isChanged;
|
|
4322
4322
|
return !isChanged ? theme.colors.lightGray.darker : "";
|
|
4323
|
+
}, function (_a) {
|
|
4324
|
+
var size = _a.size;
|
|
4325
|
+
switch (size) {
|
|
4326
|
+
case "small":
|
|
4327
|
+
return "7px";
|
|
4328
|
+
default:
|
|
4329
|
+
case "medium":
|
|
4330
|
+
return "12px";
|
|
4331
|
+
}
|
|
4332
|
+
}, function (_a) {
|
|
4333
|
+
var size = _a.size;
|
|
4334
|
+
switch (size) {
|
|
4335
|
+
case "small":
|
|
4336
|
+
return "10px";
|
|
4337
|
+
default:
|
|
4338
|
+
case "medium":
|
|
4339
|
+
return "14px";
|
|
4340
|
+
}
|
|
4323
4341
|
}, function (_a) {
|
|
4324
4342
|
var disabled = _a.disabled;
|
|
4325
4343
|
return (disabled ? "not-allowed" : "pointer");
|
|
4344
|
+
}, function (_a) {
|
|
4345
|
+
var size = _a.size;
|
|
4346
|
+
switch (size) {
|
|
4347
|
+
case "small":
|
|
4348
|
+
return "20px";
|
|
4349
|
+
default:
|
|
4350
|
+
case "medium":
|
|
4351
|
+
return "24px";
|
|
4352
|
+
}
|
|
4326
4353
|
});
|
|
4327
|
-
var StyledInput = styled__default["default"].input(templateObject_3$d || (templateObject_3$d = __makeTemplateObject$1(["\n width: 100%;\n min-width: 228px;\n height:
|
|
4354
|
+
var StyledInput = styled__default["default"].input(templateObject_3$d || (templateObject_3$d = __makeTemplateObject$1(["\n width: 100%;\n min-width: 228px;\n height: ", ";\n background-color: ", ";\n border-width: 1px;\n border-style: solid;\n border-color: ", ";\n box-sizing: border-box;\n border-radius: 4px;\n padding: 13px 15px;\n cursor: ", ";\n font-family: ", ";\n font-size: ", ";\n font-weight: 500;\n font-style: normal;\n line-height: ", ";\n color: ", ";\n\n ::placeholder {\n font-family: ", ";\n font-size: ", ";\n font-weight: 500;\n font-style: normal;\n line-height: ", ";\n color: ", ";\n }\n\n ::-webkit-calendar-picker-indicator {\n display: none;\n }\n\n :focus {\n outline: 0;\n border-color: ", ";\n box-shadow: ", ";\n }\n"], ["\n width: 100%;\n min-width: 228px;\n height: ", ";\n background-color: ", ";\n border-width: 1px;\n border-style: solid;\n border-color: ", ";\n box-sizing: border-box;\n border-radius: 4px;\n padding: 13px 15px;\n cursor: ", ";\n font-family: ", ";\n font-size: ", ";\n font-weight: 500;\n font-style: normal;\n line-height: ", ";\n color: ", ";\n\n ::placeholder {\n font-family: ", ";\n font-size: ", ";\n font-weight: 500;\n font-style: normal;\n line-height: ", ";\n color: ", ";\n }\n\n ::-webkit-calendar-picker-indicator {\n display: none;\n }\n\n :focus {\n outline: 0;\n border-color: ", ";\n box-shadow: ", ";\n }\n"])), function (_a) {
|
|
4355
|
+
var size = _a.size;
|
|
4356
|
+
switch (size) {
|
|
4357
|
+
case "small":
|
|
4358
|
+
return "40px";
|
|
4359
|
+
default:
|
|
4360
|
+
case "medium":
|
|
4361
|
+
return "50px";
|
|
4362
|
+
}
|
|
4363
|
+
}, function (_a) {
|
|
4328
4364
|
var disabled = _a.disabled;
|
|
4329
4365
|
return disabled ? theme.colors.lightGray.dark : theme.colors.lightGray.light;
|
|
4330
4366
|
}, function (_a) {
|
|
@@ -4506,7 +4542,7 @@ var PasswordInput = function (props) {
|
|
|
4506
4542
|
if (props.onKeyPress)
|
|
4507
4543
|
props.onKeyPress(e);
|
|
4508
4544
|
};
|
|
4509
|
-
return (jsxRuntime.jsxs(Container$q, { children: [jsxRuntime.jsxs(InputIconWrapper, __assign$2({ disabled: props.disabled }, { children: [jsxRuntime.jsx(Icon, { type: isVisible ? "eyeInvisible" : "eye", color: "gray", size: "small", onClick: toggle }), jsxRuntime.jsx(StyledInput, __assign$2({ type: isVisible ? "text" : "password" }, props, { onChange: onChange, onKeyPress: onKeyPress }))] })), props.helperLocale && value.length ? (jsxRuntime.jsxs(HelperContainer, { children: [jsxRuntime.jsxs(Helper, __assign$2({ isOk: expressions.hasCapitalLetter(value) }, { children: ["\u2022 ", translations[props.helperLocale]["At least 1 capital letter"]] })), jsxRuntime.jsxs(Helper, __assign$2({ isOk: expressions.hasNumber(value) }, { children: ["\u2022 ", translations[props.helperLocale]["At least 1 number"]] })), jsxRuntime.jsxs(Helper, __assign$2({ isOk: expressions.hasSpecialCharacter(value) }, { children: ["\u2022 ", translations[props.helperLocale]["At least 1 special character"]] })), jsxRuntime.jsxs(Helper, __assign$2({ isOk: value.length >= 8 }, { children: ["\u2022 ", translations[props.helperLocale]["At least 8 characters"]] }))] })) : null] }));
|
|
4545
|
+
return (jsxRuntime.jsxs(Container$q, { children: [jsxRuntime.jsxs(InputIconWrapper, __assign$2({ disabled: props.disabled, size: props.size }, { children: [jsxRuntime.jsx(Icon, { type: isVisible ? "eyeInvisible" : "eye", color: "gray", size: "small", onClick: toggle }), jsxRuntime.jsx(StyledInput, __assign$2({ type: isVisible ? "text" : "password" }, props, { onChange: onChange, onKeyPress: onKeyPress }))] })), props.helperLocale && value.length ? (jsxRuntime.jsxs(HelperContainer, { children: [jsxRuntime.jsxs(Helper, __assign$2({ isOk: expressions.hasCapitalLetter(value) }, { children: ["\u2022 ", translations[props.helperLocale]["At least 1 capital letter"]] })), jsxRuntime.jsxs(Helper, __assign$2({ isOk: expressions.hasNumber(value) }, { children: ["\u2022 ", translations[props.helperLocale]["At least 1 number"]] })), jsxRuntime.jsxs(Helper, __assign$2({ isOk: expressions.hasSpecialCharacter(value) }, { children: ["\u2022 ", translations[props.helperLocale]["At least 1 special character"]] })), jsxRuntime.jsxs(Helper, __assign$2({ isOk: value.length >= 8 }, { children: ["\u2022 ", translations[props.helperLocale]["At least 8 characters"]] }))] })) : null] }));
|
|
4510
4546
|
};
|
|
4511
4547
|
|
|
4512
4548
|
function toInteger$2(dirtyNumber) {
|
|
@@ -7983,7 +8019,7 @@ var DateInput = function (props) {
|
|
|
7983
8019
|
if (isBefore(new Date(inputRef.current.value), new Date(props.min)))
|
|
7984
8020
|
inputRef.current.value = props.min;
|
|
7985
8021
|
};
|
|
7986
|
-
return (jsxRuntime.jsxs(InputIconWrapper, __assign$2({ disabled: props.disabled, isChanged: isChanged }, { children: [jsxRuntime.jsx(Icon, { type: "calendar", color: "gray", size: "small", onClick: showPicker }), jsxRuntime.jsx(StyledInput, __assign$2({ type: "date" }, props, { onChange: onChange, onBlur: onBlur, onKeyPress: onKeyPress, ref: inputRef }))] })));
|
|
8022
|
+
return (jsxRuntime.jsxs(InputIconWrapper, __assign$2({ disabled: props.disabled, size: props.size, isChanged: isChanged }, { children: [jsxRuntime.jsx(Icon, { type: "calendar", color: "gray", size: "small", onClick: showPicker }), jsxRuntime.jsx(StyledInput, __assign$2({ type: "date" }, props, { onChange: onChange, onBlur: onBlur, onKeyPress: onKeyPress, ref: inputRef }))] })));
|
|
7987
8023
|
};
|
|
7988
8024
|
|
|
7989
8025
|
var SearchInput = function (props) {
|
|
@@ -7993,11 +8029,15 @@ var SearchInput = function (props) {
|
|
|
7993
8029
|
if (!props.disabled && !!props.onChange)
|
|
7994
8030
|
props.onChange(e.target.value);
|
|
7995
8031
|
};
|
|
8032
|
+
var onKeyPress = function (e) {
|
|
8033
|
+
if (e.key === "Enter")
|
|
8034
|
+
onSearch();
|
|
8035
|
+
};
|
|
7996
8036
|
var onSearch = function () {
|
|
7997
8037
|
if (props.onSearch)
|
|
7998
8038
|
props.onSearch(value);
|
|
7999
8039
|
};
|
|
8000
|
-
return (jsxRuntime.jsx(Container$q, { children: jsxRuntime.jsxs(InputIconWrapper, __assign$2({ disabled: props.disabled }, { children: [jsxRuntime.jsx(Icon, { type: "search", color: "gray", size: "small", onClick: onSearch }), jsxRuntime.jsx(StyledInput, __assign$2({ type: "text" }, props, { onChange: onChange }))] })) }));
|
|
8040
|
+
return (jsxRuntime.jsx(Container$q, { children: jsxRuntime.jsxs(InputIconWrapper, __assign$2({ disabled: props.disabled, size: props.size }, { children: [jsxRuntime.jsx(Icon, { type: "search", color: "gray", size: "small", onClick: onSearch }), jsxRuntime.jsx(StyledInput, __assign$2({ type: "text" }, props, { onChange: onChange, onKeyPress: onKeyPress }))] })) }));
|
|
8001
8041
|
};
|
|
8002
8042
|
|
|
8003
8043
|
var Input = function (props) {
|