@beinformed/ui 1.25.5 → 1.26.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +19 -0
- package/esm/hooks/useModularUIModel.js +7 -0
- package/esm/hooks/useModularUIModel.js.map +1 -1
- package/esm/hooks/useModularUIRequest.js +7 -5
- package/esm/hooks/useModularUIRequest.js.map +1 -1
- package/esm/models/attributes/ChoiceAttributeOptionCollection.js +3 -12
- package/esm/models/attributes/ChoiceAttributeOptionCollection.js.map +1 -1
- package/esm/modularui/ModularUIRequest.js +31 -0
- package/esm/modularui/ModularUIRequest.js.map +1 -1
- package/esm/react-server/serverNoSSR.js +2 -1
- package/esm/react-server/serverNoSSR.js.map +1 -1
- package/esm/react-server/serverUtil.js +31 -5
- package/esm/react-server/serverUtil.js.map +1 -1
- package/esm/redux/_modularui/ModularUIActions.js +7 -0
- package/esm/redux/_modularui/ModularUIActions.js.map +1 -1
- package/esm/redux/_modularui/ModularUIReducer.js +21 -1
- package/esm/redux/_modularui/ModularUIReducer.js.map +1 -1
- package/esm/redux/_modularui/types.js.map +1 -1
- package/esm/redux/store/configureStore.js +1 -1
- package/esm/redux/store/configureStore.js.map +1 -1
- package/esm/redux/types.js.map +1 -1
- package/lib/hooks/useModularUIModel.js +9 -1
- package/lib/hooks/useModularUIModel.js.flow +8 -0
- package/lib/hooks/useModularUIModel.js.map +1 -1
- package/lib/hooks/useModularUIRequest.js +7 -5
- package/lib/hooks/useModularUIRequest.js.flow +10 -11
- package/lib/hooks/useModularUIRequest.js.map +1 -1
- package/lib/models/attributes/ChoiceAttributeOptionCollection.js +3 -12
- package/lib/models/attributes/ChoiceAttributeOptionCollection.js.flow +3 -17
- package/lib/models/attributes/ChoiceAttributeOptionCollection.js.map +1 -1
- package/lib/modularui/ModularUIRequest.js +31 -0
- package/lib/modularui/ModularUIRequest.js.flow +39 -0
- package/lib/modularui/ModularUIRequest.js.map +1 -1
- package/lib/react-server/serverNoSSR.js +1 -0
- package/lib/react-server/serverNoSSR.js.flow +5 -0
- package/lib/react-server/serverNoSSR.js.map +1 -1
- package/lib/react-server/serverUtil.js +32 -5
- package/lib/react-server/serverUtil.js.flow +40 -6
- package/lib/react-server/serverUtil.js.map +1 -1
- package/lib/redux/_modularui/ModularUIActions.js +9 -1
- package/lib/redux/_modularui/ModularUIActions.js.flow +10 -0
- package/lib/redux/_modularui/ModularUIActions.js.map +1 -1
- package/lib/redux/_modularui/ModularUIReducer.js +21 -1
- package/lib/redux/_modularui/ModularUIReducer.js.flow +22 -0
- package/lib/redux/_modularui/ModularUIReducer.js.map +1 -1
- package/lib/redux/_modularui/types.js.flow +8 -0
- package/lib/redux/_modularui/types.js.map +1 -1
- package/lib/redux/store/configureStore.js +1 -1
- package/lib/redux/store/configureStore.js.flow +1 -1
- package/lib/redux/store/configureStore.js.map +1 -1
- package/lib/redux/types.js.flow +2 -0
- package/lib/redux/types.js.map +1 -1
- package/package.json +2 -2
- package/src/hooks/useModularUIModel.js +8 -0
- package/src/hooks/useModularUIRequest.js +10 -11
- package/src/models/attributes/ChoiceAttributeOptionCollection.js +3 -17
- package/src/modularui/ModularUIRequest.js +39 -0
- package/src/react-server/serverNoSSR.js +5 -0
- package/src/react-server/serverUtil.js +40 -6
- package/src/redux/_modularui/ModularUIActions.js +10 -0
- package/src/redux/_modularui/ModularUIReducer.js +22 -0
- package/src/redux/_modularui/types.js +8 -0
- package/src/redux/store/configureStore.js +1 -1
- package/src/redux/types.js +2 -0
- package/types/models/attributes/ChoiceAttributeOptionCollection.d.ts +0 -3
- package/types/modularui/ModularUIRequest.d.ts +18 -3
- package/types/redux/_modularui/types.d.ts +8 -0
- package/types/redux/types.d.ts +1 -1
- package/types/utils/fetch/types.d.ts +1 -0
|
@@ -36,6 +36,14 @@ export type SetModelAction = {
|
|
|
36
36
|
},
|
|
37
37
|
};
|
|
38
38
|
|
|
39
|
+
export type InitModelAction = {
|
|
40
|
+
type: "MODULARUI/INIT",
|
|
41
|
+
payload: Array<{
|
|
42
|
+
key: string,
|
|
43
|
+
model: ModularUIModel,
|
|
44
|
+
}>,
|
|
45
|
+
};
|
|
46
|
+
|
|
39
47
|
export type UpdateModelAction = {
|
|
40
48
|
type: "MODULARUI/UPDATE",
|
|
41
49
|
payload: ModularUIModel,
|
package/src/redux/types.js
CHANGED
|
@@ -23,6 +23,7 @@ import type {
|
|
|
23
23
|
UpdateModelAction,
|
|
24
24
|
RemoveModelByKeyAction,
|
|
25
25
|
ResetModularUIAction,
|
|
26
|
+
InitModelAction,
|
|
26
27
|
} from "./_modularui/types";
|
|
27
28
|
import type {
|
|
28
29
|
RouterState,
|
|
@@ -135,6 +136,7 @@ export type UpdateAutosaveAction = {
|
|
|
135
136
|
export type ReduxAction =
|
|
136
137
|
| UpdateStatusAction
|
|
137
138
|
| SetModelAction
|
|
139
|
+
| InitModelAction
|
|
138
140
|
| UpdateModelAction
|
|
139
141
|
| RemoveModelByKeyAction
|
|
140
142
|
| ResetModularUIAction
|
|
@@ -30,9 +30,6 @@ declare class ChoiceAttributeOptionCollection extends ResourceCollection<ChoiceA
|
|
|
30
30
|
/**
|
|
31
31
|
*/
|
|
32
32
|
addBooleanOption(code: "true" | "false", defaultLabel: string, data: string | Array<string>, options?: Array<Object>): void;
|
|
33
|
-
/**
|
|
34
|
-
*/
|
|
35
|
-
getDefaultValueForOption(value: any, contributions: Object): string;
|
|
36
33
|
/**
|
|
37
34
|
* Create two static options for true and false,
|
|
38
35
|
* there might be alternative labels configured for each option value
|
|
@@ -11,11 +11,13 @@ declare class ModularUIRequest {
|
|
|
11
11
|
_href: Href;
|
|
12
12
|
_options: RequestModularUIOptions;
|
|
13
13
|
_targetModel: TargetModel | null;
|
|
14
|
+
_forceTargetModel: boolean;
|
|
14
15
|
_contributionsHref: string;
|
|
15
16
|
_locale: string;
|
|
16
17
|
_method: $Keys<{
|
|
17
18
|
POST: string;
|
|
18
|
-
GET: string;
|
|
19
|
+
GET: string; /**
|
|
20
|
+
*/
|
|
19
21
|
}>;
|
|
20
22
|
_progressEvent: ProgressEventHandler;
|
|
21
23
|
/**
|
|
@@ -46,13 +48,15 @@ declare class ModularUIRequest {
|
|
|
46
48
|
*/
|
|
47
49
|
set method(arg: $Keys<{
|
|
48
50
|
POST: string;
|
|
49
|
-
GET: string;
|
|
51
|
+
GET: string; /**
|
|
52
|
+
*/
|
|
50
53
|
}>);
|
|
51
54
|
/**
|
|
52
55
|
*/
|
|
53
56
|
get method(): $Keys<{
|
|
54
57
|
POST: string;
|
|
55
|
-
GET: string;
|
|
58
|
+
GET: string; /**
|
|
59
|
+
*/
|
|
56
60
|
}>;
|
|
57
61
|
/**
|
|
58
62
|
*/
|
|
@@ -69,6 +73,12 @@ declare class ModularUIRequest {
|
|
|
69
73
|
/**
|
|
70
74
|
*/
|
|
71
75
|
get withChildModels(): boolean;
|
|
76
|
+
/**
|
|
77
|
+
*/
|
|
78
|
+
set forceTargetModel(arg: boolean);
|
|
79
|
+
/**
|
|
80
|
+
*/
|
|
81
|
+
get forceTargetModel(): boolean;
|
|
72
82
|
/**
|
|
73
83
|
*/
|
|
74
84
|
resolveModel(): Class<ModularUIModel>;
|
|
@@ -174,6 +184,11 @@ declare class ModularUIRequest {
|
|
|
174
184
|
* @returns {Promise<FormModel>}
|
|
175
185
|
*/
|
|
176
186
|
postForm(form: FormModel): Promise<FormModel>;
|
|
187
|
+
/**
|
|
188
|
+
* Simplified synchronous version of fetch (returns the model, not a Promise)
|
|
189
|
+
* This can be used on the server to retrieve a model. It only loads the request url and it's child models
|
|
190
|
+
*/
|
|
191
|
+
fetchSync(): ModularUIModel;
|
|
177
192
|
}
|
|
178
193
|
import ModularUIResponse from "./ModularUIResponse";
|
|
179
194
|
import Href from "../models/href/Href";
|
|
@@ -12,6 +12,13 @@ type SetModelAction = {
|
|
|
12
12
|
model: ModularUIModel;
|
|
13
13
|
};
|
|
14
14
|
};
|
|
15
|
+
type InitModelAction = {
|
|
16
|
+
type: "MODULARUI/INIT";
|
|
17
|
+
payload: {
|
|
18
|
+
key: string;
|
|
19
|
+
model: ModularUIModel;
|
|
20
|
+
}[];
|
|
21
|
+
};
|
|
15
22
|
type UpdateModelAction = {
|
|
16
23
|
type: "MODULARUI/UPDATE";
|
|
17
24
|
payload: ModularUIModel;
|
|
@@ -29,6 +36,7 @@ type ModularUIAction = {
|
|
|
29
36
|
locale: string;
|
|
30
37
|
childmodels?: boolean;
|
|
31
38
|
targetModel?: any;
|
|
39
|
+
forceTargetModel?: boolean;
|
|
32
40
|
successAction: (model: ModularUIModel) => SetModelAction | UpdateModelAction;
|
|
33
41
|
errorAction?: ErrorAction;
|
|
34
42
|
};
|
package/types/redux/types.d.ts
CHANGED
|
@@ -84,7 +84,7 @@ type UpdateAutosaveAction = {
|
|
|
84
84
|
model: FormModel;
|
|
85
85
|
};
|
|
86
86
|
};
|
|
87
|
-
type ReduxAction = UpdateLocaleAction | SetLocalesAction | SetModelAction | UpdateModelAction | UpdateStatusAction | RemoveModelByKeyAction | NoAction | ModularUIAction | ResetModularUIAction | LocationChangeAction | PushAction | ReplaceAction | GoAction | GoBackAction | GoForwardAction | SaveErrorAction | ShowModalAction | CloseModalAction | DismissNotificationAction | ShowNotificationAction | SetPreferenceAction | SetPreferencesAction | StartProgressAction | FinishProgressAction | ResetProgressAction | UpdateProgressAction | SendAuthenticationErrorAction | ResetAuthErrorsAction | LoginSuccessAction | ChangePasswordAction | LogoutSuccessAction | UpdateAutosaveAction;
|
|
87
|
+
type ReduxAction = UpdateLocaleAction | SetLocalesAction | SetModelAction | InitModelAction | UpdateModelAction | UpdateStatusAction | RemoveModelByKeyAction | NoAction | ModularUIAction | ResetModularUIAction | LocationChangeAction | PushAction | ReplaceAction | GoAction | GoBackAction | GoForwardAction | SaveErrorAction | ShowModalAction | CloseModalAction | DismissNotificationAction | ShowNotificationAction | SetPreferenceAction | SetPreferencesAction | StartProgressAction | FinishProgressAction | ResetProgressAction | UpdateProgressAction | SendAuthenticationErrorAction | ResetAuthErrorsAction | LoginSuccessAction | ChangePasswordAction | LogoutSuccessAction | UpdateAutosaveAction;
|
|
88
88
|
type AuthState = {};
|
|
89
89
|
type ErrorState = ErrorResponse;
|
|
90
90
|
type ModalState = {};
|