@tsed/react-formio 1.14.0 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (175) hide show
  1. package/coverage.json +4 -4
  2. package/dist/index.d.ts +3 -2
  3. package/dist/index.js +1278 -3685
  4. package/dist/index.js.map +1 -1
  5. package/dist/index.modern.js +957 -2768
  6. package/dist/index.modern.js.map +1 -1
  7. package/package.json +4 -5
  8. package/readme.md +9 -57
  9. package/src/components/form-edit/useFormEdit.hook.ts +2 -1
  10. package/src/components/input-tags/inputTags.component.tsx +1 -1
  11. package/src/components/select/select.component.tsx +1 -1
  12. package/src/components/table/filters/sliderColumnFilter.component.tsx +2 -2
  13. package/src/index.ts +3 -2
  14. package/dist/stores/action/action.actions.d.ts +0 -9
  15. package/dist/stores/action/action.actions.spec.d.ts +0 -1
  16. package/dist/stores/action/action.constant.d.ts +0 -1
  17. package/dist/stores/action/action.reducers.d.ts +0 -7
  18. package/dist/stores/action/action.reducers.spec.d.ts +0 -1
  19. package/dist/stores/action/action.selectors.d.ts +0 -2
  20. package/dist/stores/action/action.selectors.spec.d.ts +0 -1
  21. package/dist/stores/action/index.d.ts +0 -4
  22. package/dist/stores/action-info/action-info.actions.d.ts +0 -5
  23. package/dist/stores/action-info/action-info.actions.spec.d.ts +0 -1
  24. package/dist/stores/action-info/action-info.constant.d.ts +0 -1
  25. package/dist/stores/action-info/action-info.reducers.d.ts +0 -7
  26. package/dist/stores/action-info/action-info.reducers.spec.d.ts +0 -1
  27. package/dist/stores/action-info/action-info.selectors.d.ts +0 -2
  28. package/dist/stores/action-info/action-info.selectors.spec.d.ts +0 -1
  29. package/dist/stores/action-info/index.d.ts +0 -4
  30. package/dist/stores/actions/actions.actions.d.ts +0 -5
  31. package/dist/stores/actions/actions.actions.spec.d.ts +0 -1
  32. package/dist/stores/actions/actions.constant.d.ts +0 -1
  33. package/dist/stores/actions/actions.reducers.d.ts +0 -8
  34. package/dist/stores/actions/actions.reducers.spec.d.ts +0 -1
  35. package/dist/stores/actions/actions.selectors.d.ts +0 -2
  36. package/dist/stores/actions/actions.selectors.spec.d.ts +0 -1
  37. package/dist/stores/actions/index.d.ts +0 -4
  38. package/dist/stores/auth/auth.actions.d.ts +0 -9
  39. package/dist/stores/auth/auth.constant.d.ts +0 -1
  40. package/dist/stores/auth/auth.reducers.d.ts +0 -16
  41. package/dist/stores/auth/auth.reducers.spec.d.ts +0 -1
  42. package/dist/stores/auth/auth.selectors.d.ts +0 -6
  43. package/dist/stores/auth/auth.selectors.spec.d.ts +0 -1
  44. package/dist/stores/auth/auth.utils.d.ts +0 -6
  45. package/dist/stores/auth/auth.utils.spec.d.ts +0 -1
  46. package/dist/stores/auth/getAccess.action.d.ts +0 -1
  47. package/dist/stores/auth/getAccess.action.spec.d.ts +0 -1
  48. package/dist/stores/auth/getProjectAccess.action.d.ts +0 -1
  49. package/dist/stores/auth/index.d.ts +0 -10
  50. package/dist/stores/auth/initAuth.action.d.ts +0 -1
  51. package/dist/stores/auth/initAuth.action.spec.d.ts +0 -1
  52. package/dist/stores/auth/logout.action.d.ts +0 -1
  53. package/dist/stores/auth/logout.action.spec.d.ts +0 -1
  54. package/dist/stores/auth/setUser.action.d.ts +0 -1
  55. package/dist/stores/auth/setUser.action.spec.d.ts +0 -1
  56. package/dist/stores/form/form.actions.d.ts +0 -10
  57. package/dist/stores/form/form.actions.spec.d.ts +0 -1
  58. package/dist/stores/form/form.reducers.d.ts +0 -9
  59. package/dist/stores/form/form.reducers.spec.d.ts +0 -1
  60. package/dist/stores/form/form.selectors.d.ts +0 -2
  61. package/dist/stores/form/form.selectors.spec.d.ts +0 -1
  62. package/dist/stores/form/index.d.ts +0 -3
  63. package/dist/stores/forms/forms.actions.d.ts +0 -9
  64. package/dist/stores/forms/forms.actions.spec.d.ts +0 -1
  65. package/dist/stores/forms/forms.reducers.d.ts +0 -16
  66. package/dist/stores/forms/forms.reducers.spec.d.ts +0 -1
  67. package/dist/stores/forms/forms.selectors.d.ts +0 -10
  68. package/dist/stores/forms/forms.selectors.spec.d.ts +0 -1
  69. package/dist/stores/forms/index.d.ts +0 -3
  70. package/dist/stores/index.d.ts +0 -10
  71. package/dist/stores/index.spec.d.ts +0 -1
  72. package/dist/stores/root/index.d.ts +0 -1
  73. package/dist/stores/root/root.selectors.d.ts +0 -5
  74. package/dist/stores/root/root.selectors.spec.d.ts +0 -1
  75. package/dist/stores/submission/index.d.ts +0 -3
  76. package/dist/stores/submission/submission.actions.d.ts +0 -10
  77. package/dist/stores/submission/submission.actions.spec.d.ts +0 -1
  78. package/dist/stores/submission/submission.reducers.d.ts +0 -11
  79. package/dist/stores/submission/submission.reducers.spec.d.ts +0 -1
  80. package/dist/stores/submission/submission.selectors.d.ts +0 -2
  81. package/dist/stores/submission/submission.selectors.spec.d.ts +0 -1
  82. package/dist/stores/submissions/index.d.ts +0 -3
  83. package/dist/stores/submissions/submissions.actions.d.ts +0 -6
  84. package/dist/stores/submissions/submissions.actions.spec.d.ts +0 -1
  85. package/dist/stores/submissions/submissions.reducers.d.ts +0 -17
  86. package/dist/stores/submissions/submissions.reducers.spec.d.ts +0 -1
  87. package/dist/stores/submissions/submissions.selectors.d.ts +0 -9
  88. package/dist/stores/submissions/submissions.selectors.spec.d.ts +0 -1
  89. package/dist/utils/clean.d.ts +0 -1
  90. package/dist/utils/clean.test.d.ts +0 -1
  91. package/dist/utils/mapRequestParams.d.ts +0 -9
  92. package/dist/utils/mapRequestParams.test.d.ts +0 -1
  93. package/dist/utils/url.d.ts +0 -3
  94. package/dist/utils/url.test.d.ts +0 -1
  95. package/src/stores/action/action.actions.spec.ts +0 -114
  96. package/src/stores/action/action.actions.ts +0 -82
  97. package/src/stores/action/action.constant.ts +0 -1
  98. package/src/stores/action/action.reducers.spec.ts +0 -91
  99. package/src/stores/action/action.reducers.ts +0 -54
  100. package/src/stores/action/action.selectors.spec.ts +0 -19
  101. package/src/stores/action/action.selectors.ts +0 -6
  102. package/src/stores/action/index.ts +0 -4
  103. package/src/stores/action-info/action-info.actions.spec.ts +0 -46
  104. package/src/stores/action-info/action-info.actions.ts +0 -32
  105. package/src/stores/action-info/action-info.constant.ts +0 -1
  106. package/src/stores/action-info/action-info.reducers.spec.ts +0 -60
  107. package/src/stores/action-info/action-info.reducers.ts +0 -44
  108. package/src/stores/action-info/action-info.selectors.spec.ts +0 -19
  109. package/src/stores/action-info/action-info.selectors.ts +0 -7
  110. package/src/stores/action-info/index.ts +0 -4
  111. package/src/stores/actions/actions.actions.spec.ts +0 -62
  112. package/src/stores/actions/actions.actions.ts +0 -34
  113. package/src/stores/actions/actions.constant.ts +0 -1
  114. package/src/stores/actions/actions.reducers.spec.ts +0 -62
  115. package/src/stores/actions/actions.reducers.ts +0 -48
  116. package/src/stores/actions/actions.selectors.spec.ts +0 -34
  117. package/src/stores/actions/actions.selectors.ts +0 -7
  118. package/src/stores/actions/index.ts +0 -4
  119. package/src/stores/auth/auth.actions.ts +0 -13
  120. package/src/stores/auth/auth.constant.ts +0 -1
  121. package/src/stores/auth/auth.reducers.spec.ts +0 -376
  122. package/src/stores/auth/auth.reducers.ts +0 -151
  123. package/src/stores/auth/auth.selectors.spec.ts +0 -47
  124. package/src/stores/auth/auth.selectors.ts +0 -14
  125. package/src/stores/auth/auth.utils.spec.ts +0 -29
  126. package/src/stores/auth/auth.utils.tsx +0 -37
  127. package/src/stores/auth/getAccess.action.spec.ts +0 -257
  128. package/src/stores/auth/getAccess.action.ts +0 -57
  129. package/src/stores/auth/getProjectAccess.action.ts +0 -25
  130. package/src/stores/auth/index.ts +0 -10
  131. package/src/stores/auth/initAuth.action.spec.ts +0 -56
  132. package/src/stores/auth/initAuth.action.ts +0 -29
  133. package/src/stores/auth/logout.action.spec.ts +0 -25
  134. package/src/stores/auth/logout.action.ts +0 -9
  135. package/src/stores/auth/setUser.action.spec.ts +0 -25
  136. package/src/stores/auth/setUser.action.ts +0 -9
  137. package/src/stores/form/form.actions.spec.ts +0 -203
  138. package/src/stores/form/form.actions.ts +0 -84
  139. package/src/stores/form/form.reducers.spec.ts +0 -78
  140. package/src/stores/form/form.reducers.ts +0 -59
  141. package/src/stores/form/form.selectors.spec.ts +0 -19
  142. package/src/stores/form/form.selectors.ts +0 -5
  143. package/src/stores/form/index.ts +0 -3
  144. package/src/stores/forms/forms.actions.spec.ts +0 -91
  145. package/src/stores/forms/forms.actions.ts +0 -44
  146. package/src/stores/forms/forms.reducers.spec.ts +0 -97
  147. package/src/stores/forms/forms.reducers.ts +0 -77
  148. package/src/stores/forms/forms.selectors.spec.ts +0 -39
  149. package/src/stores/forms/forms.selectors.ts +0 -6
  150. package/src/stores/forms/index.ts +0 -3
  151. package/src/stores/index.spec.ts +0 -125
  152. package/src/stores/index.ts +0 -33
  153. package/src/stores/root/index.ts +0 -1
  154. package/src/stores/root/root.selectors.spec.ts +0 -94
  155. package/src/stores/root/root.selectors.ts +0 -23
  156. package/src/stores/submission/index.ts +0 -3
  157. package/src/stores/submission/submission.actions.spec.ts +0 -214
  158. package/src/stores/submission/submission.actions.ts +0 -81
  159. package/src/stores/submission/submission.reducers.spec.ts +0 -96
  160. package/src/stores/submission/submission.reducers.ts +0 -70
  161. package/src/stores/submission/submission.selectors.spec.ts +0 -19
  162. package/src/stores/submission/submission.selectors.ts +0 -5
  163. package/src/stores/submissions/index.ts +0 -3
  164. package/src/stores/submissions/submissions.actions.spec.ts +0 -99
  165. package/src/stores/submissions/submissions.actions.ts +0 -38
  166. package/src/stores/submissions/submissions.reducers.spec.ts +0 -98
  167. package/src/stores/submissions/submissions.reducers.ts +0 -78
  168. package/src/stores/submissions/submissions.selectors.spec.ts +0 -39
  169. package/src/stores/submissions/submissions.selectors.ts +0 -6
  170. package/src/utils/clean.test.ts +0 -7
  171. package/src/utils/clean.ts +0 -12
  172. package/src/utils/mapRequestParams.test.ts +0 -81
  173. package/src/utils/mapRequestParams.ts +0 -36
  174. package/src/utils/url.test.ts +0 -31
  175. package/src/utils/url.ts +0 -23
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tsed/react-formio",
3
- "version": "1.14.0",
3
+ "version": "2.0.0",
4
4
  "description": "Provide a react formio wrapper. Written in TypeScript.",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.modern.js",
