@servesall/atoms 1.1.13 → 1.1.14
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/dist/bundle.cjs.js +10 -3
- package/dist/bundle.esm.js +10 -3
- package/dist/bundle.umd.js +10 -3
- package/package.json +1 -1
- package/src/Inputs/InputNormal/index.js +29 -18
package/dist/bundle.cjs.js
CHANGED
|
@@ -1361,7 +1361,9 @@ var Input = function Input(_ref) {
|
|
|
1361
1361
|
_ref$isRightBound = _ref.isRightBound,
|
|
1362
1362
|
isRightBound = _ref$isRightBound === void 0 ? false : _ref$isRightBound,
|
|
1363
1363
|
_ref$isLeftBound = _ref.isLeftBound,
|
|
1364
|
-
isLeftBound = _ref$isLeftBound === void 0 ? false : _ref$isLeftBound
|
|
1364
|
+
isLeftBound = _ref$isLeftBound === void 0 ? false : _ref$isLeftBound,
|
|
1365
|
+
_ref$euro = _ref.euro,
|
|
1366
|
+
euro = _ref$euro === void 0 ? false : _ref$euro;
|
|
1365
1367
|
|
|
1366
1368
|
var _useState = React.useState(false),
|
|
1367
1369
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -1403,7 +1405,12 @@ var Input = function Input(_ref) {
|
|
|
1403
1405
|
active: isFocused || textValue && textValue.length > 0 || value && value.length > 0
|
|
1404
1406
|
}, /*#__PURE__*/React__default["default"].createElement(MarginHorizontal, null, !hasError ? children : /*#__PURE__*/React__default["default"].createElement(H4Text, {
|
|
1405
1407
|
color: borderColorError
|
|
1406
|
-
}, error || hasError))), /*#__PURE__*/React__default["default"].createElement(MarginHorizontal, null, /*#__PURE__*/React__default["default"].createElement(
|
|
1408
|
+
}, error || hasError))), /*#__PURE__*/React__default["default"].createElement(MarginHorizontal, null, /*#__PURE__*/React__default["default"].createElement(Row, null, euro && (isFocused || textValue && textValue.length > 0 || value && value.length > 0) && /*#__PURE__*/React__default["default"].createElement(Row, {
|
|
1409
|
+
style: {
|
|
1410
|
+
minHeight: 40,
|
|
1411
|
+
alignItems: "center"
|
|
1412
|
+
}
|
|
1413
|
+
}, euro), /*#__PURE__*/React__default["default"].createElement(InputElement$1, {
|
|
1407
1414
|
ref: inputRef,
|
|
1408
1415
|
onFocus: function onFocus() {
|
|
1409
1416
|
return setIsFocused(true);
|
|
@@ -1425,7 +1432,7 @@ var Input = function Input(_ref) {
|
|
|
1425
1432
|
active: isFocused,
|
|
1426
1433
|
style: style,
|
|
1427
1434
|
returnKeyType: "done"
|
|
1428
|
-
})))));
|
|
1435
|
+
}))))));
|
|
1429
1436
|
};
|
|
1430
1437
|
|
|
1431
1438
|
var _templateObject$i, _templateObject2$9, _templateObject3$3;
|
package/dist/bundle.esm.js
CHANGED
|
@@ -1348,7 +1348,9 @@ var Input = function Input(_ref) {
|
|
|
1348
1348
|
_ref$isRightBound = _ref.isRightBound,
|
|
1349
1349
|
isRightBound = _ref$isRightBound === void 0 ? false : _ref$isRightBound,
|
|
1350
1350
|
_ref$isLeftBound = _ref.isLeftBound,
|
|
1351
|
-
isLeftBound = _ref$isLeftBound === void 0 ? false : _ref$isLeftBound
|
|
1351
|
+
isLeftBound = _ref$isLeftBound === void 0 ? false : _ref$isLeftBound,
|
|
1352
|
+
_ref$euro = _ref.euro,
|
|
1353
|
+
euro = _ref$euro === void 0 ? false : _ref$euro;
|
|
1352
1354
|
|
|
1353
1355
|
var _useState = useState(false),
|
|
1354
1356
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -1390,7 +1392,12 @@ var Input = function Input(_ref) {
|
|
|
1390
1392
|
active: isFocused || textValue && textValue.length > 0 || value && value.length > 0
|
|
1391
1393
|
}, /*#__PURE__*/React.createElement(MarginHorizontal, null, !hasError ? children : /*#__PURE__*/React.createElement(H4Text, {
|
|
1392
1394
|
color: borderColorError
|
|
1393
|
-
}, error || hasError))), /*#__PURE__*/React.createElement(MarginHorizontal, null, /*#__PURE__*/React.createElement(
|
|
1395
|
+
}, error || hasError))), /*#__PURE__*/React.createElement(MarginHorizontal, null, /*#__PURE__*/React.createElement(Row, null, euro && (isFocused || textValue && textValue.length > 0 || value && value.length > 0) && /*#__PURE__*/React.createElement(Row, {
|
|
1396
|
+
style: {
|
|
1397
|
+
minHeight: 40,
|
|
1398
|
+
alignItems: "center"
|
|
1399
|
+
}
|
|
1400
|
+
}, euro), /*#__PURE__*/React.createElement(InputElement$1, {
|
|
1394
1401
|
ref: inputRef,
|
|
1395
1402
|
onFocus: function onFocus() {
|
|
1396
1403
|
return setIsFocused(true);
|
|
@@ -1412,7 +1419,7 @@ var Input = function Input(_ref) {
|
|
|
1412
1419
|
active: isFocused,
|
|
1413
1420
|
style: style,
|
|
1414
1421
|
returnKeyType: "done"
|
|
1415
|
-
})))));
|
|
1422
|
+
}))))));
|
|
1416
1423
|
};
|
|
1417
1424
|
|
|
1418
1425
|
var _templateObject$i, _templateObject2$9, _templateObject3$3;
|
package/dist/bundle.umd.js
CHANGED
|
@@ -1353,7 +1353,9 @@
|
|
|
1353
1353
|
_ref$isRightBound = _ref.isRightBound,
|
|
1354
1354
|
isRightBound = _ref$isRightBound === void 0 ? false : _ref$isRightBound,
|
|
1355
1355
|
_ref$isLeftBound = _ref.isLeftBound,
|
|
1356
|
-
isLeftBound = _ref$isLeftBound === void 0 ? false : _ref$isLeftBound
|
|
1356
|
+
isLeftBound = _ref$isLeftBound === void 0 ? false : _ref$isLeftBound,
|
|
1357
|
+
_ref$euro = _ref.euro,
|
|
1358
|
+
euro = _ref$euro === void 0 ? false : _ref$euro;
|
|
1357
1359
|
|
|
1358
1360
|
var _useState = React.useState(false),
|
|
1359
1361
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -1395,7 +1397,12 @@
|
|
|
1395
1397
|
active: isFocused || textValue && textValue.length > 0 || value && value.length > 0
|
|
1396
1398
|
}, /*#__PURE__*/React__default["default"].createElement(MarginHorizontal, null, !hasError ? children : /*#__PURE__*/React__default["default"].createElement(H4Text, {
|
|
1397
1399
|
color: borderColorError
|
|
1398
|
-
}, error || hasError))), /*#__PURE__*/React__default["default"].createElement(MarginHorizontal, null, /*#__PURE__*/React__default["default"].createElement(
|
|
1400
|
+
}, error || hasError))), /*#__PURE__*/React__default["default"].createElement(MarginHorizontal, null, /*#__PURE__*/React__default["default"].createElement(Row, null, euro && (isFocused || textValue && textValue.length > 0 || value && value.length > 0) && /*#__PURE__*/React__default["default"].createElement(Row, {
|
|
1401
|
+
style: {
|
|
1402
|
+
minHeight: 40,
|
|
1403
|
+
alignItems: "center"
|
|
1404
|
+
}
|
|
1405
|
+
}, euro), /*#__PURE__*/React__default["default"].createElement(InputElement$1, {
|
|
1399
1406
|
ref: inputRef,
|
|
1400
1407
|
onFocus: function onFocus() {
|
|
1401
1408
|
return setIsFocused(true);
|
|
@@ -1417,7 +1424,7 @@
|
|
|
1417
1424
|
active: isFocused,
|
|
1418
1425
|
style: style,
|
|
1419
1426
|
returnKeyType: "done"
|
|
1420
|
-
})))));
|
|
1427
|
+
}))))));
|
|
1421
1428
|
};
|
|
1422
1429
|
|
|
1423
1430
|
var _templateObject$i, _templateObject2$9, _templateObject3$3;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useEffect, useState, useRef } from "react";
|
|
2
2
|
import { H4 } from "../../Text";
|
|
3
|
-
import { MarginHorizontal } from "../../Layout";
|
|
3
|
+
import { MarginHorizontal, Row } from "../../Layout";
|
|
4
4
|
import { KeyboardAvoidingView, Platform } from "react-native";
|
|
5
5
|
import { InputWrapper, InputElement, BorderWrapper } from "./Animated.style";
|
|
6
6
|
import Placeholder from "./Placeholder";
|
|
@@ -26,6 +26,7 @@ const Input = ({
|
|
|
26
26
|
error,
|
|
27
27
|
isRightBound = false,
|
|
28
28
|
isLeftBound = false,
|
|
29
|
+
euro = false,
|
|
29
30
|
}) => {
|
|
30
31
|
const [isFocused, setIsFocused] = useState(false);
|
|
31
32
|
const [textValue, setTextValue] = useState(value || defaultValue);
|
|
@@ -80,23 +81,33 @@ const Input = ({
|
|
|
80
81
|
</Placeholder>
|
|
81
82
|
|
|
82
83
|
<MarginHorizontal>
|
|
83
|
-
<
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
84
|
+
<Row>
|
|
85
|
+
{euro &&
|
|
86
|
+
(isFocused ||
|
|
87
|
+
(textValue && textValue.length > 0) ||
|
|
88
|
+
(value && value.length > 0)) && (
|
|
89
|
+
<Row style={{ minHeight: 40, alignItems: "center" }}>
|
|
90
|
+
{euro}
|
|
91
|
+
</Row>
|
|
92
|
+
)}
|
|
93
|
+
<InputElement
|
|
94
|
+
ref={inputRef}
|
|
95
|
+
onFocus={() => setIsFocused(true)}
|
|
96
|
+
onBlur={() => setIsFocused(false)}
|
|
97
|
+
onChangeText={(text) => setTextValue(text)}
|
|
98
|
+
defaultValue={defaultValue}
|
|
99
|
+
value={value}
|
|
100
|
+
multiline={multiline}
|
|
101
|
+
numberOfLines={numberOfLines}
|
|
102
|
+
maxLength={maxLength}
|
|
103
|
+
autoFocus={autoFocus}
|
|
104
|
+
keyboardType={keyboardType}
|
|
105
|
+
editable={editable}
|
|
106
|
+
active={isFocused}
|
|
107
|
+
style={style}
|
|
108
|
+
returnKeyType="done"
|
|
109
|
+
/>
|
|
110
|
+
</Row>
|
|
100
111
|
</MarginHorizontal>
|
|
101
112
|
</BorderWrapper>
|
|
102
113
|
</InputWrapper>
|