@beinformed/react 1.0.0-beta.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 +12 -0
- package/LICENSE.md +1 -0
- package/dist/ErrorBoundaryFallback-D6YQem9P.d.cts +13 -0
- package/dist/ErrorBoundaryFallback-D6YQem9P.d.ts +13 -0
- package/dist/beforeRenderHooks-CNvsMmi8.d.cts +18 -0
- package/dist/beforeRenderHooks-Gb0tcmCY.d.ts +18 -0
- package/dist/chunk-347XDLN7.js +1 -0
- package/dist/chunk-347XDLN7.js.map +1 -0
- package/dist/chunk-3OP2KQ56.js +2 -0
- package/dist/chunk-3OP2KQ56.js.map +1 -0
- package/dist/chunk-4AC7YQ5Q.js +2 -0
- package/dist/chunk-4AC7YQ5Q.js.map +1 -0
- package/dist/chunk-6E5DAS6G.js +1 -0
- package/dist/chunk-6E5DAS6G.js.map +1 -0
- package/dist/chunk-6KRECIRI.js +2 -0
- package/dist/chunk-6KRECIRI.js.map +1 -0
- package/dist/chunk-A4USB53Q.js +2 -0
- package/dist/chunk-A4USB53Q.js.map +1 -0
- package/dist/chunk-AMFWIR2R.js +2 -0
- package/dist/chunk-AMFWIR2R.js.map +1 -0
- package/dist/chunk-B7PQLTVC.js +2 -0
- package/dist/chunk-B7PQLTVC.js.map +1 -0
- package/dist/chunk-DI7VM62A.js +2 -0
- package/dist/chunk-DI7VM62A.js.map +1 -0
- package/dist/chunk-FW4363Y4.js +2 -0
- package/dist/chunk-FW4363Y4.js.map +1 -0
- package/dist/chunk-HDOILTJ2.js +2 -0
- package/dist/chunk-HDOILTJ2.js.map +1 -0
- package/dist/chunk-JYAETKRB.js +2 -0
- package/dist/chunk-JYAETKRB.js.map +1 -0
- package/dist/chunk-K3DTH6XN.js +2 -0
- package/dist/chunk-K3DTH6XN.js.map +1 -0
- package/dist/chunk-KNEDBCHP.js +2 -0
- package/dist/chunk-KNEDBCHP.js.map +1 -0
- package/dist/chunk-MT7D3AJU.js +12 -0
- package/dist/chunk-MT7D3AJU.js.map +1 -0
- package/dist/chunk-RKGGCIUD.js +2 -0
- package/dist/chunk-RKGGCIUD.js.map +1 -0
- package/dist/chunk-UZIZDEU6.js +2 -0
- package/dist/chunk-UZIZDEU6.js.map +1 -0
- package/dist/chunk-VFLYA5WJ.js +2 -0
- package/dist/chunk-VFLYA5WJ.js.map +1 -0
- package/dist/chunk-VG3QU524.js +22 -0
- package/dist/chunk-VG3QU524.js.map +1 -0
- package/dist/chunk-WBPDMDW4.js +2 -0
- package/dist/chunk-WBPDMDW4.js.map +1 -0
- package/dist/chunk-X2C7CKOK.js +2 -0
- package/dist/chunk-X2C7CKOK.js.map +1 -0
- package/dist/chunk-X3N2NQVZ.js +2 -0
- package/dist/chunk-X3N2NQVZ.js.map +1 -0
- package/dist/chunk-Y7ESITVO.js +2 -0
- package/dist/chunk-Y7ESITVO.js.map +1 -0
- package/dist/chunk-YG7XDCNV.js +2 -0
- package/dist/chunk-YG7XDCNV.js.map +1 -0
- package/dist/chunk-YJNJVQFW.js +2 -0
- package/dist/chunk-YJNJVQFW.js.map +1 -0
- package/dist/chunk-Z2Y3OPVI.js +2 -0
- package/dist/chunk-Z2Y3OPVI.js.map +1 -0
- package/dist/client/index.cjs +12 -0
- package/dist/client/index.cjs.map +1 -0
- package/dist/client/index.d.cts +84 -0
- package/dist/client/index.d.ts +84 -0
- package/dist/client/index.js +2 -0
- package/dist/client/index.js.map +1 -0
- package/dist/components/index.cjs +12 -0
- package/dist/components/index.cjs.map +1 -0
- package/dist/components/index.d.cts +28 -0
- package/dist/components/index.d.ts +28 -0
- package/dist/components/index.js +2 -0
- package/dist/components/index.js.map +1 -0
- package/dist/hooks/index.cjs +2 -0
- package/dist/hooks/index.cjs.map +1 -0
- package/dist/hooks/index.d.cts +353 -0
- package/dist/hooks/index.d.ts +353 -0
- package/dist/hooks/index.js +2 -0
- package/dist/hooks/index.js.map +1 -0
- package/dist/i18n/index.cjs +2 -0
- package/dist/i18n/index.cjs.map +1 -0
- package/dist/i18n/index.d.cts +26 -0
- package/dist/i18n/index.d.ts +26 -0
- package/dist/i18n/index.js +2 -0
- package/dist/i18n/index.js.map +1 -0
- package/dist/index.cjs +32 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +27 -0
- package/dist/index.d.ts +27 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/dist/redux/index.cjs +2 -0
- package/dist/redux/index.cjs.map +1 -0
- package/dist/redux/index.d.cts +458 -0
- package/dist/redux/index.d.ts +458 -0
- package/dist/redux/index.js +2 -0
- package/dist/redux/index.js.map +1 -0
- package/dist/server/index.cjs +22 -0
- package/dist/server/index.cjs.map +1 -0
- package/dist/server/index.d.cts +78 -0
- package/dist/server/index.d.ts +78 -0
- package/dist/server/index.js +2 -0
- package/dist/server/index.js.map +1 -0
- package/dist/styled-components.d-CrkOxzv5.d.cts +346 -0
- package/dist/styled-components.d-CrkOxzv5.d.ts +346 -0
- package/dist/theme/index.cjs +2 -0
- package/dist/theme/index.cjs.map +1 -0
- package/dist/theme/index.d.cts +112 -0
- package/dist/theme/index.d.ts +112 -0
- package/dist/theme/index.js +2 -0
- package/dist/theme/index.js.map +1 -0
- package/dist/types-CGXygEPz.d.cts +8 -0
- package/dist/types-CGXygEPz.d.ts +8 -0
- package/dist/useForm-CG_DMYfZ.d.cts +178 -0
- package/dist/useForm-DW-a5mcV.d.ts +178 -0
- package/dist/utils/index.cjs +2 -0
- package/dist/utils/index.cjs.map +1 -0
- package/dist/utils/index.d.cts +6 -0
- package/dist/utils/index.d.ts +6 -0
- package/dist/utils/index.js +2 -0
- package/dist/utils/index.js.map +1 -0
- package/package.json +125 -0
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
import * as _beinformed_ui_models from '@beinformed/ui/models';
|
|
2
|
+
import { Href, ModularUIModel, FormModel, FormObjectModel, AttributeModel } from '@beinformed/ui/models';
|
|
3
|
+
import * as _reduxjs_toolkit from '@reduxjs/toolkit';
|
|
4
|
+
import { C as FetchModelResult, F as FetchModelPayload } from './styled-components.d-CrkOxzv5.cjs';
|
|
5
|
+
|
|
6
|
+
interface UpdateFormOptions {
|
|
7
|
+
autosubmit: boolean;
|
|
8
|
+
autosave: boolean;
|
|
9
|
+
autoupdate: boolean;
|
|
10
|
+
forceUpdate?: boolean;
|
|
11
|
+
/** Default true: Activate/deactivate the form object validate by an update */
|
|
12
|
+
validate?: boolean;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Load a form by href
|
|
16
|
+
*/
|
|
17
|
+
declare const useForm: (href: string | Href, data?: Record<string, unknown>) => ModularUIModel | undefined;
|
|
18
|
+
/**
|
|
19
|
+
* Form navigation methods
|
|
20
|
+
*/
|
|
21
|
+
declare const useFormNavigation: () => {
|
|
22
|
+
previous: (form: FormModel) => {
|
|
23
|
+
payload: ModularUIModel;
|
|
24
|
+
type: "MODULARUI/UPDATE_FORM";
|
|
25
|
+
};
|
|
26
|
+
cancel: (form: FormModel) => Promise<_reduxjs_toolkit.PayloadAction<{
|
|
27
|
+
payload: undefined;
|
|
28
|
+
type: string;
|
|
29
|
+
}, string, {
|
|
30
|
+
arg: FormModel;
|
|
31
|
+
requestId: string;
|
|
32
|
+
requestStatus: "fulfilled";
|
|
33
|
+
}, never> | _reduxjs_toolkit.PayloadAction<unknown, string, {
|
|
34
|
+
arg: FormModel;
|
|
35
|
+
requestId: string;
|
|
36
|
+
requestStatus: "rejected";
|
|
37
|
+
aborted: boolean;
|
|
38
|
+
condition: boolean;
|
|
39
|
+
} & ({
|
|
40
|
+
rejectedWithValue: true;
|
|
41
|
+
} | ({
|
|
42
|
+
rejectedWithValue: false;
|
|
43
|
+
} & {})), _reduxjs_toolkit.SerializedError>> & {
|
|
44
|
+
__linterBrands: "SafePromise";
|
|
45
|
+
} & {
|
|
46
|
+
abort: (reason?: string) => void;
|
|
47
|
+
requestId: string;
|
|
48
|
+
arg: FormModel;
|
|
49
|
+
unwrap: () => Promise<{
|
|
50
|
+
payload: undefined;
|
|
51
|
+
type: string;
|
|
52
|
+
}>;
|
|
53
|
+
};
|
|
54
|
+
submit: (form: FormModel) => Promise<_reduxjs_toolkit.PayloadAction<FetchModelResult, string, {
|
|
55
|
+
arg: FetchModelPayload;
|
|
56
|
+
requestId: string;
|
|
57
|
+
requestStatus: "fulfilled";
|
|
58
|
+
}, never> | _reduxjs_toolkit.PayloadAction<_beinformed_ui_models.ErrorResponse | undefined, string, {
|
|
59
|
+
arg: FetchModelPayload;
|
|
60
|
+
requestId: string;
|
|
61
|
+
requestStatus: "rejected";
|
|
62
|
+
aborted: boolean;
|
|
63
|
+
condition: boolean;
|
|
64
|
+
} & ({
|
|
65
|
+
rejectedWithValue: true;
|
|
66
|
+
} | ({
|
|
67
|
+
rejectedWithValue: false;
|
|
68
|
+
} & {})), _reduxjs_toolkit.SerializedError>> & {
|
|
69
|
+
__linterBrands: "SafePromise";
|
|
70
|
+
} & {
|
|
71
|
+
abort: (reason?: string) => void;
|
|
72
|
+
requestId: string;
|
|
73
|
+
arg: FetchModelPayload;
|
|
74
|
+
unwrap: () => Promise<FetchModelResult>;
|
|
75
|
+
};
|
|
76
|
+
remove: (form: FormModel) => {
|
|
77
|
+
payload: string;
|
|
78
|
+
type: "MODULARUI/REMOVE_KEY";
|
|
79
|
+
};
|
|
80
|
+
showFormNotification: (form: FormModel) => Promise<_reduxjs_toolkit.PayloadAction<{
|
|
81
|
+
payload: undefined;
|
|
82
|
+
type: "FINISH_PROGRESS";
|
|
83
|
+
}, string, {
|
|
84
|
+
arg: FormModel;
|
|
85
|
+
requestId: string;
|
|
86
|
+
requestStatus: "fulfilled";
|
|
87
|
+
}, never> | _reduxjs_toolkit.PayloadAction<unknown, string, {
|
|
88
|
+
arg: FormModel;
|
|
89
|
+
requestId: string;
|
|
90
|
+
requestStatus: "rejected";
|
|
91
|
+
aborted: boolean;
|
|
92
|
+
condition: boolean;
|
|
93
|
+
} & ({
|
|
94
|
+
rejectedWithValue: true;
|
|
95
|
+
} | ({
|
|
96
|
+
rejectedWithValue: false;
|
|
97
|
+
} & {})), _reduxjs_toolkit.SerializedError>> & {
|
|
98
|
+
__linterBrands: "SafePromise";
|
|
99
|
+
} & {
|
|
100
|
+
abort: (reason?: string) => void;
|
|
101
|
+
requestId: string;
|
|
102
|
+
arg: FormModel;
|
|
103
|
+
unwrap: () => Promise<{
|
|
104
|
+
payload: undefined;
|
|
105
|
+
type: "FINISH_PROGRESS";
|
|
106
|
+
}>;
|
|
107
|
+
};
|
|
108
|
+
};
|
|
109
|
+
/**
|
|
110
|
+
* Hook that returns a function to update attributes of a form object.
|
|
111
|
+
* <br >
|
|
112
|
+
* The returned function accepts the following options:
|
|
113
|
+
*
|
|
114
|
+
* - autosubmit: Automatically submit the form after a change
|
|
115
|
+
* - autosav: Automatically save the form (in the background) after a change
|
|
116
|
+
* - autoupdate: Automatically update the current form object after a change
|
|
117
|
+
* - forceUpdate: Force the update even if conditions are not met.
|
|
118
|
+
* - validate: Activate/deactivate the form object validation by an update.
|
|
119
|
+
*/
|
|
120
|
+
declare const useAttributeUpdate: (form: FormModel, formObject: FormObjectModel) => (attribute: AttributeModel, inputvalue: string, options?: UpdateFormOptions) => Promise<_reduxjs_toolkit.PayloadAction<void, string, {
|
|
121
|
+
arg: {
|
|
122
|
+
form: FormModel;
|
|
123
|
+
formObject: FormObjectModel;
|
|
124
|
+
attribute: AttributeModel;
|
|
125
|
+
inputvalue: string;
|
|
126
|
+
options?: UpdateFormOptions;
|
|
127
|
+
};
|
|
128
|
+
requestId: string;
|
|
129
|
+
requestStatus: "fulfilled";
|
|
130
|
+
}, never> | _reduxjs_toolkit.PayloadAction<unknown, string, {
|
|
131
|
+
arg: {
|
|
132
|
+
form: FormModel;
|
|
133
|
+
formObject: FormObjectModel;
|
|
134
|
+
attribute: AttributeModel;
|
|
135
|
+
inputvalue: string;
|
|
136
|
+
options?: UpdateFormOptions;
|
|
137
|
+
};
|
|
138
|
+
requestId: string;
|
|
139
|
+
requestStatus: "rejected";
|
|
140
|
+
aborted: boolean;
|
|
141
|
+
condition: boolean;
|
|
142
|
+
} & ({
|
|
143
|
+
rejectedWithValue: true;
|
|
144
|
+
} | ({
|
|
145
|
+
rejectedWithValue: false;
|
|
146
|
+
} & {})), _reduxjs_toolkit.SerializedError>> & {
|
|
147
|
+
__linterBrands: "SafePromise";
|
|
148
|
+
} & {
|
|
149
|
+
abort: (reason?: string) => void;
|
|
150
|
+
requestId: string;
|
|
151
|
+
arg: {
|
|
152
|
+
form: FormModel;
|
|
153
|
+
formObject: FormObjectModel;
|
|
154
|
+
attribute: AttributeModel;
|
|
155
|
+
inputvalue: string;
|
|
156
|
+
options?: UpdateFormOptions;
|
|
157
|
+
};
|
|
158
|
+
unwrap: () => Promise<void>;
|
|
159
|
+
};
|
|
160
|
+
/**
|
|
161
|
+
* Repeatable attributeset actions
|
|
162
|
+
*/
|
|
163
|
+
declare const useRepeatableAttributeSet: (form: FormModel) => {
|
|
164
|
+
save: () => {
|
|
165
|
+
payload: ModularUIModel;
|
|
166
|
+
type: "MODULARUI/UPDATE_FORM";
|
|
167
|
+
};
|
|
168
|
+
cancel: (object: FormObjectModel) => {
|
|
169
|
+
payload: ModularUIModel;
|
|
170
|
+
type: "MODULARUI/UPDATE_FORM";
|
|
171
|
+
};
|
|
172
|
+
remove: (object: FormObjectModel) => {
|
|
173
|
+
payload: ModularUIModel;
|
|
174
|
+
type: "MODULARUI/UPDATE_FORM";
|
|
175
|
+
};
|
|
176
|
+
};
|
|
177
|
+
|
|
178
|
+
export { type UpdateFormOptions as U, useFormNavigation as a, useAttributeUpdate as b, useRepeatableAttributeSet as c, useForm as u };
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
import * as _beinformed_ui_models from '@beinformed/ui/models';
|
|
2
|
+
import { Href, ModularUIModel, FormModel, FormObjectModel, AttributeModel } from '@beinformed/ui/models';
|
|
3
|
+
import * as _reduxjs_toolkit from '@reduxjs/toolkit';
|
|
4
|
+
import { C as FetchModelResult, F as FetchModelPayload } from './styled-components.d-CrkOxzv5.js';
|
|
5
|
+
|
|
6
|
+
interface UpdateFormOptions {
|
|
7
|
+
autosubmit: boolean;
|
|
8
|
+
autosave: boolean;
|
|
9
|
+
autoupdate: boolean;
|
|
10
|
+
forceUpdate?: boolean;
|
|
11
|
+
/** Default true: Activate/deactivate the form object validate by an update */
|
|
12
|
+
validate?: boolean;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Load a form by href
|
|
16
|
+
*/
|
|
17
|
+
declare const useForm: (href: string | Href, data?: Record<string, unknown>) => ModularUIModel | undefined;
|
|
18
|
+
/**
|
|
19
|
+
* Form navigation methods
|
|
20
|
+
*/
|
|
21
|
+
declare const useFormNavigation: () => {
|
|
22
|
+
previous: (form: FormModel) => {
|
|
23
|
+
payload: ModularUIModel;
|
|
24
|
+
type: "MODULARUI/UPDATE_FORM";
|
|
25
|
+
};
|
|
26
|
+
cancel: (form: FormModel) => Promise<_reduxjs_toolkit.PayloadAction<{
|
|
27
|
+
payload: undefined;
|
|
28
|
+
type: string;
|
|
29
|
+
}, string, {
|
|
30
|
+
arg: FormModel;
|
|
31
|
+
requestId: string;
|
|
32
|
+
requestStatus: "fulfilled";
|
|
33
|
+
}, never> | _reduxjs_toolkit.PayloadAction<unknown, string, {
|
|
34
|
+
arg: FormModel;
|
|
35
|
+
requestId: string;
|
|
36
|
+
requestStatus: "rejected";
|
|
37
|
+
aborted: boolean;
|
|
38
|
+
condition: boolean;
|
|
39
|
+
} & ({
|
|
40
|
+
rejectedWithValue: true;
|
|
41
|
+
} | ({
|
|
42
|
+
rejectedWithValue: false;
|
|
43
|
+
} & {})), _reduxjs_toolkit.SerializedError>> & {
|
|
44
|
+
__linterBrands: "SafePromise";
|
|
45
|
+
} & {
|
|
46
|
+
abort: (reason?: string) => void;
|
|
47
|
+
requestId: string;
|
|
48
|
+
arg: FormModel;
|
|
49
|
+
unwrap: () => Promise<{
|
|
50
|
+
payload: undefined;
|
|
51
|
+
type: string;
|
|
52
|
+
}>;
|
|
53
|
+
};
|
|
54
|
+
submit: (form: FormModel) => Promise<_reduxjs_toolkit.PayloadAction<FetchModelResult, string, {
|
|
55
|
+
arg: FetchModelPayload;
|
|
56
|
+
requestId: string;
|
|
57
|
+
requestStatus: "fulfilled";
|
|
58
|
+
}, never> | _reduxjs_toolkit.PayloadAction<_beinformed_ui_models.ErrorResponse | undefined, string, {
|
|
59
|
+
arg: FetchModelPayload;
|
|
60
|
+
requestId: string;
|
|
61
|
+
requestStatus: "rejected";
|
|
62
|
+
aborted: boolean;
|
|
63
|
+
condition: boolean;
|
|
64
|
+
} & ({
|
|
65
|
+
rejectedWithValue: true;
|
|
66
|
+
} | ({
|
|
67
|
+
rejectedWithValue: false;
|
|
68
|
+
} & {})), _reduxjs_toolkit.SerializedError>> & {
|
|
69
|
+
__linterBrands: "SafePromise";
|
|
70
|
+
} & {
|
|
71
|
+
abort: (reason?: string) => void;
|
|
72
|
+
requestId: string;
|
|
73
|
+
arg: FetchModelPayload;
|
|
74
|
+
unwrap: () => Promise<FetchModelResult>;
|
|
75
|
+
};
|
|
76
|
+
remove: (form: FormModel) => {
|
|
77
|
+
payload: string;
|
|
78
|
+
type: "MODULARUI/REMOVE_KEY";
|
|
79
|
+
};
|
|
80
|
+
showFormNotification: (form: FormModel) => Promise<_reduxjs_toolkit.PayloadAction<{
|
|
81
|
+
payload: undefined;
|
|
82
|
+
type: "FINISH_PROGRESS";
|
|
83
|
+
}, string, {
|
|
84
|
+
arg: FormModel;
|
|
85
|
+
requestId: string;
|
|
86
|
+
requestStatus: "fulfilled";
|
|
87
|
+
}, never> | _reduxjs_toolkit.PayloadAction<unknown, string, {
|
|
88
|
+
arg: FormModel;
|
|
89
|
+
requestId: string;
|
|
90
|
+
requestStatus: "rejected";
|
|
91
|
+
aborted: boolean;
|
|
92
|
+
condition: boolean;
|
|
93
|
+
} & ({
|
|
94
|
+
rejectedWithValue: true;
|
|
95
|
+
} | ({
|
|
96
|
+
rejectedWithValue: false;
|
|
97
|
+
} & {})), _reduxjs_toolkit.SerializedError>> & {
|
|
98
|
+
__linterBrands: "SafePromise";
|
|
99
|
+
} & {
|
|
100
|
+
abort: (reason?: string) => void;
|
|
101
|
+
requestId: string;
|
|
102
|
+
arg: FormModel;
|
|
103
|
+
unwrap: () => Promise<{
|
|
104
|
+
payload: undefined;
|
|
105
|
+
type: "FINISH_PROGRESS";
|
|
106
|
+
}>;
|
|
107
|
+
};
|
|
108
|
+
};
|
|
109
|
+
/**
|
|
110
|
+
* Hook that returns a function to update attributes of a form object.
|
|
111
|
+
* <br >
|
|
112
|
+
* The returned function accepts the following options:
|
|
113
|
+
*
|
|
114
|
+
* - autosubmit: Automatically submit the form after a change
|
|
115
|
+
* - autosav: Automatically save the form (in the background) after a change
|
|
116
|
+
* - autoupdate: Automatically update the current form object after a change
|
|
117
|
+
* - forceUpdate: Force the update even if conditions are not met.
|
|
118
|
+
* - validate: Activate/deactivate the form object validation by an update.
|
|
119
|
+
*/
|
|
120
|
+
declare const useAttributeUpdate: (form: FormModel, formObject: FormObjectModel) => (attribute: AttributeModel, inputvalue: string, options?: UpdateFormOptions) => Promise<_reduxjs_toolkit.PayloadAction<void, string, {
|
|
121
|
+
arg: {
|
|
122
|
+
form: FormModel;
|
|
123
|
+
formObject: FormObjectModel;
|
|
124
|
+
attribute: AttributeModel;
|
|
125
|
+
inputvalue: string;
|
|
126
|
+
options?: UpdateFormOptions;
|
|
127
|
+
};
|
|
128
|
+
requestId: string;
|
|
129
|
+
requestStatus: "fulfilled";
|
|
130
|
+
}, never> | _reduxjs_toolkit.PayloadAction<unknown, string, {
|
|
131
|
+
arg: {
|
|
132
|
+
form: FormModel;
|
|
133
|
+
formObject: FormObjectModel;
|
|
134
|
+
attribute: AttributeModel;
|
|
135
|
+
inputvalue: string;
|
|
136
|
+
options?: UpdateFormOptions;
|
|
137
|
+
};
|
|
138
|
+
requestId: string;
|
|
139
|
+
requestStatus: "rejected";
|
|
140
|
+
aborted: boolean;
|
|
141
|
+
condition: boolean;
|
|
142
|
+
} & ({
|
|
143
|
+
rejectedWithValue: true;
|
|
144
|
+
} | ({
|
|
145
|
+
rejectedWithValue: false;
|
|
146
|
+
} & {})), _reduxjs_toolkit.SerializedError>> & {
|
|
147
|
+
__linterBrands: "SafePromise";
|
|
148
|
+
} & {
|
|
149
|
+
abort: (reason?: string) => void;
|
|
150
|
+
requestId: string;
|
|
151
|
+
arg: {
|
|
152
|
+
form: FormModel;
|
|
153
|
+
formObject: FormObjectModel;
|
|
154
|
+
attribute: AttributeModel;
|
|
155
|
+
inputvalue: string;
|
|
156
|
+
options?: UpdateFormOptions;
|
|
157
|
+
};
|
|
158
|
+
unwrap: () => Promise<void>;
|
|
159
|
+
};
|
|
160
|
+
/**
|
|
161
|
+
* Repeatable attributeset actions
|
|
162
|
+
*/
|
|
163
|
+
declare const useRepeatableAttributeSet: (form: FormModel) => {
|
|
164
|
+
save: () => {
|
|
165
|
+
payload: ModularUIModel;
|
|
166
|
+
type: "MODULARUI/UPDATE_FORM";
|
|
167
|
+
};
|
|
168
|
+
cancel: (object: FormObjectModel) => {
|
|
169
|
+
payload: ModularUIModel;
|
|
170
|
+
type: "MODULARUI/UPDATE_FORM";
|
|
171
|
+
};
|
|
172
|
+
remove: (object: FormObjectModel) => {
|
|
173
|
+
payload: ModularUIModel;
|
|
174
|
+
type: "MODULARUI/UPDATE_FORM";
|
|
175
|
+
};
|
|
176
|
+
};
|
|
177
|
+
|
|
178
|
+
export { type UpdateFormOptions as U, useFormNavigation as a, useAttributeUpdate as b, useRepeatableAttributeSet as c, useForm as u };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var p=Object.defineProperty;var m=Object.getOwnPropertyDescriptor;var c=Object.getOwnPropertyNames;var f=Object.prototype.hasOwnProperty;var s=(n,e)=>{for(var t in e)p(n,t,{get:e[t],enumerable:!0})},i=(n,e,t,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of c(e))!f.call(n,r)&&r!==t&&p(n,r,{get:()=>e[r],enumerable:!(o=m(e,r))||o.enumerable});return n};var a=n=>i(p({},"__esModule",{value:!0}),n);var u={};s(u,{getDisplayName:()=>y,mergeRefs:()=>l});module.exports=a(u);var y=(n,e="Component",t)=>{let o=n.displayName||n.name||e;return t?`${o}[${t}]`:o},l=n=>e=>{n.forEach(t=>{typeof t=="function"?t(e):t!=null&&typeof t=="object"&&(t.current=e)})};0&&(module.exports={getDisplayName,mergeRefs});
|
|
2
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/utils/index.ts","../../src/utils/utils.ts"],"sourcesContent":["// Generated by createIndex.js - Do not edit manually!\n// This file is automatically updated when the script runs.\n\nexport * from \"./utils\";\n","import type { ComponentType, Ref } from \"react\";\n\nexport const getDisplayName = (\n WrappedComponent: ComponentType<never>,\n defaultName = \"Component\",\n contextId?: string,\n) => {\n const componentName =\n WrappedComponent.displayName || WrappedComponent.name || defaultName;\n\n if (contextId) {\n return `${componentName}[${contextId}]`;\n }\n\n return componentName;\n};\n\nexport const mergeRefs =\n <T>(refs: Ref<T>[]): Ref<T> =>\n (value) => {\n refs.forEach((ref) => {\n if (typeof ref === \"function\") {\n ref(value);\n } else if (ref != null && typeof ref === \"object\") {\n (ref as { current: T | null }).current = value;\n }\n });\n };\n"],"mappings":"yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,oBAAAE,EAAA,cAAAC,IAAA,eAAAC,EAAAJ,GCEO,IAAMK,EAAiB,CAC5BC,EACAC,EAAc,YACdC,IACG,CACH,IAAMC,EACJH,EAAiB,aAAeA,EAAiB,MAAQC,EAE3D,OAAIC,EACK,GAAGC,CAAa,IAAID,CAAS,IAG/BC,CACT,EAEaC,EACPC,GACHC,GAAU,CACTD,EAAK,QAASE,GAAQ,CAChB,OAAOA,GAAQ,WACjBA,EAAID,CAAK,EACAC,GAAO,MAAQ,OAAOA,GAAQ,WACtCA,EAA8B,QAAUD,EAE7C,CAAC,CACH","names":["utils_exports","__export","getDisplayName","mergeRefs","__toCommonJS","getDisplayName","WrappedComponent","defaultName","contextId","componentName","mergeRefs","refs","value","ref"]}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ComponentType, Ref } from 'react';
|
|
2
|
+
|
|
3
|
+
declare const getDisplayName: (WrappedComponent: ComponentType<never>, defaultName?: string, contextId?: string) => string;
|
|
4
|
+
declare const mergeRefs: <T>(refs: Ref<T>[]) => Ref<T>;
|
|
5
|
+
|
|
6
|
+
export { getDisplayName, mergeRefs };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ComponentType, Ref } from 'react';
|
|
2
|
+
|
|
3
|
+
declare const getDisplayName: (WrappedComponent: ComponentType<never>, defaultName?: string, contextId?: string) => string;
|
|
4
|
+
declare const mergeRefs: <T>(refs: Ref<T>[]) => Ref<T>;
|
|
5
|
+
|
|
6
|
+
export { getDisplayName, mergeRefs };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
package/package.json
ADDED
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@beinformed/react",
|
|
3
|
+
"version": "1.0.0-beta.0",
|
|
4
|
+
"description": "Be Informed UI React",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"files": [
|
|
9
|
+
"README.md",
|
|
10
|
+
"CHANGELOG.md",
|
|
11
|
+
"LICENSE.md",
|
|
12
|
+
"dist"
|
|
13
|
+
],
|
|
14
|
+
"peerDependencies": {
|
|
15
|
+
"@dr.pogodin/react-helmet": "^3.0.0",
|
|
16
|
+
"@reduxjs/toolkit": "^2.0.0",
|
|
17
|
+
"history": "^4.0.0",
|
|
18
|
+
"polished": "^4.0.0",
|
|
19
|
+
"react": "^18.0.0 || ^19.0.0",
|
|
20
|
+
"react-dom": "^18.0.0 || ^19.0.0",
|
|
21
|
+
"react-redux": "^9.0.0",
|
|
22
|
+
"react-router": "^5.0.0",
|
|
23
|
+
"redux": "^5.0.0",
|
|
24
|
+
"styled-components": "^6.0.0"
|
|
25
|
+
},
|
|
26
|
+
"dependencies": {
|
|
27
|
+
"big.js": "^7.0.1",
|
|
28
|
+
"deepmerge": "^4.3.1",
|
|
29
|
+
"dequal": "^2.0.3",
|
|
30
|
+
"format-message": "^6.2.4",
|
|
31
|
+
"immer": "^10.1.1",
|
|
32
|
+
"js-cookie": "^3.0.5",
|
|
33
|
+
"reselect": "^5.1.1",
|
|
34
|
+
"@beinformed/ui": "2.0.0-beta.0"
|
|
35
|
+
},
|
|
36
|
+
"devDependencies": {
|
|
37
|
+
"@dr.pogodin/react-helmet": "^3.0.2",
|
|
38
|
+
"@reduxjs/toolkit": "^2.8.2",
|
|
39
|
+
"@testing-library/dom": "^10.4.0",
|
|
40
|
+
"@testing-library/react": "^16.3.0",
|
|
41
|
+
"@types/big.js": "^6.2.2",
|
|
42
|
+
"@types/history": "^4.0.0",
|
|
43
|
+
"@types/js-cookie": "^3.0.6",
|
|
44
|
+
"@types/react": "^19.1.8",
|
|
45
|
+
"@types/react-dom": "^19.1.6",
|
|
46
|
+
"@types/react-router": "^5.1.20",
|
|
47
|
+
"@types/setimmediate": "^1.0.4",
|
|
48
|
+
"history": "^4.0.0",
|
|
49
|
+
"msw": "^2.10.4",
|
|
50
|
+
"polished": "^4.3.1",
|
|
51
|
+
"react": "^19.1.0",
|
|
52
|
+
"react-dom": "^19.1.0",
|
|
53
|
+
"react-redux": "^9.2.0",
|
|
54
|
+
"react-router": "^5.0.0",
|
|
55
|
+
"redux": "^5.0.1",
|
|
56
|
+
"styled-components": "^6.1.19",
|
|
57
|
+
"@beinformed/typescript-config": "0.0.0"
|
|
58
|
+
},
|
|
59
|
+
"exports": {
|
|
60
|
+
"./client": {
|
|
61
|
+
"types": "./dist/client/index.d.ts",
|
|
62
|
+
"import": "./dist/client/index.js",
|
|
63
|
+
"require": "./dist/client/index.cjs",
|
|
64
|
+
"default": "./dist/client/index.js"
|
|
65
|
+
},
|
|
66
|
+
"./components": {
|
|
67
|
+
"types": "./dist/components/index.d.ts",
|
|
68
|
+
"import": "./dist/components/index.js",
|
|
69
|
+
"require": "./dist/components/index.cjs",
|
|
70
|
+
"default": "./dist/components/index.js"
|
|
71
|
+
},
|
|
72
|
+
"./hooks": {
|
|
73
|
+
"types": "./dist/hooks/index.d.ts",
|
|
74
|
+
"import": "./dist/hooks/index.js",
|
|
75
|
+
"require": "./dist/hooks/index.cjs",
|
|
76
|
+
"default": "./dist/hooks/index.js"
|
|
77
|
+
},
|
|
78
|
+
"./i18n": {
|
|
79
|
+
"types": "./dist/i18n/index.d.ts",
|
|
80
|
+
"import": "./dist/i18n/index.js",
|
|
81
|
+
"require": "./dist/i18n/index.cjs",
|
|
82
|
+
"default": "./dist/i18n/index.js"
|
|
83
|
+
},
|
|
84
|
+
"./redux": {
|
|
85
|
+
"types": "./dist/redux/index.d.ts",
|
|
86
|
+
"import": "./dist/redux/index.js",
|
|
87
|
+
"require": "./dist/redux/index.cjs",
|
|
88
|
+
"default": "./dist/redux/index.js"
|
|
89
|
+
},
|
|
90
|
+
"./server": {
|
|
91
|
+
"types": "./dist/server/index.d.ts",
|
|
92
|
+
"import": "./dist/server/index.js",
|
|
93
|
+
"require": "./dist/server/index.cjs",
|
|
94
|
+
"default": "./dist/server/index.js"
|
|
95
|
+
},
|
|
96
|
+
"./theme": {
|
|
97
|
+
"types": "./dist/theme/index.d.ts",
|
|
98
|
+
"import": "./dist/theme/index.js",
|
|
99
|
+
"require": "./dist/theme/index.cjs",
|
|
100
|
+
"default": "./dist/theme/index.js"
|
|
101
|
+
},
|
|
102
|
+
"./utils": {
|
|
103
|
+
"types": "./dist/utils/index.d.ts",
|
|
104
|
+
"import": "./dist/utils/index.js",
|
|
105
|
+
"require": "./dist/utils/index.cjs",
|
|
106
|
+
"default": "./dist/utils/index.js"
|
|
107
|
+
}
|
|
108
|
+
},
|
|
109
|
+
"publishConfig": {
|
|
110
|
+
"access": "public"
|
|
111
|
+
},
|
|
112
|
+
"scripts": {
|
|
113
|
+
"dev": "tsup --watch",
|
|
114
|
+
"build": "tsup",
|
|
115
|
+
"clean:build": "rimraf ./dist",
|
|
116
|
+
"lint": "eslint .",
|
|
117
|
+
"lint:ci": "eslint . --ext .ts,.tsx --format junit -o ../../reports/eslint-report-react.xml",
|
|
118
|
+
"lint:fix": "pnpm lint --fix",
|
|
119
|
+
"prettier": "prettier --write .",
|
|
120
|
+
"test": "vitest run",
|
|
121
|
+
"test:ci": "vitest run --reporter=junit --outputFile=../../reports/vitest-report-react.xml",
|
|
122
|
+
"typecheck": "tsc --noEmit",
|
|
123
|
+
"createIndex": "node ./createIndex.mjs ./src"
|
|
124
|
+
}
|
|
125
|
+
}
|