sapo-components-ui-rn 1.1.80 → 1.1.81
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/NumberKeyboard/index.d.ts +2 -0
- package/dist/components/TextInput/TextInput.d.ts +1 -1
- package/dist/components/TextInput/TextInputNumber.d.ts +2 -2
- package/dist/index.esm.js +6 -6
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +6 -6
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/NumberKeyboard/index.tsx +10 -2
- package/src/components/TextInput/TextInput.tsx +3 -4
- package/src/components/TextInput/TextInputNumber.tsx +3 -3
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { ViewStyle, StyleProp } from 'react-native';
|
|
2
3
|
export interface NumberKeyboardProps {
|
|
3
4
|
/** Giá trị hiện tại của input */
|
|
4
5
|
value?: string | number;
|
|
@@ -18,6 +19,7 @@ export interface NumberKeyboardProps {
|
|
|
18
19
|
visible: boolean;
|
|
19
20
|
/** Callback khi đóng modal */
|
|
20
21
|
onClose: () => void;
|
|
22
|
+
keyboardStyle?: StyleProp<ViewStyle>;
|
|
21
23
|
}
|
|
22
24
|
declare const _default: React.NamedExoticComponent<NumberKeyboardProps>;
|
|
23
25
|
export default _default;
|
|
@@ -13,7 +13,7 @@ export type Props = React.ComponentPropsWithRef<typeof NativeTextInput> & {
|
|
|
13
13
|
maxValue?: number;
|
|
14
14
|
minValue?: number;
|
|
15
15
|
type?: 'integer' | 'float';
|
|
16
|
-
|
|
16
|
+
keyboardStyle?: StyleProp<ViewStyle>;
|
|
17
17
|
formatDecimal?: 1 | 2 | 3;
|
|
18
18
|
required?: boolean;
|
|
19
19
|
/**
|
|
@@ -3,7 +3,7 @@ import { StyleProp, ViewStyle, TouchableOpacityProps, TextStyle } from 'react-na
|
|
|
3
3
|
import { ThemeProp } from '../../types';
|
|
4
4
|
export interface TextInputNumberProps extends TouchableOpacityProps {
|
|
5
5
|
style?: StyleProp<ViewStyle>;
|
|
6
|
-
|
|
6
|
+
keyboardStyle?: StyleProp<ViewStyle>;
|
|
7
7
|
value?: string | number;
|
|
8
8
|
label?: string;
|
|
9
9
|
textError?: string;
|
|
@@ -25,5 +25,5 @@ export interface TextInputNumberProps extends TouchableOpacityProps {
|
|
|
25
25
|
textErrorStyle?: StyleProp<TextStyle>;
|
|
26
26
|
height?: number;
|
|
27
27
|
}
|
|
28
|
-
declare const _default: React.MemoExoticComponent<({ style, value, label, textError, left, right, onChangeText, disabled, theme: themeOverrides, prefix, suffix, clearButton, maxValue, minValue, type, formatDecimal, required, labelStyle, contentStyle, textErrorStyle, height,
|
|
28
|
+
declare const _default: React.MemoExoticComponent<({ style, value, label, textError, left, right, onChangeText, disabled, theme: themeOverrides, prefix, suffix, clearButton, maxValue, minValue, type, formatDecimal, required, labelStyle, contentStyle, textErrorStyle, height, keyboardStyle, ...props }: TextInputNumberProps) => React.JSX.Element>;
|
|
29
29
|
export default _default;
|
package/dist/index.esm.js
CHANGED
|
@@ -5413,7 +5413,7 @@ function formatShowInput(value, formatDecimal) {
|
|
|
5413
5413
|
return result;
|
|
5414
5414
|
}
|
|
5415
5415
|
var TextInputNumber = function (_a) {
|
|
5416
|
-
var style = _a.style, _b = _a.value, value = _b === void 0 ? '' : _b, _c = _a.label, label = _c === void 0 ? '' : _c, _d = _a.textError, textError = _d === void 0 ? '' : _d, left = _a.left, right = _a.right, onChangeText = _a.onChangeText, _e = _a.disabled, disabled = _e === void 0 ? false : _e; _a.theme; var _f = _a.prefix, prefix = _f === void 0 ? '' : _f, _g = _a.suffix, suffix = _g === void 0 ? '' : _g, _h = _a.clearButton, clearButton = _h === void 0 ? false : _h, _j = _a.maxValue, maxValue = _j === void 0 ? 999999999999 : _j, _k = _a.minValue, minValue = _k === void 0 ? 0 : _k, _l = _a.type, type = _l === void 0 ? 'integer' : _l, _m = _a.formatDecimal, formatDecimal = _m === void 0 ? 3 : _m, _o = _a.required, required = _o === void 0 ? false : _o, labelStyle = _a.labelStyle, contentStyle = _a.contentStyle, textErrorStyle = _a.textErrorStyle, height = _a.height, _p = _a.
|
|
5416
|
+
var style = _a.style, _b = _a.value, value = _b === void 0 ? '' : _b, _c = _a.label, label = _c === void 0 ? '' : _c, _d = _a.textError, textError = _d === void 0 ? '' : _d, left = _a.left, right = _a.right, onChangeText = _a.onChangeText, _e = _a.disabled, disabled = _e === void 0 ? false : _e; _a.theme; var _f = _a.prefix, prefix = _f === void 0 ? '' : _f, _g = _a.suffix, suffix = _g === void 0 ? '' : _g, _h = _a.clearButton, clearButton = _h === void 0 ? false : _h, _j = _a.maxValue, maxValue = _j === void 0 ? 999999999999 : _j, _k = _a.minValue, minValue = _k === void 0 ? 0 : _k, _l = _a.type, type = _l === void 0 ? 'integer' : _l, _m = _a.formatDecimal, formatDecimal = _m === void 0 ? 3 : _m, _o = _a.required, required = _o === void 0 ? false : _o, labelStyle = _a.labelStyle, contentStyle = _a.contentStyle, textErrorStyle = _a.textErrorStyle, height = _a.height, _p = _a.keyboardStyle, keyboardStyle = _p === void 0 ? {} : _p, props = __rest(_a, ["style", "value", "label", "textError", "left", "right", "onChangeText", "disabled", "theme", "prefix", "suffix", "clearButton", "maxValue", "minValue", "type", "formatDecimal", "required", "labelStyle", "contentStyle", "textErrorStyle", "height", "keyboardStyle"]);
|
|
5417
5417
|
var theme = useInternalTheme();
|
|
5418
5418
|
var colors = theme.colors;
|
|
5419
5419
|
var _q = useState(false), isShowModalKeyboard = _q[0], setIsShowModalKeyboard = _q[1];
|
|
@@ -5837,7 +5837,7 @@ var TextInputNumber = function (_a) {
|
|
|
5837
5837
|
React__default.createElement(Text$1, { size: 14, numberOfLines: 1, color: theme.colors.textErrorDefault, style: [textErrorStyle] }, textError))),
|
|
5838
5838
|
React__default.createElement(Modal, { visible: isShowModalKeyboard, transparent: true, animationType: "fade", onRequestClose: onCloseModalKeyboard },
|
|
5839
5839
|
React__default.createElement(TouchableOpacity, { style: styles$c.modalOverlay, activeOpacity: 1, onPress: onCloseModalKeyboard },
|
|
5840
|
-
React__default.createElement(View, { onPress: function () { }, activeOpacity: 1, backgroundColor: colors.surfacePrimaryDefault, style: [styles$c.modalContent,
|
|
5840
|
+
React__default.createElement(View, { onPress: function () { }, activeOpacity: 1, backgroundColor: colors.surfacePrimaryDefault, style: [styles$c.modalContent, keyboardStyle] },
|
|
5841
5841
|
React__default.createElement(Text$1, { style: [styles$c.modalTitle, styles$c.text18] }, label),
|
|
5842
5842
|
React__default.createElement(View, { width: '100%' },
|
|
5843
5843
|
React__default.createElement(View, { paddingHorizontal: SPACE_40 },
|
|
@@ -5976,7 +5976,7 @@ var DefaultRenderer = function (props) { return React__default.createElement(Tex
|
|
|
5976
5976
|
* @extends TextInput props https://reactnative.dev/docs/textinput#props
|
|
5977
5977
|
*/
|
|
5978
5978
|
var TextInput = forwardRef(function (_a, ref) {
|
|
5979
|
-
var _b = _a.mode, mode = _b === void 0 ? 'default' : _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,
|
|
5979
|
+
var _b = _a.mode, mode = _b === void 0 ? 'default' : _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, keyboardStyle = _a.keyboardStyle, rest = __rest(_a, ["mode", "dense", "disabled", "error", "multiline", "editable", "contentStyle", "render", "theme", "placeholderTextColor", "clearButton", "textError", "prefix", "suffix", "maxValue", "minValue", "type", "required", "keyboardStyle"]);
|
|
5980
5980
|
var theme = useInternalTheme();
|
|
5981
5981
|
var isControlled = rest.value !== undefined;
|
|
5982
5982
|
var validInputValue = isControlled ? rest.value : rest.defaultValue;
|
|
@@ -6178,7 +6178,7 @@ var TextInput = forwardRef(function (_a, ref) {
|
|
|
6178
6178
|
}, 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 })));
|
|
6179
6179
|
}
|
|
6180
6180
|
if (mode === 'number') {
|
|
6181
|
-
return (React__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,
|
|
6181
|
+
return (React__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, keyboardStyle: keyboardStyle }));
|
|
6182
6182
|
}
|
|
6183
6183
|
return (React__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: {
|
|
6184
6184
|
labeled: labeled,
|
|
@@ -7281,7 +7281,7 @@ var formatNumberInput = function (value, formatDecimal) {
|
|
|
7281
7281
|
return result;
|
|
7282
7282
|
};
|
|
7283
7283
|
var NumberKeyboard = function (_a) {
|
|
7284
|
-
var _b = _a.value, value = _b === void 0 ? '' : _b, _c = _a.label, label = _c === void 0 ? '' : _c, onChangeText = _a.onChangeText, _d = _a.maxValue, maxValue = _d === void 0 ? 999999999999 : _d, _e = _a.minValue, minValue = _e === void 0 ? 0 : _e, _f = _a.type, type = _f === void 0 ? 'integer' : _f, _g = _a.formatDecimal, formatDecimal = _g === void 0 ? 3 : _g, visible = _a.visible, onClose = _a.onClose;
|
|
7284
|
+
var _b = _a.value, value = _b === void 0 ? '' : _b, _c = _a.label, label = _c === void 0 ? '' : _c, onChangeText = _a.onChangeText, _d = _a.maxValue, maxValue = _d === void 0 ? 999999999999 : _d, _e = _a.minValue, minValue = _e === void 0 ? 0 : _e, _f = _a.type, type = _f === void 0 ? 'integer' : _f, _g = _a.formatDecimal, formatDecimal = _g === void 0 ? 3 : _g, visible = _a.visible, onClose = _a.onClose, keyboardStyle = _a.keyboardStyle;
|
|
7285
7285
|
var theme = useInternalTheme();
|
|
7286
7286
|
var colors = theme.colors;
|
|
7287
7287
|
var _h = useState((value === null || value === void 0 ? void 0 : value.toString()) || ''), inputValue = _h[0], setInputValue = _h[1];
|
|
@@ -7587,7 +7587,7 @@ var NumberKeyboard = function (_a) {
|
|
|
7587
7587
|
}, [onClose, value]);
|
|
7588
7588
|
return (React__default.createElement(Modal, { visible: visible, transparent: true, animationType: "fade", onRequestClose: handleClose },
|
|
7589
7589
|
React__default.createElement(TouchableOpacity, { style: styles.modalOverlay, activeOpacity: 1, onPress: handleClose },
|
|
7590
|
-
React__default.createElement(View, { onPress: function () { }, activeOpacity: 1, backgroundColor: colors.surfacePrimaryDefault, style: styles.modalContent },
|
|
7590
|
+
React__default.createElement(View, { onPress: function () { }, activeOpacity: 1, backgroundColor: colors.surfacePrimaryDefault, style: [styles.modalContent, keyboardStyle] },
|
|
7591
7591
|
React__default.createElement(Text$1, { style: [styles.text18, styles.modalTitle] }, label),
|
|
7592
7592
|
React__default.createElement(View, { width: '100%' },
|
|
7593
7593
|
React__default.createElement(View, { paddingHorizontal: SPACE_40 },
|