@app-studio/web 0.3.55 → 0.3.56
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/Form/Password/Password/Password.state.d.ts +27 -2
- package/dist/components/Form/TextArea/TextArea/TextArea.state.d.ts +1 -1
- package/dist/components/Form/TextField/TextField/TextField.state.d.ts +1 -1
- package/dist/web.cjs.development.js +8 -15
- package/dist/web.cjs.development.js.map +1 -1
- package/dist/web.cjs.production.min.js +1 -1
- package/dist/web.cjs.production.min.js.map +1 -1
- package/dist/web.esm.js +8 -15
- package/dist/web.esm.js.map +1 -1
- package/package.json +1 -1
|
@@ -7,8 +7,33 @@ export declare const usePasswordState: (props: PasswordProps) => {
|
|
|
7
7
|
setIsFocused: import("react").Dispatch<import("react").SetStateAction<boolean>>;
|
|
8
8
|
isHovered: boolean;
|
|
9
9
|
setIsHovered: import("react").Dispatch<import("react").SetStateAction<boolean>>;
|
|
10
|
-
setValue: import("react").Dispatch<
|
|
11
|
-
value:
|
|
10
|
+
setValue: import("react").Dispatch<import("react").SetStateAction<string>>;
|
|
11
|
+
value: string;
|
|
12
|
+
name?: string | undefined;
|
|
13
|
+
isDisabled?: boolean | undefined;
|
|
14
|
+
visibleIcon?: import("react").ReactNode;
|
|
15
|
+
hiddenIcon?: import("react").ReactNode;
|
|
16
|
+
id?: string | undefined;
|
|
17
|
+
error?: any;
|
|
18
|
+
helperText?: string | undefined;
|
|
19
|
+
label?: string | undefined;
|
|
20
|
+
colorScheme?: string | undefined;
|
|
21
|
+
leftChild?: import("react").ReactNode;
|
|
22
|
+
rightChild?: import("react").ReactNode;
|
|
23
|
+
placeholder?: string | undefined;
|
|
24
|
+
isReadOnly?: boolean | undefined;
|
|
25
|
+
isClearable?: boolean | undefined;
|
|
26
|
+
isAutoFocus?: boolean | undefined;
|
|
27
|
+
onChange?: ((value: any) => void) | undefined;
|
|
28
|
+
onChangeText?: ((value: string) => void) | undefined;
|
|
29
|
+
onBlur?: ((value: any) => void) | undefined;
|
|
30
|
+
onClick?: (() => void) | undefined;
|
|
31
|
+
onFocus?: (() => void) | undefined;
|
|
32
|
+
size?: "xs" | "sm" | "md" | "lg" | "xl" | undefined;
|
|
33
|
+
shadow?: import("app-studio").Shadow | import("../../../../utils/elevation").Elevation | import("react").CSSProperties | undefined;
|
|
34
|
+
shape?: "default" | "sharp" | "rounded" | "pillShaped" | undefined;
|
|
35
|
+
styles?: import("../../TextField/TextField/TextField.type").TextFieldStyles | undefined;
|
|
36
|
+
variant?: "default" | "outline" | "none" | undefined;
|
|
12
37
|
isVisible: boolean;
|
|
13
38
|
setIsVisible: import("react").Dispatch<import("react").SetStateAction<boolean>>;
|
|
14
39
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { TextAreaProps } from './TextArea.props';
|
|
3
|
-
export declare const useTextAreaState: ({ label, placeholder, value: defaultValue }: TextAreaProps) => {
|
|
3
|
+
export declare const useTextAreaState: ({ label, placeholder, value: defaultValue, }: TextAreaProps) => {
|
|
4
4
|
hint: string | undefined;
|
|
5
5
|
setHint: import("react").Dispatch<import("react").SetStateAction<string | undefined>>;
|
|
6
6
|
isHovered: boolean;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { TextFieldProps } from './TextField.props';
|
|
3
|
-
export declare const useTextFieldState: ({ label, placeholder,
|
|
3
|
+
export declare const useTextFieldState: ({ label, placeholder, }: TextFieldProps) => {
|
|
4
4
|
hint: string | undefined;
|
|
5
5
|
setHint: import("react").Dispatch<import("react").SetStateAction<string | undefined>>;
|
|
6
6
|
isFocused: boolean;
|
|
@@ -3349,8 +3349,7 @@ var DatePicker = DatePickerComponent;
|
|
|
3349
3349
|
|
|
3350
3350
|
var useTextFieldState = function useTextFieldState(_ref) {
|
|
3351
3351
|
var label = _ref.label,
|
|
3352
|
-
placeholder = _ref.placeholder
|
|
3353
|
-
defaultValue = _ref.value;
|
|
3352
|
+
placeholder = _ref.placeholder;
|
|
3354
3353
|
var _useState = React.useState(label != null ? label : placeholder),
|
|
3355
3354
|
hint = _useState[0],
|
|
3356
3355
|
setHint = _useState[1];
|
|
@@ -3360,7 +3359,7 @@ var useTextFieldState = function useTextFieldState(_ref) {
|
|
|
3360
3359
|
var _useState3 = React.useState(false),
|
|
3361
3360
|
isHovered = _useState3[0],
|
|
3362
3361
|
setIsHovered = _useState3[1];
|
|
3363
|
-
var _useState4 = React.useState(
|
|
3362
|
+
var _useState4 = React.useState(''),
|
|
3364
3363
|
value = _useState4[0],
|
|
3365
3364
|
setValue = _useState4[1];
|
|
3366
3365
|
React.useMemo(function () {
|
|
@@ -3386,7 +3385,7 @@ var usePasswordState = function usePasswordState(props) {
|
|
|
3386
3385
|
return _extends({
|
|
3387
3386
|
isVisible: isVisible,
|
|
3388
3387
|
setIsVisible: setIsVisible
|
|
3389
|
-
}, textFieldStates);
|
|
3388
|
+
}, props, textFieldStates);
|
|
3390
3389
|
};
|
|
3391
3390
|
|
|
3392
3391
|
var _excluded$p = ["id", "name", "label", "hint", "value", "onChange", "leftChild", "rightChild", "helperText", "placeholder", "onChangeText", "shadow", "styles", "size", "shape", "variant", "colorScheme", "error", "isFocused", "isHovered", "isDisabled", "isReadOnly", "isClearable", "isAutoFocus", "setHint", "setIsFocused", "setIsHovered", "setValue", "onClick", "onFocus", "onBlur"];
|
|
@@ -3478,7 +3477,7 @@ var TextFieldView = function TextFieldView(_ref) {
|
|
|
3478
3477
|
return setIsHovered(!isHovered);
|
|
3479
3478
|
};
|
|
3480
3479
|
var handleBlur = function handleBlur(event) {
|
|
3481
|
-
onBlur(event);
|
|
3480
|
+
if (onBlur) onBlur(event);
|
|
3482
3481
|
setIsFocused(false);
|
|
3483
3482
|
};
|
|
3484
3483
|
var handleChange = function handleChange(event) {
|
|
@@ -3503,12 +3502,8 @@ var TextFieldView = function TextFieldView(_ref) {
|
|
|
3503
3502
|
name: name
|
|
3504
3503
|
}
|
|
3505
3504
|
});
|
|
3506
|
-
|
|
3507
|
-
|
|
3508
|
-
name: name,
|
|
3509
|
-
value: ''
|
|
3510
|
-
}
|
|
3511
|
-
});
|
|
3505
|
+
if (onChangeText) onChangeText('');
|
|
3506
|
+
if (onChange) onChange('');
|
|
3512
3507
|
}
|
|
3513
3508
|
//for ios and android
|
|
3514
3509
|
if (typeof document === 'undefined' && onChangeText) onChangeText('');
|
|
@@ -3552,8 +3547,6 @@ var TextFieldView = function TextFieldView(_ref) {
|
|
|
3552
3547
|
}, fieldStyles, props, {
|
|
3553
3548
|
onChange: handleChange,
|
|
3554
3549
|
value: value
|
|
3555
|
-
}, onChange && {
|
|
3556
|
-
onChange: handleChange
|
|
3557
3550
|
}))), (rightChild || isClearable && value) && React__default.createElement(FieldIcons, null, rightChild && React__default.createElement(React__default.Fragment, null, rightChild), isClearable && value && !isReadOnly && !isDisabled && React__default.createElement(CloseSvg, {
|
|
3558
3551
|
size: appStudio.Typography.fontSizes[size],
|
|
3559
3552
|
color: IconColor,
|
|
@@ -3576,8 +3569,8 @@ var PasswordComponent = function PasswordComponent(_ref) {
|
|
|
3576
3569
|
var _usePasswordState = usePasswordState(props),
|
|
3577
3570
|
isVisible = _usePasswordState.isVisible,
|
|
3578
3571
|
setIsVisible = _usePasswordState.setIsVisible,
|
|
3579
|
-
|
|
3580
|
-
return React__default.createElement(TextFieldView, Object.assign({},
|
|
3572
|
+
passwordProps = _objectWithoutPropertiesLoose(_usePasswordState, _excluded2$1);
|
|
3573
|
+
return React__default.createElement(TextFieldView, Object.assign({}, passwordProps, {
|
|
3581
3574
|
type: isVisible ? 'text' : 'password',
|
|
3582
3575
|
isClearable: false,
|
|
3583
3576
|
rightChild: React__default.createElement(appStudio.View, {
|