@axelor/aos-mobile-core 7.1.3 → 7.2.1
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/lib/api/anomaly-api.d.ts +4 -0
- package/lib/api/anomaly-api.js +24 -0
- package/lib/api/anomaly-api.js.map +1 -0
- package/lib/api/login-api.js +2 -3
- package/lib/api/login-api.js.map +1 -1
- package/lib/api/user-api.d.ts +4 -0
- package/lib/api/user-api.js +31 -0
- package/lib/api/user-api.js.map +1 -0
- package/lib/apiProviders/Standard/ObjectFieldsProvider.d.ts +1 -0
- package/lib/apiProviders/Standard/ObjectFieldsProvider.js +21 -4
- package/lib/apiProviders/Standard/ObjectFieldsProvider.js.map +1 -1
- package/lib/apiProviders/middlewares/fieldParser.d.ts +2 -0
- package/lib/apiProviders/middlewares/fieldParser.js +53 -0
- package/lib/apiProviders/middlewares/fieldParser.js.map +1 -0
- package/lib/apiProviders/middlewares/index.d.ts +1 -0
- package/lib/apiProviders/middlewares/index.js +1 -0
- package/lib/apiProviders/middlewares/index.js.map +1 -1
- package/lib/apiProviders/utils.js +1 -1
- package/lib/apiProviders/utils.js.map +1 -1
- package/lib/app/ContextsProvider.js +12 -4
- package/lib/app/ContextsProvider.js.map +1 -1
- package/lib/app/Module.d.ts +2 -0
- package/lib/app/context.helper.js +6 -1
- package/lib/app/context.helper.js.map +1 -1
- package/lib/auth/models/objectFields.js +3 -3
- package/lib/auth/models/objectFields.js.map +1 -1
- package/lib/auth/screens/UserScreen.js +12 -5
- package/lib/auth/screens/UserScreen.js.map +1 -1
- package/lib/components/index.d.ts +1 -0
- package/lib/components/index.js +1 -0
- package/lib/components/index.js.map +1 -1
- package/lib/components/molecules/CameraButton/CameraButton.js +3 -3
- package/lib/components/molecules/CameraButton/CameraButton.js.map +1 -1
- package/lib/components/molecules/UploadFileInput/UploadFileInput.js +3 -1
- package/lib/components/molecules/UploadFileInput/UploadFileInput.js.map +1 -1
- package/lib/components/organisms/AnomalyBubble/AnomalyBubble.d.ts +11 -0
- package/lib/components/organisms/AnomalyBubble/AnomalyBubble.js +60 -0
- package/lib/components/organisms/AnomalyBubble/AnomalyBubble.js.map +1 -0
- package/lib/components/organisms/AnomalyList/AnomalyList.d.ts +7 -0
- package/lib/components/organisms/AnomalyList/AnomalyList.js +59 -0
- package/lib/components/organisms/AnomalyList/AnomalyList.js.map +1 -0
- package/lib/components/organisms/DateInput/DateInput.js +3 -3
- package/lib/components/organisms/DateInput/DateInput.js.map +1 -1
- package/lib/components/organisms/HeaderOptionsMenu/HeaderOptionsMenu.d.ts +2 -1
- package/lib/components/organisms/HeaderOptionsMenu/HeaderOptionsMenu.js +18 -5
- package/lib/components/organisms/HeaderOptionsMenu/HeaderOptionsMenu.js.map +1 -1
- package/lib/components/organisms/index.d.ts +2 -0
- package/lib/components/organisms/index.js +2 -0
- package/lib/components/organisms/index.js.map +1 -1
- package/lib/components/pages/FormView/Alerts/ConstraintsValidatorPopup.d.ts +11 -0
- package/lib/components/pages/FormView/Alerts/ConstraintsValidatorPopup.js +33 -0
- package/lib/components/pages/FormView/Alerts/ConstraintsValidatorPopup.js.map +1 -0
- package/lib/components/pages/FormView/Alerts/index.d.ts +1 -0
- package/lib/{sessions/components/buttons → components/pages/FormView/Alerts}/index.js +1 -3
- package/lib/components/pages/FormView/Alerts/index.js.map +1 -0
- package/lib/components/pages/FormView/Components/Field.d.ts +10 -0
- package/lib/components/pages/FormView/Components/Field.js +146 -0
- package/lib/components/pages/FormView/Components/Field.js.map +1 -0
- package/lib/components/pages/FormView/Components/Panel.d.ts +9 -0
- package/lib/components/pages/FormView/Components/Panel.js +96 -0
- package/lib/components/pages/FormView/Components/Panel.js.map +1 -0
- package/lib/components/pages/FormView/Components/index.d.ts +2 -0
- package/lib/components/pages/FormView/Components/index.js +20 -0
- package/lib/components/pages/FormView/Components/index.js.map +1 -0
- package/lib/components/pages/FormView/Custom/CustomButton.d.ts +10 -0
- package/lib/components/pages/FormView/Custom/CustomButton.js +31 -0
- package/lib/components/pages/FormView/Custom/CustomButton.js.map +1 -0
- package/lib/components/pages/FormView/Custom/CustomPasswordInput.d.ts +11 -0
- package/lib/components/pages/FormView/Custom/CustomPasswordInput.js +40 -0
- package/lib/components/pages/FormView/Custom/CustomPasswordInput.js.map +1 -0
- package/lib/components/pages/FormView/Custom/CustomPicker.d.ts +12 -0
- package/lib/components/pages/FormView/Custom/CustomPicker.js +33 -0
- package/lib/components/pages/FormView/Custom/CustomPicker.js.map +1 -0
- package/lib/components/pages/FormView/Custom/CustomSearchBar.d.ts +12 -0
- package/lib/components/pages/FormView/Custom/CustomSearchBar.js +69 -0
- package/lib/components/pages/FormView/Custom/CustomSearchBar.js.map +1 -0
- package/lib/components/pages/FormView/Custom/index.d.ts +4 -0
- package/lib/components/pages/FormView/Custom/index.js +22 -0
- package/lib/components/pages/FormView/Custom/index.js.map +1 -0
- package/lib/components/pages/FormView/FormView.d.ts +8 -0
- package/lib/components/pages/FormView/FormView.js +193 -0
- package/lib/components/pages/FormView/FormView.js.map +1 -0
- package/lib/components/pages/index.d.ts +4 -0
- package/lib/components/pages/index.js +22 -0
- package/lib/components/pages/index.js.map +1 -0
- package/lib/components/templates/MailMessageView/MailMessageView.js +8 -2
- package/lib/components/templates/MailMessageView/MailMessageView.js.map +1 -1
- package/lib/components/templates/PopupApplicationNotConfigured/PopupApplicationNotConfigured.js +10 -13
- package/lib/components/templates/PopupApplicationNotConfigured/PopupApplicationNotConfigured.js.map +1 -1
- package/lib/components/templates/PopupMinimalRequiredVersion/PopupMinimalRequiredVersion.js +15 -25
- package/lib/components/templates/PopupMinimalRequiredVersion/PopupMinimalRequiredVersion.js.map +1 -1
- package/lib/components/templates/SocialNetworkLinks/SocialNetworkLinks.d.ts +9 -6
- package/lib/components/templates/SocialNetworkLinks/SocialNetworkLinks.js +30 -10
- package/lib/components/templates/SocialNetworkLinks/SocialNetworkLinks.js.map +1 -1
- package/lib/components/templates/UserSearchBar/UserSearchBar.d.ts +14 -0
- package/lib/components/templates/UserSearchBar/UserSearchBar.js +34 -0
- package/lib/components/templates/UserSearchBar/UserSearchBar.js.map +1 -0
- package/lib/components/templates/index.d.ts +1 -0
- package/lib/components/templates/index.js +1 -0
- package/lib/components/templates/index.js.map +1 -1
- package/lib/config/routes.d.ts +3 -0
- package/lib/config/routes.js +2 -0
- package/lib/config/routes.js.map +1 -1
- package/lib/features/formSlice.d.ts +34 -0
- package/lib/features/formSlice.js +70 -0
- package/lib/features/formSlice.js.map +1 -0
- package/lib/features/index.d.ts +3 -0
- package/lib/features/index.js +3 -0
- package/lib/features/index.js.map +1 -1
- package/lib/features/metaJsonFieldSlice.d.ts +34 -0
- package/lib/features/metaJsonFieldSlice.js +68 -0
- package/lib/features/metaJsonFieldSlice.js.map +1 -0
- package/lib/features/userSlice.d.ts +16 -0
- package/lib/features/userSlice.js +49 -0
- package/lib/features/userSlice.js.map +1 -0
- package/lib/forms/FormConfigsProvider.d.ts +20 -0
- package/lib/forms/FormConfigsProvider.js +56 -0
- package/lib/forms/FormConfigsProvider.js.map +1 -0
- package/lib/forms/api.helpers.d.ts +12 -0
- package/lib/forms/api.helpers.js +59 -0
- package/lib/forms/api.helpers.js.map +1 -0
- package/lib/forms/display.helpers.d.ts +18 -0
- package/lib/forms/display.helpers.js +225 -0
- package/lib/forms/display.helpers.js.map +1 -0
- package/lib/forms/index.d.ts +7 -0
- package/lib/forms/index.js +25 -0
- package/lib/forms/index.js.map +1 -0
- package/lib/forms/register.helpers.d.ts +6 -0
- package/lib/forms/register.helpers.js +96 -0
- package/lib/forms/register.helpers.js.map +1 -0
- package/lib/forms/studio/api.helpers.d.ts +37 -0
- package/lib/forms/studio/api.helpers.js +162 -0
- package/lib/forms/studio/api.helpers.js.map +1 -0
- package/lib/forms/studio/display.helpers.d.ts +7 -0
- package/lib/forms/studio/display.helpers.js +256 -0
- package/lib/forms/studio/display.helpers.js.map +1 -0
- package/lib/forms/studio/index.d.ts +2 -0
- package/lib/forms/studio/index.js +20 -0
- package/lib/forms/studio/index.js.map +1 -0
- package/lib/forms/types.d.ts +100 -0
- package/lib/forms/types.js +19 -0
- package/lib/forms/types.js.map +1 -0
- package/lib/forms/validation.helpers.d.ts +10 -0
- package/lib/forms/validation.helpers.js +234 -0
- package/lib/forms/validation.helpers.js.map +1 -0
- package/lib/header/hooks.d.ts +15 -1
- package/lib/header/hooks.js +57 -2
- package/lib/header/hooks.js.map +1 -1
- package/lib/header/types.d.ts +1 -0
- package/lib/hooks/use-navigation.d.ts +1 -0
- package/lib/hooks/use-navigation.js +4 -1
- package/lib/hooks/use-navigation.js.map +1 -1
- package/lib/i18n/translations/en.json +52 -1
- package/lib/i18n/translations/fr.json +52 -1
- package/lib/index.d.ts +2 -1
- package/lib/index.js +2 -1
- package/lib/index.js.map +1 -1
- package/lib/models/index.d.ts +2 -0
- package/lib/models/index.js +2 -0
- package/lib/models/index.js.map +1 -1
- package/lib/models/objectFields.js +3 -0
- package/lib/models/objectFields.js.map +1 -1
- package/lib/models/searchFields.d.ts +2 -0
- package/lib/{sessions/components/buttons/LoginButton.js → models/searchFields.js} +3 -6
- package/lib/models/searchFields.js.map +1 -0
- package/lib/models/sortFields.d.ts +2 -0
- package/lib/{sessions/components/buttons/UpdateButton.js → models/sortFields.js} +3 -6
- package/lib/models/sortFields.js.map +1 -0
- package/lib/navigator/drawer/Header.js +1 -1
- package/lib/navigator/drawer/Header.js.map +1 -1
- package/lib/screens/ErrorScreen.js +1 -1
- package/lib/screens/ErrorScreen.js.map +1 -1
- package/lib/screens/JsonFieldScreen.d.ts +4 -0
- package/lib/screens/JsonFieldScreen.js +92 -0
- package/lib/screens/JsonFieldScreen.js.map +1 -0
- package/lib/screens/index.d.ts +13 -0
- package/lib/screens/index.js +9 -0
- package/lib/screens/index.js.map +1 -1
- package/lib/sessions/components/alerts/PopupCreateSession.js +8 -16
- package/lib/sessions/components/alerts/PopupCreateSession.js.map +1 -1
- package/lib/sessions/components/alerts/PopupEditSession.js +8 -16
- package/lib/sessions/components/alerts/PopupEditSession.js.map +1 -1
- package/lib/sessions/components/alerts/PopupSession.js +7 -16
- package/lib/sessions/components/alerts/PopupSession.js.map +1 -1
- package/lib/sessions/components/index.d.ts +0 -1
- package/lib/sessions/components/index.js +0 -1
- package/lib/sessions/components/index.js.map +1 -1
- package/lib/sessions/components/inputs/SessionInputs.js +9 -7
- package/lib/sessions/components/inputs/SessionInputs.js.map +1 -1
- package/lib/types/anomaly-type.d.ts +16 -0
- package/lib/types/anomaly-type.js +56 -0
- package/lib/types/anomaly-type.js.map +1 -0
- package/lib/types/index.d.ts +1 -0
- package/lib/types/index.js +1 -0
- package/lib/types/index.js.map +1 -1
- package/lib/utils/displayers.d.ts +1 -0
- package/lib/utils/displayers.js +1 -0
- package/lib/utils/displayers.js.map +1 -1
- package/lib/utils/index.d.ts +1 -1
- package/lib/utils/index.js +1 -1
- package/lib/utils/index.js.map +1 -1
- package/package.json +3 -3
- package/lib/sessions/components/buttons/DisabledButton.d.ts +0 -7
- package/lib/sessions/components/buttons/DisabledButton.js +0 -45
- package/lib/sessions/components/buttons/DisabledButton.js.map +0 -1
- package/lib/sessions/components/buttons/LoginButton.d.ts +0 -6
- package/lib/sessions/components/buttons/LoginButton.js.map +0 -1
- package/lib/sessions/components/buttons/UpdateButton.d.ts +0 -6
- package/lib/sessions/components/buttons/UpdateButton.js.map +0 -1
- package/lib/sessions/components/buttons/index.d.ts +0 -3
- package/lib/sessions/components/buttons/index.js.map +0 -1
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export const fetchJsonFieldsOfModel: import("@reduxjs/toolkit").AsyncThunk<any, void, {
|
|
2
|
+
state?: unknown;
|
|
3
|
+
dispatch?: import("redux").Dispatch<import("redux").AnyAction>;
|
|
4
|
+
extra?: unknown;
|
|
5
|
+
rejectValue?: unknown;
|
|
6
|
+
serializedErrorType?: unknown;
|
|
7
|
+
pendingMeta?: unknown;
|
|
8
|
+
fulfilledMeta?: unknown;
|
|
9
|
+
rejectedMeta?: unknown;
|
|
10
|
+
}>;
|
|
11
|
+
export const fetchObject: import("@reduxjs/toolkit").AsyncThunk<any, void, {
|
|
12
|
+
state?: unknown;
|
|
13
|
+
dispatch?: import("redux").Dispatch<import("redux").AnyAction>;
|
|
14
|
+
extra?: unknown;
|
|
15
|
+
rejectValue?: unknown;
|
|
16
|
+
serializedErrorType?: unknown;
|
|
17
|
+
pendingMeta?: unknown;
|
|
18
|
+
fulfilledMeta?: unknown;
|
|
19
|
+
rejectedMeta?: unknown;
|
|
20
|
+
}>;
|
|
21
|
+
export const updateJsonFieldsObject: import("@reduxjs/toolkit").AsyncThunk<any, void, {
|
|
22
|
+
state?: unknown;
|
|
23
|
+
dispatch?: import("redux").Dispatch<import("redux").AnyAction>;
|
|
24
|
+
extra?: unknown;
|
|
25
|
+
rejectValue?: unknown;
|
|
26
|
+
serializedErrorType?: unknown;
|
|
27
|
+
pendingMeta?: unknown;
|
|
28
|
+
fulfilledMeta?: unknown;
|
|
29
|
+
rejectedMeta?: unknown;
|
|
30
|
+
}>;
|
|
31
|
+
export const metaJsonFieldReducer: import("redux").Reducer<{
|
|
32
|
+
fields: any[];
|
|
33
|
+
object: {};
|
|
34
|
+
}>;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Axelor Business Solutions
|
|
3
|
+
*
|
|
4
|
+
* Copyright (C) 2023 Axelor (<http://axelor.com>).
|
|
5
|
+
*
|
|
6
|
+
* This program is free software: you can redistribute it and/or modify
|
|
7
|
+
* it under the terms of the GNU Affero General Public License, version 3,
|
|
8
|
+
* as published by the Free Software Foundation.
|
|
9
|
+
*
|
|
10
|
+
* This program is distributed in the hope that it will be useful,
|
|
11
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
13
|
+
* GNU Affero General Public License for more details.
|
|
14
|
+
*
|
|
15
|
+
* You should have received a copy of the GNU Affero General Public License
|
|
16
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
17
|
+
*/
|
|
18
|
+
import { createAsyncThunk, createSlice } from '@reduxjs/toolkit';
|
|
19
|
+
import { handlerApiCall } from '../apiProviders/utils';
|
|
20
|
+
import { fetchJsonFieldsOfModel as _fetchJsonFieldsOfModel, fetchObject as _fetchObject, updateJsonFieldsObject as _updateJsonFieldsObject, } from '../forms/studio/api.helpers';
|
|
21
|
+
export const fetchJsonFieldsOfModel = createAsyncThunk('metaJsonField/fetchJsonFieldsOfModel', async function (data, { getState }) {
|
|
22
|
+
return handlerApiCall({
|
|
23
|
+
fetchFunction: _fetchJsonFieldsOfModel,
|
|
24
|
+
data: data,
|
|
25
|
+
action: 'Base_SliceAction_FetchJsonFieldsOfModel',
|
|
26
|
+
getState: getState,
|
|
27
|
+
responseOptions: { isArrayResponse: true, showToast: false },
|
|
28
|
+
});
|
|
29
|
+
});
|
|
30
|
+
export const fetchObject = createAsyncThunk('metaJsonField/fetchObject', async function (data, { getState }) {
|
|
31
|
+
return handlerApiCall({
|
|
32
|
+
fetchFunction: _fetchObject,
|
|
33
|
+
data: data,
|
|
34
|
+
action: 'Base_SliceAction_FetchDataOfModel',
|
|
35
|
+
getState: getState,
|
|
36
|
+
responseOptions: { isArrayResponse: false, showToast: false },
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
export const updateJsonFieldsObject = createAsyncThunk('metaJsonField/updateJsonFieldsObject', async function (data, { getState }) {
|
|
40
|
+
return handlerApiCall({
|
|
41
|
+
fetchFunction: _updateJsonFieldsObject,
|
|
42
|
+
data: data,
|
|
43
|
+
action: 'Base_SliceAction_UpdateJsonFieldsObject',
|
|
44
|
+
getState: getState,
|
|
45
|
+
responseOptions: { isArrayResponse: false, showToast: true },
|
|
46
|
+
});
|
|
47
|
+
});
|
|
48
|
+
const initialState = {
|
|
49
|
+
fields: [],
|
|
50
|
+
object: {},
|
|
51
|
+
};
|
|
52
|
+
const metaJsonFieldSlice = createSlice({
|
|
53
|
+
name: 'metaJsonField',
|
|
54
|
+
initialState,
|
|
55
|
+
extraReducers: builder => {
|
|
56
|
+
builder.addCase(fetchJsonFieldsOfModel.fulfilled, (state, action) => {
|
|
57
|
+
state.fields = action.payload;
|
|
58
|
+
});
|
|
59
|
+
builder.addCase(fetchObject.fulfilled, (state, action) => {
|
|
60
|
+
state.object = action.payload;
|
|
61
|
+
});
|
|
62
|
+
builder.addCase(updateJsonFieldsObject.fulfilled, (state, action) => {
|
|
63
|
+
state.object = action.payload;
|
|
64
|
+
});
|
|
65
|
+
},
|
|
66
|
+
});
|
|
67
|
+
export const metaJsonFieldReducer = metaJsonFieldSlice.reducer;
|
|
68
|
+
//# sourceMappingURL=metaJsonFieldSlice.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"metaJsonFieldSlice.js","sourceRoot":"","sources":["../../src/features/metaJsonFieldSlice.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAC,gBAAgB,EAAE,WAAW,EAAC,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EAAC,cAAc,EAAC,MAAM,uBAAuB,CAAC;AACrD,OAAO,EACL,sBAAsB,IAAI,uBAAuB,EACjD,WAAW,IAAI,YAAY,EAC3B,sBAAsB,IAAI,uBAAuB,GAClD,MAAM,6BAA6B,CAAC;AAErC,MAAM,CAAC,MAAM,sBAAsB,GAAG,gBAAgB,CACpD,sCAAsC,EACtC,KAAK,WAAW,IAAI,EAAE,EAAC,QAAQ,EAAC;IAC9B,OAAO,cAAc,CAAC;QACpB,aAAa,EAAE,uBAAuB;QACtC,IAAI,EAAE,IAAI;QACV,MAAM,EAAE,yCAAyC;QACjD,QAAQ,EAAE,QAAQ;QAClB,eAAe,EAAE,EAAC,eAAe,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAC;KAC3D,CAAC,CAAC;AACL,CAAC,CACF,CAAC;AAEF,MAAM,CAAC,MAAM,WAAW,G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AAsB,CAAC,SAAS,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE;YAClE,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC;QAChC,CAAC,CAAC,CAAC;IACL,CAAC;CACF,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,oBAAoB,GAAG,kBAAkB,CAAC,OAAO,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export const searchUser: import("@reduxjs/toolkit").AsyncThunk<any, void, {
|
|
2
|
+
state?: unknown;
|
|
3
|
+
dispatch?: import("redux").Dispatch<import("redux").AnyAction>;
|
|
4
|
+
extra?: unknown;
|
|
5
|
+
rejectValue?: unknown;
|
|
6
|
+
serializedErrorType?: unknown;
|
|
7
|
+
pendingMeta?: unknown;
|
|
8
|
+
fulfilledMeta?: unknown;
|
|
9
|
+
rejectedMeta?: unknown;
|
|
10
|
+
}>;
|
|
11
|
+
export const userListReducer: import("redux").Reducer<{
|
|
12
|
+
loadingUser: boolean;
|
|
13
|
+
moreLoading: boolean;
|
|
14
|
+
isListEnd: boolean;
|
|
15
|
+
userList: any[];
|
|
16
|
+
}>;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Axelor Business Solutions
|
|
3
|
+
*
|
|
4
|
+
* Copyright (C) 2023 Axelor (<http://axelor.com>).
|
|
5
|
+
*
|
|
6
|
+
* This program is free software: you can redistribute it and/or modify
|
|
7
|
+
* it under the terms of the GNU Affero General Public License, version 3,
|
|
8
|
+
* as published by the Free Software Foundation.
|
|
9
|
+
*
|
|
10
|
+
* This program is distributed in the hope that it will be useful,
|
|
11
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
13
|
+
* GNU Affero General Public License for more details.
|
|
14
|
+
*
|
|
15
|
+
* You should have received a copy of the GNU Affero General Public License
|
|
16
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
17
|
+
*/
|
|
18
|
+
import { createAsyncThunk, createSlice } from '@reduxjs/toolkit';
|
|
19
|
+
import { generateInifiniteScrollCases, handlerApiCall, } from '../apiProviders/utils';
|
|
20
|
+
import { searchUser as _searchUser } from '../api/user-api';
|
|
21
|
+
export const searchUser = createAsyncThunk('user/searchUser', async function (data, { getState }) {
|
|
22
|
+
return handlerApiCall({
|
|
23
|
+
fetchFunction: _searchUser,
|
|
24
|
+
data,
|
|
25
|
+
action: 'Base_SliceAction_SearchUser',
|
|
26
|
+
getState,
|
|
27
|
+
responseOptions: { isArrayResponse: true },
|
|
28
|
+
});
|
|
29
|
+
});
|
|
30
|
+
const initialState = {
|
|
31
|
+
loadingUser: true,
|
|
32
|
+
moreLoading: false,
|
|
33
|
+
isListEnd: false,
|
|
34
|
+
userList: [],
|
|
35
|
+
};
|
|
36
|
+
const userSlice = createSlice({
|
|
37
|
+
name: 'user',
|
|
38
|
+
initialState,
|
|
39
|
+
extraReducers: builder => {
|
|
40
|
+
generateInifiniteScrollCases(builder, searchUser, {
|
|
41
|
+
loading: 'loadingUser',
|
|
42
|
+
moreLoading: 'moreLoading',
|
|
43
|
+
isListEnd: 'isListEnd',
|
|
44
|
+
list: 'userList',
|
|
45
|
+
});
|
|
46
|
+
},
|
|
47
|
+
});
|
|
48
|
+
export const userListReducer = userSlice.reducer;
|
|
49
|
+
//# sourceMappingURL=userSlice.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"userSlice.js","sourceRoot":"","sources":["../../src/features/userSlice.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAC,gBAAgB,EAAE,WAAW,EAAC,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EACL,4BAA4B,EAC5B,cAAc,GACf,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAC,UAAU,IAAI,WAAW,EAAC,MAAM,iBAAiB,CAAC;AAE1D,MAAM,CAAC,MAAM,UAAU,GAAG,gBAAgB,CACxC,iBAAiB,EACjB,KAAK,WAAW,IAAI,EAAE,EAAC,QAAQ,EAAC;IAC9B,OAAO,cAAc,CAAC;QACpB,aAAa,EAAE,WAAW;QAC1B,IAAI;QACJ,MAAM,EAAE,6BAA6B;QACrC,QAAQ;QACR,eAAe,EAAE,EAAC,eAAe,EAAE,IAAI,EAAC;KACzC,CAAC,CAAC;AACL,CAAC,CACF,CAAC;AAEF,MAAM,YAAY,GAAG;IACnB,WAAW,EAAE,IAAI;IACjB,WAAW,EAAE,KAAK;IAClB,SAAS,EAAE,KAAK;IAChB,QAAQ,EAAE,EAAE;CACb,CAAC;AAEF,MAAM,SAAS,GAAG,WAAW,CAAC;IAC5B,IAAI,EAAE,MAAM;IACZ,YAAY;IACZ,aAAa,EAAE,OAAO,CAAC,EAAE;QACvB,4BAA4B,CAAC,OAAO,EAAE,UAAU,EAAE;YAChD,OAAO,EAAE,aAAa;YACtB,WAAW,EAAE,aAAa;YAC1B,SAAS,EAAE,WAAW;YACtB,IAAI,EAAE,UAAU;SACjB,CAAC,CAAC;IACL,CAAC;CACF,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,eAAe,GAAG,SAAS,CAAC,OAAO,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Form, FormConfigs } from './types';
|
|
2
|
+
export interface RegisterOptions {
|
|
3
|
+
replaceOld?: boolean;
|
|
4
|
+
}
|
|
5
|
+
declare class FormConfigsProvider {
|
|
6
|
+
private formConfigs;
|
|
7
|
+
private refreshCallBack;
|
|
8
|
+
constructor();
|
|
9
|
+
register(callBack: any): void;
|
|
10
|
+
init(configs: FormConfigs): void;
|
|
11
|
+
private updateState;
|
|
12
|
+
getFormConfig(key: string): Form;
|
|
13
|
+
registerForm(key: string, options: Form, registerOptions: RegisterOptions): void;
|
|
14
|
+
getAllConfigs(): FormConfigs;
|
|
15
|
+
}
|
|
16
|
+
export declare const formConfigsProvider: FormConfigsProvider;
|
|
17
|
+
export declare const useFormConfig: (modelKey: string) => {
|
|
18
|
+
config: Form;
|
|
19
|
+
};
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Axelor Business Solutions
|
|
3
|
+
*
|
|
4
|
+
* Copyright (C) 2023 Axelor (<http://axelor.com>).
|
|
5
|
+
*
|
|
6
|
+
* This program is free software: you can redistribute it and/or modify
|
|
7
|
+
* it under the terms of the GNU Affero General Public License, version 3,
|
|
8
|
+
* as published by the Free Software Foundation.
|
|
9
|
+
*
|
|
10
|
+
* This program is distributed in the hope that it will be useful,
|
|
11
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
13
|
+
* GNU Affero General Public License for more details.
|
|
14
|
+
*
|
|
15
|
+
* You should have received a copy of the GNU Affero General Public License
|
|
16
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
17
|
+
*/
|
|
18
|
+
import { useCallback, useEffect, useMemo, useState } from 'react';
|
|
19
|
+
import { addModuleForms, fetchOptionsOfFormKey } from './register.helpers';
|
|
20
|
+
class FormConfigsProvider {
|
|
21
|
+
formConfigs;
|
|
22
|
+
refreshCallBack;
|
|
23
|
+
constructor() {
|
|
24
|
+
this.formConfigs = {};
|
|
25
|
+
this.refreshCallBack = () => { };
|
|
26
|
+
}
|
|
27
|
+
register(callBack) {
|
|
28
|
+
this.refreshCallBack = callBack;
|
|
29
|
+
}
|
|
30
|
+
init(configs) {
|
|
31
|
+
this.formConfigs = configs;
|
|
32
|
+
}
|
|
33
|
+
updateState() {
|
|
34
|
+
this.refreshCallBack(this.formConfigs);
|
|
35
|
+
}
|
|
36
|
+
getFormConfig(key) {
|
|
37
|
+
return fetchOptionsOfFormKey(this.formConfigs, key);
|
|
38
|
+
}
|
|
39
|
+
registerForm(key, options, registerOptions) {
|
|
40
|
+
this.formConfigs = addModuleForms({ ...this.formConfigs }, { [key]: options }, registerOptions);
|
|
41
|
+
this.updateState();
|
|
42
|
+
}
|
|
43
|
+
getAllConfigs() {
|
|
44
|
+
return this.formConfigs;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
export const formConfigsProvider = new FormConfigsProvider();
|
|
48
|
+
export const useFormConfig = (modelKey) => {
|
|
49
|
+
const [forms, setForms] = useState(formConfigsProvider.getAllConfigs());
|
|
50
|
+
useEffect(() => {
|
|
51
|
+
formConfigsProvider.register(setForms);
|
|
52
|
+
}, []);
|
|
53
|
+
const getFormConfigOfModel = useCallback(key => fetchOptionsOfFormKey(forms, key), [forms]);
|
|
54
|
+
return useMemo(() => ({ config: getFormConfigOfModel(modelKey) }), [getFormConfigOfModel, modelKey]);
|
|
55
|
+
};
|
|
56
|
+
//# sourceMappingURL=FormConfigsProvider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FormConfigsProvider.js","sourceRoot":"","sources":["../../src/forms/FormConfigsProvider.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAC,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAC,MAAM,OAAO,CAAC;AAEhE,OAAO,EAAC,cAAc,EAAE,qBAAqB,EAAC,MAAM,oBAAoB,CAAC;AAMzE,MAAM,mBAAmB;IACf,WAAW,CAAc;IACzB,eAAe,CAAW;IAElC;QACE,IAAI,CAAC,WAAW,GAAG,EAAE,CAAC;QACtB,IAAI,CAAC,eAAe,GAAG,GAAG,EAAE,GAAE,CAAC,CAAC;IAClC,CAAC;IAED,QAAQ,CAAC,QAAQ;QACf,IAAI,CAAC,eAAe,GAAG,QAAQ,CAAC;IAClC,CAAC;IAED,IAAI,CAAC,OAAoB;QACvB,IAAI,CAAC,WAAW,GAAG,OAAO,CAAC;IAC7B,CAAC;IAEO,WAAW;QACjB,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,WAAW,CAA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
export declare function updateRecord({ modelName, data, }: {
|
|
6
|
+
modelName: string;
|
|
7
|
+
data: any;
|
|
8
|
+
}): Promise<void>;
|
|
9
|
+
export declare function refreshRecord({ modelName, id, }: {
|
|
10
|
+
modelName: string;
|
|
11
|
+
id: number;
|
|
12
|
+
}): Promise<import("../apiProviders").RequestResponse>;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Axelor Business Solutions
|
|
3
|
+
*
|
|
4
|
+
* Copyright (C) 2023 Axelor (<http://axelor.com>).
|
|
5
|
+
*
|
|
6
|
+
* This program is free software: you can redistribute it and/or modify
|
|
7
|
+
* it under the terms of the GNU Affero General Public License, version 3,
|
|
8
|
+
* as published by the Free Software Foundation.
|
|
9
|
+
*
|
|
10
|
+
* This program is distributed in the hope that it will be useful,
|
|
11
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
13
|
+
* GNU Affero General Public License for more details.
|
|
14
|
+
*
|
|
15
|
+
* You should have received a copy of the GNU Affero General Public License
|
|
16
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
17
|
+
*/
|
|
18
|
+
import { getActionApi, getModelApi } from '../apiProviders';
|
|
19
|
+
const getMatcherFields = (data) => {
|
|
20
|
+
const fields = {};
|
|
21
|
+
Object.keys(data).forEach(key => {
|
|
22
|
+
fields[`data.${key}`] = key;
|
|
23
|
+
});
|
|
24
|
+
return fields;
|
|
25
|
+
};
|
|
26
|
+
export async function createRecord({ modelName, data, }) {
|
|
27
|
+
return getActionApi().send({
|
|
28
|
+
method: 'put',
|
|
29
|
+
url: `ws/rest/${modelName}`,
|
|
30
|
+
body: {
|
|
31
|
+
data,
|
|
32
|
+
},
|
|
33
|
+
description: `create new ${modelName}`,
|
|
34
|
+
matchers: {
|
|
35
|
+
modelName,
|
|
36
|
+
id: Date.now(),
|
|
37
|
+
fields: getMatcherFields(data),
|
|
38
|
+
},
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
export async function updateRecord({ modelName, data, }) {
|
|
42
|
+
return getActionApi().send({
|
|
43
|
+
method: 'post',
|
|
44
|
+
url: `ws/rest/${modelName}/${data?.id}`,
|
|
45
|
+
body: {
|
|
46
|
+
data,
|
|
47
|
+
},
|
|
48
|
+
description: `update ${modelName} with id ${data?.id}`,
|
|
49
|
+
matchers: {
|
|
50
|
+
modelName,
|
|
51
|
+
id: data?.id,
|
|
52
|
+
fields: getMatcherFields(data),
|
|
53
|
+
},
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
export async function refreshRecord({ modelName, id, }) {
|
|
57
|
+
return getModelApi().get({ modelName, id });
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=api.helpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api.helpers.js","sourceRoot":"","sources":["../../src/forms/api.helpers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAe,YAAY,EAAE,WAAW,EAAC,MAAM,iBAAiB,CAAC;AAExE,MAAM,gBAAgB,GAAG,CAAC,IAAS,EAAgB,EAAE;IACnD,MAAM,MAAM,GAAG,EAAE,CAAC;IAElB,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE;QAC9B,MAAM,CAAC,QAAQ,GAAG,EAAE,CAAC,GAAG,GAAG,CAAC;IAC9B,CAAC,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC;AAEF,MAAM,CAAC,KAAK,UAAU,YAAY,CAAC,EACjC,SAAS,EACT,IAAI,GAIL;IACC,OAAO,YAAY,EAAE,CAAC,IAAI,CAAC;QACzB,MAAM,EAAE,KAAK;QACb,GAAG,EAAE,WAAW,SAAS,EAAE;QAC3B,IAAI,EAAE;YACJ,IAAI;SACL;QACD,WAAW,EAAE,cAAc,SAAS,EAAE;QACtC,QAAQ,EAAE;YACR,SAAS;YACT,EAAE,EAAE,IAAI,CAAC,GAAG,EAAE;YACd,MAAM,EAAE,gBAAgB,CAAC,IAAI,CAAC;SAC/B;KACF,CAAC,CAAC;AACL,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,YAAY,CAAC,EACjC,SAAS,EACT,IAAI,GAIL;IACC,OAAO,YAAY,EAAE,CAAC,IAAI,CAAC;QACzB,MAAM,EAAE,MAAM;QACd,GAAG,EAAE,WAAW,SAAS,IAAI,IAAI,EAAE,EAAE,EAAE;QACvC,IAAI,EAAE;YACJ,IAAI;SACL;QACD,WAAW,EAAE,UAAU,SAAS,YAAY,IAAI,EAAE,EAAE,EAAE;QACtD,QAAQ,EAAE;YACR,SAAS;YACT,EAAE,EAAE,IAAI,EAAE,EAAE;YACZ,MAAM,EAAE,gBAAgB,CAAC,IAAI,CAAC;SAC/B;KACF,CAAC,CAAC;AACL,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,EAClC,SAAS,EACT,EAAE,GAIH;IACC,OAAO,WAAW,EAAE,CAAC,GAAG,CAAC,EAAC,SAAS,EAAE,EAAE,EAAC,CAAC,CAAC;AAC5C,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { KeyboardType } from 'react-native';
|
|
2
|
+
import { Action, DisplayField, DisplayPanel, Form, Widget } from './types';
|
|
3
|
+
export declare const getZIndexStyle: (zIndex: number) => {
|
|
4
|
+
zIndex: number;
|
|
5
|
+
};
|
|
6
|
+
export declare const getNumberOfParent: (key: string, formContent: (DisplayPanel | DisplayField)[]) => any;
|
|
7
|
+
export declare const getRootParentIndex: (key: string, formContent: (DisplayPanel | DisplayField)[]) => any;
|
|
8
|
+
export declare const getParentKey: (key: string, formContent: (DisplayPanel | DisplayField)[]) => string;
|
|
9
|
+
export declare const getIndexOfItemInParent: (key: string, formContent: (DisplayPanel | DisplayField)[]) => number;
|
|
10
|
+
export declare const getZIndex: (formContent: (DisplayPanel | DisplayField)[], key: string) => any;
|
|
11
|
+
export declare const isField: (_object: DisplayPanel | DisplayField) => boolean;
|
|
12
|
+
export declare const getFields: (config: Form) => DisplayField[];
|
|
13
|
+
export declare const getPanels: (config: Form) => DisplayPanel[];
|
|
14
|
+
export declare const getConfigItems: (config: Form) => (DisplayPanel | DisplayField)[];
|
|
15
|
+
export declare const sortContent: (config: Form) => (DisplayPanel | DisplayField)[];
|
|
16
|
+
export declare const getWidget: (_field: DisplayField) => Widget;
|
|
17
|
+
export declare const getKeyboardType: (_field: DisplayField) => KeyboardType;
|
|
18
|
+
export declare const getButtonTitleKey: (_action: Action) => string;
|
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Axelor Business Solutions
|
|
3
|
+
*
|
|
4
|
+
* Copyright (C) 2023 Axelor (<http://axelor.com>).
|
|
5
|
+
*
|
|
6
|
+
* This program is free software: you can redistribute it and/or modify
|
|
7
|
+
* it under the terms of the GNU Affero General Public License, version 3,
|
|
8
|
+
* as published by the Free Software Foundation.
|
|
9
|
+
*
|
|
10
|
+
* This program is distributed in the hope that it will be useful,
|
|
11
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
13
|
+
* GNU Affero General Public License for more details.
|
|
14
|
+
*
|
|
15
|
+
* You should have received a copy of the GNU Affero General Public License
|
|
16
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
17
|
+
*/
|
|
18
|
+
import { Platform } from 'react-native';
|
|
19
|
+
import { checkNullString } from '@axelor/aos-mobile-ui';
|
|
20
|
+
import { DEFAULT_COLSPAN, } from './types';
|
|
21
|
+
const DEFAULT_ZINDEX = 50;
|
|
22
|
+
export const getZIndexStyle = (zIndex) => {
|
|
23
|
+
return Platform.OS === 'ios' ? { zIndex } : null;
|
|
24
|
+
};
|
|
25
|
+
const getItem = (key, formContent) => {
|
|
26
|
+
const _item = formContent.find(_i => _i.key === key);
|
|
27
|
+
const _index = formContent.indexOf(_item);
|
|
28
|
+
return { item: _item, index: _index };
|
|
29
|
+
};
|
|
30
|
+
export const getNumberOfParent = (key, formContent) => {
|
|
31
|
+
const { item: _item } = getItem(key, formContent);
|
|
32
|
+
if (checkNullString(_item.parent)) {
|
|
33
|
+
return 0;
|
|
34
|
+
}
|
|
35
|
+
return getNumberOfParent(_item.parent, formContent) + 1;
|
|
36
|
+
};
|
|
37
|
+
export const getRootParentIndex = (key, formContent) => {
|
|
38
|
+
const { item: _item, index: _index } = getItem(key, formContent);
|
|
39
|
+
if (checkNullString(_item.parent)) {
|
|
40
|
+
return _index;
|
|
41
|
+
}
|
|
42
|
+
return getRootParentIndex(_item.parent, formContent);
|
|
43
|
+
};
|
|
44
|
+
export const getParentKey = (key, formContent) => {
|
|
45
|
+
const { item: _item } = getItem(key, formContent);
|
|
46
|
+
if (checkNullString(_item.parent) &&
|
|
47
|
+
checkNullString(_item.parentPanel)) {
|
|
48
|
+
return null;
|
|
49
|
+
}
|
|
50
|
+
if (isField(_item)) {
|
|
51
|
+
return _item.parentPanel;
|
|
52
|
+
}
|
|
53
|
+
else {
|
|
54
|
+
return _item.parent;
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
export const getIndexOfItemInParent = (key, formContent) => {
|
|
58
|
+
const parentKey = getParentKey(key, formContent);
|
|
59
|
+
if (checkNullString(parentKey)) {
|
|
60
|
+
return 0;
|
|
61
|
+
}
|
|
62
|
+
const childrenOfParent = formContent
|
|
63
|
+
.filter(_i => _i.parent === parentKey ||
|
|
64
|
+
_i.parentPanel === parentKey)
|
|
65
|
+
.sort((a, b) => b.order - a.order);
|
|
66
|
+
return childrenOfParent.findIndex(_i => _i.key === key);
|
|
67
|
+
};
|
|
68
|
+
export const getZIndex = (formContent, key) => {
|
|
69
|
+
const { item: _item, index: _index } = getItem(key, formContent);
|
|
70
|
+
if (_item == null) {
|
|
71
|
+
return 0;
|
|
72
|
+
}
|
|
73
|
+
const parentKey = getParentKey(key, formContent);
|
|
74
|
+
if (checkNullString(_item.parentPanel) &&
|
|
75
|
+
checkNullString(_item.parent)) {
|
|
76
|
+
return DEFAULT_ZINDEX - _index;
|
|
77
|
+
}
|
|
78
|
+
else {
|
|
79
|
+
const indexInParent = getIndexOfItemInParent(key, formContent);
|
|
80
|
+
return getZIndex(formContent, parentKey) + 2 + indexInParent;
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
export const isField = (_object) => {
|
|
84
|
+
return _object.type != null;
|
|
85
|
+
};
|
|
86
|
+
export const getFields = (config) => {
|
|
87
|
+
if (config.fields == null) {
|
|
88
|
+
return [];
|
|
89
|
+
}
|
|
90
|
+
return Object.entries(config.fields)
|
|
91
|
+
.map(([fieldName, _field], index) => ({
|
|
92
|
+
..._field,
|
|
93
|
+
key: fieldName,
|
|
94
|
+
order: _field.order != null ? _field.order : index * 10,
|
|
95
|
+
hideIf: _field.hideIf != null ? _field.hideIf : () => false,
|
|
96
|
+
requiredIf: _field.requiredIf != null ? _field.requiredIf : () => false,
|
|
97
|
+
readonlyIf: _field.readonlyIf != null ? _field.readonlyIf : () => false,
|
|
98
|
+
}))
|
|
99
|
+
.sort((a, b) => a.order - b.order);
|
|
100
|
+
};
|
|
101
|
+
export const getPanels = (config) => {
|
|
102
|
+
if (config.panels == null) {
|
|
103
|
+
return [];
|
|
104
|
+
}
|
|
105
|
+
return Object.entries(config.panels)
|
|
106
|
+
.map(([panelKey, _panel], index) => ({
|
|
107
|
+
..._panel,
|
|
108
|
+
key: panelKey,
|
|
109
|
+
order: _panel.order != null ? _panel.order : index * 10,
|
|
110
|
+
}))
|
|
111
|
+
.sort((a, b) => a.order - b.order);
|
|
112
|
+
};
|
|
113
|
+
export const getConfigItems = (config) => {
|
|
114
|
+
const fields = getFields(config);
|
|
115
|
+
const panels = getPanels(config);
|
|
116
|
+
const result = [...fields, ...panels];
|
|
117
|
+
return result.sort((a, b) => a.order - b.order);
|
|
118
|
+
};
|
|
119
|
+
export const sortContent = (config) => {
|
|
120
|
+
if (config == null) {
|
|
121
|
+
return [];
|
|
122
|
+
}
|
|
123
|
+
const fields = getFields(config);
|
|
124
|
+
if (config.panels == null || Object.keys(config.panels).length === 0) {
|
|
125
|
+
return fields;
|
|
126
|
+
}
|
|
127
|
+
const panels = getPanels(config);
|
|
128
|
+
const rootPanels = panels.filter(_item => checkNullString(_item.parent));
|
|
129
|
+
if (rootPanels.length === 0) {
|
|
130
|
+
return fields;
|
|
131
|
+
}
|
|
132
|
+
const result = fields.filter(_item => checkNullString(_item.parentPanel));
|
|
133
|
+
rootPanels.forEach(_panel => {
|
|
134
|
+
result.push({
|
|
135
|
+
..._panel,
|
|
136
|
+
content: getContentOfPanel(_panel.key, fields, panels),
|
|
137
|
+
});
|
|
138
|
+
});
|
|
139
|
+
return result.sort((a, b) => a.order - b.order);
|
|
140
|
+
};
|
|
141
|
+
const getContentOfPanel = (panelKey, fields, panels) => {
|
|
142
|
+
if (fields.length === 0) {
|
|
143
|
+
return [];
|
|
144
|
+
}
|
|
145
|
+
let result = fields.filter(_item => _item.parentPanel === panelKey);
|
|
146
|
+
if (panels.length === 0) {
|
|
147
|
+
return result;
|
|
148
|
+
}
|
|
149
|
+
panels
|
|
150
|
+
.filter(_item => _item.parent === panelKey)
|
|
151
|
+
.forEach(_item => {
|
|
152
|
+
result.push({
|
|
153
|
+
colSpan: DEFAULT_COLSPAN,
|
|
154
|
+
..._item,
|
|
155
|
+
content: getContentOfPanel(_item.key, fields.filter(_field => _field.parentPanel !== panelKey), panels.filter(_panel => _panel.parent !== panelKey)),
|
|
156
|
+
});
|
|
157
|
+
});
|
|
158
|
+
return result.sort((a, b) => a.order - b.order);
|
|
159
|
+
};
|
|
160
|
+
export const getWidget = (_field) => {
|
|
161
|
+
if (_field.widget === 'custom' && _field.customComponent != null) {
|
|
162
|
+
return 'custom';
|
|
163
|
+
}
|
|
164
|
+
if (_field.widget === 'file') {
|
|
165
|
+
return 'file';
|
|
166
|
+
}
|
|
167
|
+
if (_field.widget === 'label' && _field.type === 'string') {
|
|
168
|
+
return 'label';
|
|
169
|
+
}
|
|
170
|
+
if (_field.type === 'boolean') {
|
|
171
|
+
return 'checkbox';
|
|
172
|
+
}
|
|
173
|
+
if (_field.widget === 'star' && _field.type === 'number') {
|
|
174
|
+
return 'star';
|
|
175
|
+
}
|
|
176
|
+
if (_field.widget === 'increment' || _field.type === 'number') {
|
|
177
|
+
return 'increment';
|
|
178
|
+
}
|
|
179
|
+
if (_field.type === 'date' ||
|
|
180
|
+
_field.type === 'datetime' ||
|
|
181
|
+
_field.type === 'time') {
|
|
182
|
+
return 'date';
|
|
183
|
+
}
|
|
184
|
+
if (_field.widget === 'password' && _field.type === 'string') {
|
|
185
|
+
return 'password';
|
|
186
|
+
}
|
|
187
|
+
if (_field.widget === 'HTML' && _field.type === 'string') {
|
|
188
|
+
return 'HTML';
|
|
189
|
+
}
|
|
190
|
+
return 'default';
|
|
191
|
+
};
|
|
192
|
+
export const getKeyboardType = (_field) => {
|
|
193
|
+
switch (_field.type) {
|
|
194
|
+
case 'number':
|
|
195
|
+
if (_field.validationOptions != null &&
|
|
196
|
+
Object.keys(_field.validationOptions).includes('integer')) {
|
|
197
|
+
return 'number-pad';
|
|
198
|
+
}
|
|
199
|
+
return 'decimal-pad';
|
|
200
|
+
case 'phone':
|
|
201
|
+
return 'phone-pad';
|
|
202
|
+
case 'email':
|
|
203
|
+
return 'email-address';
|
|
204
|
+
default:
|
|
205
|
+
return 'default';
|
|
206
|
+
}
|
|
207
|
+
};
|
|
208
|
+
export const getButtonTitleKey = (_action) => {
|
|
209
|
+
if (_action.titleKey != null) {
|
|
210
|
+
return _action.titleKey;
|
|
211
|
+
}
|
|
212
|
+
switch (_action.type) {
|
|
213
|
+
case 'create':
|
|
214
|
+
return 'Base_FormAction_Create';
|
|
215
|
+
case 'update':
|
|
216
|
+
return 'Base_FormAction_Update';
|
|
217
|
+
case 'refresh':
|
|
218
|
+
return 'Base_FormAction_Refresh';
|
|
219
|
+
case 'reset':
|
|
220
|
+
return 'Base_FormAction_Reset';
|
|
221
|
+
default:
|
|
222
|
+
return 'Base_FormAction_Save';
|
|
223
|
+
}
|
|
224
|
+
};
|
|
225
|
+
//# sourceMappingURL=display.helpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"display.helpers.js","sourceRoot":"","sources":["../../src/forms/display.helpers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAe,QAAQ,EAAC,MAAM,cAAc,CAAC;AACpD,OAAO,EAAC,eAAe,EAAC,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAEL,eAAe,GAKhB,MAAM,SAAS,CAAC;AAEjB,MAAM,cAAc,GAAG,EAAE,CAAC;AAE1B,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,MAAc,EAAE,EAAE;IAC/C,OAAO,QAAQ,CAAC,EAAE,KAAK,KAAK,CAAC,CAAC,CAAC,EAAC,MAAM,EAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AACjD,CAAC,CAAC;AAEF,MAAM,OAAO,GAAG,CAAC,GAAW,EAAE,WAA4C,EAAE,EAAE;IAC5E,MAAM,KAAK,GAAG,WAAW,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,KAAK,GAAG,CAAC,CAAC;IACrD,MAAM,MAAM,GAAG,WAAW,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IAE1C,OAAO,EAAC,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAC,CAAC;AACtC,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAC/B,GAAW,EACX,WAA4C,EAC5C,EAAE;IACF,MAAM,EAAC,IAAI,EAAE,KAAK,EAAC,GAAG,OAAO,CAAC,GAAG,EAAE,WAAW,CAAC,CAAC;IAEhD,IAAI,eAAe,CAAE,K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;KACf;IAED,OAAO,SAAS,CAAC;AACnB,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,MAAoB,EAAgB,EAAE;IACpE,QAAQ,MAAM,CAAC,IAAI,EAAE;QACnB,KAAK,QAAQ;YACX,IACE,MAAM,CAAC,iBAAiB,IAAI,IAAI;gBAChC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAC,QAAQ,CAAC,SAAS,CAAC,EACzD;gBACA,OAAO,YAAY,CAAC;aACrB;YAED,OAAO,aAAa,CAAC;QACvB,KAAK,OAAO;YACV,OAAO,WAAW,CAAC;QACrB,KAAK,OAAO;YACV,OAAO,eAAe,CAAC;QACzB;YACE,OAAO,SAAS,CAAC;KACpB;AACH,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,OAAe,EAAU,EAAE;IAC3D,IAAI,OAAO,CAAC,QAAQ,IAAI,IAAI,EAAE;QAC5B,OAAO,OAAO,CAAC,QAAQ,CAAC;KACzB;IAED,QAAQ,OAAO,CAAC,IAAI,EAAE;QACpB,KAAK,QAAQ;YACX,OAAO,wBAAwB,CAAC;QAClC,KAAK,QAAQ;YACX,OAAO,wBAAwB,CAAC;QAClC,KAAK,SAAS;YACZ,OAAO,yBAAyB,CAAC;QACnC,KAAK,OAAO;YACV,OAAO,uBAAuB,CAAC;QACjC;YACE,OAAO,sBAAsB,CAAC;KACjC;AACH,CAAC,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Axelor Business Solutions
|
|
3
|
+
*
|
|
4
|
+
* Copyright (C) 2023 Axelor (<http://axelor.com>).
|
|
5
|
+
*
|
|
6
|
+
* This program is free software: you can redistribute it and/or modify
|
|
7
|
+
* it under the terms of the GNU Affero General Public License, version 3,
|
|
8
|
+
* as published by the Free Software Foundation.
|
|
9
|
+
*
|
|
10
|
+
* This program is distributed in the hope that it will be useful,
|
|
11
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
13
|
+
* GNU Affero General Public License for more details.
|
|
14
|
+
*
|
|
15
|
+
* You should have received a copy of the GNU Affero General Public License
|
|
16
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
17
|
+
*/
|
|
18
|
+
export * from './studio';
|
|
19
|
+
export * from './api.helpers';
|
|
20
|
+
export * from './display.helpers';
|
|
21
|
+
export * from './FormConfigsProvider';
|
|
22
|
+
export * from './register.helpers';
|
|
23
|
+
export * from './types';
|
|
24
|
+
export * from './validation.helpers';
|
|
25
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/forms/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC;AACnC,cAAc,SAAS,CAAC;AACxB,cAAc,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Field, Form, FormConfigs, JSONObject, Panel } from './types';
|
|
2
|
+
import { RegisterOptions } from './FormConfigsProvider';
|
|
3
|
+
export declare const mergePanels: (currentPanels: JSONObject<Panel>, newPanels: JSONObject<Panel>) => JSONObject<Panel>;
|
|
4
|
+
export declare const mergeFields: (currentFields: JSONObject<Field>, newFields: JSONObject<Field>) => JSONObject<Field>;
|
|
5
|
+
export declare const addModuleForms: (forms: FormConfigs, _moduleForms: FormConfigs, registerOptions?: RegisterOptions) => FormConfigs;
|
|
6
|
+
export declare const fetchOptionsOfFormKey: (forms: FormConfigs, key: string) => Form;
|