sapo-components-ui-rn 1.1.76 → 1.1.78
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/components/TextInput/TextInput.d.ts +0 -4
- package/dist/index.esm.js +12 -9
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +12 -9
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/TextInput/TextInput.tsx +1 -11
- package/src/components/TextInput/TextInputDefault.tsx +4 -3
- package/src/components/TextInput/TextInputFlat.tsx +3 -3
- package/src/components/TextInput/TextInputNumber.tsx +1 -1
package/dist/index.js
CHANGED
|
@@ -4869,9 +4869,10 @@ var TextInputFlat = function (_a) {
|
|
|
4869
4869
|
onChangeText === null || onChangeText === void 0 ? void 0 : onChangeText("");
|
|
4870
4870
|
}
|
|
4871
4871
|
else {
|
|
4872
|
-
|
|
4872
|
+
if (inputValue !== value)
|
|
4873
|
+
setInputValue(value || "");
|
|
4873
4874
|
}
|
|
4874
|
-
}, [value]);
|
|
4875
|
+
}, [value, inputValue]);
|
|
4875
4876
|
var handleChangeText = function (text) {
|
|
4876
4877
|
setInputValue(text);
|
|
4877
4878
|
onChangeText === null || onChangeText === void 0 ? void 0 : onChangeText(text);
|
|
@@ -5068,7 +5069,7 @@ var TextInputFlat = function (_a) {
|
|
|
5068
5069
|
}
|
|
5069
5070
|
return false;
|
|
5070
5071
|
};
|
|
5071
|
-
return (React__namespace.createElement(reactNative.View,
|
|
5072
|
+
return (React__namespace.createElement(reactNative.View, null,
|
|
5072
5073
|
React__namespace.createElement(reactNative.View, { style: {
|
|
5073
5074
|
flexDirection: "row",
|
|
5074
5075
|
alignItems: "center",
|
|
@@ -5195,9 +5196,10 @@ var TextInputDefault = function (_a) {
|
|
|
5195
5196
|
onChangeText === null || onChangeText === void 0 ? void 0 : onChangeText("");
|
|
5196
5197
|
}
|
|
5197
5198
|
else {
|
|
5198
|
-
|
|
5199
|
+
if (inputValue !== value)
|
|
5200
|
+
setInputValue(value || "");
|
|
5199
5201
|
}
|
|
5200
|
-
}, [value]);
|
|
5202
|
+
}, [value, inputValue]);
|
|
5201
5203
|
var handleChangeText = function (text) {
|
|
5202
5204
|
setInputValue(text);
|
|
5203
5205
|
onChangeText === null || onChangeText === void 0 ? void 0 : onChangeText(text);
|
|
@@ -5323,7 +5325,7 @@ var TextInputDefault = function (_a) {
|
|
|
5323
5325
|
}
|
|
5324
5326
|
return false;
|
|
5325
5327
|
};
|
|
5326
|
-
return (React__namespace.createElement(View, { style:
|
|
5328
|
+
return (React__namespace.createElement(View, { style: viewStyle },
|
|
5327
5329
|
React__namespace.createElement(View, { row: true, alignCenter: !multiline, justifyCenter: true, style: [
|
|
5328
5330
|
{
|
|
5329
5331
|
borderRadius: CONSTANTS.BORDER_RADIUS_6,
|
|
@@ -5396,6 +5398,7 @@ var styles$d = reactNative.StyleSheet.create({
|
|
|
5396
5398
|
clearButton: {
|
|
5397
5399
|
justifyContent: "center",
|
|
5398
5400
|
paddingHorizontal: CONSTANTS.SPACE_8,
|
|
5401
|
+
// alignItems: "center",
|
|
5399
5402
|
},
|
|
5400
5403
|
vError: {
|
|
5401
5404
|
paddingTop: CONSTANTS.SPACE_4,
|
|
@@ -5798,7 +5801,7 @@ var TextInputNumber = function (_a) {
|
|
|
5798
5801
|
setInputValue((value === null || value === void 0 ? void 0 : value.toString()) || "");
|
|
5799
5802
|
}, 300);
|
|
5800
5803
|
};
|
|
5801
|
-
return (React__default["default"].createElement(View,
|
|
5804
|
+
return (React__default["default"].createElement(View, null,
|
|
5802
5805
|
React__default["default"].createElement(ScaleButton$1, __assign({ activeOpacity: 0.8, onPress: onShowModalKeyboard }, props, { disabled: disabled || false }),
|
|
5803
5806
|
React__default["default"].createElement(View, { style: [
|
|
5804
5807
|
styles$c.container,
|
|
@@ -6016,7 +6019,7 @@ var DefaultRenderer = function (props) { return React__default["default"].create
|
|
|
6016
6019
|
* @extends TextInput props https://reactnative.dev/docs/textinput#props
|
|
6017
6020
|
*/
|
|
6018
6021
|
var TextInput = forwardRef(function (_a, ref) {
|
|
6019
|
-
var _b = _a.mode, mode = _b === void 0 ? "flat" : _b, _c = _a.dense, dense = _c === void 0 ? false : _c, _d = _a.disabled, disabled = _d === void 0 ? false : _d, _e = _a.error, errorProp = _e === void 0 ? false : _e, _f = _a.multiline, multiline = _f === void 0 ? false : _f, _g = _a.editable, editable = _g === void 0 ? true : _g, contentStyle = _a.contentStyle, _h = _a.render, render = _h === void 0 ? DefaultRenderer : _h; _a.theme; var placeholderTextColor = _a.placeholderTextColor, clearButton = _a.clearButton, textError = _a.textError, prefix = _a.prefix, suffix = _a.suffix, maxValue = _a.maxValue, minValue = _a.minValue, type = _a.type, _j = _a.required, required = _j === void 0 ? false : _j,
|
|
6022
|
+
var _b = _a.mode, mode = _b === void 0 ? "flat" : _b, _c = _a.dense, dense = _c === void 0 ? false : _c, _d = _a.disabled, disabled = _d === void 0 ? false : _d, _e = _a.error, errorProp = _e === void 0 ? false : _e, _f = _a.multiline, multiline = _f === void 0 ? false : _f, _g = _a.editable, editable = _g === void 0 ? true : _g, contentStyle = _a.contentStyle, _h = _a.render, render = _h === void 0 ? DefaultRenderer : _h; _a.theme; var placeholderTextColor = _a.placeholderTextColor, clearButton = _a.clearButton, textError = _a.textError, prefix = _a.prefix, suffix = _a.suffix, maxValue = _a.maxValue, minValue = _a.minValue, type = _a.type, _j = _a.required, required = _j === void 0 ? false : _j, rest = __rest(_a, ["mode", "dense", "disabled", "error", "multiline", "editable", "contentStyle", "render", "theme", "placeholderTextColor", "clearButton", "textError", "prefix", "suffix", "maxValue", "minValue", "type", "required"]);
|
|
6020
6023
|
var theme = useInternalTheme();
|
|
6021
6024
|
var isControlled = rest.value !== undefined;
|
|
6022
6025
|
var validInputValue = isControlled ? rest.value : rest.defaultValue;
|
|
@@ -6218,7 +6221,7 @@ var TextInput = forwardRef(function (_a, ref) {
|
|
|
6218
6221
|
}, onFocus: handleFocus, forceFocus: forceFocus, onBlur: handleBlur, allowFontScaling: false, onChangeText: handleChangeText, onLayoutAnimatedText: handleLayoutAnimatedText, onInputLayout: handleInputContainerLayout, onLabelTextLayout: handleLabelTextLayout, onLeftAffixLayoutChange: onLeftAffixLayoutChange, onRightAffixLayoutChange: onRightAffixLayoutChange, maxFontSizeMultiplier: maxFontSizeMultiplier, contentStyle: contentStyle, scaledLabel: scaledLabel })));
|
|
6219
6222
|
}
|
|
6220
6223
|
if (mode === "number") {
|
|
6221
|
-
return (React__default["default"].createElement(TextInputNumber$1, { textError: textError, disabled: disabled, prefix: prefix, suffix: suffix, value: value, right: rest.right, left: rest.left, required: required, label: rest.label, clearButton: clearButton, onChangeText: handleChangeText, maxValue: maxValue, minValue: minValue, formatDecimal: rest.formatDecimal, type: type
|
|
6224
|
+
return (React__default["default"].createElement(TextInputNumber$1, { textError: textError, disabled: disabled, prefix: prefix, suffix: suffix, value: value, right: rest.right, left: rest.left, required: required, label: rest.label, clearButton: clearButton, onChangeText: handleChangeText, maxValue: maxValue, minValue: minValue, formatDecimal: rest.formatDecimal, type: type }));
|
|
6222
6225
|
}
|
|
6223
6226
|
return (React__default["default"].createElement(TextInputFlat, __assign({ dense: dense, disabled: disabled, error: errorProp, textError: textError, editable: editable, prefix: prefix, suffix: suffix, clearButton: clearButton, required: required, render: render }, rest, { theme: theme, value: value, parentState: {
|
|
6224
6227
|
labeled: labeled,
|