@visiion/forms-library 1.0.0 → 1.1.0
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/Common/NavigationButton.d.ts +2 -2
- package/dist/components/Common/RadioOption.d.ts +12 -0
- package/dist/components/Common/TextInputField.d.ts +26 -0
- package/dist/components/Common/index.d.ts +3 -1
- package/dist/components/Forms/GenericForm.d.ts +5 -2
- package/dist/components/Inputs/AddressInput.d.ts +20 -0
- package/dist/components/Inputs/Alert.d.ts +4 -4
- package/dist/components/Inputs/CheckboxInput.d.ts +2 -2
- package/dist/components/Inputs/DatePicker.d.ts +9 -0
- package/dist/components/Inputs/DynamicInput.d.ts +2 -2
- package/dist/components/Inputs/GoogleMaps.d.ts +7 -0
- package/dist/components/Inputs/InputWrapper.d.ts +7 -1
- package/dist/components/Inputs/RadioInput.d.ts +10 -0
- package/dist/components/Inputs/RutInput.d.ts +2 -2
- package/dist/components/Inputs/SelectInput.d.ts +2 -2
- package/dist/components/Inputs/StatusScreen.d.ts +16 -0
- package/dist/components/Inputs/SubtitleInput.d.ts +8 -0
- package/dist/components/Inputs/SwornDeclaration.d.ts +8 -0
- package/dist/components/Inputs/TextInput.d.ts +2 -2
- package/dist/components/Inputs/TextareaInput.d.ts +2 -2
- package/dist/components/Inputs/index.d.ts +14 -8
- package/dist/components/Steppers/Simple.d.ts +13 -0
- package/dist/components/Steppers/Stepper.d.ts +13 -0
- package/dist/components/Steppers/index.d.ts +1 -0
- package/dist/config/theme.d.ts +2 -0
- package/dist/contexts/MiDtContext.d.ts +21 -0
- package/dist/index.d.ts +12 -6
- package/dist/index.esm.js +24400 -328
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +24428 -325
- package/dist/index.js.map +1 -1
- package/dist/utils/Common.d.ts +18 -0
- package/package.json +2 -5
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
interface RadioOptionProps {
|
|
3
|
+
id: string;
|
|
4
|
+
name: string;
|
|
5
|
+
value: string;
|
|
6
|
+
checked: boolean;
|
|
7
|
+
onChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
8
|
+
label: string;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
}
|
|
11
|
+
declare const RadioOption: React.FC<RadioOptionProps>;
|
|
12
|
+
export default RadioOption;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { TextInputProps } from "flowbite-react";
|
|
3
|
+
import { IconType } from "react-icons";
|
|
4
|
+
interface TextInputFieldProps extends TextInputProps {
|
|
5
|
+
id?: string;
|
|
6
|
+
label?: string;
|
|
7
|
+
type: string;
|
|
8
|
+
placeholder?: string;
|
|
9
|
+
value?: string | number;
|
|
10
|
+
onChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
required?: boolean;
|
|
13
|
+
name?: string;
|
|
14
|
+
icon?: IconType;
|
|
15
|
+
addon?: string;
|
|
16
|
+
rightIcon?: IconType;
|
|
17
|
+
containerClassName?: string;
|
|
18
|
+
className?: string;
|
|
19
|
+
color?: string;
|
|
20
|
+
helperText?: React.ReactNode;
|
|
21
|
+
maxLength?: number;
|
|
22
|
+
counterCharacters?: boolean;
|
|
23
|
+
inputClassName?: string;
|
|
24
|
+
}
|
|
25
|
+
declare const TextInputField: React.ForwardRefExoticComponent<TextInputFieldProps & React.RefAttributes<HTMLInputElement>>;
|
|
26
|
+
export default TextInputField;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import React from
|
|
2
|
-
import { IFormConfig } from
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { IFormConfig } from "../../types";
|
|
3
|
+
import { type CustomFlowbiteTheme } from "flowbite-react";
|
|
3
4
|
interface IGenericFormProps {
|
|
4
5
|
config: IFormConfig;
|
|
5
6
|
stepperData?: any;
|
|
@@ -7,6 +8,8 @@ interface IGenericFormProps {
|
|
|
7
8
|
changeActiveStep?: (step: number) => void;
|
|
8
9
|
loading?: boolean;
|
|
9
10
|
className?: string;
|
|
11
|
+
stepperDataKey?: string;
|
|
12
|
+
flowbiteTheme?: CustomFlowbiteTheme;
|
|
10
13
|
}
|
|
11
14
|
export declare const GenericForm: React.FC<IGenericFormProps>;
|
|
12
15
|
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { IFormField } from "../../types";
|
|
3
|
+
interface AddressInputProps {
|
|
4
|
+
field: IFormField;
|
|
5
|
+
value: any;
|
|
6
|
+
onChange: (inputData: {
|
|
7
|
+
target: {
|
|
8
|
+
name: string;
|
|
9
|
+
value: any;
|
|
10
|
+
id?: string;
|
|
11
|
+
type?: string;
|
|
12
|
+
};
|
|
13
|
+
}) => void;
|
|
14
|
+
error?: string;
|
|
15
|
+
onSearch?: (value: string | any) => void;
|
|
16
|
+
showMap?: boolean;
|
|
17
|
+
mapHeight?: string;
|
|
18
|
+
}
|
|
19
|
+
declare const AddressInput: React.FC<AddressInputProps>;
|
|
20
|
+
export default AddressInput;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import React from
|
|
2
|
-
type AlertType =
|
|
1
|
+
import React from "react";
|
|
2
|
+
type AlertType = "info" | "warning" | "error";
|
|
3
3
|
interface CustomAlertProps {
|
|
4
|
-
type?: AlertType |
|
|
4
|
+
type?: AlertType | "warning" | "info" | "error" | string;
|
|
5
5
|
text: string | null;
|
|
6
6
|
icon?: React.FC<any> | string;
|
|
7
7
|
className?: string;
|
|
8
8
|
iconClassName?: string;
|
|
9
9
|
textClassName?: string;
|
|
10
10
|
}
|
|
11
|
-
declare const Alert:
|
|
11
|
+
export declare const Alert: ({ type, text, icon, className, iconClassName, textClassName, }: CustomAlertProps) => import("react/jsx-runtime").JSX.Element;
|
|
12
12
|
export default Alert;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { IFormField } from "../../types";
|
|
3
|
+
interface DatePickerProps extends IFormField {
|
|
4
|
+
value: string;
|
|
5
|
+
onChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
6
|
+
error?: string;
|
|
7
|
+
}
|
|
8
|
+
declare const DatePicker: React.FC<DatePickerProps>;
|
|
9
|
+
export default DatePicker;
|
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
|
|
2
|
+
interface InputWrapperProps {
|
|
3
|
+
id: string;
|
|
4
|
+
label: string;
|
|
5
|
+
error?: string;
|
|
6
|
+
tooltip?: string;
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
}
|
|
3
9
|
declare const InputWrapper: React.FC<InputWrapperProps>;
|
|
4
10
|
export default InputWrapper;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { IFormField } from "../../types";
|
|
3
|
+
interface RadioInputProps {
|
|
4
|
+
field: IFormField;
|
|
5
|
+
value: string | number;
|
|
6
|
+
onChange: (e: React.ChangeEvent<HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement>) => void;
|
|
7
|
+
error?: string;
|
|
8
|
+
}
|
|
9
|
+
declare const RadioInput: React.FC<RadioInputProps>;
|
|
10
|
+
export default RadioInput;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
interface StatusScreenProps {
|
|
3
|
+
title?: string;
|
|
4
|
+
message?: string;
|
|
5
|
+
type?: "success" | "error" | "warning" | "info";
|
|
6
|
+
leftButton?: {
|
|
7
|
+
label: string;
|
|
8
|
+
onClick: () => void;
|
|
9
|
+
};
|
|
10
|
+
rightButton?: {
|
|
11
|
+
label: string;
|
|
12
|
+
onClick: () => void;
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
declare const StatusScreen: React.FC<StatusScreenProps>;
|
|
16
|
+
export default StatusScreen;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { IFormField } from "../../types";
|
|
3
|
+
interface SwornDeclarationProps extends IFormField {
|
|
4
|
+
onChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
5
|
+
error?: string;
|
|
6
|
+
}
|
|
7
|
+
declare const SwornDeclaration: React.FC<SwornDeclarationProps>;
|
|
8
|
+
export default SwornDeclaration;
|
|
@@ -1,8 +1,14 @@
|
|
|
1
|
-
export { default as TextInput } from
|
|
2
|
-
export { default as SelectInput } from
|
|
3
|
-
export { default as
|
|
4
|
-
export { default as TextareaInput } from
|
|
5
|
-
export { default as
|
|
6
|
-
export { default as
|
|
7
|
-
export { default as
|
|
8
|
-
export { default as
|
|
1
|
+
export { default as TextInput } from "./TextInput";
|
|
2
|
+
export { default as SelectInput } from "./SelectInput";
|
|
3
|
+
export { default as RadioInput } from "./RadioInput";
|
|
4
|
+
export { default as TextareaInput } from "./TextareaInput";
|
|
5
|
+
export { default as CheckboxInput } from "./CheckboxInput";
|
|
6
|
+
export { default as RutInput } from "./RutInput";
|
|
7
|
+
export { default as AddressInput } from "./AddressInput";
|
|
8
|
+
export { default as DynamicInput } from "./DynamicInput";
|
|
9
|
+
export { default as StatusScreen } from "./StatusScreen";
|
|
10
|
+
export { default as SwornDeclaration } from "./SwornDeclaration";
|
|
11
|
+
export { default as DatePicker } from "./DatePicker";
|
|
12
|
+
export { default as SubtitleInput } from "./SubtitleInput";
|
|
13
|
+
export { default as Alert } from "./Alert";
|
|
14
|
+
export { default as InputWrapper } from "./InputWrapper";
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface Step {
|
|
3
|
+
label: string;
|
|
4
|
+
value: number;
|
|
5
|
+
}
|
|
6
|
+
interface FormStepperProps {
|
|
7
|
+
activeStep: number;
|
|
8
|
+
steps: Step[];
|
|
9
|
+
completedSteps: number[];
|
|
10
|
+
changeActiveStep: (step: number) => void;
|
|
11
|
+
}
|
|
12
|
+
declare const FormStepper: React.FC<FormStepperProps>;
|
|
13
|
+
export default FormStepper;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface Step {
|
|
3
|
+
label: string;
|
|
4
|
+
value: number;
|
|
5
|
+
}
|
|
6
|
+
interface FormStepperProps {
|
|
7
|
+
activeStep: number;
|
|
8
|
+
steps: Step[];
|
|
9
|
+
completedSteps: number[];
|
|
10
|
+
changeActiveStep: (step: number) => void;
|
|
11
|
+
}
|
|
12
|
+
declare const FormStepper: React.FC<FormStepperProps>;
|
|
13
|
+
export default FormStepper;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./Stepper";
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Region, Comuna } from "../utils/Common";
|
|
3
|
+
interface MiDtData {
|
|
4
|
+
allData: {
|
|
5
|
+
metadata: {
|
|
6
|
+
Regiones: Region[];
|
|
7
|
+
Comunas: Comuna[];
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
interface MiDtContextType {
|
|
12
|
+
miDtData: MiDtData;
|
|
13
|
+
}
|
|
14
|
+
declare const MiDtContext: React.Context<MiDtContextType>;
|
|
15
|
+
export declare const MiDtProvider: React.FC<{
|
|
16
|
+
children: React.ReactNode;
|
|
17
|
+
regiones?: Region[];
|
|
18
|
+
comunas?: Comuna[];
|
|
19
|
+
}>;
|
|
20
|
+
export declare const useMiDt: () => MiDtContextType;
|
|
21
|
+
export default MiDtContext;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
|
-
export { GenericForm } from
|
|
2
|
-
export { TextInput, SelectInput, CheckboxInput, TextareaInput, RutInput, Alert, DynamicInput, InputWrapper, } from
|
|
3
|
-
export { NavigationButton } from
|
|
4
|
-
export
|
|
5
|
-
export {
|
|
6
|
-
export {
|
|
1
|
+
export { GenericForm } from "./components/Forms";
|
|
2
|
+
export { TextInput, SelectInput, RadioInput, CheckboxInput, TextareaInput, RutInput, AddressInput, Alert, DynamicInput, InputWrapper, StatusScreen, SwornDeclaration, DatePicker, SubtitleInput, } from "./components/Inputs";
|
|
3
|
+
export { NavigationButton, TextInputField, RadioOption, } from "./components/Common";
|
|
4
|
+
export { GoogleMaps } from "./components/Inputs/GoogleMaps";
|
|
5
|
+
export { MiDtProvider, useMiDt } from "./contexts/MiDtContext";
|
|
6
|
+
export { Flowbite } from "flowbite-react";
|
|
7
|
+
export type { CustomFlowbiteTheme } from "flowbite-react";
|
|
8
|
+
export type { IFormField, IFormConfig, IStepProps, ResponseOnSearch, NavigationButtonProps, DynamicInputProps, InputWrapperProps, StepperContextType, ValidationRule, CommonValidations, } from "./types";
|
|
9
|
+
export { createValidationSchema, commonValidations, } from "./utils/validationSchemas";
|
|
10
|
+
export { clean as cleanRut, formatRut, validate as validateRut, maskRut, validateOnlyNumbersAndLetters, } from "./utils/rut";
|
|
11
|
+
export { default as Common } from "./utils/Common";
|
|
12
|
+
export type { Region, Comuna } from "./utils/Common";
|