@@ -14,12 +14,11 @@
14
14
  "watch": "microbundle watch --no-compress --format modern,cjs --jsx React.createElement --jsxFragment React.Fragment --globals react/jsx-runtime=jsx"
15
15
  },
16
16
  "dependencies": {
17
- "@tsed/redux-utils": "1.14.0",
18
17
  "eventemitter2": "^6.4.3",
19
18
  "prop-types": "^15.7.2"
20
19
  },
21
20
  "peerDependencies": {
22
- "choices.js": ">=9.0.1",
21
+ "@formio/choices.js": ">=10.2.0",
23
22
  "formiojs": ">=4.0.0",
24
23
  "lodash": ">=4.17.20",
25
24
  "prop-types": ">=15.7.2",
@@ -29,8 +28,8 @@
29
28
  "tooltip.js": ">=1.3.3"
30
29
  },
31
30
  "devDependencies": {
32
- "@tsed/tailwind": "1.14.0",
33
- "@tsed/tailwind-formio": "1.14.0"
31
+ "@tsed/tailwind": "2.0.0",
32
+ "@tsed/tailwind-formio": "2.0.0"
34
33
  },
35
34
  "repository": "https://github.com/TypedProject/tsed-formio",
36
35
  "bugs": {
package/readme.md CHANGED
@@ -53,6 +53,15 @@ See our [storybook](https://formio.tsed.io/) to see all available components.
53
53
  - TypeScript support.
54
54
  - Tailwind support.
55
55
 
56
+ ## Migrate from v1
57
+
58
+ If you use redux actions from v1, you have to install `@tsed/redux-formio-stores` and remplace your imports:
59
+
60
+ ```diff
61
+ - import { defaultFormioReducer, formsReducer } from "@tsed/react-formio";
62
+ + import { defaultFormioReducer, formsReducer } from "@tsed/react-formio-stores";
63
+ ```
64
+
56
65
  ## Install
57
66
 
58
67
  `@tsed/react-formio` can be used on the server, or bundled for the client using an
@@ -262,63 +271,6 @@ The submisison grid will render a list of submissions and allow clicking on one
262
271
  | `data` | array of submissions | [] | A list of submissions to be rendered in the grid. |
263
272
  | `form` | object | {} | The form definition for the submissions. This is used to render the submissions. |
264
273
 
265
- ## Redux
266
-
267
- @tsed/react-formio contain Redux actions, reducers and selectors to simplify the API requests made for `form.io` forms.
268
- reducers, actions and selectors.
269
- The following reducers have names:
270
-
271
- - formsReducers: manage the forms,
272
- - formReducers: manage the current form,
273
- - submissionsReducers: manage the submissions of a form.
274
- - submissionReducers: manage the current submission of a form
275
-
276
- This provides namespaces so the same actions and reducers can be re-used within the same redux state.
277
-
278
- In addition, the package provides the follwing reducers
279
-
280
- - actionsReducers: Manage actions of a form.
281
- - actionReducers: Manage the current action of a form.
282
- - actionInfoReducers: Manage the available actions for all forms and resources.
283
- - authReducers: Manage formio authentication.
284
-
285
- By default, `@tsed/react-formio` provides defaults combined reducers as following:
286
-
287
- ```typescript
288
- export const defaultFormioReducer = combine(
289
- authReducer,
290
- actionsReducer,
291
- actionReducer,
292
- actionInfoReducer,
293
- formReducer("form"),
294
- formsReducer("forms", { query: { type: "form" } }),
295
- formReducer("resource"),
296
- formsReducer("resources", { query: { type: "resource" } }),
297
- submissionReducer("submission"),
298
- submissionsReducer("submissions")
299
- );
300
- ```
301
-
302
- This `defaultFormioReducer` can be added and configured in your rootReducer as following :
303
-
304
- ```typescript
305
- import { combine } from "@tsed/redux-utils";
306
- import { defaultFormioReducer, formsReducer } from "@tsed/react-formio";
307
- import { connectRouter } from "connected-react-router";
308
- import { combineReducers } from "redux";
309
-
310
- export const rootReducers = (history: any) =>
311
- combineReducers({
312
- router: connectRouter(history),
313
- ...defaultFormioReducer,
314
- // override defaultFormioReducer can done as following
315
- ...combine(
316
- formsReducer("forms", { query: { type: "form", tags: ["common"] } }), // return only forms with the common tags
317
- formsReducer("resources", { query: { type: "resource", tags: ["common"] } }) // return only resources with the common tags
318
- )
319
- });
320
- ```
321
-
322
274
  ## Contributors
323
275
 
324
276
  Please read [contributing guidelines here](./CONTRIBUTING.md).
@@ -1,3 +1,4 @@
1
+ import cloneDeep from "lodash/cloneDeep";
1
2
  import { useEffect, useReducer } from "react";
2
3
 
3
4
  import { FormSchema } from "../../interfaces/FormSchema";
@@ -47,7 +48,7 @@ export function useFormEdit(props: UseFormEditHookProps) {
47
48
  };
48
49
 
49
50
  return {
50
- form: current,
51
+ form: cloneDeep(current),
51
52
  redo,
52
53
  undo,
53
54
  reset,
@@ -1,4 +1,4 @@
1
- import Choices from "choices.js";
1
+ import Choices from "@formio/choices.js";
2
2
  import uniq from "lodash/uniq";
3
3
  import PropTypes from "prop-types";
4
4
  import React, { useEffect, useRef } from "react";
@@ -1,4 +1,4 @@
1
- import Choices from "choices.js";
1
+ import Choices from "@formio/choices.js";
2
2
  import classnames from "classnames";
3
3
  import PropTypes from "prop-types";
4
4
  import React, { ReactElement, useEffect, useRef } from "react";
@@ -8,8 +8,8 @@ export function SliderColumnFilter<D extends Record<string, unknown> = {}>({
8
8
  let min = preFilteredRows.length ? preFilteredRows[0].values[id] : 0;
9
9
  let max = preFilteredRows.length ? preFilteredRows[0].values[id] : 0;
10
10
  preFilteredRows.forEach((row) => {
11
- min = Math.min(row.values[id], min);
12
- max = Math.max(row.values[id], max);
11
+ min = Math.min(row?.values[id], min);
12
+ max = Math.max(row?.values[id], max);
13
13
  });
14
14
  return [min, max];
15
15
  }, [id, preFilteredRows]);
package/src/index.ts CHANGED
@@ -13,7 +13,8 @@ export {
13
13
  export * from "./components";
14
14
  export * from "./hooks/useTooltip";
15
15
  export * from "./interfaces";
16
- export * from "./stores";
16
+ export * from "./utils/callLast";
17
17
  export * from "./utils/iconClass";
18
- export * from "./utils/url";
18
+ export * from "./utils/mapPagination";
19
+ export * from "./utils/stopPropagationWrapper";
19
20
  export { Components, Formio, Templates, Utils } from "formiojs";
@@ -1,9 +0,0 @@
1
- export declare const clearActionError: import("@tsed/redux-utils").ActionReducer<any>;
2
- export declare const resetAction: import("@tsed/redux-utils").ActionReducer<any>;
3
- export declare const requestAction: import("@tsed/redux-utils").ActionReducer<any>;
4
- export declare const receiveAction: import("@tsed/redux-utils").ActionReducer<any>;
5
- export declare const failAction: import("@tsed/redux-utils").ActionReducer<any>;
6
- export declare const sendAction: import("@tsed/redux-utils").ActionReducer<any>;
7
- export declare const getAction: (formId: string, actionId: string, done?: (...args: any[]) => void) => (dispatch: any) => Promise<void>;
8
- export declare const saveAction: (formId: string, action: any, done?: (...args: any[]) => void) => (dispatch: any) => Promise<void>;
9
- export declare const deleteAction: (formId: string, actionId: string, done?: (...args: any[]) => void) => (dispatch: any) => Promise<void>;
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export declare const ACTION = "action";
@@ -1,7 +0,0 @@
1
- import { ActionSchema } from "../../interfaces";
2
- export interface ActionState {
3
- error: null | Error;
4
- data: ActionSchema;
5
- isActive: boolean;
6
- }
7
- export declare const actionReducer: import("@tsed/redux-utils").ReduceFunction<any, any>;
@@ -1 +0,0 @@
1
- export {};
@@ -1,2 +0,0 @@
1
- import { ActionSchema } from "../../interfaces";
2
- export declare const selectAction: (state: Record<string, any>) => ActionSchema;
@@ -1 +0,0 @@
1
- export {};
@@ -1,4 +0,0 @@
1
- export * from "./action.actions";
2
- export * from "./action.constant";
3
- export * from "./action.reducers";
4
- export * from "./action.selectors";
@@ -1,5 +0,0 @@
1
- export declare const resetActionInfo: import("@tsed/redux-utils").ActionReducer<any>;
2
- export declare const requestActionInfo: import("@tsed/redux-utils").ActionReducer<any>;
3
- export declare const receiveActionInfo: import("@tsed/redux-utils").ActionReducer<any>;
4
- export declare const failActionInfo: import("@tsed/redux-utils").ActionReducer<any>;
5
- export declare const getActionInfo: (formId: string, actionType: string, done?: (...args: any[]) => void) => (dispatch: any) => Promise<void>;
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export declare const ACTION_INFO = "actionInfo";
@@ -1,7 +0,0 @@
1
- import { ActionSchema } from "../../interfaces";
2
- export interface ActionInfoState {
3
- error: null | Error;
4
- data?: Partial<ActionSchema>;
5
- isActive: boolean;
6
- }
7
- export declare const actionInfoReducer: import("@tsed/redux-utils").ReduceFunction<any, any>;
@@ -1,2 +0,0 @@
1
- import { ActionSchema } from "../../interfaces";
2
- export declare const selectActionInfo: (state: Record<string, any>) => Partial<ActionSchema>;
@@ -1,4 +0,0 @@
1
- export * from "./action-info.actions";
2
- export * from "./action-info.constant";
3
- export * from "./action-info.reducers";
4
- export * from "./action-info.selectors";
@@ -1,5 +0,0 @@
1
- export declare const resetActions: import("@tsed/redux-utils").ActionReducer<any>;
2
- export declare const requestActions: import("@tsed/redux-utils").ActionReducer<any>;
3
- export declare const receiveActions: import("@tsed/redux-utils").ActionReducer<any>;
4
- export declare const failActions: import("@tsed/redux-utils").ActionReducer<any>;
5
- export declare const getActions: (id: string, done?: (...args: any[]) => void) => (dispatch: any) => Promise<void>;
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export declare const ACTIONS = "actions";
@@ -1,8 +0,0 @@
1
- import { ActionInfoSchema, ActionSchema } from "../../interfaces";
2
- export interface ActionsState {
3
- error: null | Error;
4
- data: ActionSchema[];
5
- availableActions: ActionInfoSchema[];
6
- isActive: boolean;
7
- }
8
- export declare const actionsReducer: import("@tsed/redux-utils").ReduceFunction<any, any>;
@@ -1 +0,0 @@
1
- export {};
@@ -1,2 +0,0 @@
1
- export declare const selectActions: (state: Record<string, any>) => import("../..").ActionSchema[];
2
- export declare const selectAvailableActions: (state: Record<string, any>) => import("../..").ActionInfoSchema[];
@@ -1 +0,0 @@
1
- export {};
@@ -1,4 +0,0 @@
1
- export * from "./actions.actions";
2
- export * from "./actions.constant";
3
- export * from "./actions.reducers";
4
- export * from "./actions.selectors";
@@ -1,9 +0,0 @@
1
- export declare const requestUser: import("@tsed/redux-utils").ActionReducer<any>;
2
- export declare const receiveUser: import("@tsed/redux-utils").ActionReducer<any>;
3
- export declare const failUser: import("@tsed/redux-utils").ActionReducer<any>;
4
- export declare const logoutUser: import("@tsed/redux-utils").ActionReducer<any>;
5
- export declare const submissionAccessUser: import("@tsed/redux-utils").ActionReducer<any>;
6
- export declare const formAccessUser: import("@tsed/redux-utils").ActionReducer<any>;
7
- export declare const projectAccessUser: import("@tsed/redux-utils").ActionReducer<any>;
8
- export declare const userRoles: import("@tsed/redux-utils").ActionReducer<any>;
9
- export declare const userForms: import("@tsed/redux-utils").ActionReducer<any>;
@@ -1 +0,0 @@
1
- export declare const AUTH = "auth";
@@ -1,16 +0,0 @@
1
- import { FormSchema, Submission } from "../../interfaces";
2
- import { RoleSchema } from "../../interfaces/RoleSchema";
3
- export interface AuthState<User = any> {
4
- init: boolean;
5
- isActive: boolean;
6
- user: null | Submission<User>;
7
- authenticated: boolean;
8
- projectAccess: Record<string, string[]>;
9
- formAccess: Record<string, string[]>;
10
- submissionAccess: Record<string, string[]>;
11
- roles: Record<string, RoleSchema>;
12
- forms: Record<string, FormSchema>;
13
- is: Record<string, boolean>;
14
- error: null | Error;
15
- }
16
- export declare const authReducer: import("@tsed/redux-utils").ReduceFunction<any, any>;
@@ -1 +0,0 @@
1
- export {};
@@ -1,6 +0,0 @@
1
- import { RoleSchema, Submission } from "../../interfaces";
2
- import { AuthState } from "./auth.reducers";
3
- export declare const selectAuth: (state: any) => AuthState<any>;
4
- export declare const selectUser: <User = any>(state: any) => Submission<User> | null;
5
- export declare const selectRoles: (state: any) => Record<string, RoleSchema>;
6
- export declare const selectIsAuthenticated: (state: any) => boolean;
@@ -1 +0,0 @@
1
- export {};
@@ -1,6 +0,0 @@
1
- import { FormSchema } from "../../interfaces/FormSchema";
2
- import { AuthState } from "./auth.reducers";
3
- export declare function hasRole(auth: AuthState, role: string): boolean;
4
- export declare function hasRoles(auth: AuthState, roles: string[]): boolean;
5
- export declare function isAuthorized(auth: AuthState, roles?: string[]): boolean;
6
- export declare function checkRoleFormAccess(auth: AuthState, form?: Partial<FormSchema>, roles?: string[]): boolean;
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export declare function getAccess(dispatch: any): Promise<void>;
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export declare function getProjectAccess(dispatch: any): Promise<void>;
@@ -1,10 +0,0 @@
1
- export * from "./auth.actions";
2
- export * from "./auth.constant";
3
- export * from "./auth.reducers";
4
- export * from "./auth.selectors";
5
- export * from "./auth.utils";
6
- export * from "./getAccess.action";
7
- export * from "./getProjectAccess.action";
8
- export * from "./initAuth.action";
9
- export * from "./logout.action";
10
- export * from "./setUser.action";
@@ -1 +0,0 @@
1
- export declare const initAuth: (done?: (...args: any[]) => void) => (dispatch: any) => Promise<void>;
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export declare const logout: () => (dispatch: any) => Promise<void>;
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export declare const setUser: (user: any) => (dispatch: any) => void;
@@ -1 +0,0 @@
1
- export {};
@@ -1,10 +0,0 @@
1
- import { FormSchema } from "../../interfaces";
2
- export declare const clearFormError: import("@tsed/redux-utils").ActionReducer<any>;
3
- export declare const requestForm: import("@tsed/redux-utils").ActionReducer<any>;
4
- export declare const receiveForm: import("@tsed/redux-utils").ActionReducer<any>;
5
- export declare const failForm: import("@tsed/redux-utils").ActionReducer<any>;
6
- export declare const resetForm: import("@tsed/redux-utils").ActionReducer<any>;
7
- export declare const sendForm: import("@tsed/redux-utils").ActionReducer<any>;
8
- export declare const getForm: (name: string, id?: string, done?: (...args: any[]) => void) => (dispatch: any, getState: any) => Promise<void>;
9
- export declare const saveForm: (name: string, form: Partial<FormSchema>, done?: (...args: any[]) => void) => (dispatch: any) => Promise<void>;
10
- export declare const deleteForm: (name: string, id: string, done?: (...args: any[]) => void) => (dispatch: any) => Promise<void>;
@@ -1 +0,0 @@
1
- export {};
@@ -1,9 +0,0 @@
1
- import { FormSchema } from "../../interfaces";
2
- export interface FormState {
3
- error: null | Error;
4
- data?: Partial<FormSchema>;
5
- isActive: boolean;
6
- lastUpdated: number;
7
- url: string;
8
- }
9
- export declare const formReducer: import("@tsed/redux-utils").SandboxReducers<any, any>;
@@ -1 +0,0 @@
1
- export {};
@@ -1,2 +0,0 @@
1
- import { FormSchema } from "../../interfaces";
2
- export declare const selectForm: (name: string, state: any) => Partial<FormSchema>;
@@ -1 +0,0 @@
1
- export {};
@@ -1,3 +0,0 @@
1
- export * from "./form.actions";
2
- export * from "./form.reducers";
3
- export * from "./form.selectors";
@@ -1,9 +0,0 @@
1
- import { FormSchema } from "../../interfaces";
2
- import type { RequestParamsOptions } from "../../utils/mapRequestParams";
3
- export declare const resetForms: import("@tsed/redux-utils").ActionReducer<any>;
4
- export declare const requestForms: import("@tsed/redux-utils").ActionReducer<any>;
5
- export declare const receiveForms: import("@tsed/redux-utils").ActionReducer<any>;
6
- export declare const failForms: import("@tsed/redux-utils").ActionReducer<any>;
7
- export declare type GetFormsCB = (err: any, forms?: FormSchema[]) => void;
8
- export declare const getForms: (name: string, parameters: Partial<RequestParamsOptions>, done?: GetFormsCB) => (dispatch: any, getState: any) => Promise<void>;
9
- export declare const refreshForms: (name: string, done?: (...args: any[]) => void) => (dispatch: any, getState: any) => Promise<void>;
@@ -1 +0,0 @@
1
- export {};
@@ -1,16 +0,0 @@
1
- import { FormSchema } from "../../interfaces";
2
- export interface FormsState {
3
- error: null | Error;
4
- isActive: boolean;
5
- parameters: {
6
- pageSize: number;
7
- pageIndex: number;
8
- pageCount: number;
9
- query: any;
10
- select: any;
11
- sortBy: any[];
12
- filters: any[];
13
- };
14
- data: FormSchema[];
15
- }
16
- export declare const formsReducer: import("@tsed/redux-utils").SandboxReducers<any, any>;
@@ -1 +0,0 @@
1
- export {};
@@ -1,10 +0,0 @@
1
- export declare const selectForms: (name: string, state: any) => import("../..").FormSchema[];
2
- export declare const selectFormsParameters: (name: string, state: any) => {
3
- pageSize: number;
4
- pageIndex: number;
5
- pageCount: number;
6
- query: any;
7
- select: any;
8
- sortBy: any[];
9
- filters: any[];
10
- };
@@ -1 +0,0 @@
1
- export {};
@@ -1,3 +0,0 @@
1
- export * from "./forms.actions";
2
- export * from "./forms.reducers";
3
- export * from "./forms.selectors";
@@ -1,10 +0,0 @@
1
- export * from "./action";
2
- export * from "./action-info";
3
- export * from "./actions";
4
- export * from "./auth";
5
- export * from "./form";
6
- export * from "./forms";
7
- export * from "./root";
8
- export * from "./submission";
9
- export * from "./submissions";
10
- export declare const defaultFormioReducer: Record<string, import("@tsed/redux-utils").ReduceFunction<any, any>>;
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export * from "./root.selectors";
@@ -1,5 +0,0 @@
1
- export declare function selectRoot<State = Record<string, any>>(name: string): (state: Record<string, any>) => State;
2
- export declare function selectRoot<State = Record<string, any>>(name: string, state: Record<string, any>): State;
3
- export declare const selectError: (name: string, state: Record<string, any>) => null | Error;
4
- export declare const selectIsActive: (name: string, state: Record<string, any>) => boolean;
5
- export declare function oneOfIsActive(...names: string[]): (state: any) => boolean;
@@ -1 +0,0 @@
1
- export {};
@@ -1,3 +0,0 @@
1
- export * from "./submission.actions";
2
- export * from "./submission.reducers";
3
- export * from "./submission.selectors";
@@ -1,10 +0,0 @@
1
- import { Submission } from "../../interfaces";
2
- export declare const clearSubmissionError: import("@tsed/redux-utils").ActionReducer<any>;
3
- export declare const requestSubmission: import("@tsed/redux-utils").ActionReducer<any>;
4
- export declare const sendSubmission: import("@tsed/redux-utils").ActionReducer<any>;
5
- export declare const receiveSubmission: import("@tsed/redux-utils").ActionReducer<any>;
6
- export declare const failSubmission: import("@tsed/redux-utils").ActionReducer<any>;
7
- export declare const resetSubmission: import("@tsed/redux-utils").ActionReducer<any>;
8
- export declare const getSubmission: (name: string, formId: string, id: string, done?: (...args: any[]) => void) => (dispatch: any, getState: any) => Promise<void>;
9
- export declare const saveSubmission: (name: string, formId: string, data: Submission, done?: (...args: any[]) => void) => (dispatch: any) => Promise<void>;
10
- export declare const deleteSubmission: (name: string, formId: string, id: string, done?: (...args: any[]) => void) => (dispatch: any) => Promise<void>;
@@ -1 +0,0 @@
1
- export {};
@@ -1,11 +0,0 @@
1
- import { Submission } from "../../interfaces";
2
- export interface SubmissionState {
3
- formId: string;
4
- id: string;
5
- isActive: boolean;
6
- lastUpdated: number;
7
- data: Partial<Submission>;
8
- url: string;
9
- error: null | Error;
10
- }
11
- export declare const submissionReducer: import("@tsed/redux-utils").SandboxReducers<any, any>;
@@ -1 +0,0 @@
1
- export {};
@@ -1,2 +0,0 @@
1
- import { Submission } from "../../interfaces";
2
- export declare const selectSubmission: (name: string, state: any) => Partial<Submission>;
@@ -1 +0,0 @@
1
- export {};
@@ -1,3 +0,0 @@
1
- export * from "./submissions.actions";
2
- export * from "./submissions.reducers";
3
- export * from "./submissions.selectors";
@@ -1,6 +0,0 @@
1
- export declare const resetSubmissions: import("@tsed/redux-utils").ActionReducer<any>;
2
- export declare const requestSubmissions: import("@tsed/redux-utils").ActionReducer<any>;
3
- export declare const receiveSubmissions: import("@tsed/redux-utils").ActionReducer<any>;
4
- export declare const failSubmissions: import("@tsed/redux-utils").ActionReducer<any>;
5
- export declare const getSubmissions: (name: string, formId: string, parameters?: any, done?: (...args: any[]) => void) => (dispatch: any, getState: any) => Promise<void>;
6
- export declare const refreshSubmissions: (name: string, formId: string, done?: (...args: any[]) => void) => (dispatch: any, getState: any) => Promise<void>;
@@ -1 +0,0 @@
1
- export {};
@@ -1,17 +0,0 @@
1
- import { Submission } from "../../interfaces/Submission";
2
- export interface SubmissionsState {
3
- error: null | Error;
4
- formId: string;
5
- isActive: boolean;
6
- parameters: {
7
- pageSize: number;
8
- pageIndex: number;
9
- pageCount: number;
10
- query: any;
11
- select: any;
12
- sortBy: any[];
13
- };
14
- data: Submission[];
15
- }
16
- export declare function createInitialState({ pageIndex, pageSize, query, select, sortBy }?: any): SubmissionsState;
17
- export declare const submissionsReducer: import("@tsed/redux-utils").SandboxReducers<any, any>;
@@ -1,9 +0,0 @@
1
- export declare const selectSubmissions: (name: string, state: any) => import("../..").Submission<any>[];
2
- export declare const selectSubmissionsParameters: (name: string, state: any) => {
3
- pageSize: number;
4
- pageIndex: number;
5
- pageCount: number;
6
- query: any;
7
- select: any;
8
- sortBy: any[];
9
- };