@app-studio/web 0.3.57 → 0.3.59
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/Formik/Formik.Checkbox.d.ts +1 -1
- package/dist/components/Formik/Formik.CountryPicker.d.ts +1 -1
- package/dist/components/Formik/Formik.DatePicker.d.ts +1 -1
- package/dist/components/Formik/Formik.Form.d.ts +1 -1
- package/dist/components/Formik/Formik.Password.d.ts +1 -1
- package/dist/components/Formik/Formik.Select.d.ts +1 -1
- package/dist/components/Formik/Formik.Switch.d.ts +1 -1
- package/dist/components/Formik/Formik.TextArea.d.ts +1 -1
- package/dist/components/Formik/Formik.TextField.d.ts +1 -1
- package/dist/components/Formik/examples/FormikCheckbox.d.ts +1 -1
- package/dist/components/Formik/examples/FormikCountryPicker.d.ts +1 -1
- package/dist/components/Formik/examples/FormikDatePicker.d.ts +1 -1
- package/dist/components/Formik/examples/FormikPassword.d.ts +1 -1
- package/dist/components/Formik/examples/FormikSelect.d.ts +1 -1
- package/dist/components/Formik/examples/FormikSwitch.d.ts +1 -1
- package/dist/components/Formik/examples/FormikTextArea.d.ts +1 -1
- package/dist/components/Formik/examples/FormikTextField.d.ts +1 -1
- package/dist/components/Formik/index.d.ts +9 -9
- package/dist/components/index.d.ts +1 -0
- package/dist/web.cjs.development.js +278 -23
- 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 +272 -26
- package/dist/web.esm.js.map +1 -1
- package/package.json +1 -1
|
@@ -3,4 +3,4 @@ import { CheckboxProps } from '../Form/Checkbox/Checkbox/Checkbox.props';
|
|
|
3
3
|
/**
|
|
4
4
|
* Checkbox allows users to select one or more options from a list of choices.
|
|
5
5
|
*/
|
|
6
|
-
export declare const
|
|
6
|
+
export declare const FormikCheckbox: React.FC<CheckboxProps>;
|
|
@@ -3,4 +3,4 @@ import { CountryPickerProps } from '../Form/CountryPicker/CountryPicker/CountryP
|
|
|
3
3
|
/**
|
|
4
4
|
* Country picker allows users to select a country from a dropdown list or search field.
|
|
5
5
|
*/
|
|
6
|
-
export declare const
|
|
6
|
+
export declare const FormikCountryPicker: React.FC<CountryPickerProps>;
|
|
@@ -3,4 +3,4 @@ import { DatePickerProps } from '../Form/DatePicker/DatePicker/DatePicker.props'
|
|
|
3
3
|
/**
|
|
4
4
|
* Date picker allows users to select a date from a calendar view.
|
|
5
5
|
*/
|
|
6
|
-
export declare const
|
|
6
|
+
export declare const FormikDatePicker: React.FC<DatePickerProps>;
|
|
@@ -21,5 +21,5 @@ interface FocusContextType {
|
|
|
21
21
|
setInputRef: (name: string, ref: HTMLInputElement | null) => void;
|
|
22
22
|
}
|
|
23
23
|
export declare const useFormFocus: () => FocusContextType;
|
|
24
|
-
export declare const
|
|
24
|
+
export declare const FormikForm: <T extends {}>({ children, autoFocus, initFocus, }: any) => React.JSX.Element;
|
|
25
25
|
export {};
|
|
@@ -3,4 +3,4 @@ import { TextAreaProps } from '../Form/TextArea/TextArea/TextArea.props';
|
|
|
3
3
|
/**
|
|
4
4
|
* Text Area is an component used to create a multi-line input field.
|
|
5
5
|
*/
|
|
6
|
-
export declare const
|
|
6
|
+
export declare const FormikTextArea: React.FC<TextAreaProps>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const FormCheckboxExemple: () => React.JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const FormikCountryPickerExemple: () => React.JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const FormikDatePickerExemple: () => React.JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const FormikPasswordExemple: () => React.JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const FormikSelectExemple: () => React.JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const FormikSwitchExemple: () => React.JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const FormikTextAreaExemple: () => React.JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const FormikTextFieldExemple: () => React.JSX.Element;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export {
|
|
3
|
-
export {
|
|
4
|
-
export {
|
|
5
|
-
export {
|
|
6
|
-
export {
|
|
7
|
-
export {
|
|
8
|
-
export {
|
|
9
|
-
export {
|
|
1
|
+
export { FormikCheckbox } from './Formik.Checkbox';
|
|
2
|
+
export { FormikDatePicker } from './Formik.DatePicker';
|
|
3
|
+
export { FormikCountryPicker } from './Formik.CountryPicker';
|
|
4
|
+
export { FormikSelect } from './Formik.Select';
|
|
5
|
+
export { FormikSwitch } from './Formik.Switch';
|
|
6
|
+
export { FormikTextArea } from './Formik.TextArea';
|
|
7
|
+
export { FormikTextField } from './Formik.TextField';
|
|
8
|
+
export { FormikPassword } from './Formik.Password';
|
|
9
|
+
export { FormikForm } from './Formik.Form';
|
|
@@ -9,6 +9,7 @@ export * from './Form/Switch/Switch';
|
|
|
9
9
|
export * from './Form/TextArea/TextArea';
|
|
10
10
|
export * from './Form/TextField/TextField';
|
|
11
11
|
export * from './Layout/Center/Center';
|
|
12
|
+
export * from './Formik';
|
|
12
13
|
export * from './Layout/Horizontal/Horizontal';
|
|
13
14
|
export * from './Layout/Vertical/Vertical';
|
|
14
15
|
export * from './Layout/View/View';
|
|
@@ -9,6 +9,7 @@ var React__default = _interopDefault(React);
|
|
|
9
9
|
var appStudio = require('app-studio');
|
|
10
10
|
var reactRouterDom = require('react-router-dom');
|
|
11
11
|
var format = _interopDefault(require('date-fns/format'));
|
|
12
|
+
var formik = require('formik');
|
|
12
13
|
var zustand = require('zustand');
|
|
13
14
|
|
|
14
15
|
var useButtonState = function useButtonState() {
|
|
@@ -4117,7 +4118,7 @@ var SliderPadding = {
|
|
|
4117
4118
|
}
|
|
4118
4119
|
};
|
|
4119
4120
|
|
|
4120
|
-
var _excluded$s = ["id", "name", "inActiveChild", "activeChild", "shadow", "size", "colorScheme", "
|
|
4121
|
+
var _excluded$s = ["id", "name", "inActiveChild", "activeChild", "shadow", "size", "colorScheme", "value", "isHovered", "isDisabled", "isReadOnly", "onChange", "setValue", "setIsHovered", "styles"];
|
|
4121
4122
|
var SwitchContent = function SwitchContent(props) {
|
|
4122
4123
|
return React__default.createElement(appStudio.Input, Object.assign({
|
|
4123
4124
|
type: "checkbox"
|
|
@@ -4134,8 +4135,8 @@ var SwitchView = function SwitchView(_ref) {
|
|
|
4134
4135
|
size = _ref$size === void 0 ? 'sm' : _ref$size,
|
|
4135
4136
|
_ref$colorScheme = _ref.colorScheme,
|
|
4136
4137
|
colorScheme = _ref$colorScheme === void 0 ? 'theme.primary' : _ref$colorScheme,
|
|
4137
|
-
_ref$
|
|
4138
|
-
|
|
4138
|
+
_ref$value = _ref.value,
|
|
4139
|
+
value = _ref$value === void 0 ? false : _ref$value,
|
|
4139
4140
|
_ref$isHovered = _ref.isHovered,
|
|
4140
4141
|
isHovered = _ref$isHovered === void 0 ? false : _ref$isHovered,
|
|
4141
4142
|
_ref$isDisabled = _ref.isDisabled,
|
|
@@ -4143,9 +4144,8 @@ var SwitchView = function SwitchView(_ref) {
|
|
|
4143
4144
|
_ref$isReadOnly = _ref.isReadOnly,
|
|
4144
4145
|
isReadOnly = _ref$isReadOnly === void 0 ? false : _ref$isReadOnly,
|
|
4145
4146
|
onChange = _ref.onChange,
|
|
4146
|
-
|
|
4147
|
-
_ref$
|
|
4148
|
-
setOn = _ref$setOn === void 0 ? function () {} : _ref$setOn,
|
|
4147
|
+
_ref$setValue = _ref.setValue,
|
|
4148
|
+
setValue = _ref$setValue === void 0 ? function () {} : _ref$setValue,
|
|
4149
4149
|
_ref$setIsHovered = _ref.setIsHovered,
|
|
4150
4150
|
setIsHovered = _ref$setIsHovered === void 0 ? function () {} : _ref$setIsHovered,
|
|
4151
4151
|
_ref$styles = _ref.styles,
|
|
@@ -4156,7 +4156,7 @@ var SwitchView = function SwitchView(_ref) {
|
|
|
4156
4156
|
props = _objectWithoutPropertiesLoose(_ref, _excluded$s);
|
|
4157
4157
|
var handleToggle = function handleToggle(event) {
|
|
4158
4158
|
if (!isReadOnly) {
|
|
4159
|
-
|
|
4159
|
+
setValue(!value);
|
|
4160
4160
|
if (onChange) onChange(event.target.checked);
|
|
4161
4161
|
}
|
|
4162
4162
|
};
|
|
@@ -4173,26 +4173,24 @@ var SwitchView = function SwitchView(_ref) {
|
|
|
4173
4173
|
opacity: 0,
|
|
4174
4174
|
width: 0,
|
|
4175
4175
|
height: 0,
|
|
4176
|
-
checked:
|
|
4176
|
+
checked: value,
|
|
4177
4177
|
onChange: handleToggle,
|
|
4178
4178
|
disabled: isDisabled,
|
|
4179
4179
|
readOnly: isReadOnly
|
|
4180
|
-
}, onValueChange && {
|
|
4181
|
-
onValueChange: handleToggle
|
|
4182
4180
|
}, props)), React__default.createElement(View, Object.assign({
|
|
4183
4181
|
display: "flex",
|
|
4184
4182
|
cursor: "pointer",
|
|
4185
4183
|
alignItems: "center",
|
|
4186
4184
|
borderRadius: 24,
|
|
4187
4185
|
marginBottom: 5,
|
|
4188
|
-
filter: isHovered &&
|
|
4186
|
+
filter: isHovered && value ? 'brightness(0.9)' : 'brightness(1)',
|
|
4189
4187
|
transition: "justify-content 0.3s cubic-bezier(0.4, 0, 0.2, 1)",
|
|
4190
|
-
backgroundColor: isDisabled ? 'disabled' :
|
|
4191
|
-
justifyContent: activeChild ? 'space-between' :
|
|
4192
|
-
}, shadow, SliderPadding[size], SliderSizes[size], styles['slider']), activeChild &&
|
|
4188
|
+
backgroundColor: isDisabled ? 'disabled' : value ? colorScheme : 'lightgray',
|
|
4189
|
+
justifyContent: activeChild ? 'space-between' : value ? 'flex-end' : 'flex-start'
|
|
4190
|
+
}, shadow, SliderPadding[size], SliderSizes[size], styles['slider']), activeChild && value && React__default.createElement(View, null, activeChild), React__default.createElement(View, Object.assign({
|
|
4193
4191
|
borderRadius: "50%",
|
|
4194
4192
|
backgroundColor: "white"
|
|
4195
|
-
}, KnobSizes[size], styles['circle'])), inActiveChild && !
|
|
4193
|
+
}, KnobSizes[size], styles['circle'])), inActiveChild && !value && React__default.createElement(View, null, inActiveChild)));
|
|
4196
4194
|
};
|
|
4197
4195
|
|
|
4198
4196
|
var SwitchComponent = function SwitchComponent(props) {
|
|
@@ -4392,6 +4390,254 @@ var TextFieldComponent = function TextFieldComponent(props) {
|
|
|
4392
4390
|
*/
|
|
4393
4391
|
var TextField = TextFieldComponent;
|
|
4394
4392
|
|
|
4393
|
+
var FocusContext = /*#__PURE__*/React.createContext({
|
|
4394
|
+
active: false,
|
|
4395
|
+
focusNextInput: function focusNextInput() {},
|
|
4396
|
+
setInputRef: function setInputRef() {},
|
|
4397
|
+
handleSubmitEditing: function handleSubmitEditing() {},
|
|
4398
|
+
getReturnKeyType: function getReturnKeyType() {
|
|
4399
|
+
return 'next';
|
|
4400
|
+
}
|
|
4401
|
+
});
|
|
4402
|
+
var useFormFocus = function useFormFocus() {
|
|
4403
|
+
return React.useContext(FocusContext);
|
|
4404
|
+
};
|
|
4405
|
+
var FormikForm = function FormikForm(_ref) {
|
|
4406
|
+
var children = _ref.children,
|
|
4407
|
+
_ref$autoFocus = _ref.autoFocus,
|
|
4408
|
+
autoFocus = _ref$autoFocus === void 0 ? false : _ref$autoFocus,
|
|
4409
|
+
initFocus = _ref.initFocus;
|
|
4410
|
+
var formik$1 = formik.useFormikContext();
|
|
4411
|
+
var inputRefs = React.useRef({});
|
|
4412
|
+
var inputNames = React.useRef([]);
|
|
4413
|
+
var setInputRef = function setInputRef(name, ref) {
|
|
4414
|
+
inputRefs.current[name] = ref;
|
|
4415
|
+
if (!inputNames.current.includes(name)) {
|
|
4416
|
+
inputNames.current.push(name);
|
|
4417
|
+
}
|
|
4418
|
+
};
|
|
4419
|
+
var focusNextInput = function focusNextInput(currentName) {
|
|
4420
|
+
if (autoFocus) {
|
|
4421
|
+
var currentIndex = inputNames.current.indexOf(currentName);
|
|
4422
|
+
var nextIndex = currentIndex + 1;
|
|
4423
|
+
if (nextIndex < inputNames.current.length) {
|
|
4424
|
+
var _inputRefs$current$in;
|
|
4425
|
+
(_inputRefs$current$in = inputRefs.current[inputNames.current[nextIndex]]) == null || _inputRefs$current$in.focus();
|
|
4426
|
+
} else if (formik$1.onSubmit) {
|
|
4427
|
+
formik$1.onSubmit(formik$1.values);
|
|
4428
|
+
}
|
|
4429
|
+
}
|
|
4430
|
+
};
|
|
4431
|
+
var contextValue = {
|
|
4432
|
+
active: autoFocus,
|
|
4433
|
+
focusNextInput: focusNextInput,
|
|
4434
|
+
setInputRef: setInputRef,
|
|
4435
|
+
handleSubmitEditing: focusNextInput,
|
|
4436
|
+
getReturnKeyType: function getReturnKeyType(name) {
|
|
4437
|
+
return inputNames.current.indexOf(name) === inputNames.current.length - 1 ? 'done' : 'next';
|
|
4438
|
+
}
|
|
4439
|
+
};
|
|
4440
|
+
React.useEffect(function () {
|
|
4441
|
+
if (autoFocus) {
|
|
4442
|
+
if (initFocus && inputRefs.current[initFocus]) {
|
|
4443
|
+
var _inputRefs$current$in2;
|
|
4444
|
+
(_inputRefs$current$in2 = inputRefs.current[initFocus]) == null || _inputRefs$current$in2.focus();
|
|
4445
|
+
} else if (inputNames.current[0]) {
|
|
4446
|
+
var _inputRefs$current$in3;
|
|
4447
|
+
(_inputRefs$current$in3 = inputRefs.current[inputNames.current[0]]) == null || _inputRefs$current$in3.focus();
|
|
4448
|
+
}
|
|
4449
|
+
}
|
|
4450
|
+
}, [autoFocus, initFocus]);
|
|
4451
|
+
return React__default.createElement(FocusContext.Provider, {
|
|
4452
|
+
value: contextValue
|
|
4453
|
+
}, React__default.createElement(appStudio.Form, null, children));
|
|
4454
|
+
};
|
|
4455
|
+
|
|
4456
|
+
var _excluded$u = ["name", "type"];
|
|
4457
|
+
var getInputTypeProps = function getInputTypeProps(type) {
|
|
4458
|
+
switch (type) {
|
|
4459
|
+
case 'email':
|
|
4460
|
+
return {
|
|
4461
|
+
autoCorrect: 'off',
|
|
4462
|
+
keyboardType: 'email-address',
|
|
4463
|
+
autoCapitalize: 'none'
|
|
4464
|
+
};
|
|
4465
|
+
case 'password':
|
|
4466
|
+
return {
|
|
4467
|
+
autoCorrect: 'off',
|
|
4468
|
+
secureTextEntry: true,
|
|
4469
|
+
autoCapitalize: 'none'
|
|
4470
|
+
};
|
|
4471
|
+
case 'digits':
|
|
4472
|
+
return {
|
|
4473
|
+
keyboardType: 'phone-pad'
|
|
4474
|
+
};
|
|
4475
|
+
case 'name':
|
|
4476
|
+
return {
|
|
4477
|
+
autoCorrect: 'off'
|
|
4478
|
+
};
|
|
4479
|
+
default:
|
|
4480
|
+
return {};
|
|
4481
|
+
}
|
|
4482
|
+
};
|
|
4483
|
+
var useFormikInput = function useFormikInput(_ref) {
|
|
4484
|
+
var name = _ref.name,
|
|
4485
|
+
type = _ref.type,
|
|
4486
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$u);
|
|
4487
|
+
var focus = useFormFocus();
|
|
4488
|
+
var _useFormikContext = formik.useFormikContext(),
|
|
4489
|
+
touched = _useFormikContext.touched,
|
|
4490
|
+
errors = _useFormikContext.errors,
|
|
4491
|
+
submitCount = _useFormikContext.submitCount,
|
|
4492
|
+
values = _useFormikContext.values,
|
|
4493
|
+
setFieldTouched = _useFormikContext.setFieldTouched,
|
|
4494
|
+
setFieldValue = _useFormikContext.setFieldValue;
|
|
4495
|
+
var error = touched[name] || submitCount > 0 ? errors[name] : undefined;
|
|
4496
|
+
var onChangeText = function onChangeText(text) {
|
|
4497
|
+
setFieldValue(name, text);
|
|
4498
|
+
props.onChangeText == null || props.onChangeText(text);
|
|
4499
|
+
};
|
|
4500
|
+
var onChange = function onChange(value) {
|
|
4501
|
+
setFieldValue(name, value);
|
|
4502
|
+
props.onChange == null || props.onChange(value);
|
|
4503
|
+
};
|
|
4504
|
+
var handleBlur = function handleBlur() {
|
|
4505
|
+
setFieldTouched(name, true);
|
|
4506
|
+
// if(props.onBlur)props.onBlur();
|
|
4507
|
+
};
|
|
4508
|
+
|
|
4509
|
+
var handleKeyPress = function handleKeyPress(e) {
|
|
4510
|
+
if (e.key === 'Enter') {
|
|
4511
|
+
e.preventDefault();
|
|
4512
|
+
focus.focusNextInput(name);
|
|
4513
|
+
}
|
|
4514
|
+
};
|
|
4515
|
+
var isText = ['text', 'password', 'email', 'digits'].includes(type);
|
|
4516
|
+
return _extends({}, getInputTypeProps(type), props, {
|
|
4517
|
+
value: values[name],
|
|
4518
|
+
error: error,
|
|
4519
|
+
onBlur: handleBlur,
|
|
4520
|
+
onKeyPress: handleKeyPress
|
|
4521
|
+
}, isText ? {
|
|
4522
|
+
onChangeText: onChangeText
|
|
4523
|
+
} : {
|
|
4524
|
+
onChange: onChange
|
|
4525
|
+
}, focus.active ? {
|
|
4526
|
+
handleKeyPress: handleKeyPress
|
|
4527
|
+
} : {});
|
|
4528
|
+
};
|
|
4529
|
+
// import FormPicker from 'src/Picker/Picker';
|
|
4530
|
+
// import FormRater from 'src/Rate/Rate';
|
|
4531
|
+
// import Upload from 'src/Upload/Upload';
|
|
4532
|
+
|
|
4533
|
+
var _excluded$v = ["value"];
|
|
4534
|
+
var CheckboxComponent$1 = function CheckboxComponent(props) {
|
|
4535
|
+
var _useFormikInput = useFormikInput(props),
|
|
4536
|
+
value = _useFormikInput.value,
|
|
4537
|
+
formProps = _objectWithoutPropertiesLoose(_useFormikInput, _excluded$v);
|
|
4538
|
+
formProps.isChecked = value;
|
|
4539
|
+
var checkboxStates = useCheckboxState(props);
|
|
4540
|
+
return React__default.createElement(CheckboxView, Object.assign({}, checkboxStates, formProps));
|
|
4541
|
+
};
|
|
4542
|
+
/**
|
|
4543
|
+
* Checkbox allows users to select one or more options from a list of choices.
|
|
4544
|
+
*/
|
|
4545
|
+
var FormikCheckbox = CheckboxComponent$1;
|
|
4546
|
+
|
|
4547
|
+
var DatePickerComponent$1 = function DatePickerComponent(props) {
|
|
4548
|
+
var formProps = useFormikInput(props);
|
|
4549
|
+
var datePickerStates = useDatePickerState();
|
|
4550
|
+
return React__default.createElement(DatePickerView, Object.assign({}, datePickerStates, formProps));
|
|
4551
|
+
};
|
|
4552
|
+
/**
|
|
4553
|
+
* Date picker allows users to select a date from a calendar view.
|
|
4554
|
+
*/
|
|
4555
|
+
var FormikDatePicker = DatePickerComponent$1;
|
|
4556
|
+
|
|
4557
|
+
var CountryPickerComponent$1 = function CountryPickerComponent(props) {
|
|
4558
|
+
var formProps = useFormikInput(props);
|
|
4559
|
+
var countryPickerStates = useCountryPickerState(props);
|
|
4560
|
+
return React__default.createElement(CountryPickerView, Object.assign({}, countryPickerStates, formProps));
|
|
4561
|
+
};
|
|
4562
|
+
/**
|
|
4563
|
+
* Country picker allows users to select a country from a dropdown list or search field.
|
|
4564
|
+
*/
|
|
4565
|
+
var FormikCountryPicker = CountryPickerComponent$1;
|
|
4566
|
+
|
|
4567
|
+
var SelectComponent$1 = function SelectComponent(props) {
|
|
4568
|
+
var formProps = useFormikInput(props);
|
|
4569
|
+
formProps.selected = formProps.value;
|
|
4570
|
+
var selectStates = useSelectState(props);
|
|
4571
|
+
return React__default.createElement(SelectView, Object.assign({}, selectStates, formProps));
|
|
4572
|
+
};
|
|
4573
|
+
/**
|
|
4574
|
+
* Select provides a dropdown list of options for the user to choose from.
|
|
4575
|
+
*/
|
|
4576
|
+
var FormikSelect = SelectComponent$1;
|
|
4577
|
+
|
|
4578
|
+
var SwitchComponent$1 = function SwitchComponent(props) {
|
|
4579
|
+
var formProps = useFormikInput(props);
|
|
4580
|
+
var switchStates = useSwitchState(props);
|
|
4581
|
+
return React__default.createElement(SwitchView, Object.assign({}, switchStates, formProps));
|
|
4582
|
+
};
|
|
4583
|
+
var FormikSwitch = SwitchComponent$1;
|
|
4584
|
+
|
|
4585
|
+
var TextAreaComponent$1 = function TextAreaComponent(props) {
|
|
4586
|
+
var formProps = useFormikInput(props);
|
|
4587
|
+
var textAreaState = useTextAreaState(props);
|
|
4588
|
+
return React__default.createElement(TextAreaView, Object.assign({}, textAreaState, formProps));
|
|
4589
|
+
};
|
|
4590
|
+
/**
|
|
4591
|
+
* Text Area is an component used to create a multi-line input field.
|
|
4592
|
+
*/
|
|
4593
|
+
var FormikTextArea = TextAreaComponent$1;
|
|
4594
|
+
|
|
4595
|
+
var _excluded$w = ["value"];
|
|
4596
|
+
var TextFieldComponent$1 = function TextFieldComponent(props) {
|
|
4597
|
+
var formProps = useFormikInput(props);
|
|
4598
|
+
var _useTextFieldState = useTextFieldState(props),
|
|
4599
|
+
textFieldStates = _objectWithoutPropertiesLoose(_useTextFieldState, _excluded$w);
|
|
4600
|
+
return React__default.createElement(TextFieldView, Object.assign({}, textFieldStates, formProps));
|
|
4601
|
+
};
|
|
4602
|
+
/**
|
|
4603
|
+
* TextField is used to capture text data from users.
|
|
4604
|
+
*/
|
|
4605
|
+
var FormikTextField = TextFieldComponent$1;
|
|
4606
|
+
|
|
4607
|
+
var _excluded$x = ["visibleIcon", "hiddenIcon"],
|
|
4608
|
+
_excluded2$3 = ["isVisible", "setIsVisible"];
|
|
4609
|
+
var PasswordComponent$1 = function PasswordComponent(_ref) {
|
|
4610
|
+
var _ref$visibleIcon = _ref.visibleIcon,
|
|
4611
|
+
visibleIcon = _ref$visibleIcon === void 0 ? React__default.createElement(OpenEyeSvg, {
|
|
4612
|
+
size: 14
|
|
4613
|
+
}) : _ref$visibleIcon,
|
|
4614
|
+
_ref$hiddenIcon = _ref.hiddenIcon,
|
|
4615
|
+
hiddenIcon = _ref$hiddenIcon === void 0 ? React__default.createElement(CloseEyeSvg, {
|
|
4616
|
+
size: 14
|
|
4617
|
+
}) : _ref$hiddenIcon,
|
|
4618
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$x);
|
|
4619
|
+
var formProps = useFormikInput(props);
|
|
4620
|
+
var _usePasswordState = usePasswordState(formProps),
|
|
4621
|
+
isVisible = _usePasswordState.isVisible,
|
|
4622
|
+
setIsVisible = _usePasswordState.setIsVisible,
|
|
4623
|
+
passwordProps = _objectWithoutPropertiesLoose(_usePasswordState, _excluded2$3);
|
|
4624
|
+
return React__default.createElement(TextFieldView, Object.assign({}, passwordProps, {
|
|
4625
|
+
type: isVisible ? 'text' : 'password',
|
|
4626
|
+
isClearable: false,
|
|
4627
|
+
rightChild: React__default.createElement(appStudio.View, {
|
|
4628
|
+
onClick: function onClick() {
|
|
4629
|
+
if (!props.isDisabled) {
|
|
4630
|
+
setIsVisible(!isVisible);
|
|
4631
|
+
}
|
|
4632
|
+
}
|
|
4633
|
+
}, isVisible ? visibleIcon : hiddenIcon)
|
|
4634
|
+
}));
|
|
4635
|
+
};
|
|
4636
|
+
/**
|
|
4637
|
+
* To allow users to securely enter sensitive information
|
|
4638
|
+
*/
|
|
4639
|
+
var FormikPassword = PasswordComponent$1;
|
|
4640
|
+
|
|
4395
4641
|
var useModalStore = /*#__PURE__*/zustand.create(function (set) {
|
|
4396
4642
|
return {
|
|
4397
4643
|
modal: false,
|
|
@@ -4477,8 +4723,8 @@ var HeaderIconSizes = {
|
|
|
4477
4723
|
xl: 28
|
|
4478
4724
|
};
|
|
4479
4725
|
|
|
4480
|
-
var _excluded$
|
|
4481
|
-
_excluded2$
|
|
4726
|
+
var _excluded$y = ["children", "blur", "isOpen", "isClosePrevented", "onClose", "position"],
|
|
4727
|
+
_excluded2$4 = ["children", "shadow", "isFullScreen", "shape"],
|
|
4482
4728
|
_excluded3$2 = ["children", "buttonColor", "iconSize", "buttonPosition"],
|
|
4483
4729
|
_excluded4$2 = ["children"],
|
|
4484
4730
|
_excluded5 = ["children"];
|
|
@@ -4493,7 +4739,7 @@ var ModalOverlay = function ModalOverlay(_ref) {
|
|
|
4493
4739
|
onClose = _ref$onClose === void 0 ? function () {} : _ref$onClose,
|
|
4494
4740
|
_ref$position = _ref.position,
|
|
4495
4741
|
position = _ref$position === void 0 ? 'center' : _ref$position,
|
|
4496
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
4742
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$y);
|
|
4497
4743
|
var handleClick = function handleClick() {
|
|
4498
4744
|
if (!isClosePrevented) onClose();
|
|
4499
4745
|
};
|
|
@@ -4526,7 +4772,7 @@ var ModalContainer = function ModalContainer(_ref2) {
|
|
|
4526
4772
|
isFullScreen = _ref2$isFullScreen === void 0 ? false : _ref2$isFullScreen,
|
|
4527
4773
|
_ref2$shape = _ref2.shape,
|
|
4528
4774
|
shape = _ref2$shape === void 0 ? 'rounded' : _ref2$shape,
|
|
4529
|
-
props = _objectWithoutPropertiesLoose(_ref2, _excluded2$
|
|
4775
|
+
props = _objectWithoutPropertiesLoose(_ref2, _excluded2$4);
|
|
4530
4776
|
var defaultShadow = typeof document !== undefined ? {
|
|
4531
4777
|
boxShadow: '0px 2px 8px rgba(0, 0, 0, 0.3)'
|
|
4532
4778
|
} : {
|
|
@@ -4649,12 +4895,12 @@ Modal.Body = ModalBody;
|
|
|
4649
4895
|
Modal.Footer = ModalFooter;
|
|
4650
4896
|
Modal.Layout = ModalLayout;
|
|
4651
4897
|
|
|
4652
|
-
var _excluded$
|
|
4653
|
-
_excluded2$
|
|
4898
|
+
var _excluded$z = ["src", "color"],
|
|
4899
|
+
_excluded2$5 = ["path"];
|
|
4654
4900
|
var FileSVG = function FileSVG(_ref) {
|
|
4655
4901
|
var src = _ref.src,
|
|
4656
4902
|
color = _ref.color,
|
|
4657
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
4903
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$z);
|
|
4658
4904
|
var _useTheme = appStudio.useTheme(),
|
|
4659
4905
|
getColor = _useTheme.getColor;
|
|
4660
4906
|
var Colorprops = color ? {
|
|
@@ -4669,7 +4915,7 @@ var FileSVG = function FileSVG(_ref) {
|
|
|
4669
4915
|
};
|
|
4670
4916
|
var FileImage = function FileImage(_ref2) {
|
|
4671
4917
|
var path = _ref2.path,
|
|
4672
|
-
props = _objectWithoutPropertiesLoose(_ref2, _excluded2$
|
|
4918
|
+
props = _objectWithoutPropertiesLoose(_ref2, _excluded2$5);
|
|
4673
4919
|
return React__default.createElement(appStudio.Image, Object.assign({
|
|
4674
4920
|
src: path
|
|
4675
4921
|
}, props));
|
|
@@ -4683,6 +4929,15 @@ exports.CountryPicker = CountryPicker;
|
|
|
4683
4929
|
exports.DatePicker = DatePicker;
|
|
4684
4930
|
exports.FileImage = FileImage;
|
|
4685
4931
|
exports.FileSVG = FileSVG;
|
|
4932
|
+
exports.FormikCheckbox = FormikCheckbox;
|
|
4933
|
+
exports.FormikCountryPicker = FormikCountryPicker;
|
|
4934
|
+
exports.FormikDatePicker = FormikDatePicker;
|
|
4935
|
+
exports.FormikForm = FormikForm;
|
|
4936
|
+
exports.FormikPassword = FormikPassword;
|
|
4937
|
+
exports.FormikSelect = FormikSelect;
|
|
4938
|
+
exports.FormikSwitch = FormikSwitch;
|
|
4939
|
+
exports.FormikTextArea = FormikTextArea;
|
|
4940
|
+
exports.FormikTextField = FormikTextField;
|
|
4686
4941
|
exports.Horizontal = Horizontal;
|
|
4687
4942
|
exports.Inline = Inline;
|
|
4688
4943
|
exports.Left = Left;
|