@bodynarf/react.components 1.4.20 → 1.4.22

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 (212) hide show
  1. package/index.d.ts +12 -9
  2. package/index.d.ts.map +1 -1
  3. package/index.js +12 -9
  4. package/package.json +2 -5
  5. package/components/form/component/index.d.ts +0 -16
  6. package/components/form/component/index.d.ts.map +0 -1
  7. package/components/form/component/index.js +0 -13
  8. package/components/form/component/styles.scss +0 -33
  9. package/components/form/components/cell/index.d.ts +0 -13
  10. package/components/form/components/cell/index.d.ts.map +0 -1
  11. package/components/form/components/cell/index.js +0 -8
  12. package/components/form/components/container/index.d.ts +0 -24
  13. package/components/form/components/container/index.d.ts.map +0 -1
  14. package/components/form/components/container/index.js +0 -26
  15. package/components/form/components/form/index.d.ts +0 -11
  16. package/components/form/components/form/index.d.ts.map +0 -1
  17. package/components/form/components/form/index.js +0 -11
  18. package/components/form/components/inputs/checkbox/index.d.ts +0 -6
  19. package/components/form/components/inputs/checkbox/index.d.ts.map +0 -1
  20. package/components/form/components/inputs/checkbox/index.js +0 -19
  21. package/components/form/components/inputs/date/index.d.ts +0 -7
  22. package/components/form/components/inputs/date/index.d.ts.map +0 -1
  23. package/components/form/components/inputs/date/index.js +0 -19
  24. package/components/form/components/inputs/lookup/index.d.ts +0 -6
  25. package/components/form/components/inputs/lookup/index.d.ts.map +0 -1
  26. package/components/form/components/inputs/lookup/index.js +0 -19
  27. package/components/form/components/inputs/multiline/index.d.ts +0 -6
  28. package/components/form/components/inputs/multiline/index.d.ts.map +0 -1
  29. package/components/form/components/inputs/multiline/index.js +0 -19
  30. package/components/form/components/inputs/number/index.d.ts +0 -6
  31. package/components/form/components/inputs/number/index.d.ts.map +0 -1
  32. package/components/form/components/inputs/number/index.js +0 -19
  33. package/components/form/components/inputs/password/index.d.ts +0 -6
  34. package/components/form/components/inputs/password/index.d.ts.map +0 -1
  35. package/components/form/components/inputs/password/index.js +0 -19
  36. package/components/form/components/inputs/text/index.d.ts +0 -6
  37. package/components/form/components/inputs/text/index.d.ts.map +0 -1
  38. package/components/form/components/inputs/text/index.js +0 -23
  39. package/components/form/components/item/index.d.ts +0 -4
  40. package/components/form/components/item/index.d.ts.map +0 -1
  41. package/components/form/components/item/index.js +0 -28
  42. package/components/form/components/row/index.d.ts +0 -10
  43. package/components/form/components/row/index.d.ts.map +0 -1
  44. package/components/form/components/row/index.js +0 -27
  45. package/components/form/index.d.ts +0 -3
  46. package/components/form/index.d.ts.map +0 -1
  47. package/components/form/index.js +0 -2
  48. package/components/form/redux/actionCreators/index.d.ts +0 -7
  49. package/components/form/redux/actionCreators/index.d.ts.map +0 -1
  50. package/components/form/redux/actionCreators/index.js +0 -6
  51. package/components/form/redux/actionCreators/initForm.d.ts +0 -9
  52. package/components/form/redux/actionCreators/initForm.d.ts.map +0 -1
  53. package/components/form/redux/actionCreators/initForm.js +0 -12
  54. package/components/form/redux/actionCreators/setFieldValue.d.ts +0 -9
  55. package/components/form/redux/actionCreators/setFieldValue.d.ts.map +0 -1
  56. package/components/form/redux/actionCreators/setFieldValue.js +0 -18
  57. package/components/form/redux/actionCreators/setFormState.d.ts +0 -8
  58. package/components/form/redux/actionCreators/setFormState.d.ts.map +0 -1
  59. package/components/form/redux/actionCreators/setFormState.js +0 -14
  60. package/components/form/redux/actionCreators/setValidationResult.d.ts +0 -9
  61. package/components/form/redux/actionCreators/setValidationResult.d.ts.map +0 -1
  62. package/components/form/redux/actionCreators/setValidationResult.js +0 -14
  63. package/components/form/redux/actionCreators/submitForm.d.ts +0 -7
  64. package/components/form/redux/actionCreators/submitForm.d.ts.map +0 -1
  65. package/components/form/redux/actionCreators/submitForm.js +0 -10
  66. package/components/form/redux/actionCreators/validateField.d.ts +0 -8
  67. package/components/form/redux/actionCreators/validateField.d.ts.map +0 -1
  68. package/components/form/redux/actionCreators/validateField.js +0 -12
  69. package/components/form/redux/actionTypes.d.ts +0 -13
  70. package/components/form/redux/actionTypes.d.ts.map +0 -1
  71. package/components/form/redux/actionTypes.js +0 -12
  72. package/components/form/redux/actions/index.d.ts +0 -2
  73. package/components/form/redux/actions/index.d.ts.map +0 -1
  74. package/components/form/redux/actions/index.js +0 -1
  75. package/components/form/redux/actions/submitForm.d.ts +0 -9
  76. package/components/form/redux/actions/submitForm.d.ts.map +0 -1
  77. package/components/form/redux/actions/submitForm.js +0 -16
  78. package/components/form/redux/index.d.ts +0 -8
  79. package/components/form/redux/index.d.ts.map +0 -1
  80. package/components/form/redux/index.js +0 -7
  81. package/components/form/redux/reducer.d.ts +0 -4
  82. package/components/form/redux/reducer.d.ts.map +0 -1
  83. package/components/form/redux/reducer.js +0 -103
  84. package/components/form/redux/store.d.ts +0 -5
  85. package/components/form/redux/store.d.ts.map +0 -1
  86. package/components/form/redux/store.js +0 -4
  87. package/components/form/redux/types/base/types.d.ts +0 -9
  88. package/components/form/redux/types/base/types.d.ts.map +0 -1
  89. package/components/form/redux/types/base/types.js +0 -2
  90. package/components/form/redux/types/fieldValue.d.ts +0 -10
  91. package/components/form/redux/types/fieldValue.d.ts.map +0 -1
  92. package/components/form/redux/types/fieldValue.js +0 -1
  93. package/components/form/redux/types/index.d.ts +0 -4
  94. package/components/form/redux/types/index.d.ts.map +0 -1
  95. package/components/form/redux/types/index.js +0 -3
  96. package/components/form/redux/types/state.d.ts +0 -37
  97. package/components/form/redux/types/state.d.ts.map +0 -1
  98. package/components/form/redux/types/state.js +0 -12
  99. package/components/form/redux/utils/index.d.ts +0 -3
  100. package/components/form/redux/utils/index.d.ts.map +0 -1
  101. package/components/form/redux/utils/index.js +0 -2
  102. package/components/form/redux/utils/mapper.d.ts +0 -16
  103. package/components/form/redux/utils/mapper.d.ts.map +0 -1
  104. package/components/form/redux/utils/mapper.js +0 -107
  105. package/components/form/redux/utils/validate.d.ts +0 -9
  106. package/components/form/redux/utils/validate.d.ts.map +0 -1
  107. package/components/form/redux/utils/validate.js +0 -33
  108. package/components/form/types/index.d.ts +0 -3
  109. package/components/form/types/index.d.ts.map +0 -1
  110. package/components/form/types/index.js +0 -2
  111. package/components/form/types/model/extensions/extendedField.d.ts +0 -7
  112. package/components/form/types/model/extensions/extendedField.d.ts.map +0 -1
  113. package/components/form/types/model/extensions/extendedField.js +0 -1
  114. package/components/form/types/model/extensions/extendedFormItem.d.ts +0 -7
  115. package/components/form/types/model/extensions/extendedFormItem.d.ts.map +0 -1
  116. package/components/form/types/model/extensions/extendedFormItem.js +0 -2
  117. package/components/form/types/model/extensions/index.d.ts +0 -4
  118. package/components/form/types/model/extensions/index.d.ts.map +0 -1
  119. package/components/form/types/model/extensions/index.js +0 -3
  120. package/components/form/types/model/extensions/items/checkbox.d.ts +0 -17
  121. package/components/form/types/model/extensions/items/checkbox.d.ts.map +0 -1
  122. package/components/form/types/model/extensions/items/checkbox.js +0 -14
  123. package/components/form/types/model/extensions/items/getExtension.d.ts +0 -9
  124. package/components/form/types/model/extensions/items/getExtension.d.ts.map +0 -1
  125. package/components/form/types/model/extensions/items/getExtension.js +0 -18
  126. package/components/form/types/model/extensions/items/index.d.ts +0 -5
  127. package/components/form/types/model/extensions/items/index.d.ts.map +0 -1
  128. package/components/form/types/model/extensions/items/index.js +0 -4
  129. package/components/form/types/model/extensions/items/lookup.d.ts +0 -20
  130. package/components/form/types/model/extensions/items/lookup.d.ts.map +0 -1
  131. package/components/form/types/model/extensions/items/lookup.js +0 -15
  132. package/components/form/types/model/extensions/items/multiline.d.ts +0 -17
  133. package/components/form/types/model/extensions/items/multiline.d.ts.map +0 -1
  134. package/components/form/types/model/extensions/items/multiline.js +0 -14
  135. package/components/form/types/model/form.config.d.ts +0 -16
  136. package/components/form/types/model/form.config.d.ts.map +0 -1
  137. package/components/form/types/model/form.config.js +0 -2
  138. package/components/form/types/model/formItem.d.ts +0 -12
  139. package/components/form/types/model/formItem.d.ts.map +0 -1
  140. package/components/form/types/model/formItem.js +0 -1
  141. package/components/form/types/model/formItem.modelConfig.d.ts +0 -20
  142. package/components/form/types/model/formItem.modelConfig.d.ts.map +0 -1
  143. package/components/form/types/model/formItem.modelConfig.js +0 -1
  144. package/components/form/types/model/formItem.viewConfig.d.ts +0 -15
  145. package/components/form/types/model/formItem.viewConfig.d.ts.map +0 -1
  146. package/components/form/types/model/formItem.viewConfig.js +0 -1
  147. package/components/form/types/model/formItemValidationState.d.ts +0 -10
  148. package/components/form/types/model/formItemValidationState.d.ts.map +0 -1
  149. package/components/form/types/model/formItemValidationState.js +0 -11
  150. package/components/form/types/model/in/baseField.d.ts +0 -21
  151. package/components/form/types/model/in/baseField.d.ts.map +0 -1
  152. package/components/form/types/model/in/baseField.js +0 -1
  153. package/components/form/types/model/in/captionConfig.d.ts +0 -14
  154. package/components/form/types/model/in/captionConfig.d.ts.map +0 -1
  155. package/components/form/types/model/in/captionConfig.js +0 -1
  156. package/components/form/types/model/in/fieldType.d.ts +0 -3
  157. package/components/form/types/model/in/fieldType.d.ts.map +0 -1
  158. package/components/form/types/model/in/fieldType.js +0 -1
  159. package/components/form/types/model/in/fieldValidator.d.ts +0 -3
  160. package/components/form/types/model/in/fieldValidator.d.ts.map +0 -1
  161. package/components/form/types/model/in/fieldValidator.js +0 -1
  162. package/components/form/types/model/in/index.d.ts +0 -6
  163. package/components/form/types/model/in/index.d.ts.map +0 -1
  164. package/components/form/types/model/in/index.js +0 -5
  165. package/components/form/types/model/in/viewConfig.d.ts +0 -24
  166. package/components/form/types/model/in/viewConfig.d.ts.map +0 -1
  167. package/components/form/types/model/in/viewConfig.js +0 -1
  168. package/components/form/types/model/index.d.ts +0 -9
  169. package/components/form/types/model/index.d.ts.map +0 -1
  170. package/components/form/types/model/index.js +0 -8
  171. package/components/form/types/model/validationResult.d.ts +0 -11
  172. package/components/form/types/model/validationResult.d.ts.map +0 -1
  173. package/components/form/types/model/validationResult.js +0 -2
  174. package/components/form/types/view/gridCell.d.ts +0 -15
  175. package/components/form/types/view/gridCell.d.ts.map +0 -1
  176. package/components/form/types/view/gridCell.js +0 -1
  177. package/components/form/types/view/index.d.ts +0 -2
  178. package/components/form/types/view/index.d.ts.map +0 -1
  179. package/components/form/types/view/index.js +0 -1
  180. package/components/form/utils/component.d.ts +0 -9
  181. package/components/form/utils/component.d.ts.map +0 -1
  182. package/components/form/utils/component.js +0 -16
  183. package/components/form/utils/grid.d.ts +0 -17
  184. package/components/form/utils/grid.d.ts.map +0 -1
  185. package/components/form/utils/grid.js +0 -75
  186. package/components/form/utils/index.d.ts +0 -4
  187. package/components/form/utils/index.d.ts.map +0 -1
  188. package/components/form/utils/index.js +0 -3
  189. package/components/form/utils/validators/index.d.ts +0 -4
  190. package/components/form/utils/validators/index.d.ts.map +0 -1
  191. package/components/form/utils/validators/index.js +0 -3
  192. package/components/form/utils/validators/number/greaterThanZero.d.ts +0 -7
  193. package/components/form/utils/validators/number/greaterThanZero.d.ts.map +0 -1
  194. package/components/form/utils/validators/number/greaterThanZero.js +0 -7
  195. package/components/form/utils/validators/number/index.d.ts +0 -4
  196. package/components/form/utils/validators/number/index.d.ts.map +0 -1
  197. package/components/form/utils/validators/number/index.js +0 -3
  198. package/components/form/utils/validators/number/lessThanZero.d.ts +0 -7
  199. package/components/form/utils/validators/number/lessThanZero.d.ts.map +0 -1
  200. package/components/form/utils/validators/number/lessThanZero.js +0 -7
  201. package/components/form/utils/validators/number/notZero.d.ts +0 -7
  202. package/components/form/utils/validators/number/notZero.d.ts.map +0 -1
  203. package/components/form/utils/validators/number/notZero.js +0 -7
  204. package/components/form/utils/validators/required.d.ts +0 -7
  205. package/components/form/utils/validators/required.d.ts.map +0 -1
  206. package/components/form/utils/validators/required.js +0 -8
  207. package/components/form/utils/validators/string/index.d.ts +0 -2
  208. package/components/form/utils/validators/string/index.d.ts.map +0 -1
  209. package/components/form/utils/validators/string/index.js +0 -1
  210. package/components/form/utils/validators/string/length.d.ts +0 -8
  211. package/components/form/utils/validators/string/length.d.ts.map +0 -1
  212. package/components/form/utils/validators/string/length.js +0 -12
