@cxbox-ui/core 2.0.0-alpha.6 → 2.0.0-alpha.7
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/actions/index.d.ts +8 -0
- package/dist/cxbox-ui-core.cjs.development.js +5 -4
- package/dist/cxbox-ui-core.cjs.production.min.js +1 -1
- package/dist/cxbox-ui-core.esm.js +60 -59
- package/dist/cxbox-ui-core.modern.development.js +60 -59
- package/dist/cxbox-ui-core.modern.js +60 -59
- package/dist/cxbox-ui-core.modern.production.min.js +1 -1
- package/package.json +1 -1
|
@@ -1650,14 +1650,15 @@ var showAssocPopupEpic = (action$, state$) => action$.pipe(filter2(showViewPopup
|
|
|
1650
1650
|
}));
|
|
1651
1651
|
}));
|
|
1652
1652
|
// src/epics/view/fileUploadConfirmEpic.ts
|
|
1653
|
-
import { catchError as catchError2, concat as concat2, filter as filter3, mergeMap as mergeMap3, of as of5 } from "rxjs";
|
|
1653
|
+
import { catchError as catchError2, concat as concat2, EMPTY as EMPTY4, filter as filter3, mergeMap as mergeMap3, of as of5 } from "rxjs";
|
|
1654
1654
|
import { OperationTypeCrud as OperationTypeCrud5 } from "@cxbox-ui/schema";
|
|
1655
1655
|
var fileUploadConfirmEpic = (action$, state$, { api }) => action$.pipe(filter3(bulkUploadFiles.match), mergeMap3((action) => {
|
|
1656
|
-
var _a, _b;
|
|
1656
|
+
var _a, _b, _c, _d;
|
|
1657
1657
|
const state = state$.value;
|
|
1658
|
-
const
|
|
1658
|
+
const isPopup = (_a = action.payload.isPopup) != null ? _a : true;
|
|
1659
|
+
const bcName = (_c = action.payload.bcName) != null ? _c : (_b = state.view.popupData) == null ? void 0 : _b.bcName;
|
|
1659
1660
|
const bcUrl = buildBcUrl(bcName, true, state);
|
|
1660
|
-
const widgetName = (
|
|
1661
|
+
const widgetName = (_d = state.view.widgets.find((item) => item.bcName === bcName)) == null ? void 0 : _d.name;
|
|
1661
1662
|
const data = action.payload.fileIds.map((id) => ({
|
|
1662
1663
|
id,
|
|
1663
1664
|
_associate: true,
|
|
@@ -1667,7 +1668,7 @@ var fileUploadConfirmEpic = (action$, state$, { api }) => action$.pipe(filter3(b
|
|
|
1667
1668
|
var _a2;
|
|
1668
1669
|
const postInvoke = (_a2 = response.postActions) == null ? void 0 : _a2[0];
|
|
1669
1670
|
const preInvoke = response.preInvoke;
|
|
1670
|
-
return concat2(of5(sendOperationSuccess({ bcName, cursor: null })), of5(bcForceUpdate({ bcName })), of5(closeViewPopup(null)), ...postOperationRoutine(widgetName, postInvoke, preInvoke, OperationTypeCrud5.save, bcName));
|
|
1671
|
+
return concat2(of5(sendOperationSuccess({ bcName, cursor: null })), of5(bcForceUpdate({ bcName })), isPopup ? of5(closeViewPopup(null)) : EMPTY4, ...postOperationRoutine(widgetName, postInvoke, preInvoke, OperationTypeCrud5.save, bcName));
|
|
1671
1672
|
}), catchError2((error) => {
|
|
1672
1673
|
console.error(error);
|
|
1673
1674
|
return createApiErrorObservable(error);
|
|
@@ -1721,7 +1722,7 @@ var sendOperationAssociateEpic = (action$, state$) => action$.pipe(filter6(sendO
|
|
|
1721
1722
|
});
|
|
1722
1723
|
}));
|
|
1723
1724
|
// src/epics/view/getRowMetaByForceActiveEpic.ts
|
|
1724
|
-
import { EMPTY as
|
|
1725
|
+
import { EMPTY as EMPTY5, concat as concat5, filter as filter7, mergeMap as mergeMap6, of as of8, catchError as catchError3 } from "rxjs";
|
|
1725
1726
|
import { WidgetTypes as WidgetTypes4 } from "@cxbox-ui/schema";
|
|
1726
1727
|
import { nanoid } from "@reduxjs/toolkit";
|
|
1727
1728
|
var getRowMetaByForceActiveEpic = (action$, state$, { api }) => action$.pipe(filter7(changeDataItem.match), mergeMap6((action) => {
|
|
@@ -1734,7 +1735,7 @@ var getRowMetaByForceActiveEpic = (action$, state$, { api }) => action$.pipe(fil
|
|
|
1734
1735
|
return widget.bcName === bcName && widget.type === WidgetTypes4.AssocListPopup && (((_a2 = widget.options) == null ? void 0 : _a2.hierarchySameBc) || ((_b2 = widget.options) == null ? void 0 : _b2.hierarchyFull));
|
|
1735
1736
|
});
|
|
1736
1737
|
if (isBcHierarchy) {
|
|
1737
|
-
return
|
|
1738
|
+
return EMPTY5;
|
|
1738
1739
|
}
|
|
1739
1740
|
const isPickListPopup = state.view.widgets.find((item) => {
|
|
1740
1741
|
var _a2;
|
|
@@ -1787,10 +1788,10 @@ var getRowMetaByForceActiveEpic = (action$, state$, { api }) => action$.pipe(fil
|
|
|
1787
1788
|
cursor,
|
|
1788
1789
|
dataItem: { [changedFiledKey]: currentRecordData == null ? void 0 : currentRecordData[changedFiledKey] },
|
|
1789
1790
|
disableRetry: true
|
|
1790
|
-
})), of8(forceActiveChangeFail({ bcName, bcUrl, viewError, entityError }))) :
|
|
1791
|
+
})), of8(forceActiveChangeFail({ bcName, bcUrl, viewError, entityError }))) : EMPTY5, createApiErrorObservable(e));
|
|
1791
1792
|
})));
|
|
1792
1793
|
}
|
|
1793
|
-
return isPickListPopup ? closePopup :
|
|
1794
|
+
return isPickListPopup ? closePopup : EMPTY5;
|
|
1794
1795
|
}));
|
|
1795
1796
|
// src/epics/view/showAllTableRecordsInitEpic.ts
|
|
1796
1797
|
import { concat as concat6, filter as filter8, mergeMap as mergeMap7, of as of9 } from "rxjs";
|
|
@@ -1807,7 +1808,7 @@ var showAllTableRecordsInitEpic = (action$, state$) => action$.pipe(filter8(show
|
|
|
1807
1808
|
return concat6(...resultObservables);
|
|
1808
1809
|
}));
|
|
1809
1810
|
// src/epics/view/clearPendingDataChangesAfterCursorChangeEpic.ts
|
|
1810
|
-
import { EMPTY as
|
|
1811
|
+
import { EMPTY as EMPTY6, filter as filter9, mergeMap as mergeMap8, of as of10 } from "rxjs";
|
|
1811
1812
|
var clearPendingDataChangesAfterCursorChangeEpic = (action$, state$) => action$.pipe(filter9(bcChangeCursors.match), mergeMap8((action) => {
|
|
1812
1813
|
const state = state$.value;
|
|
1813
1814
|
const nextCursors = parseBcCursors(state.router.bcPath) || {};
|
|
@@ -1822,10 +1823,10 @@ var clearPendingDataChangesAfterCursorChangeEpic = (action$, state$) => action$.
|
|
|
1822
1823
|
if (Object.keys(cursorsDiffMap).length) {
|
|
1823
1824
|
return of10(bcChangeCursors({ cursorsMap: cursorsDiffMap }));
|
|
1824
1825
|
}
|
|
1825
|
-
return
|
|
1826
|
+
return EMPTY6;
|
|
1826
1827
|
}));
|
|
1827
1828
|
// src/epics/router/drilldownEpic.ts
|
|
1828
|
-
import { concat as concat7, EMPTY as
|
|
1829
|
+
import { concat as concat7, EMPTY as EMPTY7, filter as filter10, switchMap } from "rxjs";
|
|
1829
1830
|
var drillDownEpic = (action$, state$) => action$.pipe(filter10(drillDown.match), switchMap((action) => {
|
|
1830
1831
|
var _a, _b;
|
|
1831
1832
|
const state = state$.value;
|
|
@@ -1903,7 +1904,7 @@ var drillDownEpic = (action$, state$) => action$.pipe(filter10(drillDown.match),
|
|
|
1903
1904
|
}));
|
|
1904
1905
|
break;
|
|
1905
1906
|
}
|
|
1906
|
-
return result.length ? concat7(result) :
|
|
1907
|
+
return result.length ? concat7(result) : EMPTY7;
|
|
1907
1908
|
}));
|
|
1908
1909
|
function shallowCompare(prevProps, nextProps, ignore = []) {
|
|
1909
1910
|
const diffProps = [];
|
|
@@ -1942,7 +1943,7 @@ var loginDoneEpic = (action$, state$) => action$.pipe(filter11(loginDone.match),
|
|
|
1942
1943
|
}));
|
|
1943
1944
|
}));
|
|
1944
1945
|
// src/epics/router/selectViewEpic.ts
|
|
1945
|
-
import { EMPTY as
|
|
1946
|
+
import { EMPTY as EMPTY8, filter as filter12, of as of12, switchMap as switchMap3 } from "rxjs";
|
|
1946
1947
|
var changeViewEpic = (action$, state$) => action$.pipe(filter12(selectView.match), switchMap3((action) => {
|
|
1947
1948
|
const state = state$.value;
|
|
1948
1949
|
const nextCursors = parseBcCursors(state.router.bcPath) || {};
|
|
@@ -1957,15 +1958,15 @@ var changeViewEpic = (action$, state$) => action$.pipe(filter12(selectView.match
|
|
|
1957
1958
|
if (Object.keys(cursorsDiffMap).length) {
|
|
1958
1959
|
return of12(bcChangeCursors({ cursorsMap: cursorsDiffMap }));
|
|
1959
1960
|
}
|
|
1960
|
-
return
|
|
1961
|
+
return EMPTY8;
|
|
1961
1962
|
}));
|
|
1962
1963
|
// src/epics/router/handleRouterEpic.ts
|
|
1963
|
-
import { catchError as catchError4, EMPTY as
|
|
1964
|
+
import { catchError as catchError4, EMPTY as EMPTY9, filter as filter13, mergeMap as mergeMap9, switchMap as switchMap4 } from "rxjs";
|
|
1964
1965
|
var handleRouterEpic = (action$, state$, { api }) => action$.pipe(filter13(handleRouter.match), switchMap4((action) => {
|
|
1965
1966
|
const path = action.payload.path;
|
|
1966
1967
|
const params = action.payload.params;
|
|
1967
1968
|
return api.routerRequest(path, params).pipe(mergeMap9(() => {
|
|
1968
|
-
return
|
|
1969
|
+
return EMPTY9;
|
|
1969
1970
|
}), catchError4((error) => {
|
|
1970
1971
|
console.error(error);
|
|
1971
1972
|
return createApiErrorObservable(error);
|
|
@@ -1982,7 +1983,7 @@ var changeScreen = (action$, state$) => action$.pipe(filter14(selectScreen.match
|
|
|
1982
1983
|
return nextView ? of13(selectView(nextView)) : of13(selectViewFail({ viewName: nextViewName }));
|
|
1983
1984
|
}));
|
|
1984
1985
|
// src/epics/router/userDrillDownEpic.ts
|
|
1985
|
-
import { catchError as catchError5, concat as concat8, EMPTY as
|
|
1986
|
+
import { catchError as catchError5, concat as concat8, EMPTY as EMPTY10, filter as filter15, mergeMap as mergeMap10, of as of14, switchMap as switchMap6 } from "rxjs";
|
|
1986
1987
|
var userDrillDownEpic = (action$, state$, { api }) => action$.pipe(filter15(userDrillDown.match), switchMap6((action) => {
|
|
1987
1988
|
const state = state$.value;
|
|
1988
1989
|
const { bcName, fieldKey, cursor } = action.payload;
|
|
@@ -1993,23 +1994,23 @@ var userDrillDownEpic = (action$, state$, { api }) => action$.pipe(filter15(user
|
|
|
1993
1994
|
const route = state.router;
|
|
1994
1995
|
const drillDownKey = (_b = (_a = state.view.widgets.find((widget) => widget.bcName === bcName)) == null ? void 0 : _a.fields.find((field) => field.key === fieldKey)) == null ? void 0 : _b.drillDownKey;
|
|
1995
1996
|
const customDrillDownUrl = (_d = (_c = state.data[bcName]) == null ? void 0 : _c.find((record) => record.id === cursor)) == null ? void 0 : _d[drillDownKey];
|
|
1996
|
-
return customDrillDownUrl || (drillDownField == null ? void 0 : drillDownField.drillDown) || (drillDownField == null ? void 0 : drillDownField.drillDown) !== route.path ? concat8((drillDownField == null ? void 0 : drillDownField.drillDownType) !== DrillDownType.inner ? of14(bcFetchRowMetaSuccess({ bcName, rowMeta, bcUrl, cursor })) :
|
|
1997
|
+
return customDrillDownUrl || (drillDownField == null ? void 0 : drillDownField.drillDown) || (drillDownField == null ? void 0 : drillDownField.drillDown) !== route.path ? concat8((drillDownField == null ? void 0 : drillDownField.drillDownType) !== DrillDownType.inner ? of14(bcFetchRowMetaSuccess({ bcName, rowMeta, bcUrl, cursor })) : EMPTY10, of14(userDrillDownSuccess({ bcName, bcUrl, cursor })), of14(drillDown({
|
|
1997
1998
|
url: customDrillDownUrl || drillDownField.drillDown,
|
|
1998
1999
|
drillDownType: drillDownField.drillDownType,
|
|
1999
2000
|
route
|
|
2000
|
-
}))) :
|
|
2001
|
+
}))) : EMPTY10;
|
|
2001
2002
|
}), catchError5((error) => {
|
|
2002
2003
|
console.error(error);
|
|
2003
2004
|
return createApiErrorObservable(error);
|
|
2004
2005
|
}));
|
|
2005
2006
|
}));
|
|
2006
2007
|
// src/epics/router/changeLocationEpic.ts
|
|
2007
|
-
import { concat as concat9, EMPTY as
|
|
2008
|
+
import { concat as concat9, EMPTY as EMPTY11, filter as filter16, mergeMap as mergeMap11, of as of15 } from "rxjs";
|
|
2008
2009
|
var changeLocationEpic = (action$, state$) => action$.pipe(filter16(changeLocation.match), mergeMap11((action) => {
|
|
2009
2010
|
var _a, _b;
|
|
2010
2011
|
const state = state$.value;
|
|
2011
2012
|
if (!state.session.active) {
|
|
2012
|
-
return
|
|
2013
|
+
return EMPTY11;
|
|
2013
2014
|
}
|
|
2014
2015
|
if (state.router.type === "router" /* router */) {
|
|
2015
2016
|
return of15(handleRouter(state.router));
|
|
@@ -2092,7 +2093,7 @@ var userDrillDownChangeCursorsEpic = (action$, state$) => action$.pipe(filter19(
|
|
|
2092
2093
|
}));
|
|
2093
2094
|
// src/epics/screen/apiErrorEpic.ts
|
|
2094
2095
|
import axios from "axios";
|
|
2095
|
-
import { EMPTY as
|
|
2096
|
+
import { EMPTY as EMPTY12, filter as filter20, mergeMap as mergeMap12, of as of16 } from "rxjs";
|
|
2096
2097
|
var apiErrorEpic = (action$) => action$.pipe(filter20(apiError.match), mergeMap12((action) => {
|
|
2097
2098
|
const { error, callContext } = action.payload;
|
|
2098
2099
|
if (error.response) {
|
|
@@ -2109,10 +2110,10 @@ var apiErrorEpic = (action$) => action$.pipe(filter20(apiError.match), mergeMap1
|
|
|
2109
2110
|
}
|
|
2110
2111
|
}));
|
|
2111
2112
|
}
|
|
2112
|
-
return
|
|
2113
|
+
return EMPTY12;
|
|
2113
2114
|
}));
|
|
2114
2115
|
// src/epics/screen/downloadFileEpic.ts
|
|
2115
|
-
import { EMPTY as
|
|
2116
|
+
import { EMPTY as EMPTY13, filter as filter21, mergeMap as mergeMap13, tap } from "rxjs";
|
|
2116
2117
|
var downloadFileEpic = (action$, state$, { api }) => action$.pipe(filter21(downloadFile.match), tap((action) => {
|
|
2117
2118
|
const { fileId } = action.payload;
|
|
2118
2119
|
const anchor = document.createElement("a");
|
|
@@ -2123,7 +2124,7 @@ var downloadFileEpic = (action$, state$, { api }) => action$.pipe(filter21(downl
|
|
|
2123
2124
|
anchor.click();
|
|
2124
2125
|
document.body.removeChild(anchor);
|
|
2125
2126
|
}, 100);
|
|
2126
|
-
}), mergeMap13(() =>
|
|
2127
|
+
}), mergeMap13(() => EMPTY13));
|
|
2127
2128
|
// src/epics/screen/httpError401Epic.ts
|
|
2128
2129
|
import { filter as filter22, map as map5 } from "rxjs";
|
|
2129
2130
|
var httpError401Epic = (action$) => action$.pipe(filter22(httpError.match), filter22((action) => action.payload.statusCode === 401), map5((action) => {
|
|
@@ -2147,14 +2148,14 @@ var httpError409Epic = (action$, state$) => action$.pipe(filter23(httpError.matc
|
|
|
2147
2148
|
});
|
|
2148
2149
|
}));
|
|
2149
2150
|
// src/epics/screen/httpError418Epic.ts
|
|
2150
|
-
import { concat as concat10, EMPTY as
|
|
2151
|
+
import { concat as concat10, EMPTY as EMPTY14, filter as filter24, mergeMap as mergeMap14, of as of17 } from "rxjs";
|
|
2151
2152
|
var httpError418Epic = (action$, state$) => action$.pipe(filter24(httpError.match), filter24((action) => action.payload.statusCode === 418), mergeMap14((action) => {
|
|
2152
2153
|
var _a, _b;
|
|
2153
2154
|
const { error, callContext } = action.payload;
|
|
2154
2155
|
const result = [];
|
|
2155
2156
|
const typedError = (_a = error.response) == null ? void 0 : _a.data;
|
|
2156
2157
|
if (!typedError.error.popup) {
|
|
2157
|
-
return
|
|
2158
|
+
return EMPTY14;
|
|
2158
2159
|
}
|
|
2159
2160
|
const businessError = {
|
|
2160
2161
|
type: 0 /* BusinessError */,
|
|
@@ -2196,7 +2197,7 @@ var httpErrorDefaultEpic = (action$, state$) => action$.pipe(filter26(httpError.
|
|
|
2196
2197
|
return showViewError({ error: businessError });
|
|
2197
2198
|
}));
|
|
2198
2199
|
// src/epics/screen/downloadFileByUrlEpic.ts
|
|
2199
|
-
import { EMPTY as
|
|
2200
|
+
import { EMPTY as EMPTY15, filter as filter27, mergeMap as mergeMap15, tap as tap2 } from "rxjs";
|
|
2200
2201
|
var downloadFileByUrlEpic = (action$, state$) => action$.pipe(filter27(downloadFileByUrl.match), tap2((action) => {
|
|
2201
2202
|
const { url } = action.payload;
|
|
2202
2203
|
const anchor = document.createElement("a");
|
|
@@ -2207,9 +2208,9 @@ var downloadFileByUrlEpic = (action$, state$) => action$.pipe(filter27(downloadF
|
|
|
2207
2208
|
anchor.click();
|
|
2208
2209
|
document.body.removeChild(anchor);
|
|
2209
2210
|
}, 100);
|
|
2210
|
-
}), mergeMap15(() =>
|
|
2211
|
+
}), mergeMap15(() => EMPTY15));
|
|
2211
2212
|
// src/epics/screen/processPostInvokeEpic.ts
|
|
2212
|
-
import { EMPTY as
|
|
2213
|
+
import { EMPTY as EMPTY16, filter as filter28, mergeMap as mergeMap16, of as of18 } from "rxjs";
|
|
2213
2214
|
var processPostInvokeEpic = (action$, state$) => action$.pipe(filter28(processPostInvoke.match), mergeMap16((action) => {
|
|
2214
2215
|
var _a;
|
|
2215
2216
|
const state = state$.value;
|
|
@@ -2266,11 +2267,11 @@ var processPostInvokeEpic = (action$, state$) => action$.pipe(filter28(processPo
|
|
|
2266
2267
|
return of18(downloadFileByUrl({ url: postInvoke.url }));
|
|
2267
2268
|
}
|
|
2268
2269
|
default:
|
|
2269
|
-
return
|
|
2270
|
+
return EMPTY16;
|
|
2270
2271
|
}
|
|
2271
2272
|
}));
|
|
2272
2273
|
// src/epics/screen/processPostInvokeConfirmEpic.ts
|
|
2273
|
-
import { EMPTY as
|
|
2274
|
+
import { EMPTY as EMPTY17, filter as filter29, mergeMap as mergeMap17, of as of19 } from "rxjs";
|
|
2274
2275
|
import { isAnyOf } from "@reduxjs/toolkit";
|
|
2275
2276
|
var processPostInvokeConfirmEpic = (action$, state$) => action$.pipe(filter29(isAnyOf(processPostInvokeConfirm, processPreInvoke)), mergeMap17((action) => {
|
|
2276
2277
|
const { bcName, operationType, widgetName } = action.payload;
|
|
@@ -2290,7 +2291,7 @@ var processPostInvokeConfirmEpic = (action$, state$) => action$.pipe(filter29(is
|
|
|
2290
2291
|
}));
|
|
2291
2292
|
}
|
|
2292
2293
|
default:
|
|
2293
|
-
return
|
|
2294
|
+
return EMPTY17;
|
|
2294
2295
|
}
|
|
2295
2296
|
}));
|
|
2296
2297
|
// src/epics/session/switchRoleEpic.ts
|
|
@@ -2306,8 +2307,8 @@ var refreshMetaEpic = (action$, state$, { api }) => action$.pipe(filter31(refres
|
|
|
2306
2307
|
return api.refreshMeta().pipe(switchMap8(() => concat12([refreshMetaDone(), logoutDone(null), login({ login: "", password: "", role: activeRole })])), catchError6((error) => concat12([loginFail(error), refreshMetaFail(), createApiError(error)])));
|
|
2307
2308
|
}));
|
|
2308
2309
|
// src/epics/session/loginDoneEpic.ts
|
|
2309
|
-
import { EMPTY as
|
|
2310
|
-
var loginDoneSessionEpic = (action$, store) => action$.pipe(filter32(login.match), switchMap9((action) =>
|
|
2310
|
+
import { EMPTY as EMPTY18, filter as filter32, switchMap as switchMap9 } from "rxjs";
|
|
2311
|
+
var loginDoneSessionEpic = (action$, store) => action$.pipe(filter32(login.match), switchMap9((action) => EMPTY18));
|
|
2311
2312
|
// src/epics/session/loginByAnotherRoleEpic.ts
|
|
2312
2313
|
import { catchError as catchError7, concat as concat13, filter as filter33, mergeMap as mergeMap19, of as of20, switchMap as switchMap10 } from "rxjs";
|
|
2313
2314
|
var responseStatusMessages = {
|
|
@@ -2350,10 +2351,10 @@ var loginByAnotherRoleEpic = (action$, state$, { api }) => action$.pipe(filter33
|
|
|
2350
2351
|
}));
|
|
2351
2352
|
}));
|
|
2352
2353
|
// src/epics/session/refreshMetaAndReloadPageEpic.ts
|
|
2353
|
-
import { concat as concat14, EMPTY as
|
|
2354
|
-
var refreshMetaAndReloadPageEpic = (action$, state$) => action$.pipe(filter34(refreshMetaAndReloadPage.match), switchMap11(() => concat14(of21(refreshMeta()), action$.pipe(filter34(loginDone.match), take(1), tap3(() => location.reload()), switchMap11(() =>
|
|
2354
|
+
import { concat as concat14, EMPTY as EMPTY19, filter as filter34, of as of21, switchMap as switchMap11, take, tap as tap3 } from "rxjs";
|
|
2355
|
+
var refreshMetaAndReloadPageEpic = (action$, state$) => action$.pipe(filter34(refreshMetaAndReloadPage.match), switchMap11(() => concat14(of21(refreshMeta()), action$.pipe(filter34(loginDone.match), take(1), tap3(() => location.reload()), switchMap11(() => EMPTY19)))));
|
|
2355
2356
|
// src/epics/data/bcNewDataEpic.ts
|
|
2356
|
-
import { catchError as catchError8, concat as concat15, EMPTY as
|
|
2357
|
+
import { catchError as catchError8, concat as concat15, EMPTY as EMPTY20, filter as filter35, mergeMap as mergeMap20, of as of22 } from "rxjs";
|
|
2357
2358
|
import { OperationTypeCrud as OperationTypeCrud8 } from "@cxbox-ui/schema";
|
|
2358
2359
|
var bcNewDataEpic = (action$, state$, { api }) => action$.pipe(filter35(sendOperation.match), filter35((action) => matchOperationRole(OperationTypeCrud8.create, action.payload, state$.value)), mergeMap20((action) => {
|
|
2359
2360
|
var _a;
|
|
@@ -2378,7 +2379,7 @@ var bcNewDataEpic = (action$, state$, { api }) => action$.pipe(filter35(sendOper
|
|
|
2378
2379
|
dataItem: {
|
|
2379
2380
|
id: cursor
|
|
2380
2381
|
}
|
|
2381
|
-
})), postInvoke ? of22(processPostInvoke({ bcName, postInvoke, cursor, widgetName: action.payload.widgetName })) :
|
|
2382
|
+
})), postInvoke ? of22(processPostInvoke({ bcName, postInvoke, cursor, widgetName: action.payload.widgetName })) : EMPTY20);
|
|
2382
2383
|
}), catchError8((error) => {
|
|
2383
2384
|
console.error(error);
|
|
2384
2385
|
return concat15(of22(bcNewDataFail({ bcName })), createApiErrorObservable(error, context));
|
|
@@ -2433,7 +2434,7 @@ var bcLoadMoreEpic = (action$, state$, { api }) => action$.pipe(filter37(bcLoadM
|
|
|
2433
2434
|
return race(cancelFlow, normalFlow);
|
|
2434
2435
|
}));
|
|
2435
2436
|
// src/epics/data/bcSaveDataEpic.ts
|
|
2436
|
-
import { catchError as catchError10, concat as concat17, EMPTY as
|
|
2437
|
+
import { catchError as catchError10, concat as concat17, EMPTY as EMPTY21, filter as filter38, mergeMap as mergeMap23, of as of25 } from "rxjs";
|
|
2437
2438
|
var bcSaveDataEpic = (action$, state$, { api }) => action$.pipe(filter38(sendOperation.match), filter38((action) => matchOperationRole(OperationTypeCrud.save, action.payload, state$.value)), mergeMap23((action) => {
|
|
2438
2439
|
var _a, _b, _c, _d;
|
|
2439
2440
|
const state = state$.value;
|
|
@@ -2467,11 +2468,11 @@ var bcSaveDataEpic = (action$, state$, { api }) => action$.pipe(filter38(sendOpe
|
|
|
2467
2468
|
widgetName,
|
|
2468
2469
|
postInvoke,
|
|
2469
2470
|
cursor: responseDataItem.id
|
|
2470
|
-
})) :
|
|
2471
|
+
})) : EMPTY21, action.payload.onSuccessAction ? of25(action.payload.onSuccessAction) : EMPTY21);
|
|
2471
2472
|
}), catchError10((e) => {
|
|
2472
2473
|
var _a2, _b2, _c2, _d2, _e, _f, _g, _h;
|
|
2473
2474
|
console.error(e);
|
|
2474
|
-
let notification$ =
|
|
2475
|
+
let notification$ = EMPTY21;
|
|
2475
2476
|
if (action.payload.onSuccessAction && !(options == null ? void 0 : options.disableNotification)) {
|
|
2476
2477
|
notification$ = of25(addNotification({
|
|
2477
2478
|
key: "data_autosave_undo",
|
|
@@ -2497,7 +2498,7 @@ var bcSaveDataEpic = (action$, state$, { api }) => action$.pipe(filter38(sendOpe
|
|
|
2497
2498
|
}));
|
|
2498
2499
|
}));
|
|
2499
2500
|
// src/epics/data/selectViewEpic.ts
|
|
2500
|
-
import { EMPTY as
|
|
2501
|
+
import { EMPTY as EMPTY22, filter as filter39, mergeMap as mergeMap24 } from "rxjs";
|
|
2501
2502
|
var selectViewEpic = (action$, state$) => action$.pipe(filter39(selectView.match), mergeMap24((action) => {
|
|
2502
2503
|
try {
|
|
2503
2504
|
const state = state$.value;
|
|
@@ -2522,11 +2523,11 @@ var selectViewEpic = (action$, state$) => action$.pipe(filter39(selectView.match
|
|
|
2522
2523
|
}
|
|
2523
2524
|
catch (e) {
|
|
2524
2525
|
console.error(`selectView Epic:: ${e}`);
|
|
2525
|
-
return
|
|
2526
|
+
return EMPTY22;
|
|
2526
2527
|
}
|
|
2527
2528
|
}));
|
|
2528
2529
|
// src/epics/data/bcFetchDataEpic.ts
|
|
2529
|
-
import { catchError as catchError11, concat as concat18, EMPTY as
|
|
2530
|
+
import { catchError as catchError11, concat as concat18, EMPTY as EMPTY23, filter as filter40, mergeMap as mergeMap25, of as of26, race as race2 } from "rxjs";
|
|
2530
2531
|
import { WidgetTypes as WidgetTypes5 } from "@cxbox-ui/schema";
|
|
2531
2532
|
import { isAnyOf as isAnyOf3 } from "@reduxjs/toolkit";
|
|
2532
2533
|
var bcFetchDataEpic = (action$, state$, { api }) => action$.pipe(filter40(isAnyOf3(bcFetchDataRequest, bcFetchDataPages, showViewPopup, bcForceUpdate, bcChangePage)), mergeMap25((action) => {
|
|
@@ -2573,7 +2574,7 @@ var bcFetchDataEpic = (action$, state$, { api }) => action$.pipe(filter40(isAnyO
|
|
|
2573
2574
|
const { widgets, infiniteWidgets } = state.view;
|
|
2574
2575
|
const widget = (_a = widgets == null ? void 0 : widgets.find((item) => item.name === widgetName)) != null ? _a : widgets == null ? void 0 : widgets.find((item) => item.bcName === action.payload.bcName);
|
|
2575
2576
|
if (!widget) {
|
|
2576
|
-
return [
|
|
2577
|
+
return [EMPTY23];
|
|
2577
2578
|
}
|
|
2578
2579
|
const bcName = action.payload.bcName;
|
|
2579
2580
|
const bc = state.screen.bo.bc[bcName];
|
|
@@ -2581,7 +2582,7 @@ var bcFetchDataEpic = (action$, state$, { api }) => action$.pipe(filter40(isAnyO
|
|
|
2581
2582
|
const limit = (_c = ((_b = widgets == null ? void 0 : widgets.find((i) => i.bcName === bcName)) == null ? void 0 : _b.limit) || bc.limit) != null ? _c : 5;
|
|
2582
2583
|
const sorters = state.screen.sorters[bcName];
|
|
2583
2584
|
if (showViewPopup.match(action) && bcName === action.payload.calleeBCName) {
|
|
2584
|
-
return [
|
|
2585
|
+
return [EMPTY23];
|
|
2585
2586
|
}
|
|
2586
2587
|
const anyHierarchyWidget = widgets == null ? void 0 : widgets.find((item) => {
|
|
2587
2588
|
return item.bcName === widget.bcName && item.type === WidgetTypes5.AssocListPopup && isHierarchyWidget(item);
|
|
@@ -2642,9 +2643,9 @@ var bcFetchDataEpic = (action$, state$, { api }) => action$.pipe(filter40(isAnyO
|
|
|
2642
2643
|
const lazyWidget = (!isWidgetVisible(widget) || PopupWidgetTypes.includes(widget.type)) && !parentOfNotLazyWidget;
|
|
2643
2644
|
const skipLazy = ((_a2 = state.view.popupData) == null ? void 0 : _a2.bcName) !== widget.bcName;
|
|
2644
2645
|
if (lazyWidget && skipLazy) {
|
|
2645
|
-
return
|
|
2646
|
+
return EMPTY23;
|
|
2646
2647
|
}
|
|
2647
|
-
const fetchChildren = ((_b2 = response.data) == null ? void 0 : _b2.length) ? getChildrenData(widgets, state.screen.bo.bc, !!anyHierarchyWidget, isWidgetVisible) :
|
|
2648
|
+
const fetchChildren = ((_b2 = response.data) == null ? void 0 : _b2.length) ? getChildrenData(widgets, state.screen.bo.bc, !!anyHierarchyWidget, isWidgetVisible) : EMPTY23;
|
|
2648
2649
|
const fetchRowMeta = of26(bcFetchRowMeta({ widgetName, bcName }));
|
|
2649
2650
|
return concat18(cursorChange, of26(bcFetchDataSuccess({
|
|
2650
2651
|
bcName,
|
|
@@ -2665,7 +2666,7 @@ function isHierarchyWidget(widget) {
|
|
|
2665
2666
|
return ((_a = widget.options) == null ? void 0 : _a.hierarchy) || ((_b = widget.options) == null ? void 0 : _b.hierarchyFull);
|
|
2666
2667
|
}
|
|
2667
2668
|
// src/epics/data/bcDeleteDataEpic.ts
|
|
2668
|
-
import { catchError as catchError12, concat as concat19, EMPTY as
|
|
2669
|
+
import { catchError as catchError12, concat as concat19, EMPTY as EMPTY24, filter as filter41, mergeMap as mergeMap26, of as of27 } from "rxjs";
|
|
2669
2670
|
import { OperationTypeCrud as OperationTypeCrud9 } from "@cxbox-ui/schema";
|
|
2670
2671
|
var bcDeleteDataEpic = (action$, store$, { api }) => action$.pipe(filter41(sendOperation.match), filter41((action) => matchOperationRole(OperationTypeCrud9.delete, action.payload, store$.value)), mergeMap26((action) => {
|
|
2671
2672
|
const widgetName = action.payload.widgetName;
|
|
@@ -2678,7 +2679,7 @@ var bcDeleteDataEpic = (action$, store$, { api }) => action$.pipe(filter41(sendO
|
|
|
2678
2679
|
return api.deleteBcData(state.screen.screenName, bcUrl, context).pipe(mergeMap26((data) => {
|
|
2679
2680
|
var _a;
|
|
2680
2681
|
const postInvoke = (_a = data.postActions) == null ? void 0 : _a[0];
|
|
2681
|
-
return concat19(isTargetFormatPVF ? of27(bcCancelPendingChanges({ bcNames: [bcName] })) :
|
|
2682
|
+
return concat19(isTargetFormatPVF ? of27(bcCancelPendingChanges({ bcNames: [bcName] })) : EMPTY24, of27(bcFetchDataRequest({ bcName, widgetName })), postInvoke ? of27(processPostInvoke({ bcName, postInvoke, cursor, widgetName })) : EMPTY24);
|
|
2682
2683
|
}), catchError12((error) => {
|
|
2683
2684
|
console.error(error);
|
|
2684
2685
|
return concat19(of27(bcDeleteDataFail({ bcName })), createApiErrorObservable(error, context));
|
|
@@ -2775,7 +2776,7 @@ var changeAssociationEpic = (action$, state$) => action$.pipe(filter43(changeAss
|
|
|
2775
2776
|
return concat21(...result);
|
|
2776
2777
|
}));
|
|
2777
2778
|
// src/epics/data/bcCancelCreateDataEpic.ts
|
|
2778
|
-
import { catchError as catchError13, concat as concat22, EMPTY as
|
|
2779
|
+
import { catchError as catchError13, concat as concat22, EMPTY as EMPTY25, filter as filter44, mergeMap as mergeMap29, of as of30 } from "rxjs";
|
|
2779
2780
|
import { OperationTypeCrud as OperationTypeCrud10 } from "@cxbox-ui/schema";
|
|
2780
2781
|
import { isAnyOf as isAnyOf4 } from "@reduxjs/toolkit";
|
|
2781
2782
|
var actionTypesMatcher = isAnyOf4(sendOperation);
|
|
@@ -2796,7 +2797,7 @@ var bcCancelCreateDataEpic = (action$, state$, { api }) => action$.pipe(filter44
|
|
|
2796
2797
|
return api.customAction(screenName, bcUrl, data, context, params).pipe(mergeMap29((response) => {
|
|
2797
2798
|
var _a2;
|
|
2798
2799
|
const postInvoke = (_a2 = response.postActions) == null ? void 0 : _a2[0];
|
|
2799
|
-
return concat22(of30(sendOperationSuccess({ bcName, cursor })), of30(bcChangeCursors({ cursorsMap })), postInvoke ? of30(processPostInvoke({ bcName, postInvoke, cursor, widgetName: context.widgetName })) :
|
|
2800
|
+
return concat22(of30(sendOperationSuccess({ bcName, cursor })), of30(bcChangeCursors({ cursorsMap })), postInvoke ? of30(processPostInvoke({ bcName, postInvoke, cursor, widgetName: context.widgetName })) : EMPTY25);
|
|
2800
2801
|
}), catchError13((error) => {
|
|
2801
2802
|
console.error(error);
|
|
2802
2803
|
return concat22(of30(bcDeleteDataFail({ bcName })), createApiErrorObservable(error, context));
|
|
@@ -3014,7 +3015,7 @@ var changeAssociationFullEpic = (action$, state$) => action$.pipe(filter48(chang
|
|
|
3014
3015
|
return concat26(...result);
|
|
3015
3016
|
}));
|
|
3016
3017
|
// src/epics/data/saveAssociationsActiveEpic.ts
|
|
3017
|
-
import { catchError as catchError15, concat as concat27, EMPTY as
|
|
3018
|
+
import { catchError as catchError15, concat as concat27, EMPTY as EMPTY26, filter as filter49, mergeMap as mergeMap34, of as of35, switchMap as switchMap12 } from "rxjs";
|
|
3018
3019
|
var saveAssociationsActiveEpic = (action$, state$, { api }) => action$.pipe(filter49(saveAssociations.match), filter49((action) => {
|
|
3019
3020
|
var _a;
|
|
3020
3021
|
return (_a = state$.value.view.popupData) == null ? void 0 : _a.active;
|
|
@@ -3030,10 +3031,10 @@ var saveAssociationsActiveEpic = (action$, state$, { api }) => action$.pipe(filt
|
|
|
3030
3031
|
return api.associate(state.screen.screenName, bcUrl, Object.values(pendingChanges).filter((i) => i._associate), params).pipe(mergeMap34((response) => {
|
|
3031
3032
|
const postInvoke = response.postActions[0];
|
|
3032
3033
|
const calleeWidget = state.view.widgets.find((widgetItem) => widgetItem.bcName === calleeBCName);
|
|
3033
|
-
return concat27(postInvoke ? of35(processPostInvoke({ bcName: calleeBCName, postInvoke, widgetName: calleeWidget == null ? void 0 : calleeWidget.name })) :
|
|
3034
|
+
return concat27(postInvoke ? of35(processPostInvoke({ bcName: calleeBCName, postInvoke, widgetName: calleeWidget == null ? void 0 : calleeWidget.name })) : EMPTY26, of35(bcCancelPendingChanges({ bcNames })), of35(bcForceUpdate({ bcName: calleeBCName, widgetName: calleeWidgetName })));
|
|
3034
3035
|
}), catchError15((err) => {
|
|
3035
3036
|
console.error(err);
|
|
3036
|
-
return
|
|
3037
|
+
return EMPTY26;
|
|
3037
3038
|
}));
|
|
3038
3039
|
}));
|
|
3039
3040
|
// src/epics/data/changeAssociationSameBcEpic.ts
|
|
@@ -3239,7 +3240,7 @@ var ObservableApiWrapper = class {
|
|
|
3239
3240
|
};
|
|
3240
3241
|
// src/api/ObservableApi.ts
|
|
3241
3242
|
import axios3 from "axios";
|
|
3242
|
-
import { EMPTY as
|
|
3243
|
+
import { EMPTY as EMPTY27, expand, map as map11, reduce } from "rxjs";
|
|
3243
3244
|
var Api = class {
|
|
3244
3245
|
constructor(instance) {
|
|
3245
3246
|
__publicField(this, "api$");
|
|
@@ -3260,7 +3261,7 @@ var Api = class {
|
|
|
3260
3261
|
fetchBcDataAll(screenName, bcUrl, params = {}) {
|
|
3261
3262
|
let currentPage = 1;
|
|
3262
3263
|
return this.fetchBcData(screenName, bcUrl, __spreadProps(__spreadValues({}, params), { _page: currentPage })).pipe(expand((response) => {
|
|
3263
|
-
return response.hasNext ? this.fetchBcData(screenName, bcUrl, __spreadProps(__spreadValues({}, params), { _page: ++currentPage })) :
|
|
3264
|
+
return response.hasNext ? this.fetchBcData(screenName, bcUrl, __spreadProps(__spreadValues({}, params), { _page: ++currentPage })) : EMPTY27;
|
|
3264
3265
|
}), reduce((items, nextResponse) => {
|
|
3265
3266
|
return [...items, ...nextResponse.data];
|
|
3266
3267
|
}, []));
|