@app-studio/web 0.3.35 → 0.3.37
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 +10 -1
- package/dist/web.cjs.development.js +260 -252
- 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 +261 -253
- package/dist/web.esm.js.map +1 -1
- package/package.json +1 -1
package/dist/web.esm.js
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import React, { useState, useRef, useEffect,
|
|
1
|
+
import React, { useState, useRef, useEffect, useMemo, useCallback, Fragment } from 'react';
|
|
2
2
|
import { View as View$1, Element, Typography, useTheme, Input, Image } from 'app-studio';
|
|
3
3
|
import { Link as Link$1 } from 'react-router-dom';
|
|
4
4
|
import format from 'date-fns/format';
|
|
5
|
-
import 'formik';
|
|
6
5
|
import { create } from 'zustand';
|
|
7
6
|
|
|
8
7
|
var useButtonState = function useButtonState() {
|
|
@@ -3129,15 +3128,253 @@ var DatePickerComponent = function DatePickerComponent(props) {
|
|
|
3129
3128
|
*/
|
|
3130
3129
|
var DatePicker = DatePickerComponent;
|
|
3131
3130
|
|
|
3132
|
-
var
|
|
3131
|
+
var useTextFieldState = function useTextFieldState(_ref) {
|
|
3132
|
+
var label = _ref.label,
|
|
3133
|
+
placeholder = _ref.placeholder,
|
|
3134
|
+
value = _ref.value;
|
|
3135
|
+
var _useState = useState(label != null ? label : placeholder),
|
|
3136
|
+
hint = _useState[0],
|
|
3137
|
+
setHint = _useState[1];
|
|
3138
|
+
var _useState2 = useState(false),
|
|
3139
|
+
isFocused = _useState2[0],
|
|
3140
|
+
setIsFocused = _useState2[1];
|
|
3141
|
+
var _useState3 = useState(false),
|
|
3142
|
+
isHovered = _useState3[0],
|
|
3143
|
+
setIsHovered = _useState3[1];
|
|
3144
|
+
var _useState4 = useState(value || ''),
|
|
3145
|
+
inputValue = _useState4[0],
|
|
3146
|
+
setInputValue = _useState4[1];
|
|
3147
|
+
return {
|
|
3148
|
+
hint: hint,
|
|
3149
|
+
setHint: setHint,
|
|
3150
|
+
isFocused: isFocused,
|
|
3151
|
+
setIsFocused: setIsFocused,
|
|
3152
|
+
isHovered: isHovered,
|
|
3153
|
+
setIsHovered: setIsHovered,
|
|
3154
|
+
inputValue: inputValue,
|
|
3155
|
+
setInputValue: setInputValue
|
|
3156
|
+
};
|
|
3157
|
+
};
|
|
3158
|
+
|
|
3159
|
+
var usePasswordState = function usePasswordState(props) {
|
|
3160
|
+
var textFieldStates = useTextFieldState(props);
|
|
3133
3161
|
var _useState = useState(false),
|
|
3134
3162
|
isVisible = _useState[0],
|
|
3135
3163
|
setIsVisible = _useState[1];
|
|
3136
|
-
return {
|
|
3164
|
+
return _extends({
|
|
3137
3165
|
isVisible: isVisible,
|
|
3138
3166
|
setIsVisible: setIsVisible
|
|
3167
|
+
}, textFieldStates);
|
|
3168
|
+
};
|
|
3169
|
+
|
|
3170
|
+
var _excluded$o = ["id", "name", "label", "value", "hint", "inputValue", "onChange", "leftChild", "rightChild", "helperText", "placeholder", "onChangeText", "shadow", "styles", "size", "shape", "variant", "colorScheme", "error", "isFocused", "isHovered", "isDisabled", "isReadOnly", "isClearable", "isAutoFocus", "setHint", "setIsFocused", "setIsHovered", "setInputValue", "onClick", "onFocus", "onBlur"];
|
|
3171
|
+
var TextFieldInput = function TextFieldInput(props) {
|
|
3172
|
+
return React.createElement(Input, Object.assign({
|
|
3173
|
+
type: "text"
|
|
3174
|
+
}, props));
|
|
3175
|
+
};
|
|
3176
|
+
var TextFieldView = function TextFieldView(_ref) {
|
|
3177
|
+
var id = _ref.id,
|
|
3178
|
+
name = _ref.name,
|
|
3179
|
+
label = _ref.label,
|
|
3180
|
+
hint = _ref.hint,
|
|
3181
|
+
inputValue = _ref.inputValue,
|
|
3182
|
+
onChange = _ref.onChange,
|
|
3183
|
+
leftChild = _ref.leftChild,
|
|
3184
|
+
rightChild = _ref.rightChild,
|
|
3185
|
+
helperText = _ref.helperText,
|
|
3186
|
+
placeholder = _ref.placeholder,
|
|
3187
|
+
onChangeText = _ref.onChangeText,
|
|
3188
|
+
_ref$shadow = _ref.shadow,
|
|
3189
|
+
shadow = _ref$shadow === void 0 ? {} : _ref$shadow,
|
|
3190
|
+
_ref$styles = _ref.styles,
|
|
3191
|
+
styles = _ref$styles === void 0 ? {
|
|
3192
|
+
box: {},
|
|
3193
|
+
field: {},
|
|
3194
|
+
label: {},
|
|
3195
|
+
helperText: {},
|
|
3196
|
+
text: {}
|
|
3197
|
+
} : _ref$styles,
|
|
3198
|
+
_ref$size = _ref.size,
|
|
3199
|
+
size = _ref$size === void 0 ? 'md' : _ref$size,
|
|
3200
|
+
_ref$shape = _ref.shape,
|
|
3201
|
+
shape = _ref$shape === void 0 ? 'default' : _ref$shape,
|
|
3202
|
+
_ref$variant = _ref.variant,
|
|
3203
|
+
variant = _ref$variant === void 0 ? 'default' : _ref$variant,
|
|
3204
|
+
_ref$colorScheme = _ref.colorScheme,
|
|
3205
|
+
colorScheme = _ref$colorScheme === void 0 ? 'theme.primary' : _ref$colorScheme,
|
|
3206
|
+
_ref$error = _ref.error,
|
|
3207
|
+
error = _ref$error === void 0 ? false : _ref$error,
|
|
3208
|
+
_ref$isFocused = _ref.isFocused,
|
|
3209
|
+
isFocused = _ref$isFocused === void 0 ? false : _ref$isFocused,
|
|
3210
|
+
_ref$isHovered = _ref.isHovered,
|
|
3211
|
+
isHovered = _ref$isHovered === void 0 ? false : _ref$isHovered,
|
|
3212
|
+
_ref$isDisabled = _ref.isDisabled,
|
|
3213
|
+
isDisabled = _ref$isDisabled === void 0 ? false : _ref$isDisabled,
|
|
3214
|
+
_ref$isReadOnly = _ref.isReadOnly,
|
|
3215
|
+
isReadOnly = _ref$isReadOnly === void 0 ? false : _ref$isReadOnly,
|
|
3216
|
+
_ref$isClearable = _ref.isClearable,
|
|
3217
|
+
isClearable = _ref$isClearable === void 0 ? true : _ref$isClearable,
|
|
3218
|
+
_ref$isAutoFocus = _ref.isAutoFocus,
|
|
3219
|
+
isAutoFocus = _ref$isAutoFocus === void 0 ? false : _ref$isAutoFocus,
|
|
3220
|
+
_ref$setHint = _ref.setHint,
|
|
3221
|
+
setHint = _ref$setHint === void 0 ? function () {} : _ref$setHint,
|
|
3222
|
+
_ref$setIsFocused = _ref.setIsFocused,
|
|
3223
|
+
setIsFocused = _ref$setIsFocused === void 0 ? function () {} : _ref$setIsFocused,
|
|
3224
|
+
_ref$setIsHovered = _ref.setIsHovered,
|
|
3225
|
+
setIsHovered = _ref$setIsHovered === void 0 ? function () {} : _ref$setIsHovered,
|
|
3226
|
+
_ref$setInputValue = _ref.setInputValue,
|
|
3227
|
+
setInputValue = _ref$setInputValue === void 0 ? function () {} : _ref$setInputValue,
|
|
3228
|
+
onFocus = _ref.onFocus,
|
|
3229
|
+
_ref$onBlur = _ref.onBlur,
|
|
3230
|
+
onBlur = _ref$onBlur === void 0 ? function () {} : _ref$onBlur,
|
|
3231
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$o);
|
|
3232
|
+
var _useTheme = useTheme(),
|
|
3233
|
+
getColor = _useTheme.getColor;
|
|
3234
|
+
var IconColor = getColor('color.blueGray.700');
|
|
3235
|
+
var isWithLabel = !!(isFocused && label);
|
|
3236
|
+
useMemo(function () {
|
|
3237
|
+
setHint(isFocused && !inputValue ? placeholder != null ? placeholder : '' : label != null ? label : placeholder);
|
|
3238
|
+
}, [inputValue, isFocused, label, placeholder]);
|
|
3239
|
+
var fieldStyles = _extends({
|
|
3240
|
+
margin: 0,
|
|
3241
|
+
paddingVertical: 8,
|
|
3242
|
+
padddingHorizontal: 0,
|
|
3243
|
+
width: '100%',
|
|
3244
|
+
heigth: '100%',
|
|
3245
|
+
border: 'none',
|
|
3246
|
+
on: {
|
|
3247
|
+
focus: {
|
|
3248
|
+
outline: 'none'
|
|
3249
|
+
}
|
|
3250
|
+
},
|
|
3251
|
+
fontSize: Typography.fontSizes[size],
|
|
3252
|
+
lineHeight: Typography.fontSizes[size],
|
|
3253
|
+
backgroundColor: 'transparent',
|
|
3254
|
+
color: isDisabled ? 'color.trueGray.600' : 'color.blueGray.700',
|
|
3255
|
+
cursor: isDisabled ? 'not-allowed' : 'auto'
|
|
3256
|
+
}, styles['field']);
|
|
3257
|
+
var handleFocus = function handleFocus() {
|
|
3258
|
+
setIsFocused(true);
|
|
3259
|
+
if (onFocus) onFocus();
|
|
3139
3260
|
};
|
|
3261
|
+
var handleHover = function handleHover() {
|
|
3262
|
+
return setIsHovered(!isHovered);
|
|
3263
|
+
};
|
|
3264
|
+
var handleBlur = function handleBlur(event) {
|
|
3265
|
+
onBlur(event);
|
|
3266
|
+
setIsFocused(false);
|
|
3267
|
+
};
|
|
3268
|
+
var handleChange = function handleChange(event) {
|
|
3269
|
+
if (typeof event === 'string') {
|
|
3270
|
+
//for ios and android
|
|
3271
|
+
setInputValue(event);
|
|
3272
|
+
if (onChangeText) onChangeText(event);
|
|
3273
|
+
} else {
|
|
3274
|
+
//Web
|
|
3275
|
+
setInputValue(event.target.value);
|
|
3276
|
+
if (onChange) onChange(event);
|
|
3277
|
+
}
|
|
3278
|
+
};
|
|
3279
|
+
var handleClear = function handleClear() {
|
|
3280
|
+
setInputValue('');
|
|
3281
|
+
//Web
|
|
3282
|
+
if (onChange) {
|
|
3283
|
+
onBlur({
|
|
3284
|
+
target: {
|
|
3285
|
+
name: name
|
|
3286
|
+
}
|
|
3287
|
+
});
|
|
3288
|
+
onChange({
|
|
3289
|
+
target: {
|
|
3290
|
+
name: name,
|
|
3291
|
+
value: ''
|
|
3292
|
+
}
|
|
3293
|
+
});
|
|
3294
|
+
}
|
|
3295
|
+
//for ios and android
|
|
3296
|
+
if (typeof document === 'undefined' && onChangeText) onChangeText('');
|
|
3297
|
+
};
|
|
3298
|
+
return React.createElement(FieldContainer, {
|
|
3299
|
+
helperText: helperText,
|
|
3300
|
+
error: error,
|
|
3301
|
+
styles: styles
|
|
3302
|
+
}, React.createElement(FieldContent, {
|
|
3303
|
+
label: label,
|
|
3304
|
+
size: size,
|
|
3305
|
+
error: error,
|
|
3306
|
+
shape: shape,
|
|
3307
|
+
styles: styles,
|
|
3308
|
+
shadow: shadow,
|
|
3309
|
+
variant: variant,
|
|
3310
|
+
value: inputValue,
|
|
3311
|
+
color: colorScheme,
|
|
3312
|
+
isHovered: isHovered,
|
|
3313
|
+
isDisabled: isDisabled,
|
|
3314
|
+
isReadOnly: isReadOnly,
|
|
3315
|
+
isFocused: isFocused,
|
|
3316
|
+
isWithLabel: isWithLabel,
|
|
3317
|
+
colorScheme: colorScheme,
|
|
3318
|
+
onMouseEnter: handleHover,
|
|
3319
|
+
onMouseLeave: handleHover
|
|
3320
|
+
}, leftChild, React.createElement(FieldWrapper, null, isWithLabel && React.createElement(FieldLabel, Object.assign({
|
|
3321
|
+
htmlFor: id,
|
|
3322
|
+
color: colorScheme,
|
|
3323
|
+
error: error
|
|
3324
|
+
}, styles), label), React.createElement(TextFieldInput, Object.assign({
|
|
3325
|
+
id: id,
|
|
3326
|
+
name: name,
|
|
3327
|
+
value: inputValue,
|
|
3328
|
+
readOnly: isReadOnly,
|
|
3329
|
+
disabled: isDisabled,
|
|
3330
|
+
autoFocus: isAutoFocus,
|
|
3331
|
+
placeholder: hint,
|
|
3332
|
+
onFocus: handleFocus,
|
|
3333
|
+
onBlur: handleBlur,
|
|
3334
|
+
autoComplete: "off"
|
|
3335
|
+
}, fieldStyles, props, {
|
|
3336
|
+
onChange: handleChange
|
|
3337
|
+
}, onChangeText && {
|
|
3338
|
+
onChangeText: handleChange
|
|
3339
|
+
}))), (rightChild || isClearable && inputValue) && React.createElement(FieldIcons, null, rightChild && React.createElement(React.Fragment, null, rightChild), isClearable && inputValue && !isReadOnly && !isDisabled && React.createElement(CloseSvg, {
|
|
3340
|
+
size: Typography.fontSizes[size],
|
|
3341
|
+
color: IconColor,
|
|
3342
|
+
onClick: handleClear
|
|
3343
|
+
}))));
|
|
3344
|
+
};
|
|
3345
|
+
|
|
3346
|
+
var _excluded$p = ["visibleIcon", "hiddenIcon"],
|
|
3347
|
+
_excluded2 = ["isVisible", "setIsVisible"];
|
|
3348
|
+
var PasswordComponent = function PasswordComponent(_ref) {
|
|
3349
|
+
var _ref$visibleIcon = _ref.visibleIcon,
|
|
3350
|
+
visibleIcon = _ref$visibleIcon === void 0 ? React.createElement(OpenEyeSvg, {
|
|
3351
|
+
size: 14
|
|
3352
|
+
}) : _ref$visibleIcon,
|
|
3353
|
+
_ref$hiddenIcon = _ref.hiddenIcon,
|
|
3354
|
+
hiddenIcon = _ref$hiddenIcon === void 0 ? React.createElement(CloseEyeSvg, {
|
|
3355
|
+
size: 14
|
|
3356
|
+
}) : _ref$hiddenIcon,
|
|
3357
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$p);
|
|
3358
|
+
var _usePasswordState = usePasswordState(props),
|
|
3359
|
+
isVisible = _usePasswordState.isVisible,
|
|
3360
|
+
setIsVisible = _usePasswordState.setIsVisible,
|
|
3361
|
+
passwordState = _objectWithoutPropertiesLoose(_usePasswordState, _excluded2);
|
|
3362
|
+
return React.createElement(TextFieldView, Object.assign({
|
|
3363
|
+
type: isVisible ? 'text' : 'password',
|
|
3364
|
+
isClearable: false,
|
|
3365
|
+
rightChild: React.createElement(View$1, {
|
|
3366
|
+
onClick: function onClick() {
|
|
3367
|
+
if (!props.isDisabled) {
|
|
3368
|
+
setIsVisible(!isVisible);
|
|
3369
|
+
}
|
|
3370
|
+
}
|
|
3371
|
+
}, isVisible ? visibleIcon : hiddenIcon)
|
|
3372
|
+
}, passwordState, props));
|
|
3140
3373
|
};
|
|
3374
|
+
/**
|
|
3375
|
+
* To allow users to securely enter sensitive information
|
|
3376
|
+
*/
|
|
3377
|
+
var Password = PasswordComponent;
|
|
3141
3378
|
|
|
3142
3379
|
var useSelectState = function useSelectState(_ref) {
|
|
3143
3380
|
var placeholder = _ref.placeholder,
|
|
@@ -3185,8 +3422,8 @@ var IconSizes$4 = {
|
|
|
3185
3422
|
xl: 16
|
|
3186
3423
|
};
|
|
3187
3424
|
|
|
3188
|
-
var _excluded$
|
|
3189
|
-
_excluded2 = ["id", "name", "selected", "onChange", "isMulti", "isDisabled", "isReadOnly", "options"],
|
|
3425
|
+
var _excluded$q = ["isHovered", "setIsHovered", "option", "size", "callback"],
|
|
3426
|
+
_excluded2$1 = ["id", "name", "selected", "onChange", "isMulti", "isDisabled", "isReadOnly", "options"],
|
|
3190
3427
|
_excluded3 = ["option", "size", "removeOption"],
|
|
3191
3428
|
_excluded4 = ["id", "name", "label", "selected", "placeholder", "helperText", "hide", "error", "isMulti", "isFocused", "isHovered", "isDisabled", "isReadOnly", "options", "shadow", "size", "colorScheme", "shape", "variant", "styles", "onChange", "setHide", "setSelected", "setIsHovered", "setIsFocused"];
|
|
3192
3429
|
var Item = function Item(_ref) {
|
|
@@ -3197,7 +3434,7 @@ var Item = function Item(_ref) {
|
|
|
3197
3434
|
size = _ref$size === void 0 ? 'md' : _ref$size,
|
|
3198
3435
|
_ref$callback = _ref.callback,
|
|
3199
3436
|
callback = _ref$callback === void 0 ? function () {} : _ref$callback,
|
|
3200
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
3437
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$q);
|
|
3201
3438
|
var handleOptionClick = function handleOptionClick(option) {
|
|
3202
3439
|
return callback(option);
|
|
3203
3440
|
};
|
|
@@ -3267,7 +3504,7 @@ var HiddenSelect = function HiddenSelect(_ref3) {
|
|
|
3267
3504
|
isReadOnly = _ref3$isReadOnly === void 0 ? false : _ref3$isReadOnly,
|
|
3268
3505
|
_ref3$options = _ref3.options,
|
|
3269
3506
|
options = _ref3$options === void 0 ? [] : _ref3$options,
|
|
3270
|
-
props = _objectWithoutPropertiesLoose(_ref3, _excluded2);
|
|
3507
|
+
props = _objectWithoutPropertiesLoose(_ref3, _excluded2$1);
|
|
3271
3508
|
var handleChange = function handleChange(event) {
|
|
3272
3509
|
if (onChange) onChange(event);
|
|
3273
3510
|
};
|
|
@@ -3667,7 +3904,7 @@ var SliderPadding = {
|
|
|
3667
3904
|
}
|
|
3668
3905
|
};
|
|
3669
3906
|
|
|
3670
|
-
var _excluded$
|
|
3907
|
+
var _excluded$r = ["id", "name", "inActiveChild", "activeChild", "shadow", "size", "colorScheme", "on", "isHovered", "isChecked", "isDisabled", "isReadOnly", "onChange", "onValueChange", "setOn", "setIsHovered", "styles"];
|
|
3671
3908
|
var SwitchContent = function SwitchContent(props) {
|
|
3672
3909
|
return React.createElement(Input, Object.assign({
|
|
3673
3910
|
type: "checkbox"
|
|
@@ -3703,7 +3940,7 @@ var SwitchView = function SwitchView(_ref) {
|
|
|
3703
3940
|
slider: {},
|
|
3704
3941
|
circle: {}
|
|
3705
3942
|
} : _ref$styles,
|
|
3706
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
3943
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$r);
|
|
3707
3944
|
var handleToggle = function handleToggle(event) {
|
|
3708
3945
|
if (!isReadOnly) {
|
|
3709
3946
|
setOn(!on);
|
|
@@ -3779,7 +4016,7 @@ var useTextAreaState = function useTextAreaState(_ref) {
|
|
|
3779
4016
|
};
|
|
3780
4017
|
};
|
|
3781
4018
|
|
|
3782
|
-
var _excluded$
|
|
4019
|
+
var _excluded$s = ["id", "name", "hint", "error", "value", "label", "shadow", "inputValue", "helperText", "placeholder", "defaultValue", "size", "shape", "variant", "colorScheme", "isHovered", "isFocused", "isEditable", "isReadOnly", "isDisabled", "isAutoFocus", "isMultiline", "maxRows", "maxCols", "onBlur", "onChange", "onFocus", "onChangeText", "setHint", "setInputValue", "setIsFocused", "setIsHovered", "styles"];
|
|
3783
4020
|
var TextAreaView = function TextAreaView(_ref) {
|
|
3784
4021
|
var id = _ref.id,
|
|
3785
4022
|
name = _ref.name,
|
|
@@ -3837,7 +4074,7 @@ var TextAreaView = function TextAreaView(_ref) {
|
|
|
3837
4074
|
helperText: {},
|
|
3838
4075
|
field: {}
|
|
3839
4076
|
} : _ref$styles,
|
|
3840
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
4077
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$s);
|
|
3841
4078
|
var isWithLabel = !!(isFocused && label);
|
|
3842
4079
|
useMemo(function () {
|
|
3843
4080
|
setHint(isFocused && !inputValue ? placeholder != null ? placeholder : '' : label != null ? label : placeholder);
|
|
@@ -3936,210 +4173,6 @@ var TextAreaComponent = function TextAreaComponent(props) {
|
|
|
3936
4173
|
*/
|
|
3937
4174
|
var TextArea = TextAreaComponent;
|
|
3938
4175
|
|
|
3939
|
-
var useTextFieldState = function useTextFieldState(_ref) {
|
|
3940
|
-
var label = _ref.label,
|
|
3941
|
-
placeholder = _ref.placeholder,
|
|
3942
|
-
value = _ref.value;
|
|
3943
|
-
var _useState = useState(label != null ? label : placeholder),
|
|
3944
|
-
hint = _useState[0],
|
|
3945
|
-
setHint = _useState[1];
|
|
3946
|
-
var _useState2 = useState(false),
|
|
3947
|
-
isFocused = _useState2[0],
|
|
3948
|
-
setIsFocused = _useState2[1];
|
|
3949
|
-
var _useState3 = useState(false),
|
|
3950
|
-
isHovered = _useState3[0],
|
|
3951
|
-
setIsHovered = _useState3[1];
|
|
3952
|
-
var _useState4 = useState(value || ''),
|
|
3953
|
-
inputValue = _useState4[0],
|
|
3954
|
-
setInputValue = _useState4[1];
|
|
3955
|
-
return {
|
|
3956
|
-
hint: hint,
|
|
3957
|
-
setHint: setHint,
|
|
3958
|
-
isFocused: isFocused,
|
|
3959
|
-
setIsFocused: setIsFocused,
|
|
3960
|
-
isHovered: isHovered,
|
|
3961
|
-
setIsHovered: setIsHovered,
|
|
3962
|
-
inputValue: inputValue,
|
|
3963
|
-
setInputValue: setInputValue
|
|
3964
|
-
};
|
|
3965
|
-
};
|
|
3966
|
-
|
|
3967
|
-
var _excluded$r = ["id", "name", "label", "value", "hint", "inputValue", "onChange", "leftChild", "rightChild", "helperText", "placeholder", "onChangeText", "shadow", "styles", "size", "shape", "variant", "colorScheme", "error", "isFocused", "isHovered", "isDisabled", "isReadOnly", "isClearable", "isAutoFocus", "setHint", "setIsFocused", "setIsHovered", "setInputValue", "onClick", "onFocus", "onBlur"];
|
|
3968
|
-
var TextFieldInput = function TextFieldInput(props) {
|
|
3969
|
-
return React.createElement(Input, Object.assign({
|
|
3970
|
-
type: "text"
|
|
3971
|
-
}, props));
|
|
3972
|
-
};
|
|
3973
|
-
var TextFieldView = function TextFieldView(_ref) {
|
|
3974
|
-
var id = _ref.id,
|
|
3975
|
-
name = _ref.name,
|
|
3976
|
-
label = _ref.label,
|
|
3977
|
-
hint = _ref.hint,
|
|
3978
|
-
inputValue = _ref.inputValue,
|
|
3979
|
-
onChange = _ref.onChange,
|
|
3980
|
-
leftChild = _ref.leftChild,
|
|
3981
|
-
rightChild = _ref.rightChild,
|
|
3982
|
-
helperText = _ref.helperText,
|
|
3983
|
-
placeholder = _ref.placeholder,
|
|
3984
|
-
onChangeText = _ref.onChangeText,
|
|
3985
|
-
_ref$shadow = _ref.shadow,
|
|
3986
|
-
shadow = _ref$shadow === void 0 ? {} : _ref$shadow,
|
|
3987
|
-
_ref$styles = _ref.styles,
|
|
3988
|
-
styles = _ref$styles === void 0 ? {
|
|
3989
|
-
box: {},
|
|
3990
|
-
field: {},
|
|
3991
|
-
label: {},
|
|
3992
|
-
helperText: {},
|
|
3993
|
-
text: {}
|
|
3994
|
-
} : _ref$styles,
|
|
3995
|
-
_ref$size = _ref.size,
|
|
3996
|
-
size = _ref$size === void 0 ? 'md' : _ref$size,
|
|
3997
|
-
_ref$shape = _ref.shape,
|
|
3998
|
-
shape = _ref$shape === void 0 ? 'default' : _ref$shape,
|
|
3999
|
-
_ref$variant = _ref.variant,
|
|
4000
|
-
variant = _ref$variant === void 0 ? 'default' : _ref$variant,
|
|
4001
|
-
_ref$colorScheme = _ref.colorScheme,
|
|
4002
|
-
colorScheme = _ref$colorScheme === void 0 ? 'theme.primary' : _ref$colorScheme,
|
|
4003
|
-
_ref$error = _ref.error,
|
|
4004
|
-
error = _ref$error === void 0 ? false : _ref$error,
|
|
4005
|
-
_ref$isFocused = _ref.isFocused,
|
|
4006
|
-
isFocused = _ref$isFocused === void 0 ? false : _ref$isFocused,
|
|
4007
|
-
_ref$isHovered = _ref.isHovered,
|
|
4008
|
-
isHovered = _ref$isHovered === void 0 ? false : _ref$isHovered,
|
|
4009
|
-
_ref$isDisabled = _ref.isDisabled,
|
|
4010
|
-
isDisabled = _ref$isDisabled === void 0 ? false : _ref$isDisabled,
|
|
4011
|
-
_ref$isReadOnly = _ref.isReadOnly,
|
|
4012
|
-
isReadOnly = _ref$isReadOnly === void 0 ? false : _ref$isReadOnly,
|
|
4013
|
-
_ref$isClearable = _ref.isClearable,
|
|
4014
|
-
isClearable = _ref$isClearable === void 0 ? true : _ref$isClearable,
|
|
4015
|
-
_ref$isAutoFocus = _ref.isAutoFocus,
|
|
4016
|
-
isAutoFocus = _ref$isAutoFocus === void 0 ? false : _ref$isAutoFocus,
|
|
4017
|
-
_ref$setHint = _ref.setHint,
|
|
4018
|
-
setHint = _ref$setHint === void 0 ? function () {} : _ref$setHint,
|
|
4019
|
-
_ref$setIsFocused = _ref.setIsFocused,
|
|
4020
|
-
setIsFocused = _ref$setIsFocused === void 0 ? function () {} : _ref$setIsFocused,
|
|
4021
|
-
_ref$setIsHovered = _ref.setIsHovered,
|
|
4022
|
-
setIsHovered = _ref$setIsHovered === void 0 ? function () {} : _ref$setIsHovered,
|
|
4023
|
-
_ref$setInputValue = _ref.setInputValue,
|
|
4024
|
-
setInputValue = _ref$setInputValue === void 0 ? function () {} : _ref$setInputValue,
|
|
4025
|
-
onFocus = _ref.onFocus,
|
|
4026
|
-
_ref$onBlur = _ref.onBlur,
|
|
4027
|
-
onBlur = _ref$onBlur === void 0 ? function () {} : _ref$onBlur,
|
|
4028
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$r);
|
|
4029
|
-
var _useTheme = useTheme(),
|
|
4030
|
-
getColor = _useTheme.getColor;
|
|
4031
|
-
var IconColor = getColor('color.blueGray.700');
|
|
4032
|
-
var isWithLabel = !!(isFocused && label);
|
|
4033
|
-
useMemo(function () {
|
|
4034
|
-
setHint(isFocused && !inputValue ? placeholder != null ? placeholder : '' : label != null ? label : placeholder);
|
|
4035
|
-
}, [inputValue, isFocused, label, placeholder]);
|
|
4036
|
-
var fieldStyles = _extends({
|
|
4037
|
-
margin: 0,
|
|
4038
|
-
paddingVertical: 8,
|
|
4039
|
-
padddingHorizontal: 0,
|
|
4040
|
-
width: '100%',
|
|
4041
|
-
heigth: '100%',
|
|
4042
|
-
border: 'none',
|
|
4043
|
-
on: {
|
|
4044
|
-
focus: {
|
|
4045
|
-
outline: 'none'
|
|
4046
|
-
}
|
|
4047
|
-
},
|
|
4048
|
-
fontSize: Typography.fontSizes[size],
|
|
4049
|
-
lineHeight: Typography.fontSizes[size],
|
|
4050
|
-
backgroundColor: 'transparent',
|
|
4051
|
-
color: isDisabled ? 'color.trueGray.600' : 'color.blueGray.700',
|
|
4052
|
-
cursor: isDisabled ? 'not-allowed' : 'auto'
|
|
4053
|
-
}, styles['field']);
|
|
4054
|
-
var handleFocus = function handleFocus() {
|
|
4055
|
-
setIsFocused(true);
|
|
4056
|
-
if (onFocus) onFocus();
|
|
4057
|
-
};
|
|
4058
|
-
var handleHover = function handleHover() {
|
|
4059
|
-
return setIsHovered(!isHovered);
|
|
4060
|
-
};
|
|
4061
|
-
var handleBlur = function handleBlur(event) {
|
|
4062
|
-
onBlur(event);
|
|
4063
|
-
setIsFocused(false);
|
|
4064
|
-
};
|
|
4065
|
-
var handleChange = function handleChange(event) {
|
|
4066
|
-
if (typeof event === 'string') {
|
|
4067
|
-
//for ios and android
|
|
4068
|
-
setInputValue(event);
|
|
4069
|
-
if (onChangeText) onChangeText(event);
|
|
4070
|
-
} else {
|
|
4071
|
-
//Web
|
|
4072
|
-
setInputValue(event.target.value);
|
|
4073
|
-
if (onChange) onChange(event);
|
|
4074
|
-
}
|
|
4075
|
-
};
|
|
4076
|
-
var handleClear = function handleClear() {
|
|
4077
|
-
setInputValue('');
|
|
4078
|
-
//Web
|
|
4079
|
-
if (onChange) {
|
|
4080
|
-
onBlur({
|
|
4081
|
-
target: {
|
|
4082
|
-
name: name
|
|
4083
|
-
}
|
|
4084
|
-
});
|
|
4085
|
-
onChange({
|
|
4086
|
-
target: {
|
|
4087
|
-
name: name,
|
|
4088
|
-
value: ''
|
|
4089
|
-
}
|
|
4090
|
-
});
|
|
4091
|
-
}
|
|
4092
|
-
//for ios and android
|
|
4093
|
-
if (typeof document === 'undefined' && onChangeText) onChangeText('');
|
|
4094
|
-
};
|
|
4095
|
-
return React.createElement(FieldContainer, {
|
|
4096
|
-
helperText: helperText,
|
|
4097
|
-
error: error,
|
|
4098
|
-
styles: styles
|
|
4099
|
-
}, React.createElement(FieldContent, {
|
|
4100
|
-
label: label,
|
|
4101
|
-
size: size,
|
|
4102
|
-
error: error,
|
|
4103
|
-
shape: shape,
|
|
4104
|
-
styles: styles,
|
|
4105
|
-
shadow: shadow,
|
|
4106
|
-
variant: variant,
|
|
4107
|
-
value: inputValue,
|
|
4108
|
-
color: colorScheme,
|
|
4109
|
-
isHovered: isHovered,
|
|
4110
|
-
isDisabled: isDisabled,
|
|
4111
|
-
isReadOnly: isReadOnly,
|
|
4112
|
-
isFocused: isFocused,
|
|
4113
|
-
isWithLabel: isWithLabel,
|
|
4114
|
-
colorScheme: colorScheme,
|
|
4115
|
-
onMouseEnter: handleHover,
|
|
4116
|
-
onMouseLeave: handleHover
|
|
4117
|
-
}, leftChild, React.createElement(FieldWrapper, null, isWithLabel && React.createElement(FieldLabel, Object.assign({
|
|
4118
|
-
htmlFor: id,
|
|
4119
|
-
color: colorScheme,
|
|
4120
|
-
error: error
|
|
4121
|
-
}, styles), label), React.createElement(TextFieldInput, Object.assign({
|
|
4122
|
-
id: id,
|
|
4123
|
-
name: name,
|
|
4124
|
-
value: inputValue,
|
|
4125
|
-
readOnly: isReadOnly,
|
|
4126
|
-
disabled: isDisabled,
|
|
4127
|
-
autoFocus: isAutoFocus,
|
|
4128
|
-
placeholder: hint,
|
|
4129
|
-
onFocus: handleFocus,
|
|
4130
|
-
onBlur: handleBlur,
|
|
4131
|
-
autoComplete: "off"
|
|
4132
|
-
}, fieldStyles, props, {
|
|
4133
|
-
onChange: handleChange
|
|
4134
|
-
}, onChangeText && {
|
|
4135
|
-
onChangeText: handleChange
|
|
4136
|
-
}))), (rightChild || isClearable && inputValue) && React.createElement(FieldIcons, null, rightChild && React.createElement(React.Fragment, null, rightChild), isClearable && inputValue && !isReadOnly && !isDisabled && React.createElement(CloseSvg, {
|
|
4137
|
-
size: Typography.fontSizes[size],
|
|
4138
|
-
color: IconColor,
|
|
4139
|
-
onClick: handleClear
|
|
4140
|
-
}))));
|
|
4141
|
-
};
|
|
4142
|
-
|
|
4143
4176
|
var TextFieldComponent = function TextFieldComponent(props) {
|
|
4144
4177
|
var textFieldStates = useTextFieldState(props);
|
|
4145
4178
|
return React.createElement(TextFieldView, Object.assign({}, textFieldStates, props));
|
|
@@ -4149,31 +4182,6 @@ var TextFieldComponent = function TextFieldComponent(props) {
|
|
|
4149
4182
|
*/
|
|
4150
4183
|
var TextField = TextFieldComponent;
|
|
4151
4184
|
|
|
4152
|
-
var PasswordComponent = function PasswordComponent(props) {
|
|
4153
|
-
var passwordState = usePasswordState();
|
|
4154
|
-
return React.createElement(TextField, Object.assign({
|
|
4155
|
-
type: passwordState.isVisible ? 'text' : 'password',
|
|
4156
|
-
isClearable: false,
|
|
4157
|
-
visibleIcon: React.createElement(OpenEyeSvg, {
|
|
4158
|
-
size: 14
|
|
4159
|
-
}),
|
|
4160
|
-
hiddenIcon: React.createElement(CloseEyeSvg, {
|
|
4161
|
-
size: 14
|
|
4162
|
-
}),
|
|
4163
|
-
rightChild: React.createElement(View$1, {
|
|
4164
|
-
onClick: function onClick() {
|
|
4165
|
-
if (!props.isDisabled) {
|
|
4166
|
-
passwordState.setIsVisible(!props.isVisible);
|
|
4167
|
-
}
|
|
4168
|
-
}
|
|
4169
|
-
}, passwordState.isVisible ? props.visibleIcon : props.hiddenIcon)
|
|
4170
|
-
}, props));
|
|
4171
|
-
};
|
|
4172
|
-
/**
|
|
4173
|
-
* To allow users to securely enter sensitive information
|
|
4174
|
-
*/
|
|
4175
|
-
var Password = PasswordComponent;
|
|
4176
|
-
|
|
4177
4185
|
var DefaultSizes = {
|
|
4178
4186
|
xs: 14,
|
|
4179
4187
|
sm: 18,
|
|
@@ -4192,8 +4200,8 @@ var DefaultSpeeds = {
|
|
|
4192
4200
|
slow: 300
|
|
4193
4201
|
};
|
|
4194
4202
|
|
|
4195
|
-
var _excluded$
|
|
4196
|
-
_excluded2$
|
|
4203
|
+
var _excluded$t = ["size", "speed", "color"],
|
|
4204
|
+
_excluded2$2 = ["size", "speed", "color"],
|
|
4197
4205
|
_excluded3$1 = ["size", "speed", "color"],
|
|
4198
4206
|
_excluded4$1 = ["size", "children", "textColor", "loaderColor", "type", "speed", "textPosition"];
|
|
4199
4207
|
var DefaultSpinner = function DefaultSpinner(_ref) {
|
|
@@ -4203,7 +4211,7 @@ var DefaultSpinner = function DefaultSpinner(_ref) {
|
|
|
4203
4211
|
speed = _ref$speed === void 0 ? 'normal' : _ref$speed,
|
|
4204
4212
|
_ref$color = _ref.color,
|
|
4205
4213
|
color = _ref$color === void 0 ? 'theme.loading' : _ref$color,
|
|
4206
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
4214
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$t);
|
|
4207
4215
|
var theme = useTheme();
|
|
4208
4216
|
var colorStyle = theme.getColor(color);
|
|
4209
4217
|
var sizeStyle = typeof size === 'number' ? size : DefaultSizes[size];
|
|
@@ -4253,7 +4261,7 @@ var Dotted = function Dotted(_ref2) {
|
|
|
4253
4261
|
speed = _ref2$speed === void 0 ? 'normal' : _ref2$speed,
|
|
4254
4262
|
_ref2$color = _ref2.color,
|
|
4255
4263
|
color = _ref2$color === void 0 ? 'theme.loading' : _ref2$color,
|
|
4256
|
-
props = _objectWithoutPropertiesLoose(_ref2, _excluded2$
|
|
4264
|
+
props = _objectWithoutPropertiesLoose(_ref2, _excluded2$2);
|
|
4257
4265
|
var theme = useTheme();
|
|
4258
4266
|
var colorStyle = theme.getColor(color);
|
|
4259
4267
|
var sizeStyle = typeof size === 'number' ? size : DefaultSizes[size];
|
|
@@ -4453,8 +4461,8 @@ var HeaderIconSizes = {
|
|
|
4453
4461
|
xl: 28
|
|
4454
4462
|
};
|
|
4455
4463
|
|
|
4456
|
-
var _excluded$
|
|
4457
|
-
_excluded2$
|
|
4464
|
+
var _excluded$u = ["children", "blur", "isOpen", "isClosePrevented", "onClose", "position"],
|
|
4465
|
+
_excluded2$3 = ["children", "shadow", "isFullScreen", "shape"],
|
|
4458
4466
|
_excluded3$2 = ["children", "buttonColor", "iconSize", "buttonPosition"],
|
|
4459
4467
|
_excluded4$2 = ["children"],
|
|
4460
4468
|
_excluded5 = ["children"];
|
|
@@ -4469,7 +4477,7 @@ var ModalOverlay = function ModalOverlay(_ref) {
|
|
|
4469
4477
|
onClose = _ref$onClose === void 0 ? function () {} : _ref$onClose,
|
|
4470
4478
|
_ref$position = _ref.position,
|
|
4471
4479
|
position = _ref$position === void 0 ? 'center' : _ref$position,
|
|
4472
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
4480
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$u);
|
|
4473
4481
|
var handleClick = function handleClick() {
|
|
4474
4482
|
if (!isClosePrevented) onClose();
|
|
4475
4483
|
};
|
|
@@ -4503,7 +4511,7 @@ var ModalContainer = function ModalContainer(_ref2) {
|
|
|
4503
4511
|
isFullScreen = _ref2$isFullScreen === void 0 ? false : _ref2$isFullScreen,
|
|
4504
4512
|
_ref2$shape = _ref2.shape,
|
|
4505
4513
|
shape = _ref2$shape === void 0 ? 'rounded' : _ref2$shape,
|
|
4506
|
-
props = _objectWithoutPropertiesLoose(_ref2, _excluded2$
|
|
4514
|
+
props = _objectWithoutPropertiesLoose(_ref2, _excluded2$3);
|
|
4507
4515
|
var defaultShadow = typeof document !== undefined ? {
|
|
4508
4516
|
boxShadow: '0px 2px 8px rgba(0, 0, 0, 0.3)'
|
|
4509
4517
|
} : {
|
|
@@ -4626,12 +4634,12 @@ Modal.Body = ModalBody;
|
|
|
4626
4634
|
Modal.Footer = ModalFooter;
|
|
4627
4635
|
Modal.Layout = ModalLayout;
|
|
4628
4636
|
|
|
4629
|
-
var _excluded$
|
|
4630
|
-
_excluded2$
|
|
4637
|
+
var _excluded$v = ["src", "color"],
|
|
4638
|
+
_excluded2$4 = ["path"];
|
|
4631
4639
|
var FileSVG = function FileSVG(_ref) {
|
|
4632
4640
|
var src = _ref.src,
|
|
4633
4641
|
color = _ref.color,
|
|
4634
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
4642
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$v);
|
|
4635
4643
|
var _useTheme = useTheme(),
|
|
4636
4644
|
getColor = _useTheme.getColor;
|
|
4637
4645
|
var Colorprops = color ? {
|
|
@@ -4646,7 +4654,7 @@ var FileSVG = function FileSVG(_ref) {
|
|
|
4646
4654
|
};
|
|
4647
4655
|
var FileImage = function FileImage(_ref2) {
|
|
4648
4656
|
var path = _ref2.path,
|
|
4649
|
-
props = _objectWithoutPropertiesLoose(_ref2, _excluded2$
|
|
4657
|
+
props = _objectWithoutPropertiesLoose(_ref2, _excluded2$4);
|
|
4650
4658
|
return React.createElement(Image, Object.assign({
|
|
4651
4659
|
src: path
|
|
4652
4660
|
}, props));
|