sapo-components-ui-rn 1.0.13 → 1.0.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/index.js
CHANGED
|
@@ -5558,13 +5558,13 @@ var Text$1 = memoDeepEqual(Text);
|
|
|
5558
5558
|
|
|
5559
5559
|
var TextInputDefault = function (_a) {
|
|
5560
5560
|
var _b;
|
|
5561
|
-
var _c = _a.disabled, disabled = _c === void 0 ? false : _c, _d = _a.editable, editable = _d === void 0 ? true : _d, label = _a.label, _e = _a.error, error = _e === void 0 ? false : _e, customSelectionColor = _a.selectionColor, cursorColor = _a.cursorColor, customOutlineColor = _a.outlineColor, activeOutlineColor = _a.activeOutlineColor; _a.outlineStyle; var textColor = _a.textColor; _a.dense; var style = _a.style, theme = _a.theme, _f = _a.render, render = _f === void 0 ? function (props) { return React__namespace.createElement(reactNative.TextInput, __assign({}, props)); } : _f, _g = _a.multiline, multiline = _g === void 0 ? false : _g, parentState = _a.parentState, innerRef = _a.innerRef, onFocus = _a.onFocus; _a.forceFocus; var onBlur = _a.onBlur, onChangeText = _a.onChangeText; _a.onLayout; var left = _a.left, right = _a.right, placeholderTextColor = _a.placeholderTextColor, _h = _a.clearButton, clearButton = _h === void 0 ? false : _h, contentStyle = _a.contentStyle,
|
|
5561
|
+
var _c = _a.disabled, disabled = _c === void 0 ? false : _c, _d = _a.editable, editable = _d === void 0 ? true : _d, label = _a.label, _e = _a.error, error = _e === void 0 ? false : _e, customSelectionColor = _a.selectionColor, cursorColor = _a.cursorColor, customOutlineColor = _a.outlineColor, activeOutlineColor = _a.activeOutlineColor; _a.outlineStyle; var textColor = _a.textColor; _a.dense; var style = _a.style, theme = _a.theme, _f = _a.render, render = _f === void 0 ? function (props) { return React__namespace.createElement(reactNative.TextInput, __assign({}, props)); } : _f, _g = _a.multiline, multiline = _g === void 0 ? false : _g, parentState = _a.parentState, innerRef = _a.innerRef, onFocus = _a.onFocus; _a.forceFocus; var onBlur = _a.onBlur, onChangeText = _a.onChangeText; _a.onLayout; var left = _a.left, right = _a.right, placeholderTextColor = _a.placeholderTextColor, _h = _a.clearButton, clearButton = _h === void 0 ? false : _h, contentStyle = _a.contentStyle, _j = _a.value, value = _j === void 0 ? "" : _j, rest = __rest(_a, ["disabled", "editable", "label", "error", "selectionColor", "cursorColor", "outlineColor", "activeOutlineColor", "outlineStyle", "textColor", "dense", "style", "theme", "render", "multiline", "parentState", "innerRef", "onFocus", "forceFocus", "onBlur", "onChangeText", "onLayout", "left", "right", "placeholderTextColor", "clearButton", "contentStyle", "value"]);
|
|
5562
5562
|
var colors = theme.colors;
|
|
5563
5563
|
var font = theme.fonts.bodyLarge;
|
|
5564
|
-
var
|
|
5564
|
+
var _k = (reactNative.StyleSheet.flatten(style) || {}), fontSizeStyle = _k.fontSize, fontWeight = _k.fontWeight, lineHeightStyle = _k.lineHeight, height = _k.height, _l = _k.backgroundColor; _l === void 0 ? colors === null || colors === void 0 ? void 0 : colors.backgroundPrimary : _l; var textAlign = _k.textAlign, viewStyle = __rest(_k, ["fontSize", "fontWeight", "lineHeight", "height", "backgroundColor", "textAlign"]);
|
|
5565
5565
|
var fontSize = fontSizeStyle || MAXIMIZED_LABEL_FONT_SIZE;
|
|
5566
5566
|
var lineHeight = lineHeightStyle || (reactNative.Platform.OS === "web" ? fontSize * 1.2 : undefined);
|
|
5567
|
-
var
|
|
5567
|
+
var _m = getOutlinedInputColors({
|
|
5568
5568
|
activeOutlineColor: activeOutlineColor,
|
|
5569
5569
|
customOutlineColor: customOutlineColor,
|
|
5570
5570
|
customSelectionColor: customSelectionColor,
|
|
@@ -5572,8 +5572,8 @@ var TextInputDefault = function (_a) {
|
|
|
5572
5572
|
disabled: disabled,
|
|
5573
5573
|
error: error,
|
|
5574
5574
|
theme: theme,
|
|
5575
|
-
}), inputTextColor =
|
|
5576
|
-
var
|
|
5575
|
+
}), inputTextColor = _m.inputTextColor, activeColor = _m.activeColor, selectionColor = _m.selectionColor;
|
|
5576
|
+
var _o = React__namespace.useState(value || ""), inputValue = _o[0], setInputValue = _o[1];
|
|
5577
5577
|
React__namespace.useEffect(function () {
|
|
5578
5578
|
setInputValue(value || "");
|
|
5579
5579
|
}, [value]);
|
|
@@ -5613,7 +5613,8 @@ var TextInputDefault = function (_a) {
|
|
|
5613
5613
|
};
|
|
5614
5614
|
var renderLabel = function () {
|
|
5615
5615
|
var _a;
|
|
5616
|
-
if (parentState.focused ||
|
|
5616
|
+
if (parentState.focused ||
|
|
5617
|
+
(parentState.value !== undefined && ((_a = parentState.value) === null || _a === void 0 ? void 0 : _a.toString()) !== "")) {
|
|
5617
5618
|
return (React__namespace.createElement(View, { paddingTop: CONSTANTS.SPACE_4 },
|
|
5618
5619
|
React__namespace.createElement(Text$1, { color: getLabelColor(), size: MINIMIZED_LABEL_FONT_SIZE }, label)));
|
|
5619
5620
|
}
|
|
@@ -5658,11 +5659,13 @@ var styles$a = reactNative.StyleSheet.create({
|
|
|
5658
5659
|
margin: 0,
|
|
5659
5660
|
flex: 1,
|
|
5660
5661
|
height: 48,
|
|
5662
|
+
paddingLeft: 0,
|
|
5663
|
+
paddingTop: reactNative.Platform.OS === "ios" ? CONSTANTS.SPACE_4 : CONSTANTS.SPACE_2,
|
|
5661
5664
|
},
|
|
5662
5665
|
clearButton: {
|
|
5663
|
-
|
|
5666
|
+
paddingRight: CONSTANTS.SPACE_12,
|
|
5664
5667
|
height: "100%",
|
|
5665
|
-
paddingTop: CONSTANTS.
|
|
5668
|
+
paddingTop: CONSTANTS.SPACE_12,
|
|
5666
5669
|
},
|
|
5667
5670
|
});
|
|
5668
5671
|
|