indicator-ui 0.0.4 → 0.0.5

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.
Files changed (46) hide show
  1. package/README.md +66 -66
  2. package/dist/index.css +356 -0
  3. package/dist/index.css.map +1 -1
  4. package/dist/index.js +1550 -198
  5. package/dist/index.js.map +1 -1
  6. package/dist/scss/ui/FormBuilder/styles/CustomFields/CustomInputField/CustomInput.scss +126 -0
  7. package/dist/scss/ui/FormBuilder/styles/CustomFields/CustomInputField/CustomInputField.scss +33 -0
  8. package/dist/scss/ui/FormBuilder/styles/CustomFields/CustomInputField/CustomTextareaInput.scss +30 -0
  9. package/dist/scss/ui/FormBuilder/styles/CustomFields/CustomInputField/index.scss +2 -0
  10. package/dist/scss/ui/FormBuilder/styles/CustomFields/CustomInputWrapper/CustomInputWrapper.scss +55 -0
  11. package/dist/scss/ui/FormBuilder/styles/CustomFields/CustomInputWrapper/config.scss +5 -0
  12. package/dist/scss/ui/FormBuilder/styles/CustomFields/CustomInputWrapper/index.scss +1 -0
  13. package/dist/scss/ui/FormBuilder/styles/CustomFields/CustomOptionsInput/index.scss +48 -0
  14. package/dist/scss/ui/FormBuilder/styles/CustomFields/CustomSelectField/CustomSelectField.scss +54 -0
  15. package/dist/scss/ui/FormBuilder/styles/CustomFields/CustomSelectField/CustomSelectFieldOption.scss +50 -0
  16. package/dist/scss/ui/FormBuilder/styles/CustomFields/CustomSelectField/CustomSelectFieldViewField.scss +28 -0
  17. package/dist/scss/ui/FormBuilder/styles/CustomFields/CustomSelectField/index.scss +1 -0
  18. package/dist/scss/ui/FormBuilder/styles/CustomFields/CustomSwitchersField/CustomSwitchersField.scss +17 -0
  19. package/dist/scss/ui/FormBuilder/styles/CustomFields/CustomSwitchersField/components/index.scss +1 -0
  20. package/dist/scss/ui/FormBuilder/styles/CustomFields/CustomSwitchersField/components/option.scss +34 -0
  21. package/dist/scss/ui/FormBuilder/styles/CustomFields/CustomSwitchersField/index.scss +1 -0
  22. package/dist/scss/ui/FormBuilder/styles/CustomFields/index.scss +5 -0
  23. package/dist/scss/ui/InputFields/FlexField/styles/mixins/flexField.scss +77 -1
  24. package/dist/types/src/test/pages/FormBuilderPage.d.ts +1 -0
  25. package/dist/types/src/ui/Buttons/types/ButtonTypes.d.ts +8 -1
  26. package/dist/types/src/ui/Buttons/ui/Button.d.ts +1 -1
  27. package/dist/types/src/ui/FormBuilder/consts/index.d.ts +2 -0
  28. package/dist/types/src/ui/FormBuilder/index.d.ts +2 -0
  29. package/dist/types/src/ui/FormBuilder/lib/arrayFieldComponent.d.ts +5 -0
  30. package/dist/types/src/ui/FormBuilder/lib/blockComponent.d.ts +5 -0
  31. package/dist/types/src/ui/FormBuilder/lib/blockWrapperComponent.d.ts +5 -0
  32. package/dist/types/src/ui/FormBuilder/lib/customFieldWrapperComponent.d.ts +5 -0
  33. package/dist/types/src/ui/FormBuilder/lib/formBuilder.d.ts +4 -0
  34. package/dist/types/src/ui/FormBuilder/lib/formWrapperComponent.d.ts +5 -0
  35. package/dist/types/src/ui/FormBuilder/lib/index.d.ts +8 -0
  36. package/dist/types/src/ui/FormBuilder/lib/inputFieldComponent.d.ts +5 -0
  37. package/dist/types/src/ui/FormBuilder/lib/reactNodeComponent.d.ts +5 -0
  38. package/dist/types/src/ui/FormBuilder/schemes/index.d.ts +76 -0
  39. package/dist/types/src/ui/FormBuilder/styles/index.d.ts +1 -0
  40. package/dist/types/src/ui/FormBuilder/types/FormBuilderTypes.d.ts +56 -0
  41. package/dist/types/src/ui/FormBuilder/types/index.d.ts +2 -0
  42. package/dist/types/src/ui/FormBuilder/ui/FormBuilder.d.ts +5 -0
  43. package/dist/types/src/ui/FormBuilder/ui/index.d.ts +1 -0
  44. package/dist/types/src/ui/InputFields/FlexField/types/FlexFieldTypes.d.ts +11 -1
  45. package/dist/types/src/ui/index.d.ts +1 -0
  46. package/package.json +62 -87
