@bodynarf/react.components 1.4.19 → 1.4.20

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 (235) hide show
  1. package/components/form/component/index.d.ts +16 -0
  2. package/components/form/component/index.d.ts.map +1 -0
  3. package/components/form/component/index.js +13 -0
  4. package/components/form/component/styles.scss +33 -0
  5. package/components/form/components/cell/index.d.ts +13 -0
  6. package/components/form/components/cell/index.d.ts.map +1 -0
  7. package/components/form/components/cell/index.js +8 -0
  8. package/components/form/components/container/index.d.ts +24 -0
  9. package/components/form/components/container/index.d.ts.map +1 -0
  10. package/components/form/components/container/index.js +26 -0
  11. package/components/form/components/form/index.d.ts +11 -0
  12. package/components/form/components/form/index.d.ts.map +1 -0
  13. package/components/form/components/form/index.js +11 -0
  14. package/components/form/components/inputs/checkbox/index.d.ts +6 -0
  15. package/components/form/components/inputs/checkbox/index.d.ts.map +1 -0
  16. package/components/form/components/inputs/checkbox/index.js +19 -0
  17. package/components/form/components/inputs/date/index.d.ts +7 -0
  18. package/components/form/components/inputs/date/index.d.ts.map +1 -0
  19. package/components/form/components/inputs/date/index.js +19 -0
  20. package/components/form/components/inputs/lookup/index.d.ts +6 -0
  21. package/components/form/components/inputs/lookup/index.d.ts.map +1 -0
  22. package/components/form/components/inputs/lookup/index.js +19 -0
  23. package/components/form/components/inputs/multiline/index.d.ts +6 -0
  24. package/components/form/components/inputs/multiline/index.d.ts.map +1 -0
  25. package/components/form/components/inputs/multiline/index.js +19 -0
  26. package/components/form/components/inputs/number/index.d.ts +6 -0
  27. package/components/form/components/inputs/number/index.d.ts.map +1 -0
  28. package/components/form/components/inputs/number/index.js +19 -0
  29. package/components/form/components/inputs/password/index.d.ts +6 -0
  30. package/components/form/components/inputs/password/index.d.ts.map +1 -0
  31. package/components/form/components/inputs/password/index.js +19 -0
  32. package/components/form/components/inputs/text/index.d.ts +6 -0
  33. package/components/form/components/inputs/text/index.d.ts.map +1 -0
  34. package/components/form/components/inputs/text/index.js +23 -0
  35. package/components/form/components/item/index.d.ts +4 -0
  36. package/components/form/components/item/index.d.ts.map +1 -0
  37. package/components/form/components/item/index.js +28 -0
  38. package/components/form/components/row/index.d.ts +10 -0
  39. package/components/form/components/row/index.d.ts.map +1 -0
  40. package/components/form/components/row/index.js +27 -0
  41. package/components/form/index.d.ts +3 -0
  42. package/components/form/index.d.ts.map +1 -0
  43. package/components/form/index.js +2 -0
  44. package/components/form/redux/actionCreators/index.d.ts +7 -0
  45. package/components/form/redux/actionCreators/index.d.ts.map +1 -0
  46. package/components/form/redux/actionCreators/index.js +6 -0
  47. package/components/form/redux/actionCreators/initForm.d.ts +9 -0
  48. package/components/form/redux/actionCreators/initForm.d.ts.map +1 -0
  49. package/components/form/redux/actionCreators/initForm.js +12 -0
  50. package/components/form/redux/actionCreators/setFieldValue.d.ts +9 -0
  51. package/components/form/redux/actionCreators/setFieldValue.d.ts.map +1 -0
  52. package/components/form/redux/actionCreators/setFieldValue.js +18 -0
  53. package/components/form/redux/actionCreators/setFormState.d.ts +8 -0
  54. package/components/form/redux/actionCreators/setFormState.d.ts.map +1 -0
  55. package/components/form/redux/actionCreators/setFormState.js +14 -0
  56. package/components/form/redux/actionCreators/setValidationResult.d.ts +9 -0
  57. package/components/form/redux/actionCreators/setValidationResult.d.ts.map +1 -0
  58. package/components/form/redux/actionCreators/setValidationResult.js +14 -0
  59. package/components/form/redux/actionCreators/submitForm.d.ts +7 -0
  60. package/components/form/redux/actionCreators/submitForm.d.ts.map +1 -0
  61. package/components/form/redux/actionCreators/submitForm.js +10 -0
  62. package/components/form/redux/actionCreators/validateField.d.ts +8 -0
  63. package/components/form/redux/actionCreators/validateField.d.ts.map +1 -0
  64. package/components/form/redux/actionCreators/validateField.js +12 -0
  65. package/components/form/redux/actionTypes.d.ts +13 -0
  66. package/components/form/redux/actionTypes.d.ts.map +1 -0
  67. package/components/form/redux/actionTypes.js +12 -0
  68. package/components/form/redux/actions/index.d.ts +2 -0
  69. package/components/form/redux/actions/index.d.ts.map +1 -0
  70. package/components/form/redux/actions/index.js +1 -0
  71. package/components/form/redux/actions/submitForm.d.ts +9 -0
  72. package/components/form/redux/actions/submitForm.d.ts.map +1 -0
  73. package/components/form/redux/actions/submitForm.js +16 -0
  74. package/components/form/redux/index.d.ts +8 -0
  75. package/components/form/redux/index.d.ts.map +1 -0
  76. package/components/form/redux/index.js +7 -0
  77. package/components/form/redux/reducer.d.ts +4 -0
  78. package/components/form/redux/reducer.d.ts.map +1 -0
  79. package/components/form/redux/reducer.js +103 -0
  80. package/components/form/redux/store.d.ts +5 -0
  81. package/components/form/redux/store.d.ts.map +1 -0
  82. package/components/form/redux/store.js +4 -0
  83. package/components/form/redux/types/base/types.d.ts +9 -0
  84. package/components/form/redux/types/base/types.d.ts.map +1 -0
  85. package/components/form/redux/types/base/types.js +2 -0
  86. package/components/form/redux/types/fieldValue.d.ts +10 -0
  87. package/components/form/redux/types/fieldValue.d.ts.map +1 -0
  88. package/components/form/redux/types/fieldValue.js +1 -0
  89. package/components/form/redux/types/index.d.ts +4 -0
  90. package/components/form/redux/types/index.d.ts.map +1 -0
  91. package/components/form/redux/types/index.js +3 -0
  92. package/components/form/redux/types/state.d.ts +37 -0
  93. package/components/form/redux/types/state.d.ts.map +1 -0
  94. package/components/form/redux/types/state.js +12 -0
  95. package/components/form/redux/utils/index.d.ts +3 -0
  96. package/components/form/redux/utils/index.d.ts.map +1 -0
  97. package/components/form/redux/utils/index.js +2 -0
  98. package/components/form/redux/utils/mapper.d.ts +16 -0
  99. package/components/form/redux/utils/mapper.d.ts.map +1 -0
  100. package/components/form/redux/utils/mapper.js +107 -0
  101. package/components/form/redux/utils/validate.d.ts +9 -0
  102. package/components/form/redux/utils/validate.d.ts.map +1 -0
  103. package/components/form/redux/utils/validate.js +33 -0
  104. package/components/form/types/index.d.ts +3 -0
  105. package/components/form/types/index.d.ts.map +1 -0
  106. package/components/form/types/index.js +2 -0
  107. package/components/form/types/model/extensions/extendedField.d.ts +7 -0
  108. package/components/form/types/model/extensions/extendedField.d.ts.map +1 -0
  109. package/components/form/types/model/extensions/extendedField.js +1 -0
  110. package/components/form/types/model/extensions/extendedFormItem.d.ts +7 -0
  111. package/components/form/types/model/extensions/extendedFormItem.d.ts.map +1 -0
  112. package/components/form/types/model/extensions/extendedFormItem.js +2 -0
  113. package/components/form/types/model/extensions/index.d.ts +4 -0
  114. package/components/form/types/model/extensions/index.d.ts.map +1 -0
  115. package/components/form/types/model/extensions/index.js +3 -0
  116. package/components/form/types/model/extensions/items/checkbox.d.ts +17 -0
  117. package/components/form/types/model/extensions/items/checkbox.d.ts.map +1 -0
  118. package/components/form/types/model/extensions/items/checkbox.js +14 -0
  119. package/components/form/types/model/extensions/items/getExtension.d.ts +9 -0
  120. package/components/form/types/model/extensions/items/getExtension.d.ts.map +1 -0
  121. package/components/form/types/model/extensions/items/getExtension.js +18 -0
  122. package/components/form/types/model/extensions/items/index.d.ts +5 -0
  123. package/components/form/types/model/extensions/items/index.d.ts.map +1 -0
  124. package/components/form/types/model/extensions/items/index.js +4 -0
  125. package/components/form/types/model/extensions/items/lookup.d.ts +20 -0
  126. package/components/form/types/model/extensions/items/lookup.d.ts.map +1 -0
  127. package/components/form/types/model/extensions/items/lookup.js +15 -0
  128. package/components/form/types/model/extensions/items/multiline.d.ts +17 -0
  129. package/components/form/types/model/extensions/items/multiline.d.ts.map +1 -0
  130. package/components/form/types/model/extensions/items/multiline.js +14 -0
  131. package/components/form/types/model/form.config.d.ts +16 -0
  132. package/components/form/types/model/form.config.d.ts.map +1 -0
  133. package/components/form/types/model/form.config.js +2 -0
  134. package/components/form/types/model/formItem.d.ts +12 -0
  135. package/components/form/types/model/formItem.d.ts.map +1 -0
  136. package/components/form/types/model/formItem.js +1 -0
  137. package/components/form/types/model/formItem.modelConfig.d.ts +20 -0
  138. package/components/form/types/model/formItem.modelConfig.d.ts.map +1 -0
  139. package/components/form/types/model/formItem.modelConfig.js +1 -0
  140. package/components/form/types/model/formItem.viewConfig.d.ts +15 -0
  141. package/components/form/types/model/formItem.viewConfig.d.ts.map +1 -0
  142. package/components/form/types/model/formItem.viewConfig.js +1 -0
  143. package/components/form/types/model/formItemValidationState.d.ts +10 -0
  144. package/components/form/types/model/formItemValidationState.d.ts.map +1 -0
  145. package/components/form/types/model/formItemValidationState.js +11 -0
  146. package/components/form/types/model/in/baseField.d.ts +21 -0
  147. package/components/form/types/model/in/baseField.d.ts.map +1 -0
  148. package/components/form/types/model/in/baseField.js +1 -0
  149. package/components/form/types/model/in/captionConfig.d.ts +14 -0
  150. package/components/form/types/model/in/captionConfig.d.ts.map +1 -0
  151. package/components/form/types/model/in/captionConfig.js +1 -0
  152. package/components/form/types/model/in/fieldType.d.ts +3 -0
  153. package/components/form/types/model/in/fieldType.d.ts.map +1 -0
  154. package/components/form/types/model/in/fieldType.js +1 -0
  155. package/components/form/types/model/in/fieldValidator.d.ts +3 -0
  156. package/components/form/types/model/in/fieldValidator.d.ts.map +1 -0
  157. package/components/form/types/model/in/fieldValidator.js +1 -0
  158. package/components/form/types/model/in/index.d.ts +6 -0
  159. package/components/form/types/model/in/index.d.ts.map +1 -0
  160. package/components/form/types/model/in/index.js +5 -0
  161. package/components/form/types/model/in/viewConfig.d.ts +24 -0
  162. package/components/form/types/model/in/viewConfig.d.ts.map +1 -0
  163. package/components/form/types/model/in/viewConfig.js +1 -0
  164. package/components/form/types/model/index.d.ts +9 -0
  165. package/components/form/types/model/index.d.ts.map +1 -0
  166. package/components/form/types/model/index.js +8 -0
  167. package/components/form/types/model/validationResult.d.ts +11 -0
  168. package/components/form/types/model/validationResult.d.ts.map +1 -0
  169. package/components/form/types/model/validationResult.js +2 -0
  170. package/components/form/types/view/gridCell.d.ts +15 -0
  171. package/components/form/types/view/gridCell.d.ts.map +1 -0
  172. package/components/form/types/view/gridCell.js +1 -0
  173. package/components/form/types/view/index.d.ts +2 -0
  174. package/components/form/types/view/index.d.ts.map +1 -0
  175. package/components/form/types/view/index.js +1 -0
  176. package/components/form/utils/component.d.ts +9 -0
  177. package/components/form/utils/component.d.ts.map +1 -0
  178. package/components/form/utils/component.js +16 -0
  179. package/components/form/utils/grid.d.ts +17 -0
  180. package/components/form/utils/grid.d.ts.map +1 -0
  181. package/components/form/utils/grid.js +75 -0
  182. package/components/form/utils/index.d.ts +4 -0
  183. package/components/form/utils/index.d.ts.map +1 -0
  184. package/components/form/utils/index.js +3 -0
  185. package/components/form/utils/validators/index.d.ts +4 -0
  186. package/components/form/utils/validators/index.d.ts.map +1 -0
  187. package/components/form/utils/validators/index.js +3 -0
  188. package/components/form/utils/validators/number/greaterThanZero.d.ts +7 -0
  189. package/components/form/utils/validators/number/greaterThanZero.d.ts.map +1 -0
  190. package/components/form/utils/validators/number/greaterThanZero.js +7 -0
  191. package/components/form/utils/validators/number/index.d.ts +4 -0
  192. package/components/form/utils/validators/number/index.d.ts.map +1 -0
  193. package/components/form/utils/validators/number/index.js +3 -0
  194. package/components/form/utils/validators/number/lessThanZero.d.ts +7 -0
  195. package/components/form/utils/validators/number/lessThanZero.d.ts.map +1 -0
  196. package/components/form/utils/validators/number/lessThanZero.js +7 -0
  197. package/components/form/utils/validators/number/notZero.d.ts +7 -0
  198. package/components/form/utils/validators/number/notZero.d.ts.map +1 -0
  199. package/components/form/utils/validators/number/notZero.js +7 -0
  200. package/components/form/utils/validators/required.d.ts +7 -0
  201. package/components/form/utils/validators/required.d.ts.map +1 -0
  202. package/components/form/utils/validators/required.js +8 -0
  203. package/components/form/utils/validators/string/index.d.ts +2 -0
  204. package/components/form/utils/validators/string/index.d.ts.map +1 -0
  205. package/components/form/utils/validators/string/index.js +1 -0
  206. package/components/form/utils/validators/string/length.d.ts +8 -0
  207. package/components/form/utils/validators/string/length.d.ts.map +1 -0
  208. package/components/form/utils/validators/string/length.js +12 -0
  209. package/components/primitives/date/index.d.ts +0 -1
  210. package/components/primitives/date/index.d.ts.map +1 -1
  211. package/components/primitives/multiline/components/multilineWithLabel/index.d.ts +0 -1
  212. package/components/primitives/multiline/components/multilineWithLabel/index.d.ts.map +1 -1
  213. package/components/primitives/multiline/components/multilineWithoutLabel/index.d.ts +0 -1
  214. package/components/primitives/multiline/components/multilineWithoutLabel/index.d.ts.map +1 -1
  215. package/components/primitives/multiline/index.d.ts +0 -1
  216. package/components/primitives/multiline/index.d.ts.map +1 -1
  217. package/components/primitives/number/components/withLabel/index.d.ts +0 -1
  218. package/components/primitives/number/components/withLabel/index.d.ts.map +1 -1
  219. package/components/primitives/number/components/withoutLabel/index.d.ts +0 -1
  220. package/components/primitives/number/components/withoutLabel/index.d.ts.map +1 -1
  221. package/components/primitives/number/index.d.ts +0 -1
  222. package/components/primitives/number/index.d.ts.map +1 -1
  223. package/components/primitives/password/components/withLabel/index.d.ts +0 -1
  224. package/components/primitives/password/components/withLabel/index.d.ts.map +1 -1
  225. package/components/primitives/password/components/withoutLabel/index.d.ts +0 -1
  226. package/components/primitives/password/components/withoutLabel/index.d.ts.map +1 -1
  227. package/components/primitives/password/index.d.ts +0 -1
  228. package/components/primitives/password/index.d.ts.map +1 -1
  229. package/components/primitives/text/components/textWithLabel/index.d.ts +0 -1
  230. package/components/primitives/text/components/textWithLabel/index.d.ts.map +1 -1
  231. package/components/primitives/text/components/textWithoutLabel/index.d.ts +0 -1
  232. package/components/primitives/text/components/textWithoutLabel/index.d.ts.map +1 -1
  233. package/components/primitives/text/index.d.ts +0 -1
  234. package/components/primitives/text/index.d.ts.map +1 -1
  235. package/package.json +5 -2
