@zauru-sdk/redux 2.32.4 → 6.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.
- package/dist/esm/store.js +1 -1
- package/dist/slices/agency.slice.d.ts +1 -1
- package/dist/slices/automaticNumbers.slice.d.ts +1 -1
- package/dist/slices/catalogs.slice.d.ts +1 -1
- package/dist/slices/formsSavedData.slice.d.ts +1 -1
- package/dist/slices/profile.slice.d.ts +1 -1
- package/dist/slices/reception.slice.d.ts +1 -1
- package/dist/slices/session.slice.d.ts +1 -1
- package/dist/slices/tables.slice.d.ts +1 -1
- package/dist/slices/templates.slice.d.ts +1 -1
- package/dist/slices/user.slice.d.ts +1 -1
- package/dist/slices/webapp-tables.slice.d.ts +1 -1
- package/dist/store.d.ts +3 -3
- package/package.json +5 -4
- package/dist/cjs/index.js +0 -18
- package/dist/cjs/slices/agency.slice.js +0 -24
- package/dist/cjs/slices/automaticNumbers.slice.js +0 -24
- package/dist/cjs/slices/catalogs.slice.js +0 -69
- package/dist/cjs/slices/formValidation.slice.js +0 -19
- package/dist/cjs/slices/index.js +0 -27
- package/dist/cjs/slices/profile.slice.js +0 -26
- package/dist/cjs/slices/reception.slice.js +0 -76
- package/dist/cjs/slices/session.slice.js +0 -16
- package/dist/cjs/slices/tables.slice.js +0 -20
- package/dist/cjs/slices/templates.slice.js +0 -23
- package/dist/cjs/slices/user.slice.js +0 -42
- package/dist/cjs/slices/webapp-tables.slice.js +0 -24
- package/dist/cjs/store.js +0 -131
- package/dist/esm/slices/formValidation.slice.js +0 -19
- package/dist/slices/formValidation.slice.d.ts +0 -14
package/dist/esm/store.js
CHANGED
|
@@ -28,7 +28,7 @@ const formsSavedData_slice_js_1 = __importDefault(require("./slices/formsSavedDa
|
|
|
28
28
|
* private mode, Safari, or nearly full disks can lower the effective cap. Other
|
|
29
29
|
* apps on the same origin share the same quota.
|
|
30
30
|
*/
|
|
31
|
-
exports.LOCAL_STORAGE_REDUX_NAME = "
|
|
31
|
+
exports.LOCAL_STORAGE_REDUX_NAME = "___redux__state__v7.0";
|
|
32
32
|
function isQuotaExceededError(error) {
|
|
33
33
|
if (error instanceof DOMException && error.name === "QuotaExceededError") {
|
|
34
34
|
return true;
|
|
@@ -4,5 +4,5 @@ export interface AgencyState {
|
|
|
4
4
|
loadingAgencyProfile: boolean;
|
|
5
5
|
}
|
|
6
6
|
export declare const setAgencyProfile: import("@reduxjs/toolkit").ActionCreatorWithPayload<AgencyGraphQL, "agency/setAgencyProfile">, setLoadingAgencyProfile: import("@reduxjs/toolkit").ActionCreatorWithPayload<boolean, "agency/setLoadingAgencyProfile">;
|
|
7
|
-
declare const _default: import("
|
|
7
|
+
declare const _default: import("@reduxjs/toolkit").Reducer<AgencyState>;
|
|
8
8
|
export default _default;
|
|
@@ -13,5 +13,5 @@ export declare const automaticNumberFetchStart: import("@reduxjs/toolkit").Actio
|
|
|
13
13
|
name: AUTOMATIC_NUMBER_NAMES;
|
|
14
14
|
data: any;
|
|
15
15
|
}, "automaticNumbers/automaticNumberFetchSuccess">;
|
|
16
|
-
declare const _default: import("
|
|
16
|
+
declare const _default: import("@reduxjs/toolkit").Reducer<AutomaticNumberState>;
|
|
17
17
|
export default _default;
|
|
@@ -60,5 +60,5 @@ export declare const catalogsFetchStart: import("@reduxjs/toolkit").ActionCreato
|
|
|
60
60
|
name: CATALOGS_NAMES;
|
|
61
61
|
data: any[];
|
|
62
62
|
}, "catalogs/catalogsFetchSuccess">, catalogsSetReFetch: import("@reduxjs/toolkit").ActionCreatorWithPayload<CATALOGS_NAMES, "catalogs/catalogsSetReFetch">;
|
|
63
|
-
declare const _default: import("
|
|
63
|
+
declare const _default: import("@reduxjs/toolkit").Reducer<CatalogState>;
|
|
64
64
|
export default _default;
|
|
@@ -8,5 +8,5 @@ export declare const setFormFieldSavedData: import("@reduxjs/toolkit").ActionCre
|
|
|
8
8
|
name: string;
|
|
9
9
|
value: any;
|
|
10
10
|
}, "formSavedData/setFormFieldSavedData">;
|
|
11
|
-
declare const _default: import("
|
|
11
|
+
declare const _default: import("@reduxjs/toolkit").Reducer<FormSavedData>;
|
|
12
12
|
export default _default;
|
|
@@ -22,5 +22,5 @@ export declare const profileFetchStart: import("@reduxjs/toolkit").ActionCreator
|
|
|
22
22
|
name: PROFILE_NAMES;
|
|
23
23
|
data: any;
|
|
24
24
|
}, "profile/profileFetchSuccess">;
|
|
25
|
-
declare const _default: import("
|
|
25
|
+
declare const _default: import("@reduxjs/toolkit").Reducer<ProfilesState>;
|
|
26
26
|
export default _default;
|
|
@@ -62,5 +62,5 @@ export declare const receptionFetchStart: import("@reduxjs/toolkit").ActionCreat
|
|
|
62
62
|
name: RECEPTION_NAMES;
|
|
63
63
|
data: any;
|
|
64
64
|
}, "reception/receptionConcatToArray">;
|
|
65
|
-
declare const _default: import("
|
|
65
|
+
declare const _default: import("@reduxjs/toolkit").Reducer<ReceptionState>;
|
|
66
66
|
export default _default;
|
|
@@ -5,5 +5,5 @@ export declare const setSessionValue: import("@reduxjs/toolkit").ActionCreatorWi
|
|
|
5
5
|
name: string;
|
|
6
6
|
data: any;
|
|
7
7
|
}, "session/setSessionValue">;
|
|
8
|
-
declare const _default: import("
|
|
8
|
+
declare const _default: import("@reduxjs/toolkit").Reducer<SessionState>;
|
|
9
9
|
export default _default;
|
|
@@ -8,5 +8,5 @@ export declare const tableSetPage: import("@reduxjs/toolkit").ActionCreatorWithP
|
|
|
8
8
|
name: TABLE_NAMES;
|
|
9
9
|
data: number;
|
|
10
10
|
}, "table/tableSetPage">;
|
|
11
|
-
declare const _default: import("
|
|
11
|
+
declare const _default: import("@reduxjs/toolkit").Reducer<TableState>;
|
|
12
12
|
export default _default;
|
|
@@ -9,5 +9,5 @@ export declare const templateFetchStart: import("@reduxjs/toolkit").ActionCreato
|
|
|
9
9
|
name: TEMPLATE_NAMES;
|
|
10
10
|
data: any;
|
|
11
11
|
}, "template/templateFetchSuccess">;
|
|
12
|
-
declare const _default: import("
|
|
12
|
+
declare const _default: import("@reduxjs/toolkit").Reducer<TemplateState>;
|
|
13
13
|
export default _default;
|
|
@@ -8,5 +8,5 @@ export interface UserState {
|
|
|
8
8
|
loadingEmployeeInfo: boolean;
|
|
9
9
|
}
|
|
10
10
|
export declare const setUserProfile: import("@reduxjs/toolkit").ActionCreatorWithPayload<ProfileResponse, "user/setUserProfile">, setEmployeeProfile: import("@reduxjs/toolkit").ActionCreatorWithPayload<EmployeeGraphQL, "user/setEmployeeProfile">, setOauthProfile: import("@reduxjs/toolkit").ActionCreatorWithPayload<OauthProfile, "user/setOauthProfile">, setLoadingEmployeeProfile: import("@reduxjs/toolkit").ActionCreatorWithPayload<boolean, "user/setLoadingEmployeeProfile">, setLoadingOauthProfile: import("@reduxjs/toolkit").ActionCreatorWithPayload<boolean, "user/setLoadingOauthProfile">, setLoadingUserProfile: import("@reduxjs/toolkit").ActionCreatorWithPayload<boolean, "user/setLoadingUserProfile">;
|
|
11
|
-
declare const _default: import("
|
|
11
|
+
declare const _default: import("@reduxjs/toolkit").Reducer<UserState>;
|
|
12
12
|
export default _default;
|
|
@@ -4,5 +4,5 @@ export interface WebAppTableState {
|
|
|
4
4
|
loadingSpecialItems: boolean;
|
|
5
5
|
}
|
|
6
6
|
export declare const setLoadingSpecialItems: import("@reduxjs/toolkit").ActionCreatorWithPayload<boolean, "webappTables/setLoadingSpecialItems">, setSpecialItems: import("@reduxjs/toolkit").ActionCreatorWithPayload<WebAppRowGraphQL<SpecialItem>[], "webappTables/setSpecialItems">;
|
|
7
|
-
declare const _default: import("
|
|
7
|
+
declare const _default: import("@reduxjs/toolkit").Reducer<WebAppTableState>;
|
|
8
8
|
export default _default;
|
package/dist/store.d.ts
CHANGED
|
@@ -13,14 +13,14 @@ import { Tuple } from "@reduxjs/toolkit";
|
|
|
13
13
|
* private mode, Safari, or nearly full disks can lower the effective cap. Other
|
|
14
14
|
* apps on the same origin share the same quota.
|
|
15
15
|
*/
|
|
16
|
-
export declare const LOCAL_STORAGE_REDUX_NAME = "
|
|
16
|
+
export declare const LOCAL_STORAGE_REDUX_NAME = "___redux__state__v7.0";
|
|
17
17
|
type Whitelist = {
|
|
18
18
|
[K in keyof RootState]?: string[];
|
|
19
19
|
};
|
|
20
20
|
export declare const cleanLocalStorage: (whitelist?: Whitelist) => void;
|
|
21
|
-
export declare const store: import("@reduxjs/toolkit").EnhancedStore<any, import("
|
|
21
|
+
export declare const store: import("@reduxjs/toolkit").EnhancedStore<any, import("@reduxjs/toolkit").UnknownAction, Tuple<[import("@reduxjs/toolkit").StoreEnhancer<{
|
|
22
22
|
dispatch: {};
|
|
23
|
-
}>, import("
|
|
23
|
+
}>, import("@reduxjs/toolkit").StoreEnhancer]>>;
|
|
24
24
|
export type RootState = ReturnType<typeof store.getState>;
|
|
25
25
|
export type AppDispatch = typeof store.dispatch;
|
|
26
26
|
export declare const useAppSelector: TypedUseSelectorHook<RootState>;
|
package/package.json
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zauru-sdk/redux",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "6.0.0",
|
|
4
4
|
"description": "Estructura de Redux propuesta para el desarrollo de webapps en Zauru.",
|
|
5
5
|
"main": "./dist/esm/index.js",
|
|
6
6
|
"module": "./dist/esm/index.js",
|
|
7
7
|
"types": "./dist/index.d.ts",
|
|
8
8
|
"publishConfig": {
|
|
9
|
-
"access": "public"
|
|
9
|
+
"access": "public",
|
|
10
|
+
"registry": "https://registry.npmjs.org/"
|
|
10
11
|
},
|
|
11
12
|
"scripts": {
|
|
12
13
|
"build": "npm run build:esm",
|
|
@@ -25,11 +26,11 @@
|
|
|
25
26
|
},
|
|
26
27
|
"dependencies": {
|
|
27
28
|
"@reduxjs/toolkit": "^2.2.1",
|
|
28
|
-
"@zauru-sdk/types": "^
|
|
29
|
+
"@zauru-sdk/types": "^6.0.0",
|
|
29
30
|
"react": "^18.2.0",
|
|
30
31
|
"react-dom": "^18.2.0",
|
|
31
32
|
"react-redux": "^9.1.0",
|
|
32
33
|
"react-select": "^5.8.0"
|
|
33
34
|
},
|
|
34
|
-
"gitHead": "
|
|
35
|
+
"gitHead": "32fe3db68a20bc4bfec9b59db37bd1bf221acc34"
|
|
35
36
|
}
|
package/dist/cjs/index.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./slices/index.js"), exports);
|
|
18
|
-
__exportStar(require("./store.js"), exports);
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var _a;
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.setLoadingAgencyProfile = exports.setAgencyProfile = void 0;
|
|
5
|
-
const toolkit_1 = require("@reduxjs/toolkit");
|
|
6
|
-
const initialState = {
|
|
7
|
-
agencyProfile: {},
|
|
8
|
-
loadingAgencyProfile: false,
|
|
9
|
-
};
|
|
10
|
-
const agencySlice = (0, toolkit_1.createSlice)({
|
|
11
|
-
name: "agency",
|
|
12
|
-
initialState,
|
|
13
|
-
reducers: {
|
|
14
|
-
setAgencyProfile: (state, action) => {
|
|
15
|
-
state.agencyProfile = action.payload;
|
|
16
|
-
},
|
|
17
|
-
setLoadingAgencyProfile: (state, action) => {
|
|
18
|
-
state.loadingAgencyProfile = action.payload;
|
|
19
|
-
state.loadingAgencyProfile = false;
|
|
20
|
-
},
|
|
21
|
-
},
|
|
22
|
-
});
|
|
23
|
-
_a = agencySlice.actions, exports.setAgencyProfile = _a.setAgencyProfile, exports.setLoadingAgencyProfile = _a.setLoadingAgencyProfile;
|
|
24
|
-
exports.default = agencySlice.reducer;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var _a;
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.automaticNumberFetchSuccess = exports.automaticNumberFetchStart = void 0;
|
|
5
|
-
const toolkit_1 = require("@reduxjs/toolkit");
|
|
6
|
-
const initialState = {
|
|
7
|
-
purchaseOrderIdNumber: { data: "", loading: false },
|
|
8
|
-
dischargeIdNumber: { data: "NCB00000", loading: false },
|
|
9
|
-
};
|
|
10
|
-
const automaticNumbersSlice = (0, toolkit_1.createSlice)({
|
|
11
|
-
name: "automaticNumbers",
|
|
12
|
-
initialState,
|
|
13
|
-
reducers: {
|
|
14
|
-
automaticNumberFetchStart: (state, action) => {
|
|
15
|
-
state[action.payload].loading = true;
|
|
16
|
-
},
|
|
17
|
-
automaticNumberFetchSuccess: (state, action) => {
|
|
18
|
-
state[action.payload.name].data = action.payload.data;
|
|
19
|
-
state[action.payload.name].loading = false;
|
|
20
|
-
},
|
|
21
|
-
},
|
|
22
|
-
});
|
|
23
|
-
_a = automaticNumbersSlice.actions, exports.automaticNumberFetchStart = _a.automaticNumberFetchStart, exports.automaticNumberFetchSuccess = _a.automaticNumberFetchSuccess;
|
|
24
|
-
exports.default = automaticNumbersSlice.reducer;
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var _a;
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.catalogsSetReFetch = exports.catalogsFetchSuccess = exports.catalogsFetchStart = void 0;
|
|
5
|
-
const toolkit_1 = require("@reduxjs/toolkit");
|
|
6
|
-
const createLoadingState = (initialData) => ({
|
|
7
|
-
data: initialData,
|
|
8
|
-
loading: false,
|
|
9
|
-
reFetch: false,
|
|
10
|
-
});
|
|
11
|
-
const initialState = {
|
|
12
|
-
agencies: createLoadingState([]),
|
|
13
|
-
suggestedPrices: createLoadingState([]),
|
|
14
|
-
providers: createLoadingState([]),
|
|
15
|
-
providerCategories: createLoadingState([]),
|
|
16
|
-
receptionTypes: createLoadingState([]),
|
|
17
|
-
tiposDeMuestra: createLoadingState([]),
|
|
18
|
-
templates: createLoadingState([]),
|
|
19
|
-
shipments: createLoadingState([]),
|
|
20
|
-
bookings: createLoadingState([]),
|
|
21
|
-
motivosRechazo: createLoadingState([]),
|
|
22
|
-
bitacoraRechazoMasivo: createLoadingState([]),
|
|
23
|
-
items: createLoadingState([]),
|
|
24
|
-
itemsByReception: createLoadingState([]),
|
|
25
|
-
payees: createLoadingState([]),
|
|
26
|
-
payeesForLab: createLoadingState([]),
|
|
27
|
-
itemCategoriesForLab: createLoadingState([]),
|
|
28
|
-
payeeCategoriesLabPrices: createLoadingState([]),
|
|
29
|
-
payeeCategories: createLoadingState([]),
|
|
30
|
-
clientCategories: createLoadingState([]),
|
|
31
|
-
itemsByLab: createLoadingState([]),
|
|
32
|
-
itemServicesByLab: createLoadingState([]),
|
|
33
|
-
bundlesRecipForLab: createLoadingState([]),
|
|
34
|
-
bundlesForLab: createLoadingState([]),
|
|
35
|
-
currencies: createLoadingState([]),
|
|
36
|
-
paymentTerms: createLoadingState([]),
|
|
37
|
-
employeesByLab: createLoadingState([]),
|
|
38
|
-
employeesByCurrentAgency: createLoadingState([]),
|
|
39
|
-
invoicesByLab: createLoadingState([]),
|
|
40
|
-
invoiceForms: createLoadingState([]),
|
|
41
|
-
caseForms: createLoadingState([]),
|
|
42
|
-
allForms: createLoadingState([]),
|
|
43
|
-
invoiceFormSubmissions: createLoadingState([]),
|
|
44
|
-
myCases: createLoadingState([]),
|
|
45
|
-
myCaseFormSubmissions: createLoadingState([]),
|
|
46
|
-
myAgencyLotStocks: createLoadingState([]),
|
|
47
|
-
shipmentsToMyAgency: createLoadingState([]),
|
|
48
|
-
paymentMethods: createLoadingState([]),
|
|
49
|
-
printTemplates: createLoadingState([]),
|
|
50
|
-
};
|
|
51
|
-
const catalogsSlice = (0, toolkit_1.createSlice)({
|
|
52
|
-
name: "catalogs",
|
|
53
|
-
initialState,
|
|
54
|
-
reducers: {
|
|
55
|
-
catalogsSetReFetch: (state, action) => {
|
|
56
|
-
state[action.payload].reFetch = true;
|
|
57
|
-
},
|
|
58
|
-
catalogsFetchStart: (state, action) => {
|
|
59
|
-
state[action.payload].loading = true;
|
|
60
|
-
},
|
|
61
|
-
catalogsFetchSuccess: (state, action) => {
|
|
62
|
-
state[action.payload.name].data = action.payload.data;
|
|
63
|
-
state[action.payload.name].loading = false;
|
|
64
|
-
state[action.payload.name].reFetch = false;
|
|
65
|
-
},
|
|
66
|
-
},
|
|
67
|
-
});
|
|
68
|
-
_a = catalogsSlice.actions, exports.catalogsFetchStart = _a.catalogsFetchStart, exports.catalogsFetchSuccess = _a.catalogsFetchSuccess, exports.catalogsSetReFetch = _a.catalogsSetReFetch;
|
|
69
|
-
exports.default = catalogsSlice.reducer;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.setFieldError = void 0;
|
|
4
|
-
const toolkit_1 = require("@reduxjs/toolkit");
|
|
5
|
-
const initialState = {
|
|
6
|
-
formValidations: {},
|
|
7
|
-
};
|
|
8
|
-
const formValidationsSlice = (0, toolkit_1.createSlice)({
|
|
9
|
-
name: "formValidations",
|
|
10
|
-
initialState,
|
|
11
|
-
reducers: {
|
|
12
|
-
setFieldError: (state, action) => {
|
|
13
|
-
state.formValidations[action.payload.formName][action.payload.name] =
|
|
14
|
-
action.payload.error;
|
|
15
|
-
},
|
|
16
|
-
},
|
|
17
|
-
});
|
|
18
|
-
exports.setFieldError = formValidationsSlice.actions.setFieldError;
|
|
19
|
-
exports.default = formValidationsSlice.reducer;
|
package/dist/cjs/slices/index.js
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./agency.slice.js"), exports);
|
|
18
|
-
__exportStar(require("./automaticNumbers.slice.js"), exports);
|
|
19
|
-
__exportStar(require("./catalogs.slice.js"), exports);
|
|
20
|
-
__exportStar(require("./formValidation.slice.js"), exports);
|
|
21
|
-
__exportStar(require("./profile.slice.js"), exports);
|
|
22
|
-
__exportStar(require("./reception.slice.js"), exports);
|
|
23
|
-
__exportStar(require("./session.slice.js"), exports);
|
|
24
|
-
__exportStar(require("./tables.slice.js"), exports);
|
|
25
|
-
__exportStar(require("./templates.slice.js"), exports);
|
|
26
|
-
__exportStar(require("./user.slice.js"), exports);
|
|
27
|
-
__exportStar(require("./webapp-tables.slice.js"), exports);
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var _a;
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.profileFetchSuccess = exports.profileFetchStart = void 0;
|
|
5
|
-
const toolkit_1 = require("@reduxjs/toolkit");
|
|
6
|
-
const initialState = {
|
|
7
|
-
userProfile: { data: {}, loading: false },
|
|
8
|
-
oauthProfile: { data: {}, loading: false },
|
|
9
|
-
employeeProfile: { data: {}, loading: false },
|
|
10
|
-
agencyProfile: { data: {}, loading: false },
|
|
11
|
-
};
|
|
12
|
-
const profileSlice = (0, toolkit_1.createSlice)({
|
|
13
|
-
name: "profile",
|
|
14
|
-
initialState,
|
|
15
|
-
reducers: {
|
|
16
|
-
profileFetchStart: (state, action) => {
|
|
17
|
-
state[action.payload].loading = true;
|
|
18
|
-
},
|
|
19
|
-
profileFetchSuccess: (state, action) => {
|
|
20
|
-
state[action.payload.name].data = action.payload.data;
|
|
21
|
-
state[action.payload.name].loading = false;
|
|
22
|
-
},
|
|
23
|
-
},
|
|
24
|
-
});
|
|
25
|
-
_a = profileSlice.actions, exports.profileFetchStart = _a.profileFetchStart, exports.profileFetchSuccess = _a.profileFetchSuccess;
|
|
26
|
-
exports.default = profileSlice.reducer;
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var _a;
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.receptionConcatToArray = exports.receptionFetchSuccess = exports.receptionFetchStart = void 0;
|
|
5
|
-
const toolkit_1 = require("@reduxjs/toolkit");
|
|
6
|
-
const initialState = {
|
|
7
|
-
basketLots: {
|
|
8
|
-
data: {},
|
|
9
|
-
loading: false,
|
|
10
|
-
reFetch: false,
|
|
11
|
-
},
|
|
12
|
-
rejectionInfo: {
|
|
13
|
-
data: {},
|
|
14
|
-
loading: false,
|
|
15
|
-
reFetch: false,
|
|
16
|
-
},
|
|
17
|
-
newPurchaseOrderInfo: {
|
|
18
|
-
data: {},
|
|
19
|
-
loading: false,
|
|
20
|
-
reFetch: false,
|
|
21
|
-
},
|
|
22
|
-
purchaseOrderGeneralInfo: {
|
|
23
|
-
data: {},
|
|
24
|
-
loading: false,
|
|
25
|
-
reFetch: false,
|
|
26
|
-
},
|
|
27
|
-
poReceptions: {
|
|
28
|
-
data: [],
|
|
29
|
-
loading: false,
|
|
30
|
-
reFetch: false,
|
|
31
|
-
},
|
|
32
|
-
queueReceptions: {
|
|
33
|
-
data: [],
|
|
34
|
-
loading: false,
|
|
35
|
-
reFetch: false,
|
|
36
|
-
},
|
|
37
|
-
offlineQueueReceptions: {
|
|
38
|
-
data: [],
|
|
39
|
-
loading: false,
|
|
40
|
-
reFetch: false,
|
|
41
|
-
},
|
|
42
|
-
};
|
|
43
|
-
const receptionSlice = (0, toolkit_1.createSlice)({
|
|
44
|
-
name: "reception",
|
|
45
|
-
initialState,
|
|
46
|
-
reducers: {
|
|
47
|
-
receptionFetchStart: (state, action) => {
|
|
48
|
-
state[action.payload].loading = true;
|
|
49
|
-
},
|
|
50
|
-
receptionFetchSuccess: (state, action) => {
|
|
51
|
-
if (state[action.payload.name].data) {
|
|
52
|
-
state[action.payload.name].data = action.payload.data;
|
|
53
|
-
}
|
|
54
|
-
else {
|
|
55
|
-
console.error("receptionFetchSuccess not found: ", action.payload.name);
|
|
56
|
-
}
|
|
57
|
-
state[action.payload.name].loading = false;
|
|
58
|
-
},
|
|
59
|
-
receptionConcatToArray: (state, action) => {
|
|
60
|
-
if (state[action.payload.name].data) {
|
|
61
|
-
if (Array.isArray(state[action.payload.name].data)) {
|
|
62
|
-
state[action.payload.name].data = [
|
|
63
|
-
...state[action.payload.name].data,
|
|
64
|
-
action.payload.data,
|
|
65
|
-
];
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
else {
|
|
69
|
-
console.error("receptionConcatToArray not found: ", action.payload.name);
|
|
70
|
-
}
|
|
71
|
-
state[action.payload.name].loading = false;
|
|
72
|
-
},
|
|
73
|
-
},
|
|
74
|
-
});
|
|
75
|
-
_a = receptionSlice.actions, exports.receptionFetchStart = _a.receptionFetchStart, exports.receptionFetchSuccess = _a.receptionFetchSuccess, exports.receptionConcatToArray = _a.receptionConcatToArray;
|
|
76
|
-
exports.default = receptionSlice.reducer;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.setSessionValue = void 0;
|
|
4
|
-
const toolkit_1 = require("@reduxjs/toolkit");
|
|
5
|
-
const initialState = {};
|
|
6
|
-
const sessionSlice = (0, toolkit_1.createSlice)({
|
|
7
|
-
name: "session",
|
|
8
|
-
initialState,
|
|
9
|
-
reducers: {
|
|
10
|
-
setSessionValue: (state, action) => {
|
|
11
|
-
state[action.payload.name] = action.payload.data;
|
|
12
|
-
},
|
|
13
|
-
},
|
|
14
|
-
});
|
|
15
|
-
exports.setSessionValue = sessionSlice.actions.setSessionValue;
|
|
16
|
-
exports.default = sessionSlice.reducer;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.tableSetPage = void 0;
|
|
4
|
-
const toolkit_1 = require("@reduxjs/toolkit");
|
|
5
|
-
const initialState = {
|
|
6
|
-
pageTable1: 1,
|
|
7
|
-
pageTable2: 1,
|
|
8
|
-
pageTable3: 1,
|
|
9
|
-
};
|
|
10
|
-
const tableSlice = (0, toolkit_1.createSlice)({
|
|
11
|
-
name: "table",
|
|
12
|
-
initialState,
|
|
13
|
-
reducers: {
|
|
14
|
-
tableSetPage: (state, action) => {
|
|
15
|
-
state[action.payload.name] = action.payload.data;
|
|
16
|
-
},
|
|
17
|
-
},
|
|
18
|
-
});
|
|
19
|
-
exports.tableSetPage = tableSlice.actions.tableSetPage;
|
|
20
|
-
exports.default = tableSlice.reducer;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var _a;
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.templateFetchSuccess = exports.templateFetchStart = void 0;
|
|
5
|
-
const toolkit_1 = require("@reduxjs/toolkit");
|
|
6
|
-
const initialState = {
|
|
7
|
-
receptionTemplate: { data: "", loading: false },
|
|
8
|
-
};
|
|
9
|
-
const templateSlice = (0, toolkit_1.createSlice)({
|
|
10
|
-
name: "template",
|
|
11
|
-
initialState,
|
|
12
|
-
reducers: {
|
|
13
|
-
templateFetchStart: (state, action) => {
|
|
14
|
-
state[action.payload].loading = true;
|
|
15
|
-
},
|
|
16
|
-
templateFetchSuccess: (state, action) => {
|
|
17
|
-
state[action.payload.name].data = action.payload.data;
|
|
18
|
-
state[action.payload.name].loading = false;
|
|
19
|
-
},
|
|
20
|
-
},
|
|
21
|
-
});
|
|
22
|
-
_a = templateSlice.actions, exports.templateFetchStart = _a.templateFetchStart, exports.templateFetchSuccess = _a.templateFetchSuccess;
|
|
23
|
-
exports.default = templateSlice.reducer;
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var _a;
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.setLoadingUserProfile = exports.setLoadingOauthProfile = exports.setLoadingEmployeeProfile = exports.setOauthProfile = exports.setEmployeeProfile = exports.setUserProfile = void 0;
|
|
5
|
-
const toolkit_1 = require("@reduxjs/toolkit");
|
|
6
|
-
const initialState = {
|
|
7
|
-
userProfile: {},
|
|
8
|
-
loadingUserProfile: false,
|
|
9
|
-
oauthProfile: {},
|
|
10
|
-
loadingOauthProfile: false,
|
|
11
|
-
employeeProfile: {},
|
|
12
|
-
loadingEmployeeInfo: false,
|
|
13
|
-
};
|
|
14
|
-
const userSlice = (0, toolkit_1.createSlice)({
|
|
15
|
-
name: "user",
|
|
16
|
-
initialState,
|
|
17
|
-
reducers: {
|
|
18
|
-
setUserProfile: (state, action) => {
|
|
19
|
-
state.userProfile = action.payload;
|
|
20
|
-
state.loadingUserProfile = false;
|
|
21
|
-
},
|
|
22
|
-
setLoadingUserProfile: (state, action) => {
|
|
23
|
-
state.loadingUserProfile = action.payload;
|
|
24
|
-
},
|
|
25
|
-
setOauthProfile: (state, action) => {
|
|
26
|
-
state.oauthProfile = action.payload;
|
|
27
|
-
state.loadingOauthProfile = false;
|
|
28
|
-
},
|
|
29
|
-
setLoadingOauthProfile: (state, action) => {
|
|
30
|
-
state.loadingOauthProfile = action.payload;
|
|
31
|
-
},
|
|
32
|
-
setEmployeeProfile: (state, action) => {
|
|
33
|
-
state.employeeProfile = action.payload;
|
|
34
|
-
state.loadingEmployeeInfo = false;
|
|
35
|
-
},
|
|
36
|
-
setLoadingEmployeeProfile: (state, action) => {
|
|
37
|
-
state.loadingEmployeeInfo = action.payload;
|
|
38
|
-
},
|
|
39
|
-
},
|
|
40
|
-
});
|
|
41
|
-
_a = userSlice.actions, exports.setUserProfile = _a.setUserProfile, exports.setEmployeeProfile = _a.setEmployeeProfile, exports.setOauthProfile = _a.setOauthProfile, exports.setLoadingEmployeeProfile = _a.setLoadingEmployeeProfile, exports.setLoadingOauthProfile = _a.setLoadingOauthProfile, exports.setLoadingUserProfile = _a.setLoadingUserProfile;
|
|
42
|
-
exports.default = userSlice.reducer;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var _a;
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.setSpecialItems = exports.setLoadingSpecialItems = void 0;
|
|
5
|
-
const toolkit_1 = require("@reduxjs/toolkit");
|
|
6
|
-
const initialState = {
|
|
7
|
-
specialItems: [],
|
|
8
|
-
loadingSpecialItems: false,
|
|
9
|
-
};
|
|
10
|
-
const webappTablesSlice = (0, toolkit_1.createSlice)({
|
|
11
|
-
name: "webappTables",
|
|
12
|
-
initialState,
|
|
13
|
-
reducers: {
|
|
14
|
-
setLoadingSpecialItems: (state, action) => {
|
|
15
|
-
state.loadingSpecialItems = action.payload;
|
|
16
|
-
},
|
|
17
|
-
setSpecialItems: (state, action) => {
|
|
18
|
-
state.specialItems = action.payload;
|
|
19
|
-
state.loadingSpecialItems = false;
|
|
20
|
-
},
|
|
21
|
-
},
|
|
22
|
-
});
|
|
23
|
-
_a = webappTablesSlice.actions, exports.setLoadingSpecialItems = _a.setLoadingSpecialItems, exports.setSpecialItems = _a.setSpecialItems;
|
|
24
|
-
exports.default = webappTablesSlice.reducer;
|
package/dist/cjs/store.js
DELETED
|
@@ -1,131 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.useAppDispatch = exports.useAppSelector = exports.store = exports.cleanLocalStorage = exports.LOCAL_STORAGE_REDUX_NAME = void 0;
|
|
7
|
-
const react_redux_1 = require("react-redux");
|
|
8
|
-
const toolkit_1 = require("@reduxjs/toolkit");
|
|
9
|
-
const catalogs_slice_js_1 = __importDefault(require("./slices/catalogs.slice.js"));
|
|
10
|
-
const profile_slice_js_1 = __importDefault(require("./slices/profile.slice.js"));
|
|
11
|
-
const webapp_tables_slice_js_1 = __importDefault(require("./slices/webapp-tables.slice.js"));
|
|
12
|
-
const reception_slice_js_1 = __importDefault(require("./slices/reception.slice.js"));
|
|
13
|
-
const session_slice_js_1 = __importDefault(require("./slices/session.slice.js"));
|
|
14
|
-
const templates_slice_js_1 = __importDefault(require("./slices/templates.slice.js"));
|
|
15
|
-
const automaticNumbers_slice_js_1 = __importDefault(require("./slices/automaticNumbers.slice.js"));
|
|
16
|
-
const tables_slice_js_1 = __importDefault(require("./slices/tables.slice.js"));
|
|
17
|
-
const formValidation_slice_js_1 = __importDefault(require("./slices/formValidation.slice.js"));
|
|
18
|
-
exports.LOCAL_STORAGE_REDUX_NAME = "___redux__state__v3.1.1";
|
|
19
|
-
const persistanceLocalStorageMiddleware = (store) => (next) => (action) => {
|
|
20
|
-
const result = next(action);
|
|
21
|
-
if (!(typeof document === "undefined")) {
|
|
22
|
-
localStorage.setItem(exports.LOCAL_STORAGE_REDUX_NAME, JSON.stringify(store.getState()));
|
|
23
|
-
}
|
|
24
|
-
return result;
|
|
25
|
-
};
|
|
26
|
-
const preloadedState = (() => {
|
|
27
|
-
try {
|
|
28
|
-
if (!(typeof document === "undefined")) {
|
|
29
|
-
const savedState = localStorage.getItem(exports.LOCAL_STORAGE_REDUX_NAME);
|
|
30
|
-
if (savedState) {
|
|
31
|
-
return JSON.parse(savedState);
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
catch (e) {
|
|
36
|
-
// Ignorar los errores, se utiliza el estado inicial definido en cada reducer
|
|
37
|
-
}
|
|
38
|
-
})();
|
|
39
|
-
const cleanLocalStorage = (whitelist = {}) => {
|
|
40
|
-
const savedState = localStorage.getItem(exports.LOCAL_STORAGE_REDUX_NAME);
|
|
41
|
-
const state = JSON.parse(savedState ?? "{}");
|
|
42
|
-
try {
|
|
43
|
-
//delete all cookies
|
|
44
|
-
// const deleteAllCookies = () => {
|
|
45
|
-
// const cookies = document.cookie.split(";");
|
|
46
|
-
// for (const cookie of cookies) {
|
|
47
|
-
// const eqPos = cookie.indexOf("=");
|
|
48
|
-
// const name = eqPos > -1 ? cookie.substring(0, eqPos) : cookie;
|
|
49
|
-
// document.cookie = name + "=;expires=Thu, 01 Jan 1970 00:00:00 GMT";
|
|
50
|
-
// }
|
|
51
|
-
// };
|
|
52
|
-
// deleteAllCookies();
|
|
53
|
-
// //delete caché
|
|
54
|
-
// caches.keys().then((names) => {
|
|
55
|
-
// for (const name of names) {
|
|
56
|
-
// caches.delete(name);
|
|
57
|
-
// }
|
|
58
|
-
// });
|
|
59
|
-
//unregister service workers
|
|
60
|
-
// navigator.serviceWorker.getRegistrations().then((registrations) => {
|
|
61
|
-
// for (const registration of registrations) {
|
|
62
|
-
// registration.unregister();
|
|
63
|
-
// }
|
|
64
|
-
// });
|
|
65
|
-
// Limpiar todo el localStorage
|
|
66
|
-
localStorage.clear();
|
|
67
|
-
}
|
|
68
|
-
catch (error) {
|
|
69
|
-
console.error(error);
|
|
70
|
-
}
|
|
71
|
-
try {
|
|
72
|
-
if (!(typeof document === "undefined") && Object.keys(state)?.length > 0) {
|
|
73
|
-
const initialState = {
|
|
74
|
-
catalogs: (0, catalogs_slice_js_1.default)(undefined, { type: "" }),
|
|
75
|
-
profiles: (0, profile_slice_js_1.default)(undefined, { type: "" }),
|
|
76
|
-
webappTables: (0, webapp_tables_slice_js_1.default)(undefined, { type: "" }),
|
|
77
|
-
receptions: (0, reception_slice_js_1.default)(undefined, { type: "" }),
|
|
78
|
-
session: (0, session_slice_js_1.default)(undefined, { type: "" }),
|
|
79
|
-
templates: (0, templates_slice_js_1.default)(undefined, { type: "" }),
|
|
80
|
-
automaticNumbers: (0, automaticNumbers_slice_js_1.default)(undefined, { type: "" }),
|
|
81
|
-
tables: (0, tables_slice_js_1.default)(undefined, { type: "" }),
|
|
82
|
-
formValidation: (0, formValidation_slice_js_1.default)(undefined, { type: "" }),
|
|
83
|
-
};
|
|
84
|
-
const newState = { ...initialState };
|
|
85
|
-
for (const reducerName in whitelist) {
|
|
86
|
-
if (state.hasOwnProperty(reducerName)) {
|
|
87
|
-
const key = reducerName;
|
|
88
|
-
const reducerState = state[key];
|
|
89
|
-
const whitelistKey = whitelist[key];
|
|
90
|
-
if (whitelistKey && whitelistKey.length > 0) {
|
|
91
|
-
newState[key] = newState[key] ? { ...newState[key] } : {};
|
|
92
|
-
for (const propertyName of whitelistKey) {
|
|
93
|
-
if (reducerState?.hasOwnProperty(propertyName)) {
|
|
94
|
-
const propKey = propertyName;
|
|
95
|
-
if (newState[key] && reducerState) {
|
|
96
|
-
newState[key][propKey] = reducerState[propKey];
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
else if (reducerState) {
|
|
102
|
-
newState[key] = reducerState;
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
// Guarda el nuevo estado en el almacenamiento local
|
|
107
|
-
localStorage.setItem(exports.LOCAL_STORAGE_REDUX_NAME, JSON.stringify(newState));
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
catch (e) {
|
|
111
|
-
console.error("Ocurrió un error al clonar y eliminar el viejo localStorage");
|
|
112
|
-
}
|
|
113
|
-
};
|
|
114
|
-
exports.cleanLocalStorage = cleanLocalStorage;
|
|
115
|
-
exports.store = (0, toolkit_1.configureStore)({
|
|
116
|
-
reducer: {
|
|
117
|
-
catalogs: catalogs_slice_js_1.default,
|
|
118
|
-
profiles: profile_slice_js_1.default,
|
|
119
|
-
webappTables: webapp_tables_slice_js_1.default,
|
|
120
|
-
receptions: reception_slice_js_1.default,
|
|
121
|
-
session: session_slice_js_1.default,
|
|
122
|
-
templates: templates_slice_js_1.default,
|
|
123
|
-
automaticNumbers: automaticNumbers_slice_js_1.default,
|
|
124
|
-
tables: tables_slice_js_1.default,
|
|
125
|
-
formValidation: formValidation_slice_js_1.default,
|
|
126
|
-
},
|
|
127
|
-
preloadedState,
|
|
128
|
-
middleware: (getDefaultMiddleware) => new toolkit_1.Tuple(persistanceLocalStorageMiddleware),
|
|
129
|
-
});
|
|
130
|
-
exports.useAppSelector = react_redux_1.useSelector;
|
|
131
|
-
exports.useAppDispatch = react_redux_1.useDispatch;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.setFieldError = void 0;
|
|
4
|
-
const toolkit_1 = require("@reduxjs/toolkit");
|
|
5
|
-
const initialState = {
|
|
6
|
-
formValidations: {},
|
|
7
|
-
};
|
|
8
|
-
const formValidationsSlice = (0, toolkit_1.createSlice)({
|
|
9
|
-
name: "formValidations",
|
|
10
|
-
initialState,
|
|
11
|
-
reducers: {
|
|
12
|
-
setFieldError: (state, action) => {
|
|
13
|
-
state.formValidations[action.payload.formName][action.payload.name] =
|
|
14
|
-
action.payload.error;
|
|
15
|
-
},
|
|
16
|
-
},
|
|
17
|
-
});
|
|
18
|
-
exports.setFieldError = formValidationsSlice.actions.setFieldError;
|
|
19
|
-
exports.default = formValidationsSlice.reducer;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export type FormValidations = {
|
|
2
|
-
formValidations: {
|
|
3
|
-
[key: string]: {
|
|
4
|
-
[key: string]: string;
|
|
5
|
-
};
|
|
6
|
-
};
|
|
7
|
-
};
|
|
8
|
-
export declare const setFieldError: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
9
|
-
formName: string;
|
|
10
|
-
name: string;
|
|
11
|
-
error: string;
|
|
12
|
-
}, "formValidations/setFieldError">;
|
|
13
|
-
declare const _default: import("redux").Reducer<FormValidations>;
|
|
14
|
-
export default _default;
|