@@ -0,0 +1,8 @@
1
+ export { default as inputFieldComponent } from './inputFieldComponent';
2
+ export { default as reactNodeComponent } from './reactNodeComponent';
3
+ export { default as formWrapperComponent } from './formWrapperComponent';
4
+ export { default as arrayFieldComponent } from './arrayFieldComponent';
5
+ export { default as blockComponent } from "./blockComponent";
6
+ export { default as customFieldWrapperComponent } from "./customFieldWrapperComponent";
7
+ export { default as blockWrapperComponent } from "./blockWrapperComponent";
8
+ export { default as formBuilder } from './formBuilder';
@@ -0,0 +1,5 @@
1
+ import { Key, ReactElement } from "react";
2
+ import { INPUT_FIELD_SCHEMA } from "../schemes";
3
+ import { AdditionPropsType } from "../types";
4
+ declare const inputFieldComponent: (schema: INPUT_FIELD_SCHEMA, key: Key, additionProps: AdditionPropsType) => ReactElement;
5
+ export default inputFieldComponent;
@@ -0,0 +1,5 @@
1
+ import { Key, ReactNode } from "react";
2
+ import { REACT_NODE_SCHEMA } from "../schemes";
3
+ import { AdditionPropsType } from '../types';
4
+ declare const reactNodeComponent: (schema: REACT_NODE_SCHEMA, key: Key, _additionProps: AdditionPropsType) => ReactNode;
5
+ export default reactNodeComponent;
@@ -0,0 +1,76 @@
1
+ import React, { ReactElement, ReactNode } from "react";
2
+ import { InputFieldPropsType, InputFieldWrapperPropsType } from "@/ui";
3
+ import { Overwrite } from "@/types";
4
+ export type BLOCK_SCHEMA = {
5
+ type: 'block';
6
+ props?: Overwrite<React.HTMLProps<HTMLDivElement>, {
7
+ children?: FORM_BUILDER_SCHEMA;
8
+ }>;
9
+ };
10
+ export type ADDITION_PROPS = {
11
+ type: 'addition_props';
12
+ props: {
13
+ className?: {
14
+ [key: string]: string;
15
+ };
16
+ };
17
+ };
18
+ export type CUSTOM_FIELD_WRAPPER_SCHEMA = {
19
+ type: 'custom_field_wrapper';
20
+ props: Overwrite<InputFieldWrapperPropsType, {
21
+ children?: FORM_BUILDER_SCHEMA;
22
+ }>;
23
+ };
24
+ export type InputFieldValidationFunObjectReturnType = {
25
+ status: boolean;
26
+ message: string;
27
+ };
28
+ export type InputFieldValidationFunReturnType = string | boolean | InputFieldValidationFunObjectReturnType;
29
+ export type InputFieldValidationFunType = (data: any) => InputFieldValidationFunReturnType;
30
+ export type InputFieldOnBlurValidationType = {
31
+ required?: boolean;
32
+ fun?: InputFieldValidationFunType;
33
+ };
34
+ export type INPUT_FIELD_SCHEMA = {
35
+ type: 'input_field';
36
+ props: Overwrite<InputFieldPropsType, {
37
+ keyWay?: string[];
38
+ ownerInputComponent?: ReactElement;
39
+ onBlurValidation?: InputFieldOnBlurValidationType;
40
+ onChangeValidation?: InputFieldOnBlurValidationType;
41
+ required?: boolean;
42
+ defaultValue?: any;
43
+ serializeValue?: (data: any) => any;
44
+ deserializeValue?: (data: any) => any;
45
+ }> & {
46
+ [key: string]: any;
47
+ };
48
+ };
49
+ export type REACT_NODE_SCHEMA = {
50
+ type: 'react_node_component';
51
+ react_node_comp?: ReactNode;
52
+ };
53
+ export type FORM_WRAPPER_SCHEMA = {
54
+ type: 'form_wrapper';
55
+ form_wrapper?: ReactElement;
56
+ props: Overwrite<React.HTMLProps<HTMLDivElement>, {
57
+ name?: string;
58
+ children?: FORM_BUILDER_SCHEMA;
59
+ }>;
60
+ };
61
+ export type ARRAY_FIELDS_SCHEMA = {
62
+ type: 'array_fields';
63
+ array_comp?: ReactElement;
64
+ props: Overwrite<React.HTMLProps<HTMLDivElement>, {
65
+ name: string;
66
+ children?: FORM_BUILDER_SCHEMA;
67
+ }>;
68
+ };
69
+ export type BLOCK_WRAPPER_SCHEMA<T = HTMLDivElement> = {
70
+ type: 'block_wrapper';
71
+ block_wrapper?: ReactElement;
72
+ props?: Overwrite<React.HTMLProps<T>, {
73
+ children?: FORM_BUILDER_SCHEMA;
74
+ }>;
75
+ };
76
+ export type FORM_BUILDER_SCHEMA = (FORM_WRAPPER_SCHEMA | REACT_NODE_SCHEMA | INPUT_FIELD_SCHEMA | BLOCK_SCHEMA | ADDITION_PROPS | CUSTOM_FIELD_WRAPPER_SCHEMA | ARRAY_FIELDS_SCHEMA | BLOCK_WRAPPER_SCHEMA)[];
@@ -0,0 +1 @@
1
+ export { default as FormBuilderStyle } from './FormBuilder.module.scss';
@@ -0,0 +1,56 @@
1
+ import { InputFieldClassNameType } from "@/ui";
2
+ import { DictDeepActionKeyWayType } from "@/types";
3
+ import { UseFormDataDeleteArrayItemType, UseFormDataGetValueType, UseFormDataSetValueType, UseIsErrorFieldAddErrorFieldType, UseIsErrorFieldGetErrorMessageType, UseIsErrorFieldIsErrorFieldType, UseIsErrorFieldIsErrorType, UseIsErrorFieldRemoveErrorFieldType } from "@/hooks";
4
+ import { FORM_BUILDER_SCHEMA } from "../schemes";
5
+ export type FormBuilderPropsType<T> = {
6
+ schema: FORM_BUILDER_SCHEMA;
7
+ formDataDefault?: T;
8
+ onChange?: (formData: T) => void;
9
+ onChangeIsError?: (isError: UseIsErrorFieldIsErrorType) => void;
10
+ onChangeValidateIsError?: (isError: UseIsErrorFieldIsErrorType) => void;
11
+ inputFieldClassName?: InputFieldClassNameType;
12
+ additionIsErrorFields?: UseIsErrorFieldIsErrorType;
13
+ formDataDefaultListener?: T;
14
+ sensitiveErrorSearch?: boolean;
15
+ inputFieldAdditionProps?: InputFieldAdditionPropsType;
16
+ };
17
+ export type GetStoreValueType = (key: string) => any;
18
+ export type AddStoreValueType = (value: any, key: string) => void;
19
+ export type RemoveStoreValueType = (key: string) => void;
20
+ export type ValidateFunction = {
21
+ validateFun: (data: any) => boolean;
22
+ keyWay: DictDeepActionKeyWayType;
23
+ errorMessage?: string;
24
+ };
25
+ export type CustomCompAdditionPropsType = {
26
+ deletearrayitem?: () => void;
27
+ getvalue?: () => any;
28
+ };
29
+ export type StandardCompAdditionPropsType = {
30
+ [key: string]: any;
31
+ };
32
+ export type InputFieldAdditionPropsType = {
33
+ [key: string]: any;
34
+ };
35
+ export type AdditionPropsType = {
36
+ keyWay: DictDeepActionKeyWayType;
37
+ arrayKeyWayItemName?: string;
38
+ getCurArrayIndex?: () => number;
39
+ incrementCurArrayIndex?: () => void;
40
+ getValue: UseFormDataGetValueType;
41
+ setValue: UseFormDataSetValueType;
42
+ deleteArrayItemHook: UseFormDataDeleteArrayItemType;
43
+ isErrorField: UseIsErrorFieldIsErrorFieldType;
44
+ getErrorMessage: UseIsErrorFieldGetErrorMessageType;
45
+ addErrorField: UseIsErrorFieldAddErrorFieldType;
46
+ removeErrorField: UseIsErrorFieldRemoveErrorFieldType;
47
+ addOnChangeErrorField: UseIsErrorFieldAddErrorFieldType;
48
+ removeOnChangeErrorField: UseIsErrorFieldRemoveErrorFieldType;
49
+ inputFieldClassName?: InputFieldClassNameType;
50
+ standardCompAdditionProps?: StandardCompAdditionPropsType;
51
+ customCompAdditionProps?: CustomCompAdditionPropsType;
52
+ inputFieldAdditionProps?: InputFieldAdditionPropsType;
53
+ getPrivateRefStoreValue: GetStoreValueType;
54
+ addPrivateRefStoreValue: AddStoreValueType;
55
+ removePrivateRefStoreValue: RemoveStoreValueType;
56
+ };
@@ -0,0 +1,2 @@
1
+ export * from './FormBuilderTypes';
2
+ export * from "../schemes";
@@ -0,0 +1,5 @@
1
+ import React from "react";
2
+ import { FormBuilderPropsType } from "../types";
3
+ export declare function FormBuilder<T extends {
4
+ [key: string]: any;
5
+ }>({ schema, formDataDefault, onChange, onChangeIsError, inputFieldClassName, additionIsErrorFields, onChangeValidateIsError, formDataDefaultListener, inputFieldAdditionProps, sensitiveErrorSearch, }: FormBuilderPropsType<T>): React.JSX.Element;
@@ -0,0 +1 @@
1
+ export * from './FormBuilder';
@@ -6,7 +6,15 @@ export type FlexFieldClassNameType = {
6
6
  disabled?: string;
7
7
  focus?: string;
8
8
  pointer?: string;
9
- dropdownIcon?: string;
9
+ icon?: string;
10
+ textSupport?: string;
11
+ userPic?: string;
12
+ help?: string;
13
+ dropdown?: string;
14
+ dropdownReverse?: string;
15
+ button?: string;
16
+ gray?: string;
17
+ red?: string;
10
18
  };
