sapo-components-ui-rn 1.1.74 → 1.1.76
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.esm.js +20 -17
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +20 -17
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/TextInput/TextInputDefault.tsx +17 -8
- package/src/components/TextInput/TextInputFlat.tsx +3 -3
- package/src/components/TextInput/TextInputNumber.tsx +5 -4
package/dist/index.esm.js
CHANGED
|
@@ -5026,14 +5026,14 @@ var TextInputFlat = function (_a) {
|
|
|
5026
5026
|
}
|
|
5027
5027
|
return false;
|
|
5028
5028
|
};
|
|
5029
|
-
return (React$3.createElement(View$1,
|
|
5029
|
+
return (React$3.createElement(View$1, { style: { flex: 1 } },
|
|
5030
5030
|
React$3.createElement(View$1, { style: {
|
|
5031
5031
|
flexDirection: "row",
|
|
5032
5032
|
alignItems: "center",
|
|
5033
5033
|
borderRadius: BORDER_RADIUS_6,
|
|
5034
5034
|
borderWidth: 1,
|
|
5035
5035
|
borderColor: getBorderColor(),
|
|
5036
|
-
height:
|
|
5036
|
+
height: 48,
|
|
5037
5037
|
overflow: "hidden",
|
|
5038
5038
|
backgroundColor: disabled
|
|
5039
5039
|
? theme.colors.surfacePrimaryDisabled
|
|
@@ -5102,7 +5102,7 @@ var styles$e = StyleSheet.create({
|
|
|
5102
5102
|
input: {
|
|
5103
5103
|
// margin: 0,
|
|
5104
5104
|
flex: 1,
|
|
5105
|
-
height:
|
|
5105
|
+
height: 48,
|
|
5106
5106
|
},
|
|
5107
5107
|
inputFlat: {
|
|
5108
5108
|
paddingTop: 24,
|
|
@@ -5131,7 +5131,7 @@ var styles$e = StyleSheet.create({
|
|
|
5131
5131
|
|
|
5132
5132
|
var TextInputDefault = function (_a) {
|
|
5133
5133
|
var _b;
|
|
5134
|
-
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$3.createElement(TextInput$1, __assign({}, props)); } : _f, _g = _a.multiline, multiline = _g === void 0 ? false : _g, parentState = _a.parentState, innerRef = _a.innerRef, onFocus = _a.onFocus
|
|
5134
|
+
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$3.createElement(TextInput$1, __assign({}, props)); } : _f, _g = _a.multiline, multiline = _g === void 0 ? false : _g, parentState = _a.parentState, innerRef = _a.innerRef, onFocus = _a.onFocus, forceFocus = _a.forceFocus, onBlur = _a.onBlur, onChangeText = _a.onChangeText; _a.onLayout; var left = _a.left, right = _a.right, prefix = _a.prefix, suffix = _a.suffix, placeholderTextColor = _a.placeholderTextColor, _h = _a.clearButton, clearButton = _h === void 0 ? false : _h, contentStyle = _a.contentStyle, _j = _a.value, value = _j === void 0 ? "" : _j, textError = _a.textError, required = _a.required, 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", "prefix", "suffix", "placeholderTextColor", "clearButton", "contentStyle", "value", "textError", "required"]);
|
|
5135
5135
|
var colors = theme.colors;
|
|
5136
5136
|
var font = theme.fonts.bodyLarge;
|
|
5137
5137
|
var _k = (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; _k.minHeight; var viewStyle = __rest(_k, ["fontSize", "fontWeight", "lineHeight", "height", "backgroundColor", "textAlign", "minHeight"]);
|
|
@@ -5197,13 +5197,17 @@ var TextInputDefault = function (_a) {
|
|
|
5197
5197
|
var _a, _b;
|
|
5198
5198
|
if (parentState.focused ||
|
|
5199
5199
|
(parentState.value !== undefined && ((_a = parentState.value) === null || _a === void 0 ? void 0 : _a.toString()) !== "")) {
|
|
5200
|
-
return (React$3.createElement(View, { paddingTop: CONSTANTS.SPACE_6
|
|
5200
|
+
return (React$3.createElement(View, { paddingTop: CONSTANTS.SPACE_6, onPress: function () {
|
|
5201
|
+
forceFocus();
|
|
5202
|
+
} },
|
|
5201
5203
|
React$3.createElement(Text$1, { color: getLabelColor(), size: MINIMIZED_LABEL_FONT_SIZE },
|
|
5202
5204
|
label,
|
|
5203
5205
|
required && React$3.createElement(Text$1, { color: theme.colors.textErrorDefault }, " *"))));
|
|
5204
5206
|
}
|
|
5205
5207
|
else if (((_b = parentState.value) === null || _b === void 0 ? void 0 : _b.toString()) == "") {
|
|
5206
|
-
return (React$3.createElement(View, { paddingTop: CONSTANTS.SPACE_12
|
|
5208
|
+
return (React$3.createElement(View, { paddingTop: CONSTANTS.SPACE_12, onPress: function () {
|
|
5209
|
+
forceFocus();
|
|
5210
|
+
} },
|
|
5207
5211
|
React$3.createElement(Text$1, { color: getLabelColor(), style: [contentStyle] },
|
|
5208
5212
|
label,
|
|
5209
5213
|
required && (React$3.createElement(Text$1, { style: [contentStyle], color: theme.colors.textErrorDefault },
|
|
@@ -5277,7 +5281,7 @@ var TextInputDefault = function (_a) {
|
|
|
5277
5281
|
}
|
|
5278
5282
|
return false;
|
|
5279
5283
|
};
|
|
5280
|
-
return (React$3.createElement(View, { style: viewStyle },
|
|
5284
|
+
return (React$3.createElement(View, { style: [{ flex: 1 }, viewStyle] },
|
|
5281
5285
|
React$3.createElement(View, { row: true, alignCenter: !multiline, justifyCenter: true, style: [
|
|
5282
5286
|
{
|
|
5283
5287
|
borderRadius: CONSTANTS.BORDER_RADIUS_6,
|
|
@@ -5294,7 +5298,7 @@ var TextInputDefault = function (_a) {
|
|
|
5294
5298
|
left && React$3.createElement(Spacer, { width: CONSTANTS.SPACE_8 }),
|
|
5295
5299
|
React$3.createElement(View, { full: true, style: [
|
|
5296
5300
|
{
|
|
5297
|
-
height: height ||
|
|
5301
|
+
height: height || 48,
|
|
5298
5302
|
},
|
|
5299
5303
|
] },
|
|
5300
5304
|
multiline && renderLabel(),
|
|
@@ -5308,7 +5312,7 @@ var TextInputDefault = function (_a) {
|
|
|
5308
5312
|
? textAlign
|
|
5309
5313
|
: I18nManager.getConstants().isRTL
|
|
5310
5314
|
? "right"
|
|
5311
|
-
: "left", height: height ? height :
|
|
5315
|
+
: "left", height: height ? height : 48, paddingTop: getPaddingTopValue(), paddingBottom: multiline ? CONSTANTS.SPACE_4 : 0 }),
|
|
5312
5316
|
contentStyle,
|
|
5313
5317
|
] }))) : (React$3.createElement(View, { style: {
|
|
5314
5318
|
flexDirection: "row",
|
|
@@ -5318,7 +5322,7 @@ var TextInputDefault = function (_a) {
|
|
|
5318
5322
|
? activeColor
|
|
5319
5323
|
: cursorColor, placeholderTextColor: placeholderTextColorBasedOnState, onFocus: onFocus, onBlur: onBlur, underlineColorAndroid: "transparent", multiline: multiline, style: [
|
|
5320
5324
|
styles$d.input,
|
|
5321
|
-
__assign(__assign({}, font), { fontSize: fontSize, lineHeight: lineHeight, fontWeight: fontWeight, color: inputTextColor, textAlignVertical: "center", height: height ? height :
|
|
5325
|
+
__assign(__assign({}, font), { fontSize: fontSize, lineHeight: lineHeight, fontWeight: fontWeight, color: inputTextColor, textAlignVertical: "center", height: height ? height : 48, paddingTop: getPaddingTopValue(), paddingBottom: 0 }),
|
|
5322
5326
|
contentStyle,
|
|
5323
5327
|
] })),
|
|
5324
5328
|
renderSuffix()))),
|
|
@@ -5339,7 +5343,7 @@ var styles$d = StyleSheet.create({
|
|
|
5339
5343
|
input: {
|
|
5340
5344
|
margin: 0,
|
|
5341
5345
|
flex: 1,
|
|
5342
|
-
height:
|
|
5346
|
+
height: 48,
|
|
5343
5347
|
paddingLeft: 0,
|
|
5344
5348
|
},
|
|
5345
5349
|
clearButtonMultiline: {
|
|
@@ -5350,7 +5354,6 @@ var styles$d = StyleSheet.create({
|
|
|
5350
5354
|
clearButton: {
|
|
5351
5355
|
justifyContent: "center",
|
|
5352
5356
|
paddingHorizontal: CONSTANTS.SPACE_8,
|
|
5353
|
-
// alignItems: "center",
|
|
5354
5357
|
},
|
|
5355
5358
|
vError: {
|
|
5356
5359
|
paddingTop: CONSTANTS.SPACE_4,
|
|
@@ -5753,7 +5756,7 @@ var TextInputNumber = function (_a) {
|
|
|
5753
5756
|
setInputValue((value === null || value === void 0 ? void 0 : value.toString()) || "");
|
|
5754
5757
|
}, 300);
|
|
5755
5758
|
};
|
|
5756
|
-
return (React__default.createElement(View,
|
|
5759
|
+
return (React__default.createElement(View, { style: { flex: 1 } },
|
|
5757
5760
|
React__default.createElement(ScaleButton$1, __assign({ activeOpacity: 0.8, onPress: onShowModalKeyboard }, props, { disabled: disabled || false }),
|
|
5758
5761
|
React__default.createElement(View, { style: [
|
|
5759
5762
|
styles$c.container,
|
|
@@ -5761,7 +5764,7 @@ var TextInputNumber = function (_a) {
|
|
|
5761
5764
|
borderRadius: BORDER_RADIUS_6,
|
|
5762
5765
|
},
|
|
5763
5766
|
{
|
|
5764
|
-
height: height ? height :
|
|
5767
|
+
height: height ? height : 48,
|
|
5765
5768
|
},
|
|
5766
5769
|
[
|
|
5767
5770
|
styles$c.border,
|
|
@@ -5793,7 +5796,7 @@ var TextInputNumber = function (_a) {
|
|
|
5793
5796
|
left && (React__default.createElement(View, { center: true, paddingRight: SPACE_8, height: "100%" }, left)),
|
|
5794
5797
|
React__default.createElement(View, { full: true, paddingRight: SPACE_4 },
|
|
5795
5798
|
!checkValueEmpty() && !checkLabelEmpty() && (React__default.createElement(View, null,
|
|
5796
|
-
React__default.createElement(Text$1, { size: 14, color: colors.textSecondary, style: [
|
|
5799
|
+
React__default.createElement(Text$1, { numberOfLines: 1, size: 14, color: colors.textSecondary, style: [
|
|
5797
5800
|
labelStyle,
|
|
5798
5801
|
disabled && {
|
|
5799
5802
|
color: colors.textPlaceholder,
|
|
@@ -5877,7 +5880,7 @@ var TextInputNumber = function (_a) {
|
|
|
5877
5880
|
] }, "L\u01B0u"))))))));
|
|
5878
5881
|
};
|
|
5879
5882
|
var styles$c = StyleSheet.create(__assign(__assign({}, containerStyles), { disabled: { opacity: 0.6 }, container: {
|
|
5880
|
-
height:
|
|
5883
|
+
height: 48,
|
|
5881
5884
|
flexDirection: "row",
|
|
5882
5885
|
justifyContent: "space-between",
|
|
5883
5886
|
alignItems: "center",
|
|
@@ -5920,7 +5923,7 @@ var styles$c = StyleSheet.create(__assign(__assign({}, containerStyles), { disab
|
|
|
5920
5923
|
borderRadius: 8,
|
|
5921
5924
|
alignItems: "center",
|
|
5922
5925
|
justifyContent: "center",
|
|
5923
|
-
height:
|
|
5926
|
+
height: 48,
|
|
5924
5927
|
}, keyText: {
|
|
5925
5928
|
fontWeight: "500",
|
|
5926
5929
|
}, actionRow: {
|