@@ -0,0 +1,16 @@
1
+ /// <reference types="react" />
2
+ import "./styles.scss";
3
+ import { FormConfig } from "../types";
4
+ import { FieldValue } from "../redux";
5
+ /** Form component input props type */
6
+ export interface FormModuleProps extends FormConfig {
7
+ /** Handler for form submit event */
8
+ onSubmit: (values: Array<FieldValue>) => void;
9
+ }
10
+ /**
11
+ * Form component
12
+ * Allows to render a form by config
13
+ */
14
+ declare const FormContextContainer: (formConfig: FormModuleProps) => JSX.Element;
15
+ export default FormContextContainer;
16
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/form/component/index.tsx"],"names":[],"mappings":";AAEA,OAAO,eAAe,CAAC;AAEvB,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAKtC,sCAAsC;AACtC,MAAM,WAAW,eAAgB,SAAQ,UAAU;IAC/C,oCAAoC;IACpC,QAAQ,EAAE,CAAC,MAAM,EAAE,KAAK,CAAC,UAAU,CAAC,KAAK,IAAI,CAAC;CACjD;AAED;;;GAGG;AACH,QAAA,MAAM,oBAAoB,eAAgB,eAAe,KAAG,WAM3D,CAAC;AAEF,eAAe,oBAAoB,CAAC"}
@@ -0,0 +1,13 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Provider } from "react-redux";
3
+ import "./styles.scss";
4
+ import store from "../redux/store";
5
+ import FormContainer from "../components/container";
6
+ /**
7
+ * Form component
8
+ * Allows to render a form by config
9
+ */
10
+ const FormContextContainer = (formConfig) => {
11
+ return (_jsx(Provider, { store: store, children: _jsx(FormContainer, { ...formConfig }) }));
12
+ };
13
+ export default FormContextContainer;
@@ -0,0 +1,33 @@
1
+ .bbr-form {
2
+ &__row {
3
+ &--has-errors {
4
+ .column {
5
+ padding-bottom: 0.25rem;
6
+ }
7
+ }
8
+ }
9
+
10
+ &__field {
11
+ &--vertically-center {
12
+ display: flex;
13
+ align-items: center;
14
+ }
15
+
16
+ &--is-checkbox {
17
+ .field-label {
18
+ padding-top: 0.15em;
19
+ }
20
+ }
21
+
22
+ .field-label {
23
+ max-width: 8rem;
24
+ flex-basis: auto;
25
+
26
+ & label.is-required::after {
27
+ content: "*";
28
+ color: red;
29
+ margin-left: 0.25rem;
30
+ }
31
+ }
32
+ }
33
+ }
@@ -0,0 +1,13 @@
1
+ /// <reference types="react" />
2
+ import { GridCell, FormItem } from "../../types";
3
+ /** Grid cell component props */
4
+ interface CellProps {
5
+ /** Field */
6
+ item: FormItem<any>;
7
+ /** Cell configuration */
8
+ cellConfig: GridCell;
9
+ }
10
+ /** Layout row cell */
11
+ declare const Cell: ({ item, cellConfig }: CellProps) => JSX.Element;
12
+ export default Cell;
13
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/components/cell/index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAIjD,gCAAgC;AAChC,UAAU,SAAS;IACf,YAAY;IACZ,IAAI,EAAE,QAAQ,CAAC,GAAG,CAAC,CAAC;IAEpB,yBAAyB;IACzB,UAAU,EAAE,QAAQ,CAAC;CACxB;AAED,sBAAsB;AACtB,QAAA,MAAM,IAAI,yBAA0B,SAAS,KAAG,WAQ/C,CAAC;AAEF,eAAe,IAAI,CAAC"}
@@ -0,0 +1,8 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { FormItemViewComponent } from "../item";
3
+ ;
4
+ /** Layout row cell */
5
+ const Cell = ({ item, cellConfig }) => {
6
+ return (_jsx("div", { className: cellConfig.className, children: _jsx(FormItemViewComponent, { ...item }) }));
7
+ };
8
+ export default Cell;
@@ -0,0 +1,24 @@
1
+ /// <reference types="react" />
2
+ import { FormState } from "../../redux";
3
+ import { FormModuleProps } from "../../component";
4
+ /** Form container props type */
5
+ interface FormContainerComponentProps extends Omit<FormState, 'initialConfig' | 'purityState'> {
6
+ /** Form initial configuration */
7
+ formCfg: FormModuleProps;
8
+ /**
9
+ * Submit form action.
10
+ * Callback for successfull form validation
11
+ */
12
+ submitForm: () => void;
13
+ }
14
+ /** Form container component */
15
+ declare const FormContainer: import("react-redux").ConnectedComponent<({ items, state, valuesStorage, formCfg, submitForm }: FormContainerComponentProps) => JSX.Element, {
16
+ onSubmit: (values: import("../../redux").FieldValue[]) => void;
17
+ name: string;
18
+ caption?: string | undefined;
19
+ items: import("../../types").Field<any>[];
20
+ context?: import("react").Context<import("react-redux").ReactReduxContextValue<any, import("redux").AnyAction>> | undefined;
21
+ store?: import("redux").Store<any, import("redux").AnyAction> | undefined;
22
+ }>;
23
+ export default FormContainer;
24
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/components/container/index.tsx"],"names":[],"mappings":";AAKA,OAAO,EAAmC,SAAS,EAAE,MAAM,aAAa,CAAC;AAGzE,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAuClD,gCAAgC;AAChC,UAAU,2BAA4B,SAAQ,IAAI,CAAC,SAAS,EAAE,eAAe,GAAG,aAAa,CAAC;IAE1F,iCAAiC;IACjC,OAAO,EAAE,eAAe,CAAC;IAEzB;;;OAGG;IACH,UAAU,EAAE,MAAM,IAAI,CAAC;CAC1B;AAED,+BAA+B;AAC/B,QAAA,MAAM,aAAa,kGA7ChB,2BAA2B,KAAG,WAAW;;;;;;;EAmDnB,CAAC;AAE1B,eAAe,aAAa,CAAC"}
@@ -0,0 +1,26 @@
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useCallback, useEffect } from "react";
3
+ import { useDispatch, connect } from "react-redux";
4
+ import Form from "../form";
5
+ import { getInitAction, getSetFormStatus } from "../../redux";
6
+ import { submitFormAsync } from "../../redux/actions";
7
+ import Button from "../../../button";
8
+ const FormContainerComponent = ({ items, state, valuesStorage, formCfg, submitForm }) => {
9
+ const dispatch = useDispatch();
10
+ useEffect(() => {
11
+ if (state === "init") {
12
+ dispatch(getInitAction(formCfg));
13
+ }
14
+ else if (state === "submited") {
15
+ formCfg.onSubmit(valuesStorage);
16
+ dispatch(getSetFormStatus("idle"));
17
+ }
18
+ }, [state]);
19
+ const onSubmitClick = useCallback(submitForm, [submitForm]);
20
+ return (_jsxs(_Fragment, { children: [_jsx(Form, { items: items, name: formCfg.name, caption: formCfg.caption }), _jsx(Button, { onClick: onSubmitClick, caption: "Submit", type: "success", disabled: state === "validating" })] }));
21
+ };
22
+ /** Form container component */
23
+ const FormContainer = connect(({ items, state, valuesStorage }, props) => ({ items, state, valuesStorage, formCfg: props }), {
24
+ submitForm: submitFormAsync,
25
+ })(FormContainerComponent);
26
+ export default FormContainer;
@@ -0,0 +1,11 @@
1
+ /// <reference types="react" />
2
+ import { FormConfig, FormItem } from "../../types";
3
+ /** Form component props type */
4
+ interface FormProps extends Omit<FormConfig, 'items'> {
5
+ /** Form caption */
6
+ items: Array<FormItem<any>>;
7
+ }
8
+ /** Layout form group */
9
+ declare const Form: ({ name, caption, items }: FormProps) => JSX.Element;
10
+ export default Form;
11
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/components/form/index.tsx"],"names":[],"mappings":";AAIA,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAInD,gCAAgC;AAChC,UAAU,SAAU,SAAQ,IAAI,CAAC,UAAU,EAAE,OAAO,CAAC;IACjD,mBAAmB;IACnB,KAAK,EAAE,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC;CAC/B;AAED,wBAAwB;AACxB,QAAA,MAAM,IAAI,6BAA8B,SAAS,KAAG,WAuBnD,CAAC;AAEF,eAAe,IAAI,CAAC"}
@@ -0,0 +1,11 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useMemo } from "react";
3
+ import Row from "../row";
4
+ import { getRows } from "../../utils/grid";
5
+ /** Layout form group */
6
+ const Form = ({ name, caption, items }) => {
7
+ const rows = useMemo(() => getRows(items), [items]);
8
+ return (_jsxs("div", { className: "bbr-form", "data-form": name, role: "form", children: [caption &&
9
+ _jsx("div", { className: "content", children: _jsx("h3", { className: "is-title", children: caption }) }), _jsx("section", { children: rows.map((x, i) => _jsx(Row, { items: x }, i)) })] }));
10
+ };
11
+ export default Form;
@@ -0,0 +1,6 @@
1
+ /// <reference types="react" />
2
+ import { CheckboxFormItem } from "../../../types";
3
+ /** Checkbox component for boolean form item */
4
+ declare const CheckBoxFormComponent: ({ modelConfig, name, viewConfig, extension }: CheckboxFormItem) => JSX.Element;
5
+ export default CheckBoxFormComponent;
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/form/components/inputs/checkbox/index.tsx"],"names":[],"mappings":";AAQA,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAGlD,+CAA+C;AAC/C,QAAA,MAAM,qBAAqB,iDAAkD,gBAAgB,KAAG,WAwB/F,CAAC;AAEF,eAAe,qBAAqB,CAAC"}
@@ -0,0 +1,19 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useCallback } from "react";
3
+ import { useDispatch, useSelector } from "react-redux";
4
+ import { InputColor } from "../../../../primitives";
5
+ import Checkbox from "../../../../primitives/checkbox";
6
+ import { getSetFieldValueAction } from "../../../redux";
7
+ import { getValidationState } from "../../../utils";
8
+ /** Checkbox component for boolean form item */
9
+ const CheckBoxFormComponent = ({ modelConfig, name, viewConfig, extension }) => {
10
+ const dispatcher = useDispatch();
11
+ const state = useSelector(x => x.state);
12
+ const validationState = getValidationState(modelConfig);
13
+ const onValueChange = useCallback((value) => dispatcher(getSetFieldValueAction(name, value)), [name]);
14
+ return (_jsx(Checkbox, { className: viewConfig.className, defaultValue: modelConfig.defaultValue, onValueChange: onValueChange, label: {
15
+ caption: viewConfig.caption,
16
+ horizontal: true,
17
+ }, disabled: viewConfig.disabled || state === "validating", validationState: validationState, readonly: state === "validating", isFormLabel: true, withoutBorder: extension?.withoutBorder ?? false, style: InputColor.Link }));
18
+ };
19
+ export default CheckBoxFormComponent;
@@ -0,0 +1,7 @@
1
+ /// <reference types="react" />
2
+ import Date from "../../../../primitives/date";
3
+ import { FormItem } from "../../../types";
4
+ /** Date picker component for date form item */
5
+ declare const DateFormComponent: ({ modelConfig, name, viewConfig }: FormItem<Date>) => JSX.Element;
6
+ export default DateFormComponent;
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/form/components/inputs/date/index.tsx"],"names":[],"mappings":";AAIA,OAAO,IAAI,MAAM,6BAA6B,CAAC;AAG/C,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAG1C,+CAA+C;AAC/C,QAAA,MAAM,iBAAiB,sCAAuC,SAAS,IAAI,CAAC,KAAG,WAsB9E,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
@@ -0,0 +1,19 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useCallback } from "react";
3
+ import { useDispatch, useSelector } from "react-redux";
4
+ import Date from "../../../../primitives/date";
5
+ import { getSetFieldValueAction } from "../../../redux";
6
+ import { getValidationState } from "../../../utils";
7
+ /** Date picker component for date form item */
8
+ const DateFormComponent = ({ modelConfig, name, viewConfig }) => {
9
+ const dispatcher = useDispatch();
10
+ const state = useSelector(x => x.state);
11
+ const validationState = getValidationState(modelConfig);
12
+ const onValueChange = useCallback((value) => dispatcher(getSetFieldValueAction(name, value)), [name]);
13
+ return (_jsx(Date, { name: name, className: viewConfig.className, defaultValue: modelConfig.defaultValue, onValueChange: onValueChange, label: {
14
+ caption: viewConfig.caption,
15
+ horizontal: true,
16
+ className: modelConfig.required ? "is-required" : ""
17
+ }, disabled: viewConfig.disabled || state === "validating", validationState: validationState }));
18
+ };
19
+ export default DateFormComponent;
@@ -0,0 +1,6 @@
1
+ /// <reference types="react" />
2
+ import { LookupFormItem } from "../../../types";
3
+ /** Dropdown component for lookup form item */
4
+ declare const LookupFormComponent: ({ modelConfig, name, viewConfig, extension }: LookupFormItem) => JSX.Element;
5
+ export default LookupFormComponent;
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/form/components/inputs/lookup/index.tsx"],"names":[],"mappings":";AAQA,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAGhD,8CAA8C;AAC9C,QAAA,MAAM,mBAAmB,iDAAkD,cAAc,KAAG,WA0B3F,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
@@ -0,0 +1,19 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useCallback } from "react";
3
+ import { useDispatch, useSelector } from "react-redux";
4
+ import Dropdown from "../../../../dropdown";
5
+ import { getSetFieldValueAction } from "../../../redux";
6
+ import { getValidationState } from "../../../utils";
7
+ /** Dropdown component for lookup form item */
8
+ const LookupFormComponent = ({ modelConfig, name, viewConfig, extension }) => {
9
+ const dispatcher = useDispatch();
10
+ const state = useSelector(x => x.state);
11
+ const validationState = getValidationState(modelConfig);
12
+ const onSelect = useCallback((value) => dispatcher(getSetFieldValueAction(name, value)), [name]);
13
+ return (_jsx(Dropdown, { className: viewConfig.className, value: modelConfig.value, onSelect: onSelect, label: {
14
+ caption: viewConfig.caption,
15
+ horizontal: true,
16
+ className: modelConfig.required ? "is-required" : ""
17
+ }, disabled: viewConfig.disabled || state === "validating", validationState: validationState, placeholder: viewConfig.caption, hideOnOuterClick: true, deselectable: true, items: extension?.items ?? [], listMaxHeight: extension?.listMaxHeight?.toString() }));
18
+ };
19
+ export default LookupFormComponent;
@@ -0,0 +1,6 @@
1
+ /// <reference types="react" />
2
+ import { FormItem } from "../../../types";
3
+ /** Multiline component for multiline text form item */
4
+ declare const MultilineFormComponent: ({ modelConfig, name, viewConfig }: FormItem<string>) => JSX.Element;
5
+ export default MultilineFormComponent;
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/form/components/inputs/multiline/index.tsx"],"names":[],"mappings":";AAOA,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAG1C,uDAAuD;AACvD,QAAA,MAAM,sBAAsB,sCAAuC,SAAS,MAAM,CAAC,KAAG,WAuBrF,CAAC;AAEF,eAAe,sBAAsB,CAAC"}
@@ -0,0 +1,19 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useCallback } from "react";
3
+ import { useDispatch, useSelector } from "react-redux";
4
+ import Multiline from "../../../../primitives/multiline";
5
+ import { getSetFieldValueAction } from "../../../redux";
6
+ import { getValidationState } from "../../../utils";
7
+ /** Multiline component for multiline text form item */
8
+ const MultilineFormComponent = ({ modelConfig, name, viewConfig }) => {
9
+ const dispatcher = useDispatch();
10
+ const state = useSelector(x => x.state);
11
+ const validationState = getValidationState(modelConfig);
12
+ const onValueChange = useCallback((value) => dispatcher(getSetFieldValueAction(name, value)), [name]);
13
+ return (_jsx(Multiline, { name: name, className: viewConfig.className, defaultValue: modelConfig.defaultValue, onValueChange: onValueChange, label: {
14
+ caption: viewConfig.caption,
15
+ horizontal: true,
16
+ className: modelConfig.required ? "is-required" : ""
17
+ }, disabled: viewConfig.disabled || state === "validating", validationState: validationState, placeholder: viewConfig.caption }));
18
+ };
19
+ export default MultilineFormComponent;
@@ -0,0 +1,6 @@
1
+ /// <reference types="react" />
2
+ import { FormItem } from "../../../types";
3
+ /** Number picker component for number form item */
4
+ declare const NumberFormComponent: ({ modelConfig, name, viewConfig }: FormItem<number>) => JSX.Element;
5
+ export default NumberFormComponent;
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/form/components/inputs/number/index.tsx"],"names":[],"mappings":";AAOA,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAG1C,mDAAmD;AACnD,QAAA,MAAM,mBAAmB,sCAAuC,SAAS,MAAM,CAAC,KAAG,WAuBlF,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
@@ -0,0 +1,19 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useCallback } from "react";
3
+ import { useDispatch, useSelector } from "react-redux";
4
+ import Number from "../../../../primitives/number";
5
+ import { getSetFieldValueAction } from "../../../redux";
6
+ import { getValidationState } from "../../../utils";
7
+ /** Number picker component for number form item */
8
+ const NumberFormComponent = ({ modelConfig, name, viewConfig }) => {
9
+ const dispatcher = useDispatch();
10
+ const state = useSelector(x => x.state);
11
+ const validationState = getValidationState(modelConfig);
12
+ const onValueChange = useCallback((value) => dispatcher(getSetFieldValueAction(name, value)), [name]);
13
+ return (_jsx(Number, { name: name, className: viewConfig.className, defaultValue: modelConfig.defaultValue, onValueChange: onValueChange, label: {
14
+ caption: viewConfig.caption,
15
+ horizontal: true,
16
+ className: modelConfig.required ? "is-required" : ""
17
+ }, disabled: viewConfig.disabled || state === "validating", validationState: validationState, placeholder: viewConfig.caption }));
18
+ };
19
+ export default NumberFormComponent;
@@ -0,0 +1,6 @@
1
+ /// <reference types="react" />
2
+ import { FormItem } from "../../../types";
3
+ /** Password component for password text form item */
4
+ declare const PasswordFormComponent: ({ modelConfig, name, viewConfig }: FormItem<string>) => JSX.Element;
5
+ export default PasswordFormComponent;
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/form/components/inputs/password/index.tsx"],"names":[],"mappings":";AAOA,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAG1C,qDAAqD;AACrD,QAAA,MAAM,qBAAqB,sCAAuC,SAAS,MAAM,CAAC,KAAG,WAuBpF,CAAC;AAEF,eAAe,qBAAqB,CAAC"}
@@ -0,0 +1,19 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useCallback } from "react";
3
+ import { useDispatch, useSelector } from "react-redux";
4
+ import Password from "../../../../primitives/password";
5
+ import { getSetFieldValueAction } from "../../../redux";
6
+ import { getValidationState } from "../../../utils";
7
+ /** Password component for password text form item */
8
+ const PasswordFormComponent = ({ modelConfig, name, viewConfig }) => {
9
+ const dispatcher = useDispatch();
10
+ const state = useSelector(x => x.state);
11
+ const validationState = getValidationState(modelConfig);
12
+ const onValueChange = useCallback((value) => dispatcher(getSetFieldValueAction(name, value)), [name]);
13
+ return (_jsx(Password, { name: name, className: viewConfig.className, onValueChange: onValueChange, label: {
14
+ caption: viewConfig.caption,
15
+ horizontal: true,
16
+ className: modelConfig.required ? "is-required" : ""
17
+ }, disabled: viewConfig.disabled || state === "validating", validationState: validationState, canShowPassword: true, placeholder: viewConfig.caption }));
18
+ };
19
+ export default PasswordFormComponent;
@@ -0,0 +1,6 @@
1
+ /// <reference types="react" />
2
+ import { FormItem } from "../../../types";
3
+ /** Text component for single-line text form item */
4
+ declare const TextFormComponent: ({ modelConfig, name, viewConfig }: FormItem<string>) => JSX.Element;
5
+ export default TextFormComponent;
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/form/components/inputs/text/index.tsx"],"names":[],"mappings":";AAQA,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAI1C,oDAAoD;AACpD,QAAA,MAAM,iBAAiB,sCAAuC,SAAS,MAAM,CAAC,KAAG,WA0BhF,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
@@ -0,0 +1,23 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useCallback } from "react";
3
+ import { useDispatch, useSelector } from "react-redux";
4
+ import { isNullOrEmpty } from "@bodynarf/utils";
5
+ import Text from "../../../../primitives/text";
6
+ import { getSetFieldValueAction } from "../../../redux";
7
+ import { getValidationState } from "../../../utils";
8
+ /** Text component for single-line text form item */
9
+ const TextFormComponent = ({ modelConfig, name, viewConfig }) => {
10
+ const dispatcher = useDispatch();
11
+ const state = useSelector(x => x.state);
12
+ const validationState = getValidationState(modelConfig);
13
+ const onValueChange = useCallback((value) => {
14
+ const newValue = isNullOrEmpty(value) ? undefined : value;
15
+ dispatcher(getSetFieldValueAction(name, newValue));
16
+ }, [name]);
17
+ return (_jsx(Text, { name: name, className: viewConfig.className, defaultValue: modelConfig.defaultValue, onValueChange: onValueChange, label: {
18
+ caption: viewConfig.caption,
19
+ horizontal: true,
20
+ className: modelConfig.required ? "is-required" : ""
21
+ }, disabled: viewConfig.disabled || state === "validating", validationState: validationState, placeholder: viewConfig.caption }));
22
+ };
23
+ export default TextFormComponent;
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ import { FormItem } from "../../types";
3
+ export declare const FormItemViewComponent: (item: FormItem<any>) => JSX.Element;
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/components/item/index.tsx"],"names":[],"mappings":";AAQA,OAAO,EAAoB,QAAQ,EAAkB,MAAM,aAAa,CAAC;AAEzE,eAAO,MAAM,qBAAqB,SAAU,SAAS,GAAG,CAAC,KAAG,WAmB3D,CAAC"}
@@ -0,0 +1,28 @@
1
+ import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import CheckBoxFormComponent from "../inputs/checkbox";
3
+ import DateFormComponent from "../inputs/date";
4
+ import LookupFormComponent from "../inputs/lookup";
5
+ import MultilineFormComponent from "../inputs/multiline";
6
+ import NumberFormComponent from "../inputs/number";
7
+ import PasswordFormComponent from "../inputs/password";
8
+ import TextFormComponent from "../inputs/text";
9
+ export const FormItemViewComponent = (item) => {
10
+ switch (item.viewConfig.type) {
11
+ case "text":
12
+ return _jsx(TextFormComponent, { ...item });
13
+ case "multiline":
14
+ return _jsx(MultilineFormComponent, { ...item });
15
+ case "checkbox":
16
+ return _jsx(CheckBoxFormComponent, { ...item });
17
+ case "number":
18
+ return _jsx(NumberFormComponent, { ...item });
19
+ case "date":
20
+ return _jsx(DateFormComponent, { ...item });
21
+ case "lookup":
22
+ return _jsx(LookupFormComponent, { ...item });
23
+ case "password":
24
+ return _jsx(PasswordFormComponent, { ...item });
25
+ default:
26
+ return _jsx(_Fragment, { children: "INVALID COMPONENT" });
27
+ }
28
+ };
@@ -0,0 +1,10 @@
1
+ /// <reference types="react" />
2
+ import { FormItem } from "../../types";
3
+ interface RowProps {
4
+ /** Row fields */
5
+ items: Array<FormItem<any>>;
6
+ }
7
+ /** Layout row with fields */
8
+ declare const Row: ({ items }: RowProps) => JSX.Element;
9
+ export default Row;
10
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/components/row/index.tsx"],"names":[],"mappings":";AAGA,OAAO,EAAE,QAAQ,EAA2B,MAAM,aAAa,CAAC;AAKhE,UAAU,QAAQ;IACd,iBAAiB;IACjB,KAAK,EAAE,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC;CAC/B;AAED,6BAA6B;AAC7B,QAAA,MAAM,GAAG,cAAe,QAAQ,KAAG,WAkClC,CAAC;AAEF,eAAe,GAAG,CAAC"}
@@ -0,0 +1,27 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { getClassName } from "@bodynarf/utils";
3
+ import { useMemo } from "react";
4
+ import { FormItemValidationState } from "../../types";
5
+ import { getSortedColumns } from "../../utils/grid";
6
+ import Cell from "../cell";
7
+ ;
8
+ /** Layout row with fields */
9
+ const Row = ({ items }) => {
10
+ const columns = useMemo(() => {
11
+ const sortedColumns = getSortedColumns(items);
12
+ return sortedColumns.map(x => ({
13
+ item: items.find(({ name }) => name === x.name),
14
+ cellConfig: x,
15
+ }));
16
+ }, [items]);
17
+ const className = getClassName([
18
+ "columns",
19
+ "m-0",
20
+ "bbr-form__row",
21
+ columns.some(({ item }) => item.modelConfig.validationState === FormItemValidationState.Invalid)
22
+ ? "bbr-form__row--has-errors"
23
+ : ""
24
+ ]);
25
+ return (_jsx("div", { className: className, children: columns.map(x => _jsx(Cell, { ...x }, x.item.name)) }));
26
+ };
27
+ export default Row;
@@ -0,0 +1,3 @@
1
+ import Form from "./component";
2
+ export default Form;
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/form/index.tsx"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,aAAa,CAAC;AAE/B,eAAe,IAAI,CAAC"}
@@ -0,0 +1,2 @@
1
+ import Form from "./component";
2
+ export default Form;
@@ -0,0 +1,7 @@
1
+ export * from "./initForm";
2
+ export * from "./setFieldValue";
3
+ export * from "./submitForm";
4
+ export * from "./validateField";
5
+ export * from "./setFormState";
6
+ export * from "./setValidationResult";
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/redux/actionCreators/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,uBAAuB,CAAC"}
@@ -0,0 +1,6 @@
1
+ export * from "./initForm";
2
+ export * from "./setFieldValue";
3
+ export * from "./submitForm";
4
+ export * from "./validateField";
5
+ export * from "./setFormState";
6
+ export * from "./setValidationResult";
@@ -0,0 +1,9 @@
1
+ import { FormConfig } from "../../types";
2
+ import { ActionWithPayload } from "../types";
3
+ /**
4
+ * Get redux action "Init form state"
5
+ * @param {object} initialConfig Initial form configuration
6
+ * @returns State updating action
7
+ */
8
+ export declare const getInitAction: (initialConfig: FormConfig) => ActionWithPayload;
9
+ //# sourceMappingURL=initForm.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"initForm.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/redux/actionCreators/initForm.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAG7C;;;;GAIG;AACH,eAAO,MAAM,aAAa,kBAAmB,UAAU,KAAG,iBAKzD,CAAC"}
@@ -0,0 +1,12 @@
1
+ import { initForm } from "../actionTypes";
2
+ /**
3
+ * Get redux action "Init form state"
4
+ * @param {object} initialConfig Initial form configuration
5
+ * @returns State updating action
6
+ */
7
+ export const getInitAction = (initialConfig) => {
8
+ return ({
9
+ type: initForm,
10
+ payload: { initialConfig }
11
+ });
12
+ };
@@ -0,0 +1,9 @@
1
+ import { ActionWithPayload } from "../types";
2
+ /**
3
+ * Get redux action "Set field value"
4
+ * @param {string} fieldName Field name
5
+ * @param {any | undefined} fieldValue Field value
6
+ * @returns State updating action
7
+ */
8
+ export declare const getSetFieldValueAction: (fieldName: string, fieldValue: any | undefined) => ActionWithPayload;
9
+ //# sourceMappingURL=setFieldValue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"setFieldValue.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/redux/actionCreators/setFieldValue.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAG7C;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB,cAAe,MAAM,cAAc,GAAG,GAAG,SAAS,KAAG,iBAUvF,CAAC"}
@@ -0,0 +1,18 @@
1
+ import { setFieldValue } from "../actionTypes";
2
+ /**
3
+ * Get redux action "Set field value"
4
+ * @param {string} fieldName Field name
5
+ * @param {any | undefined} fieldValue Field value
6
+ * @returns State updating action
7
+ */
8
+ export const getSetFieldValueAction = (fieldName, fieldValue) => {
9
+ return ({
10
+ type: setFieldValue,
11
+ payload: {
12
+ field: {
13
+ name: fieldName,
14
+ value: fieldValue
15
+ }
16
+ }
17
+ });
18
+ };
@@ -0,0 +1,8 @@
1
+ import { ActionWithPayload, FormStatus } from "../types";
2
+ /**
3
+ * Get redux action "Set form state status"
4
+ * @param newStatus New form state status
5
+ * @returns State updating action
6
+ */
7
+ export declare const getSetFormStatus: (newStatus: FormStatus) => ActionWithPayload;
8
+ //# sourceMappingURL=setFormState.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"setFormState.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/redux/actionCreators/setFormState.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAGzD;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,cAAe,UAAU,KAAG,iBAOxD,CAAC"}