11
19
  export type FlexFieldPropsType = {
12
20
  value?: any;
@@ -28,5 +36,7 @@ export type FlexFieldPropsType = {
28
36
  dropdown?: boolean | ReactNode;
29
37
  button?: boolean | ReactNode;
30
38
  dropdownState?: boolean;
39
+ buttonState?: 'gray' | 'red';
40
+ onButtonClick?: () => void;
31
41
  className?: FlexFieldClassNameType;
32
42
  };
@@ -2,3 +2,4 @@ export * from './Buttons';
2
2
  export * from './MicroButton';
3
3
  export * from './DatePicker';
4
4
  export * from './InputFields';
5
+ export * from './FormBuilder';
package/package.json CHANGED
@@ -1,87 +1,62 @@
1
- {
2
- "name": "indicator-ui",
3
- "version": "0.0.04",
4
- "main": "dist/index.js",
5
- "types": "dist/types/src/index.d.ts",
6
- "style": "dist/index.css",
7
- "sass": "dist/scss/index.scss",
8
- "scripts": {
9
- "build": "rimraf dist && rollup -c --bundleConfigAsCjs",
10
- "watch": "rollup -c -w --bundleConfigAsCjs",
11
- "dev": "rollup -c rollup.app.config.js --watch --bundleConfigAsCjs",
12
-
13
-
14
-
15
- "dev:dev": "webpack serve --mode development",
16
- "dev:build": "webpack --mode=production && tsc --project tsconfig.json --outDir webpack",
17
- "lib:build": "webpack --config webpack.lib.config.js"
18
- },
19
- "author": "indicator",
20
- "license": "ISC",
21
- "description": "",
22
- "devDependencies": {
23
- "@babel/core": "^7.26.7",
24
- "@babel/preset-env": "^7.26.7",
25
- "@babel/preset-react": "^7.26.3",
26
- "@babel/preset-typescript": "^7.26.0",
27
- "@rollup/plugin-alias": "^5.1.1",
28
- "@rollup/plugin-babel": "^6.0.4",
29
- "@rollup/plugin-commonjs": "^28.0.2",
30
- "@rollup/plugin-inject": "^5.0.5",
31
- "@rollup/plugin-node-resolve": "^16.0.0",
32
- "@rollup/plugin-replace": "^6.0.2",
33
- "@rollup/plugin-terser": "^0.4.4",
34
- "@rollup/plugin-typescript": "^12.1.2",
35
- "@rollup/plugin-url": "^8.0.2",
36
- "@svgr/rollup": "^8.1.0",
37
- "@svgr/webpack": "^8.1.0",
38
- "@types/jest": "^29.5.14",
39
- "@types/node": "^22.12.0",
40
- "@types/react": "^19.0.8",
41
- "@types/react-dom": "^19.0.3",
42
- "babel-loader": "^9.2.1",
43
- "clsx": "^2.1.1",
44
- "copy-webpack-plugin": "^12.0.2",
45
- "css-loader": "^6.8.1",
46
- "css-modules-typescript-loader": "^4.0.1",
47
- "date-fns": "^4.1.0",
48
- "file-loader": "^6.2.0",
49
- "html-loader": "^5.1.0",
50
- "html-webpack-plugin": "^5.6.3",
51
- "mini-css-extract-plugin": "^2.9.2",
52
- "postcss": "^8.5.1",
53
- "postcss-import": "^16.1.0",
54
- "postcss-loader": "^8.1.1",
55
- "process": "^0.11.10",
56
- "react-imask": "^7.6.1",
57
- "react-router-dom": "^7.1.5",
58
- "resolve-url-loader": "^5.0.0",
59
- "rollup": "^4.32.1",
60
- "rollup-plugin-copy": "^3.5.0",
61
- "rollup-plugin-delete": "^2.1.0",
62
- "rollup-plugin-dts": "^6.1.1",
63
- "rollup-plugin-livereload": "^2.0.5",
64
- "rollup-plugin-peer-deps-external": "^2.2.4",
65
- "rollup-plugin-postcss": "^4.0.2",
66
- "rollup-plugin-scss": "^4.0.1",
67
- "rollup-plugin-serve": "^1.1.1",
68
- "sass": "^1.66.1",
69
- "sass-loader": "^16.0.4",
70
- "style-loader": "^4.0.0",
71
- "ts-loader": "^9.5.2",
72
- "tsconfig-paths-webpack-plugin": "^4.2.0",
73
- "tslib": "^2.8.1",
74
- "typed-css-modules-webpack-plugin": "^0.2.0",
75
- "typescript": "^5.7.3",
76
- "webpack": "^5.97.1",
77
- "webpack-cli": "^6.0.1",
78
- "webpack-dev-server": "^5.2.0"
79
- },
80
- "peerDependencies": {
81
- "react": "^18.3.1",
82
- "react-dom": "^18.3.1"
83
- },
84
- "files": [
85
- "dist"
86
- ]
87
- }
1
+ {
2
+ "name": "indicator-ui",
3
+ "version": "0.0.05",
4
+ "main": "dist/index.js",
5
+ "types": "dist/types/src/index.d.ts",
6
+ "style": "dist/index.css",
7
+ "sass": "dist/scss/index.scss",
8
+ "scripts": {
9
+ "dev:dev": "webpack serve --mode development",
10
+ "dev:build": "webpack --mode=production && tsc --project tsconfig.json --outDir webpack",
11
+ "lib:build": "webpack --config webpack.lib.config.js"
12
+ },
13
+ "author": "indicator",
14
+ "license": "ISC",
15
+ "description": "",
16
+ "devDependencies": {
17
+ "@babel/core": "^7.26.7",
18
+ "@babel/preset-env": "^7.26.7",
19
+ "@babel/preset-react": "^7.26.3",
20
+ "@babel/preset-typescript": "^7.26.0",
21
+ "@svgr/webpack": "^8.1.0",
22
+ "@types/jest": "^29.5.14",
23
+ "@types/node": "^22.12.0",
24
+ "@types/react": "^19.0.8",
25
+ "@types/react-dom": "^19.0.3",
26
+ "babel-loader": "^9.2.1",
27
+ "clsx": "^2.1.1",
28
+ "copy-webpack-plugin": "^12.0.2",
29
+ "css-loader": "^6.8.1",
30
+ "css-modules-typescript-loader": "^4.0.1",
31
+ "date-fns": "^4.1.0",
32
+ "file-loader": "^6.2.0",
33
+ "html-loader": "^5.1.0",
34
+ "html-webpack-plugin": "^5.6.3",
35
+ "mini-css-extract-plugin": "^2.9.2",
36
+ "postcss": "^8.5.1",
37
+ "postcss-import": "^16.1.0",
38
+ "postcss-loader": "^8.1.1",
39
+ "process": "^0.11.10",
40
+ "react-imask": "^7.6.1",
41
+ "react-router-dom": "^7.1.5",
42
+ "resolve-url-loader": "^5.0.0",
43
+ "sass": "^1.66.1",
44
+ "sass-loader": "^16.0.4",
45
+ "style-loader": "^4.0.0",
46
+ "ts-loader": "^9.5.2",
47
+ "tsconfig-paths-webpack-plugin": "^4.2.0",
48
+ "tslib": "^2.8.1",
49
+ "typed-css-modules-webpack-plugin": "^0.2.0",
50
+ "typescript": "^5.7.3",
51
+ "webpack": "^5.97.1",
52
+ "webpack-cli": "^6.0.1",
53
+ "webpack-dev-server": "^5.2.0"
54
+ },
55
+ "peerDependencies": {
56
+ "react": "^18.3.1",
57
+ "react-dom": "^18.3.1"
58
+ },
59
+ "files": [
60
+ "dist"
61
+ ]
62
+ }