@@ -1,9 +0,0 @@
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
@@ -1 +0,0 @@
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"}
@@ -1,12 +0,0 @@
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
- };
@@ -1,9 +0,0 @@
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
@@ -1 +0,0 @@
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"}
@@ -1,18 +0,0 @@
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
- };
@@ -1,8 +0,0 @@
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
@@ -1 +0,0 @@
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"}
@@ -1,14 +0,0 @@
1
- import { setFormStatus } from "../actionTypes";
2
- /**
3
- * Get redux action "Set form state status"
4
- * @param newStatus New form state status
5
- * @returns State updating action
6
- */
7
- export const getSetFormStatus = (newStatus) => {
8
- return ({
9
- type: setFormStatus,
10
- payload: {
11
- newState: newStatus
12
- }
13
- });
14
- };
@@ -1,9 +0,0 @@
1
- import { ActionWithPayload } from "../types";
2
- import { ValidationResult } from "../../types";
3
- /**
4
- * Get redux action "Set form validation result"
5
- * @param validationResult Result of form fields validation
6
- * @returns State updating action
7
- */
8
- export declare const getSetValidationResultAction: (validationResult: Map<string, ValidationResult>) => ActionWithPayload;
9
- //# sourceMappingURL=setValidationResult.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"setValidationResult.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/redux/actionCreators/setValidationResult.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAE7C,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/C;;;;GAIG;AACH,eAAO,MAAM,4BAA4B,qBAAsB,IAAI,MAAM,EAAE,gBAAgB,CAAC,KAAG,iBAO9F,CAAC"}
@@ -1,14 +0,0 @@
1
- import { setValidationResult } from "../actionTypes";
2
- /**
3
- * Get redux action "Set form validation result"
4
- * @param validationResult Result of form fields validation
5
- * @returns State updating action
6
- */
7
- export const getSetValidationResultAction = (validationResult) => {
8
- return ({
9
- type: setValidationResult,
10
- payload: {
11
- validationResult
12
- }
13
- });
14
- };
@@ -1,7 +0,0 @@
1
- import { Action } from "redux";
2
- /**
3
- * Get redux action "Submit form"
4
- * @returns State updating action
5
- */
6
- export declare const getSubmitFormAction: () => Action<string>;
7
- //# sourceMappingURL=submitForm.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"submitForm.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/redux/actionCreators/submitForm.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAG/B;;;GAGG;AACH,eAAO,MAAM,mBAAmB,QAAO,OAAO,MAAM,CAInD,CAAC"}
@@ -1,10 +0,0 @@
1
- import { submitForm } from "../actionTypes";
2
- /**
3
- * Get redux action "Submit form"
4
- * @returns State updating action
5
- */
6
- export const getSubmitFormAction = () => {
7
- return ({
8
- type: submitForm,
9
- });
10
- };
@@ -1,8 +0,0 @@
1
- import { ActionWithPayload } from "../types";
2
- /**
3
- * Get redux action "Validate field"
4
- * @param {string} fieldName Name of field which should be validated
5
- * @returns State updating action
6
- */
7
- export declare const getValidateFieldAction: (fieldName: string) => ActionWithPayload;
8
- //# sourceMappingURL=validateField.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"validateField.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/redux/actionCreators/validateField.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAG7C;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,cAAe,MAAM,KAAG,iBAK1D,CAAC"}
@@ -1,12 +0,0 @@
1
- import { validateField } from "../actionTypes";
2
- /**
3
- * Get redux action "Validate field"
4
- * @param {string} fieldName Name of field which should be validated
5
- * @returns State updating action
6
- */
7
- export const getValidateFieldAction = (fieldName) => {
8
- return ({
9
- type: validateField,
10
- payload: { fieldName }
11
- });
12
- };
@@ -1,13 +0,0 @@
1
- /** Initialize form state with config */
2
- export declare const initForm = "bbr-form/init";
3
- /** Set single field value */
4
- export declare const setFieldValue = "bbr-form/setFiedValue";
5
- /** Validate specified field */
6
- export declare const validateField = "bbr-form/validateField";
7
- /** Submit form */
8
- export declare const submitForm = "bbr-form/submit";
9
- /** Set form state status */
10
- export declare const setFormStatus = "bbr-form/setStatus";
11
- /** Set form validation result */
12
- export declare const setValidationResult = "bbr-form/setValidationResult";
13
- //# sourceMappingURL=actionTypes.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"actionTypes.d.ts","sourceRoot":"","sources":["../../../../src/components/form/redux/actionTypes.ts"],"names":[],"mappings":"AAAA,wCAAwC;AACxC,eAAO,MAAM,QAAQ,kBAAkB,CAAC;AAExC,6BAA6B;AAC7B,eAAO,MAAM,aAAa,0BAA0B,CAAC;AAErD,+BAA+B;AAC/B,eAAO,MAAM,aAAa,2BAA2B,CAAC;AAEtD,kBAAkB;AAClB,eAAO,MAAM,UAAU,oBAAoB,CAAC;AAE5C,4BAA4B;AAC5B,eAAO,MAAM,aAAa,uBAAuB,CAAC;AAElD,iCAAiC;AACjC,eAAO,MAAM,mBAAmB,iCAAiC,CAAC"}
@@ -1,12 +0,0 @@
1
- /** Initialize form state with config */
2
- export const initForm = "bbr-form/init";
3
- /** Set single field value */
4
- export const setFieldValue = "bbr-form/setFiedValue";
5
- /** Validate specified field */
6
- export const validateField = "bbr-form/validateField";
7
- /** Submit form */
8
- export const submitForm = "bbr-form/submit";
9
- /** Set form state status */
10
- export const setFormStatus = "bbr-form/setStatus";
11
- /** Set form validation result */
12
- export const setValidationResult = "bbr-form/setValidationResult";
@@ -1,2 +0,0 @@
1
- export * from "./submitForm";
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/redux/actions/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC"}
@@ -1 +0,0 @@
1
- export * from "./submitForm";
@@ -1,9 +0,0 @@
1
- import { ThunkAction } from "redux-thunk";
2
- import { ActionWithPayload, FormState } from "../types";
3
- /**
4
- * Get action "submit form".
5
- * Moves form to validating stage, validates fields.
6
- * If form is valid - executes user callback. Otherwise - push form to previous state
7
- */
8
- export declare const submitFormAsync: () => ThunkAction<void, FormState, unknown, ActionWithPayload>;
9
- //# sourceMappingURL=submitForm.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"submitForm.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/redux/actions/submitForm.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAiB,MAAM,aAAa,CAAC;AAIzD,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAoBxD;;;;GAIG;AACH,eAAO,MAAM,eAAe,QAAO,YAAY,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,iBAAiB,CAAqB,CAAC"}
@@ -1,16 +0,0 @@
1
- import { getSetFormStatus, getSetValidationResultAction } from "../actionCreators";
2
- import { validateItem } from "../utils";
3
- const submitFormAction = (dispatch, getState) => {
4
- const { items } = getState();
5
- dispatch(getSetFormStatus("validating"));
6
- (async () => {
7
- const validationResults = new Map(items.map(item => [item.name, validateItem(item, item.modelConfig.value)]));
8
- dispatch(getSetValidationResultAction(validationResults));
9
- })();
10
- };
11
- /**
12
- * Get action "submit form".
13
- * Moves form to validating stage, validates fields.
14
- * If form is valid - executes user callback. Otherwise - push form to previous state
15
- */
16
- export const submitFormAsync = () => submitFormAction;
@@ -1,8 +0,0 @@
1
- export * from "./actionCreators";
2
- export * from "./reducer";
3
- export * from "./utils";
4
- export * from "./actionTypes";
5
- export * from "./store";
6
- export * from "./types";
7
- export * from "./actions";
8
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/form/redux/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,eAAe,CAAC;AAC9B,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC"}
@@ -1,7 +0,0 @@
1
- export * from "./actionCreators";
2
- export * from "./reducer";
3
- export * from "./utils";
4
- export * from "./actionTypes";
5
- export * from "./store";
6
- export * from "./types";
7
- export * from "./actions";
@@ -1,4 +0,0 @@
1
- import { ActionWithPayload, FormState } from "./types";
2
- /** Form reducer function */
3
- export default function (state: FormState | undefined, action: ActionWithPayload): FormState;
4
- //# sourceMappingURL=reducer.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"reducer.d.ts","sourceRoot":"","sources":["../../../../src/components/form/redux/reducer.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,iBAAiB,EAAmB,SAAS,EAAc,MAAM,SAAS,CAAC;AAapF,4BAA4B;AAC5B,MAAM,CAAC,OAAO,WAAW,KAAK,uBAAe,EAAE,MAAM,EAAE,iBAAiB,GAAG,SAAS,CA6GnF"}
@@ -1,103 +0,0 @@
1
- import { isNullOrUndefined } from "@bodynarf/utils";
2
- import { FormItemValidationState } from "../types";
3
- import { FormPurityState } from "./types";
4
- import { initForm, setFieldValue, setFormStatus, setValidationResult } from "./actionTypes";
5
- import { map as mapFormItems, validateItem } from "./utils";
6
- /** Initial form state values */
7
- const initialState = {
8
- state: "init",
9
- initialConfig: undefined,
10
- items: [],
11
- valuesStorage: [],
12
- purityState: FormPurityState.Pure,
13
- };
14
- /** Form reducer function */
15
- export default function (state = initialState, action) {
16
- switch (action.type) {
17
- case setFormStatus: {
18
- const newStatus = action.payload["newState"];
19
- if (isNullOrUndefined(newStatus)) {
20
- return state;
21
- }
22
- return {
23
- ...state,
24
- state: newStatus,
25
- };
26
- }
27
- case initForm: {
28
- const config = action.payload["initialConfig"];
29
- if (isNullOrUndefined(config)) {
30
- return state;
31
- }
32
- const formConfig = mapFormItems(config.items);
33
- return {
34
- ...state,
35
- state: "idle",
36
- initialConfig: config,
37
- items: formConfig.map((x, i) => ({ ...x, order: i })),
38
- valuesStorage: [],
39
- };
40
- }
41
- case setFieldValue: {
42
- const { name, value } = action.payload["field"];
43
- const item = state.items.find(item => item.name === name);
44
- if (isNullOrUndefined(item)) {
45
- return state;
46
- }
47
- item.modelConfig.value = value;
48
- const purityState = state.purityState === FormPurityState.Pure && value !== item.modelConfig.defaultValue
49
- ? state.purityState
50
- : FormPurityState.Dirty;
51
- if (state.state === "validation errors") {
52
- const validationResult = validateItem(item, value);
53
- if (validationResult.state !== FormItemValidationState.Invalid) {
54
- item.modelConfig.validationState = FormItemValidationState.None;
55
- item.modelConfig.validationMessages = [];
56
- }
57
- else {
58
- item.modelConfig.validationMessages = validationResult.messages;
59
- item.modelConfig.validationState = validationResult.state;
60
- }
61
- }
62
- const updatedItems = [
63
- ...state.items.filter(({ name }) => name !== item.name),
64
- item
65
- ].sort((x, y) => x.order - y.order);
66
- return {
67
- ...state,
68
- purityState: purityState,
69
- items: updatedItems
70
- };
71
- }
72
- case setValidationResult: {
73
- const validationResult = action.payload["validationResult"];
74
- state.valuesStorage.length = 0;
75
- let currentState = FormItemValidationState.Valid;
76
- const values = [];
77
- for (let [key, value] of validationResult) {
78
- const item = state.items.find(({ name }) => name === key);
79
- item.modelConfig.validationState = value.state;
80
- item.modelConfig.validationMessages.length = 0;
81
- item.modelConfig.validationMessages.push(...value.messages);
82
- if (value.state === FormItemValidationState.Invalid) {
83
- currentState = FormItemValidationState.Invalid;
84
- }
85
- if (currentState !== FormItemValidationState.Invalid
86
- && value.state !== FormItemValidationState.Invalid) {
87
- values.push({
88
- key,
89
- type: item.modelConfig.type,
90
- value: item.modelConfig.value,
91
- });
92
- }
93
- }
94
- return {
95
- ...state,
96
- state: currentState === FormItemValidationState.Valid ? "submited" : "validation errors",
97
- valuesStorage: currentState === FormItemValidationState.Valid ? values : [],
98
- };
99
- }
100
- default:
101
- return state;
102
- }
103
- }
@@ -1,5 +0,0 @@
1
- declare const _default: import("redux").Store<import("./types").FormState, import("./types").ActionWithPayload> & {
2
- dispatch: unknown;
3
- };
4
- export default _default;
5
- //# sourceMappingURL=store.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../../../src/components/form/redux/store.ts"],"names":[],"mappings":";;;AAKA,wBAGE"}
@@ -1,4 +0,0 @@
1
- import { createStore, applyMiddleware } from "redux";
2
- import thunkMiddleware from 'redux-thunk';
3
- import rootReducer from "./reducer";
4
- export default createStore(rootReducer, applyMiddleware(thunkMiddleware));
@@ -1,9 +0,0 @@
1
- import { AnyAction } from "redux";
2
- /** Redux action with some extra payload */
3
- export interface ActionWithPayload extends AnyAction {
4
- /** Action payload data */
5
- payload: {
6
- [extraProps: string]: unknown;
7
- };
8
- }
9
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../src/components/form/redux/types/base/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC,2CAA2C;AAC3C,MAAM,WAAW,iBAAkB,SAAQ,SAAS;IAChD,0BAA0B;IAC1B,OAAO,EAAE;QACL,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC;KACjC,CAAC;CACL"}
@@ -1,2 +0,0 @@
1
- ;
2
- export {};
@@ -1,10 +0,0 @@
1
- /** Form field value */
2
- export interface FieldValue {
3
- /** Field name */
4
- key: string;
5
- /** Field value data type */
6
- type: string;
7
- /** Last field value */
8
- value: any;
9
- }
10
- //# sourceMappingURL=fieldValue.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"fieldValue.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/redux/types/fieldValue.ts"],"names":[],"mappings":"AAAA,uBAAuB;AACvB,MAAM,WAAW,UAAU;IACvB,iBAAiB;IACjB,GAAG,EAAE,MAAM,CAAC;IAEZ,4BAA4B;IAC5B,IAAI,EAAE,MAAM,CAAC;IAEb,uBAAuB;IACvB,KAAK,EAAE,GAAG,CAAC;CACd"}
@@ -1 +0,0 @@
1
- export {};
@@ -1,4 +0,0 @@
1
- export * from "./state";
2
- export * from "./base/types";
3
- export * from "./fieldValue";
4
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/redux/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC"}
@@ -1,3 +0,0 @@
1
- export * from "./state";
2
- export * from "./base/types";
3
- export * from "./fieldValue";
@@ -1,37 +0,0 @@
1
- import { FormConfig, ExtendedFormItem } from "../../types";
2
- import { FieldValue } from "./fieldValue";
3
- /**
4
- * Form status
5
- * @description Represents form current lifecycle stage
6
- */
7
- export declare type FormStatus = "init" | "idle" | "validating" | "submited" | "validation errors";
8
- /**
9
- * Form purity state.
10
- * Represent form state whenever user changed any field value
11
- */
12
- export declare enum FormPurityState {
13
- /** Form is pure, none fields was changed */
14
- Pure = 0,
15
- /** Form is dirty, some of fields was touched by user and value was changed */
16
- Dirty = 1
17
- }
18
- /** Form state */
19
- export interface FormState {
20
- /** Current state */
21
- state: FormStatus;
22
- /** Form items */
23
- items: Array<ExtendedFormItemInState<any, any>>;
24
- /** Form configuration */
25
- initialConfig: FormConfig | undefined;
26
- /** Valid form values */
27
- valuesStorage: Array<FieldValue>;
28
- /** Current purity state */
29
- purityState: FormPurityState;
30
- }
31
- /** Extension of form item to store order */
32
- interface ExtendedFormItemInState<TValue, TExtension> extends ExtendedFormItem<TValue, TExtension> {
33
- /** Order in initial config */
34
- order: number;
35
- }
36
- export {};
37
- //# sourceMappingURL=state.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/redux/types/state.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C;;;EAGE;AACF,oBAAY,UAAU,GAChB,MAAM,GACN,MAAM,GACN,YAAY,GACZ,UAAU,GACV,mBAAmB,CACpB;AAEL;;;GAGG;AACH,oBAAY,eAAe;IACvB,4CAA4C;IAC5C,IAAI,IAAI;IAER,8EAA8E;IAC9E,KAAK,IAAI;CACZ;AAED,iBAAiB;AACjB,MAAM,WAAW,SAAS;IACtB,oBAAoB;IACpB,KAAK,EAAE,UAAU,CAAC;IAElB,iBAAiB;IACjB,KAAK,EAAE,KAAK,CAAC,uBAAuB,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;IAEhD,yBAAyB;IACzB,aAAa,EAAE,UAAU,GAAG,SAAS,CAAC;IAEtC,wBAAwB;IACxB,aAAa,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC;IAEjC,2BAA2B;IAC3B,WAAW,EAAE,eAAe,CAAC;CAChC;AAED,4CAA4C;AAC5C,UAAU,uBAAuB,CAAC,MAAM,EAAE,UAAU,CAAE,SAAQ,gBAAgB,CAAC,MAAM,EAAE,UAAU,CAAC;IAC9F,8BAA8B;IAC9B,KAAK,EAAE,MAAM,CAAC;CACjB"}
@@ -1,12 +0,0 @@
1
- /**
2
- * Form purity state.
3
- * Represent form state whenever user changed any field value
4
- */
5
- export var FormPurityState;
6
- (function (FormPurityState) {
7
- /** Form is pure, none fields was changed */
8
- FormPurityState[FormPurityState["Pure"] = 0] = "Pure";
9
- /** Form is dirty, some of fields was touched by user and value was changed */
10
- FormPurityState[FormPurityState["Dirty"] = 1] = "Dirty";
11
- })(FormPurityState || (FormPurityState = {}));
12
- ;
@@ -1,3 +0,0 @@
1
- export * from "./mapper";
2
- export * from "./validate";
3
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/redux/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC"}
@@ -1,2 +0,0 @@
1
- export * from "./mapper";
2
- export * from "./validate";
@@ -1,16 +0,0 @@
1
- import { Field, ExtendedFormItem } from "../../types";
2
- /**
3
- * @public
4
- * Map external config to internal model
5
- * @param items Form items from external config
6
- * @returns Form items for internal use
7
- */
8
- export declare const map: (items: Array<Field<any>>) => Array<ExtendedFormItem<any, any>>;
9
- /**
10
- * @public
11
- * Map external config to internal model
12
- * @param item Form item from external config
13
- * @returns Form item for internal use
14
- */
15
- export declare const mapItem: (item: Field<any>) => ExtendedFormItem<any, any>;
16
- //# sourceMappingURL=mapper.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"mapper.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/redux/utils/mapper.ts"],"names":[],"mappings":"AAEA,OAAO,EACQ,KAAK,EAAa,gBAAgB,EAEhD,MAAM,aAAa,CAAC;AAIrB;;;;;GAKG;AACH,eAAO,MAAM,GAAG,UAAW,MAAM,MAAM,GAAG,CAAC,CAAC,KAAG,MAAM,iBAAiB,GAAG,EAAE,GAAG,CAAC,CAE9E,CAAC;AAgCF;;;;;GAKG;AACH,eAAO,MAAM,OAAO,SAAU,MAAM,GAAG,CAAC,KAAG,iBAAiB,GAAG,EAAE,GAAG,CA0CnE,CAAC"}