sapo-components-ui-rn 1.0.62 → 1.0.64
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 +21 -0
- package/dist/components/Switch/Switch.d.ts +3 -33
- package/dist/components/TextInput/TextInput.d.ts +1 -0
- package/dist/components/TextInput/TextInputDefault.d.ts +1 -1
- package/dist/components/TextInput/TextInputFlat.d.ts +1 -1
- package/dist/components/TextInput/TextInputNumber.d.ts +3 -9
- package/dist/components/TextInput/types.d.ts +2 -0
- package/dist/index.esm.js +588 -603
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +587 -601
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/NumberKeyboard/index.tsx +315 -0
- package/src/components/Switch/Switch.tsx +123 -76
- package/src/components/TextInput/Label/InputLabel.tsx +7 -0
- package/src/components/TextInput/TextInput.tsx +7 -0
- package/src/components/TextInput/TextInputDefault.tsx +2 -0
- package/src/components/TextInput/TextInputFlat.tsx +2 -0
- package/src/components/TextInput/TextInputNumber.tsx +26 -37
- package/src/components/TextInput/types.tsx +2 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export interface NumberKeyboardProps {
|
|
3
|
+
/** Giá trị hiện tại của input */
|
|
4
|
+
value?: string | number;
|
|
5
|
+
/** Label hiển thị trên modal */
|
|
6
|
+
label?: string;
|
|
7
|
+
/** Callback khi giá trị thay đổi */
|
|
8
|
+
onChangeText?: (value: string) => void;
|
|
9
|
+
/** Giá trị tối đa cho phép */
|
|
10
|
+
maxValue?: number;
|
|
11
|
+
/** Loại input: integer hoặc float */
|
|
12
|
+
type?: "integer" | "float";
|
|
13
|
+
/** Số chữ số thập phân cho phép */
|
|
14
|
+
formatDecimal?: 1 | 2 | 3;
|
|
15
|
+
/** Trạng thái hiển thị modal */
|
|
16
|
+
visible: boolean;
|
|
17
|
+
/** Callback khi đóng modal */
|
|
18
|
+
onClose: () => void;
|
|
19
|
+
}
|
|
20
|
+
declare const _default: React.NamedExoticComponent<NumberKeyboardProps>;
|
|
21
|
+
export default _default;
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
|
|
3
|
-
import type { ThemeProp } from "../../types";
|
|
4
|
-
export type Props = React.ComponentPropsWithRef<typeof NativeSwitch> & {
|
|
2
|
+
export type Props = {
|
|
5
3
|
/**
|
|
6
4
|
* Disable toggling the switch.
|
|
7
5
|
*/
|
|
@@ -10,38 +8,10 @@ export type Props = React.ComponentPropsWithRef<typeof NativeSwitch> & {
|
|
|
10
8
|
* Value of the switch, true means 'on', false means 'off'.
|
|
11
9
|
*/
|
|
12
10
|
value?: boolean;
|
|
13
|
-
/**
|
|
14
|
-
* Custom color for switch.
|
|
15
|
-
*/
|
|
16
|
-
color?: string;
|
|
17
11
|
/**
|
|
18
12
|
* Callback called with the new value when it changes.
|
|
19
13
|
*/
|
|
20
|
-
onValueChange?:
|
|
21
|
-
style?: StyleProp<ViewStyle>;
|
|
22
|
-
/**
|
|
23
|
-
* @optional
|
|
24
|
-
*/
|
|
25
|
-
theme?: ThemeProp;
|
|
14
|
+
onValueChange?: (value: boolean) => void;
|
|
26
15
|
};
|
|
27
|
-
|
|
28
|
-
* Switch is a visual toggle between two mutually exclusive states — on and off.
|
|
29
|
-
*
|
|
30
|
-
* ## Usage
|
|
31
|
-
* ```js
|
|
32
|
-
* import * as React from 'react';
|
|
33
|
-
* import { Switch } from 'react-native-paper';
|
|
34
|
-
*
|
|
35
|
-
* const MyComponent = () => {
|
|
36
|
-
* const [isSwitchOn, setIsSwitchOn] = React.useState(false);
|
|
37
|
-
*
|
|
38
|
-
* const onToggleSwitch = () => setIsSwitchOn(!isSwitchOn);
|
|
39
|
-
*
|
|
40
|
-
* return <Switch value={isSwitchOn} onValueChange={onToggleSwitch} />;
|
|
41
|
-
* };
|
|
42
|
-
*
|
|
43
|
-
* export default MyComponent;
|
|
44
|
-
* ```
|
|
45
|
-
*/
|
|
46
|
-
declare const Switch: ({ value, disabled, onValueChange, color, theme: themeOverrides, ...rest }: Props) => React.JSX.Element;
|
|
16
|
+
declare const Switch: React.MemoExoticComponent<({ value, disabled, onValueChange }: Props) => React.JSX.Element>;
|
|
47
17
|
export default Switch;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import type { ChildTextInputProps } from "./types";
|
|
3
|
-
declare const TextInputDefault: ({ disabled, editable, label, error, selectionColor: customSelectionColor, cursorColor, outlineColor: customOutlineColor, activeOutlineColor, outlineStyle, textColor, dense, style, theme, render, multiline, parentState, innerRef, onFocus, forceFocus, onBlur, onChangeText, onLayout, left, right, placeholderTextColor, clearButton, contentStyle, value, textError, ...rest }: ChildTextInputProps) => React.JSX.Element;
|
|
3
|
+
declare const TextInputDefault: ({ disabled, editable, label, error, selectionColor: customSelectionColor, cursorColor, outlineColor: customOutlineColor, activeOutlineColor, outlineStyle, textColor, dense, style, theme, render, multiline, parentState, innerRef, onFocus, forceFocus, onBlur, onChangeText, onLayout, left, right, placeholderTextColor, clearButton, contentStyle, value, textError, required, ...rest }: ChildTextInputProps) => React.JSX.Element;
|
|
4
4
|
export default TextInputDefault;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import type { ChildTextInputProps } from "./types";
|
|
3
|
-
declare const TextInputFlat: ({ disabled, editable, label, error, selectionColor: customSelectionColor, cursorColor, underlineColor, underlineStyle, activeUnderlineColor, textColor, dense, style, theme, render, multiline, parentState, innerRef, onFocus, forceFocus, onBlur, onChangeText, onLayoutAnimatedText, onLabelTextLayout, onLeftAffixLayoutChange, onRightAffixLayoutChange, onInputLayout, left, right, prefix, placeholderTextColor, clearButton, contentStyle, scaledLabel, outlineStyle, outlineColor, value, textError, ...rest }: ChildTextInputProps) => React.JSX.Element;
|
|
3
|
+
declare const TextInputFlat: ({ disabled, editable, label, error, selectionColor: customSelectionColor, cursorColor, underlineColor, underlineStyle, activeUnderlineColor, textColor, dense, style, theme, render, multiline, parentState, innerRef, onFocus, forceFocus, onBlur, onChangeText, onLayoutAnimatedText, onLabelTextLayout, onLeftAffixLayoutChange, onRightAffixLayoutChange, onInputLayout, left, right, prefix, placeholderTextColor, clearButton, contentStyle, scaledLabel, outlineStyle, outlineColor, value, textError, required, ...rest }: ChildTextInputProps) => React.JSX.Element;
|
|
4
4
|
export default TextInputFlat;
|
|
@@ -1,20 +1,13 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { StyleProp, ViewStyle, TouchableOpacityProps
|
|
3
|
-
import { IText } from "../Text";
|
|
2
|
+
import { StyleProp, ViewStyle, TouchableOpacityProps } from "react-native";
|
|
4
3
|
import { ThemeProp } from "../../types";
|
|
5
4
|
export interface TextInputNumberProps extends TouchableOpacityProps {
|
|
6
5
|
style?: StyleProp<ViewStyle>;
|
|
7
|
-
borderColor?: string;
|
|
8
6
|
value?: string | number;
|
|
9
7
|
label?: string;
|
|
10
8
|
textError?: string;
|
|
11
9
|
left?: React.ReactNode;
|
|
12
10
|
right?: React.ReactNode;
|
|
13
|
-
textProps?: IText;
|
|
14
|
-
textColor?: string;
|
|
15
|
-
labelColor?: string;
|
|
16
|
-
textStyle?: TextStyle;
|
|
17
|
-
labelStyle?: TextStyle;
|
|
18
11
|
disabled?: boolean;
|
|
19
12
|
prefix?: string;
|
|
20
13
|
onChangeText?: (value: string) => void;
|
|
@@ -23,6 +16,7 @@ export interface TextInputNumberProps extends TouchableOpacityProps {
|
|
|
23
16
|
maxValue?: number;
|
|
24
17
|
type?: "integer" | "float";
|
|
25
18
|
formatDecimal?: 1 | 2 | 3;
|
|
19
|
+
required?: boolean;
|
|
26
20
|
}
|
|
27
|
-
declare const _default: React.MemoExoticComponent<({ style, value, label, textError,
|
|
21
|
+
declare const _default: React.MemoExoticComponent<({ style, value, label, textError, left, right, onChangeText, disabled, theme: themeOverrides, prefix, clearButton, maxValue, type, formatDecimal, required, ...props }: TextInputNumberProps) => React.JSX.Element>;
|
|
28
22
|
export default _default;
|
|
@@ -95,6 +95,7 @@ export type ChildTextInputProps = {
|
|
|
95
95
|
clearButton?: boolean;
|
|
96
96
|
prefix?: string;
|
|
97
97
|
textError?: string;
|
|
98
|
+
required?: boolean;
|
|
98
99
|
} & $Omit<TextInputTypesWithoutMode, "theme"> & {
|
|
99
100
|
theme: InternalTheme;
|
|
100
101
|
};
|
|
@@ -144,6 +145,7 @@ export type InputLabelProps = {
|
|
|
144
145
|
labelBackground?: any;
|
|
145
146
|
maxFontSizeMultiplier?: number | undefined | null;
|
|
146
147
|
scaledLabel?: boolean;
|
|
148
|
+
required?: boolean;
|
|
147
149
|
} & LabelProps;
|
|
148
150
|
export type LabelBackgroundProps = {
|
|
149
151
|
labelStyle: any;
|