@cxbox-ui/core 2.0.0-alpha.5 → 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 +13 -6
- package/dist/cxbox-ui-core.cjs.production.min.js +1 -1
- package/dist/cxbox-ui-core.esm.js +68 -61
- package/dist/cxbox-ui-core.modern.development.js +68 -61
- package/dist/cxbox-ui-core.modern.js +68 -61
- package/dist/cxbox-ui-core.modern.production.min.js +1 -1
- package/package.json +1 -1
|
@@ -767,10 +767,13 @@ function parseFilters(defaultFilters = "") {
|
|
|
767
767
|
}
|
|
768
768
|
value = Array.isArray(value) ? value : [];
|
|
769
769
|
}
|
|
770
|
+
else {
|
|
771
|
+
value = Array.isArray(value) ? value[0] : value;
|
|
772
|
+
}
|
|
770
773
|
result.push({
|
|
771
774
|
fieldName,
|
|
772
775
|
type,
|
|
773
|
-
value
|
|
776
|
+
value
|
|
774
777
|
});
|
|
775
778
|
}
|
|
776
779
|
});
|
|
@@ -1647,14 +1650,15 @@ var showAssocPopupEpic = (action$, state$) => action$.pipe(filter2(showViewPopup
|
|
|
1647
1650
|
}));
|
|
1648
1651
|
}));
|
|
1649
1652
|
// src/epics/view/fileUploadConfirmEpic.ts
|
|
1650
|
-
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";
|
|
1651
1654
|
import { OperationTypeCrud as OperationTypeCrud5 } from "@cxbox-ui/schema";
|
|
1652
1655
|
var fileUploadConfirmEpic = (action$, state$, { api }) => action$.pipe(filter3(bulkUploadFiles.match), mergeMap3((action) => {
|
|
1653
|
-
var _a, _b;
|
|
1656
|
+
var _a, _b, _c, _d;
|
|
1654
1657
|
const state = state$.value;
|
|
1655
|
-
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;
|
|
1656
1660
|
const bcUrl = buildBcUrl(bcName, true, state);
|
|
1657
|
-
const widgetName = (
|
|
1661
|
+
const widgetName = (_d = state.view.widgets.find((item) => item.bcName === bcName)) == null ? void 0 : _d.name;
|
|
1658
1662
|
const data = action.payload.fileIds.map((id) => ({
|
|
1659
1663
|
id,
|
|
1660
1664
|
_associate: true,
|
|
@@ -1664,7 +1668,7 @@ var fileUploadConfirmEpic = (action$, state$, { api }) => action$.pipe(filter3(b
|
|
|
1664
1668
|
var _a2;
|
|
1665
1669
|
const postInvoke = (_a2 = response.postActions) == null ? void 0 : _a2[0];
|
|
1666
1670
|
const preInvoke = response.preInvoke;
|
|
1667
|
-
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));
|
|
1668
1672
|
}), catchError2((error) => {
|
|
1669
1673
|
console.error(error);
|
|
1670
1674
|
return createApiErrorObservable(error);
|
|
@@ -1718,7 +1722,7 @@ var sendOperationAssociateEpic = (action$, state$) => action$.pipe(filter6(sendO
|
|
|
1718
1722
|
});
|
|
1719
1723
|
}));
|
|
1720
1724
|
// src/epics/view/getRowMetaByForceActiveEpic.ts
|
|
1721
|
-
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";
|
|
1722
1726
|
import { WidgetTypes as WidgetTypes4 } from "@cxbox-ui/schema";
|
|
1723
1727
|
import { nanoid } from "@reduxjs/toolkit";
|
|
1724
1728
|
var getRowMetaByForceActiveEpic = (action$, state$, { api }) => action$.pipe(filter7(changeDataItem.match), mergeMap6((action) => {
|
|
@@ -1731,7 +1735,7 @@ var getRowMetaByForceActiveEpic = (action$, state$, { api }) => action$.pipe(fil
|
|
|
1731
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));
|
|
1732
1736
|
});
|
|
1733
1737
|
if (isBcHierarchy) {
|
|
1734
|
-
return
|
|
1738
|
+
return EMPTY5;
|
|
1735
1739
|
}
|
|
1736
1740
|
const isPickListPopup = state.view.widgets.find((item) => {
|
|
1737
1741
|
var _a2;
|
|
@@ -1784,10 +1788,10 @@ var getRowMetaByForceActiveEpic = (action$, state$, { api }) => action$.pipe(fil
|
|
|
1784
1788
|
cursor,
|
|
1785
1789
|
dataItem: { [changedFiledKey]: currentRecordData == null ? void 0 : currentRecordData[changedFiledKey] },
|
|
1786
1790
|
disableRetry: true
|
|
1787
|
-
})), of8(forceActiveChangeFail({ bcName, bcUrl, viewError, entityError }))) :
|
|
1791
|
+
})), of8(forceActiveChangeFail({ bcName, bcUrl, viewError, entityError }))) : EMPTY5, createApiErrorObservable(e));
|
|
1788
1792
|
})));
|
|
1789
1793
|
}
|
|
1790
|
-
return isPickListPopup ? closePopup :
|
|
1794
|
+
return isPickListPopup ? closePopup : EMPTY5;
|
|
1791
1795
|
}));
|
|
1792
1796
|
// src/epics/view/showAllTableRecordsInitEpic.ts
|
|
1793
1797
|
import { concat as concat6, filter as filter8, mergeMap as mergeMap7, of as of9 } from "rxjs";
|
|
@@ -1804,7 +1808,7 @@ var showAllTableRecordsInitEpic = (action$, state$) => action$.pipe(filter8(show
|
|
|
1804
1808
|
return concat6(...resultObservables);
|
|
1805
1809
|
}));
|
|
1806
1810
|
// src/epics/view/clearPendingDataChangesAfterCursorChangeEpic.ts
|
|
1807
|
-
import { EMPTY as
|
|
1811
|
+
import { EMPTY as EMPTY6, filter as filter9, mergeMap as mergeMap8, of as of10 } from "rxjs";
|
|
1808
1812
|
var clearPendingDataChangesAfterCursorChangeEpic = (action$, state$) => action$.pipe(filter9(bcChangeCursors.match), mergeMap8((action) => {
|
|
1809
1813
|
const state = state$.value;
|
|
1810
1814
|
const nextCursors = parseBcCursors(state.router.bcPath) || {};
|
|
@@ -1819,10 +1823,10 @@ var clearPendingDataChangesAfterCursorChangeEpic = (action$, state$) => action$.
|
|
|
1819
1823
|
if (Object.keys(cursorsDiffMap).length) {
|
|
1820
1824
|
return of10(bcChangeCursors({ cursorsMap: cursorsDiffMap }));
|
|
1821
1825
|
}
|
|
1822
|
-
return
|
|
1826
|
+
return EMPTY6;
|
|
1823
1827
|
}));
|
|
1824
1828
|
// src/epics/router/drilldownEpic.ts
|
|
1825
|
-
import { concat as concat7, EMPTY as
|
|
1829
|
+
import { concat as concat7, EMPTY as EMPTY7, filter as filter10, switchMap } from "rxjs";
|
|
1826
1830
|
var drillDownEpic = (action$, state$) => action$.pipe(filter10(drillDown.match), switchMap((action) => {
|
|
1827
1831
|
var _a, _b;
|
|
1828
1832
|
const state = state$.value;
|
|
@@ -1894,10 +1898,13 @@ var drillDownEpic = (action$, state$) => action$.pipe(filter10(drillDown.match),
|
|
|
1894
1898
|
result.push(bcForceUpdate({ bcName }));
|
|
1895
1899
|
});
|
|
1896
1900
|
}
|
|
1897
|
-
result.push(changeLocation({
|
|
1901
|
+
result.push(changeLocation({
|
|
1902
|
+
location: defaultParseURL(new URL(makeRelativeUrl(urlBase), window.location.origin)),
|
|
1903
|
+
forceUpdate: true
|
|
1904
|
+
}));
|
|
1898
1905
|
break;
|
|
1899
1906
|
}
|
|
1900
|
-
return result.length ? concat7(result) :
|
|
1907
|
+
return result.length ? concat7(result) : EMPTY7;
|
|
1901
1908
|
}));
|
|
1902
1909
|
function shallowCompare(prevProps, nextProps, ignore = []) {
|
|
1903
1910
|
const diffProps = [];
|
|
@@ -1936,7 +1943,7 @@ var loginDoneEpic = (action$, state$) => action$.pipe(filter11(loginDone.match),
|
|
|
1936
1943
|
}));
|
|
1937
1944
|
}));
|
|
1938
1945
|
// src/epics/router/selectViewEpic.ts
|
|
1939
|
-
import { EMPTY as
|
|
1946
|
+
import { EMPTY as EMPTY8, filter as filter12, of as of12, switchMap as switchMap3 } from "rxjs";
|
|
1940
1947
|
var changeViewEpic = (action$, state$) => action$.pipe(filter12(selectView.match), switchMap3((action) => {
|
|
1941
1948
|
const state = state$.value;
|
|
1942
1949
|
const nextCursors = parseBcCursors(state.router.bcPath) || {};
|
|
@@ -1951,15 +1958,15 @@ var changeViewEpic = (action$, state$) => action$.pipe(filter12(selectView.match
|
|
|
1951
1958
|
if (Object.keys(cursorsDiffMap).length) {
|
|
1952
1959
|
return of12(bcChangeCursors({ cursorsMap: cursorsDiffMap }));
|
|
1953
1960
|
}
|
|
1954
|
-
return
|
|
1961
|
+
return EMPTY8;
|
|
1955
1962
|
}));
|
|
1956
1963
|
// src/epics/router/handleRouterEpic.ts
|
|
1957
|
-
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";
|
|
1958
1965
|
var handleRouterEpic = (action$, state$, { api }) => action$.pipe(filter13(handleRouter.match), switchMap4((action) => {
|
|
1959
1966
|
const path = action.payload.path;
|
|
1960
1967
|
const params = action.payload.params;
|
|
1961
1968
|
return api.routerRequest(path, params).pipe(mergeMap9(() => {
|
|
1962
|
-
return
|
|
1969
|
+
return EMPTY9;
|
|
1963
1970
|
}), catchError4((error) => {
|
|
1964
1971
|
console.error(error);
|
|
1965
1972
|
return createApiErrorObservable(error);
|
|
@@ -1976,7 +1983,7 @@ var changeScreen = (action$, state$) => action$.pipe(filter14(selectScreen.match
|
|
|
1976
1983
|
return nextView ? of13(selectView(nextView)) : of13(selectViewFail({ viewName: nextViewName }));
|
|
1977
1984
|
}));
|
|
1978
1985
|
// src/epics/router/userDrillDownEpic.ts
|
|
1979
|
-
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";
|
|
1980
1987
|
var userDrillDownEpic = (action$, state$, { api }) => action$.pipe(filter15(userDrillDown.match), switchMap6((action) => {
|
|
1981
1988
|
const state = state$.value;
|
|
1982
1989
|
const { bcName, fieldKey, cursor } = action.payload;
|
|
@@ -1987,23 +1994,23 @@ var userDrillDownEpic = (action$, state$, { api }) => action$.pipe(filter15(user
|
|
|
1987
1994
|
const route = state.router;
|
|
1988
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;
|
|
1989
1996
|
const customDrillDownUrl = (_d = (_c = state.data[bcName]) == null ? void 0 : _c.find((record) => record.id === cursor)) == null ? void 0 : _d[drillDownKey];
|
|
1990
|
-
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({
|
|
1991
1998
|
url: customDrillDownUrl || drillDownField.drillDown,
|
|
1992
1999
|
drillDownType: drillDownField.drillDownType,
|
|
1993
2000
|
route
|
|
1994
|
-
}))) :
|
|
2001
|
+
}))) : EMPTY10;
|
|
1995
2002
|
}), catchError5((error) => {
|
|
1996
2003
|
console.error(error);
|
|
1997
2004
|
return createApiErrorObservable(error);
|
|
1998
2005
|
}));
|
|
1999
2006
|
}));
|
|
2000
2007
|
// src/epics/router/changeLocationEpic.ts
|
|
2001
|
-
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";
|
|
2002
2009
|
var changeLocationEpic = (action$, state$) => action$.pipe(filter16(changeLocation.match), mergeMap11((action) => {
|
|
2003
2010
|
var _a, _b;
|
|
2004
2011
|
const state = state$.value;
|
|
2005
2012
|
if (!state.session.active) {
|
|
2006
|
-
return
|
|
2013
|
+
return EMPTY11;
|
|
2007
2014
|
}
|
|
2008
2015
|
if (state.router.type === "router" /* router */) {
|
|
2009
2016
|
return of15(handleRouter(state.router));
|
|
@@ -2086,7 +2093,7 @@ var userDrillDownChangeCursorsEpic = (action$, state$) => action$.pipe(filter19(
|
|
|
2086
2093
|
}));
|
|
2087
2094
|
// src/epics/screen/apiErrorEpic.ts
|
|
2088
2095
|
import axios from "axios";
|
|
2089
|
-
import { EMPTY as
|
|
2096
|
+
import { EMPTY as EMPTY12, filter as filter20, mergeMap as mergeMap12, of as of16 } from "rxjs";
|
|
2090
2097
|
var apiErrorEpic = (action$) => action$.pipe(filter20(apiError.match), mergeMap12((action) => {
|
|
2091
2098
|
const { error, callContext } = action.payload;
|
|
2092
2099
|
if (error.response) {
|
|
@@ -2103,10 +2110,10 @@ var apiErrorEpic = (action$) => action$.pipe(filter20(apiError.match), mergeMap1
|
|
|
2103
2110
|
}
|
|
2104
2111
|
}));
|
|
2105
2112
|
}
|
|
2106
|
-
return
|
|
2113
|
+
return EMPTY12;
|
|
2107
2114
|
}));
|
|
2108
2115
|
// src/epics/screen/downloadFileEpic.ts
|
|
2109
|
-
import { EMPTY as
|
|
2116
|
+
import { EMPTY as EMPTY13, filter as filter21, mergeMap as mergeMap13, tap } from "rxjs";
|
|
2110
2117
|
var downloadFileEpic = (action$, state$, { api }) => action$.pipe(filter21(downloadFile.match), tap((action) => {
|
|
2111
2118
|
const { fileId } = action.payload;
|
|
2112
2119
|
const anchor = document.createElement("a");
|
|
@@ -2117,7 +2124,7 @@ var downloadFileEpic = (action$, state$, { api }) => action$.pipe(filter21(downl
|
|
|
2117
2124
|
anchor.click();
|
|
2118
2125
|
document.body.removeChild(anchor);
|
|
2119
2126
|
}, 100);
|
|
2120
|
-
}), mergeMap13(() =>
|
|
2127
|
+
}), mergeMap13(() => EMPTY13));
|
|
2121
2128
|
// src/epics/screen/httpError401Epic.ts
|
|
2122
2129
|
import { filter as filter22, map as map5 } from "rxjs";
|
|
2123
2130
|
var httpError401Epic = (action$) => action$.pipe(filter22(httpError.match), filter22((action) => action.payload.statusCode === 401), map5((action) => {
|
|
@@ -2141,14 +2148,14 @@ var httpError409Epic = (action$, state$) => action$.pipe(filter23(httpError.matc
|
|
|
2141
2148
|
});
|
|
2142
2149
|
}));
|
|
2143
2150
|
// src/epics/screen/httpError418Epic.ts
|
|
2144
|
-
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";
|
|
2145
2152
|
var httpError418Epic = (action$, state$) => action$.pipe(filter24(httpError.match), filter24((action) => action.payload.statusCode === 418), mergeMap14((action) => {
|
|
2146
2153
|
var _a, _b;
|
|
2147
2154
|
const { error, callContext } = action.payload;
|
|
2148
2155
|
const result = [];
|
|
2149
2156
|
const typedError = (_a = error.response) == null ? void 0 : _a.data;
|
|
2150
2157
|
if (!typedError.error.popup) {
|
|
2151
|
-
return
|
|
2158
|
+
return EMPTY14;
|
|
2152
2159
|
}
|
|
2153
2160
|
const businessError = {
|
|
2154
2161
|
type: 0 /* BusinessError */,
|
|
@@ -2190,7 +2197,7 @@ var httpErrorDefaultEpic = (action$, state$) => action$.pipe(filter26(httpError.
|
|
|
2190
2197
|
return showViewError({ error: businessError });
|
|
2191
2198
|
}));
|
|
2192
2199
|
// src/epics/screen/downloadFileByUrlEpic.ts
|
|
2193
|
-
import { EMPTY as
|
|
2200
|
+
import { EMPTY as EMPTY15, filter as filter27, mergeMap as mergeMap15, tap as tap2 } from "rxjs";
|
|
2194
2201
|
var downloadFileByUrlEpic = (action$, state$) => action$.pipe(filter27(downloadFileByUrl.match), tap2((action) => {
|
|
2195
2202
|
const { url } = action.payload;
|
|
2196
2203
|
const anchor = document.createElement("a");
|
|
@@ -2201,9 +2208,9 @@ var downloadFileByUrlEpic = (action$, state$) => action$.pipe(filter27(downloadF
|
|
|
2201
2208
|
anchor.click();
|
|
2202
2209
|
document.body.removeChild(anchor);
|
|
2203
2210
|
}, 100);
|
|
2204
|
-
}), mergeMap15(() =>
|
|
2211
|
+
}), mergeMap15(() => EMPTY15));
|
|
2205
2212
|
// src/epics/screen/processPostInvokeEpic.ts
|
|
2206
|
-
import { EMPTY as
|
|
2213
|
+
import { EMPTY as EMPTY16, filter as filter28, mergeMap as mergeMap16, of as of18 } from "rxjs";
|
|
2207
2214
|
var processPostInvokeEpic = (action$, state$) => action$.pipe(filter28(processPostInvoke.match), mergeMap16((action) => {
|
|
2208
2215
|
var _a;
|
|
2209
2216
|
const state = state$.value;
|
|
@@ -2260,11 +2267,11 @@ var processPostInvokeEpic = (action$, state$) => action$.pipe(filter28(processPo
|
|
|
2260
2267
|
return of18(downloadFileByUrl({ url: postInvoke.url }));
|
|
2261
2268
|
}
|
|
2262
2269
|
default:
|
|
2263
|
-
return
|
|
2270
|
+
return EMPTY16;
|
|
2264
2271
|
}
|
|
2265
2272
|
}));
|
|
2266
2273
|
// src/epics/screen/processPostInvokeConfirmEpic.ts
|
|
2267
|
-
import { EMPTY as
|
|
2274
|
+
import { EMPTY as EMPTY17, filter as filter29, mergeMap as mergeMap17, of as of19 } from "rxjs";
|
|
2268
2275
|
import { isAnyOf } from "@reduxjs/toolkit";
|
|
2269
2276
|
var processPostInvokeConfirmEpic = (action$, state$) => action$.pipe(filter29(isAnyOf(processPostInvokeConfirm, processPreInvoke)), mergeMap17((action) => {
|
|
2270
2277
|
const { bcName, operationType, widgetName } = action.payload;
|
|
@@ -2284,7 +2291,7 @@ var processPostInvokeConfirmEpic = (action$, state$) => action$.pipe(filter29(is
|
|
|
2284
2291
|
}));
|
|
2285
2292
|
}
|
|
2286
2293
|
default:
|
|
2287
|
-
return
|
|
2294
|
+
return EMPTY17;
|
|
2288
2295
|
}
|
|
2289
2296
|
}));
|
|
2290
2297
|
// src/epics/session/switchRoleEpic.ts
|
|
@@ -2300,8 +2307,8 @@ var refreshMetaEpic = (action$, state$, { api }) => action$.pipe(filter31(refres
|
|
|
2300
2307
|
return api.refreshMeta().pipe(switchMap8(() => concat12([refreshMetaDone(), logoutDone(null), login({ login: "", password: "", role: activeRole })])), catchError6((error) => concat12([loginFail(error), refreshMetaFail(), createApiError(error)])));
|
|
2301
2308
|
}));
|
|
2302
2309
|
// src/epics/session/loginDoneEpic.ts
|
|
2303
|
-
import { EMPTY as
|
|
2304
|
-
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));
|
|
2305
2312
|
// src/epics/session/loginByAnotherRoleEpic.ts
|
|
2306
2313
|
import { catchError as catchError7, concat as concat13, filter as filter33, mergeMap as mergeMap19, of as of20, switchMap as switchMap10 } from "rxjs";
|
|
2307
2314
|
var responseStatusMessages = {
|
|
@@ -2344,10 +2351,10 @@ var loginByAnotherRoleEpic = (action$, state$, { api }) => action$.pipe(filter33
|
|
|
2344
2351
|
}));
|
|
2345
2352
|
}));
|
|
2346
2353
|
// src/epics/session/refreshMetaAndReloadPageEpic.ts
|
|
2347
|
-
import { concat as concat14, EMPTY as
|
|
2348
|
-
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)))));
|
|
2349
2356
|
// src/epics/data/bcNewDataEpic.ts
|
|
2350
|
-
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";
|
|
2351
2358
|
import { OperationTypeCrud as OperationTypeCrud8 } from "@cxbox-ui/schema";
|
|
2352
2359
|
var bcNewDataEpic = (action$, state$, { api }) => action$.pipe(filter35(sendOperation.match), filter35((action) => matchOperationRole(OperationTypeCrud8.create, action.payload, state$.value)), mergeMap20((action) => {
|
|
2353
2360
|
var _a;
|
|
@@ -2372,7 +2379,7 @@ var bcNewDataEpic = (action$, state$, { api }) => action$.pipe(filter35(sendOper
|
|
|
2372
2379
|
dataItem: {
|
|
2373
2380
|
id: cursor
|
|
2374
2381
|
}
|
|
2375
|
-
})), postInvoke ? of22(processPostInvoke({ bcName, postInvoke, cursor, widgetName: action.payload.widgetName })) :
|
|
2382
|
+
})), postInvoke ? of22(processPostInvoke({ bcName, postInvoke, cursor, widgetName: action.payload.widgetName })) : EMPTY20);
|
|
2376
2383
|
}), catchError8((error) => {
|
|
2377
2384
|
console.error(error);
|
|
2378
2385
|
return concat15(of22(bcNewDataFail({ bcName })), createApiErrorObservable(error, context));
|
|
@@ -2427,7 +2434,7 @@ var bcLoadMoreEpic = (action$, state$, { api }) => action$.pipe(filter37(bcLoadM
|
|
|
2427
2434
|
return race(cancelFlow, normalFlow);
|
|
2428
2435
|
}));
|
|
2429
2436
|
// src/epics/data/bcSaveDataEpic.ts
|
|
2430
|
-
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";
|
|
2431
2438
|
var bcSaveDataEpic = (action$, state$, { api }) => action$.pipe(filter38(sendOperation.match), filter38((action) => matchOperationRole(OperationTypeCrud.save, action.payload, state$.value)), mergeMap23((action) => {
|
|
2432
2439
|
var _a, _b, _c, _d;
|
|
2433
2440
|
const state = state$.value;
|
|
@@ -2461,11 +2468,11 @@ var bcSaveDataEpic = (action$, state$, { api }) => action$.pipe(filter38(sendOpe
|
|
|
2461
2468
|
widgetName,
|
|
2462
2469
|
postInvoke,
|
|
2463
2470
|
cursor: responseDataItem.id
|
|
2464
|
-
})) :
|
|
2471
|
+
})) : EMPTY21, action.payload.onSuccessAction ? of25(action.payload.onSuccessAction) : EMPTY21);
|
|
2465
2472
|
}), catchError10((e) => {
|
|
2466
2473
|
var _a2, _b2, _c2, _d2, _e, _f, _g, _h;
|
|
2467
2474
|
console.error(e);
|
|
2468
|
-
let notification$ =
|
|
2475
|
+
let notification$ = EMPTY21;
|
|
2469
2476
|
if (action.payload.onSuccessAction && !(options == null ? void 0 : options.disableNotification)) {
|
|
2470
2477
|
notification$ = of25(addNotification({
|
|
2471
2478
|
key: "data_autosave_undo",
|
|
@@ -2491,7 +2498,7 @@ var bcSaveDataEpic = (action$, state$, { api }) => action$.pipe(filter38(sendOpe
|
|
|
2491
2498
|
}));
|
|
2492
2499
|
}));
|
|
2493
2500
|
// src/epics/data/selectViewEpic.ts
|
|
2494
|
-
import { EMPTY as
|
|
2501
|
+
import { EMPTY as EMPTY22, filter as filter39, mergeMap as mergeMap24 } from "rxjs";
|
|
2495
2502
|
var selectViewEpic = (action$, state$) => action$.pipe(filter39(selectView.match), mergeMap24((action) => {
|
|
2496
2503
|
try {
|
|
2497
2504
|
const state = state$.value;
|
|
@@ -2516,11 +2523,11 @@ var selectViewEpic = (action$, state$) => action$.pipe(filter39(selectView.match
|
|
|
2516
2523
|
}
|
|
2517
2524
|
catch (e) {
|
|
2518
2525
|
console.error(`selectView Epic:: ${e}`);
|
|
2519
|
-
return
|
|
2526
|
+
return EMPTY22;
|
|
2520
2527
|
}
|
|
2521
2528
|
}));
|
|
2522
2529
|
// src/epics/data/bcFetchDataEpic.ts
|
|
2523
|
-
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";
|
|
2524
2531
|
import { WidgetTypes as WidgetTypes5 } from "@cxbox-ui/schema";
|
|
2525
2532
|
import { isAnyOf as isAnyOf3 } from "@reduxjs/toolkit";
|
|
2526
2533
|
var bcFetchDataEpic = (action$, state$, { api }) => action$.pipe(filter40(isAnyOf3(bcFetchDataRequest, bcFetchDataPages, showViewPopup, bcForceUpdate, bcChangePage)), mergeMap25((action) => {
|
|
@@ -2567,7 +2574,7 @@ var bcFetchDataEpic = (action$, state$, { api }) => action$.pipe(filter40(isAnyO
|
|
|
2567
2574
|
const { widgets, infiniteWidgets } = state.view;
|
|
2568
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);
|
|
2569
2576
|
if (!widget) {
|
|
2570
|
-
return [
|
|
2577
|
+
return [EMPTY23];
|
|
2571
2578
|
}
|
|
2572
2579
|
const bcName = action.payload.bcName;
|
|
2573
2580
|
const bc = state.screen.bo.bc[bcName];
|
|
@@ -2575,7 +2582,7 @@ var bcFetchDataEpic = (action$, state$, { api }) => action$.pipe(filter40(isAnyO
|
|
|
2575
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;
|
|
2576
2583
|
const sorters = state.screen.sorters[bcName];
|
|
2577
2584
|
if (showViewPopup.match(action) && bcName === action.payload.calleeBCName) {
|
|
2578
|
-
return [
|
|
2585
|
+
return [EMPTY23];
|
|
2579
2586
|
}
|
|
2580
2587
|
const anyHierarchyWidget = widgets == null ? void 0 : widgets.find((item) => {
|
|
2581
2588
|
return item.bcName === widget.bcName && item.type === WidgetTypes5.AssocListPopup && isHierarchyWidget(item);
|
|
@@ -2636,9 +2643,9 @@ var bcFetchDataEpic = (action$, state$, { api }) => action$.pipe(filter40(isAnyO
|
|
|
2636
2643
|
const lazyWidget = (!isWidgetVisible(widget) || PopupWidgetTypes.includes(widget.type)) && !parentOfNotLazyWidget;
|
|
2637
2644
|
const skipLazy = ((_a2 = state.view.popupData) == null ? void 0 : _a2.bcName) !== widget.bcName;
|
|
2638
2645
|
if (lazyWidget && skipLazy) {
|
|
2639
|
-
return
|
|
2646
|
+
return EMPTY23;
|
|
2640
2647
|
}
|
|
2641
|
-
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;
|
|
2642
2649
|
const fetchRowMeta = of26(bcFetchRowMeta({ widgetName, bcName }));
|
|
2643
2650
|
return concat18(cursorChange, of26(bcFetchDataSuccess({
|
|
2644
2651
|
bcName,
|
|
@@ -2659,7 +2666,7 @@ function isHierarchyWidget(widget) {
|
|
|
2659
2666
|
return ((_a = widget.options) == null ? void 0 : _a.hierarchy) || ((_b = widget.options) == null ? void 0 : _b.hierarchyFull);
|
|
2660
2667
|
}
|
|
2661
2668
|
// src/epics/data/bcDeleteDataEpic.ts
|
|
2662
|
-
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";
|
|
2663
2670
|
import { OperationTypeCrud as OperationTypeCrud9 } from "@cxbox-ui/schema";
|
|
2664
2671
|
var bcDeleteDataEpic = (action$, store$, { api }) => action$.pipe(filter41(sendOperation.match), filter41((action) => matchOperationRole(OperationTypeCrud9.delete, action.payload, store$.value)), mergeMap26((action) => {
|
|
2665
2672
|
const widgetName = action.payload.widgetName;
|
|
@@ -2672,7 +2679,7 @@ var bcDeleteDataEpic = (action$, store$, { api }) => action$.pipe(filter41(sendO
|
|
|
2672
2679
|
return api.deleteBcData(state.screen.screenName, bcUrl, context).pipe(mergeMap26((data) => {
|
|
2673
2680
|
var _a;
|
|
2674
2681
|
const postInvoke = (_a = data.postActions) == null ? void 0 : _a[0];
|
|
2675
|
-
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);
|
|
2676
2683
|
}), catchError12((error) => {
|
|
2677
2684
|
console.error(error);
|
|
2678
2685
|
return concat19(of27(bcDeleteDataFail({ bcName })), createApiErrorObservable(error, context));
|
|
@@ -2769,7 +2776,7 @@ var changeAssociationEpic = (action$, state$) => action$.pipe(filter43(changeAss
|
|
|
2769
2776
|
return concat21(...result);
|
|
2770
2777
|
}));
|
|
2771
2778
|
// src/epics/data/bcCancelCreateDataEpic.ts
|
|
2772
|
-
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";
|
|
2773
2780
|
import { OperationTypeCrud as OperationTypeCrud10 } from "@cxbox-ui/schema";
|
|
2774
2781
|
import { isAnyOf as isAnyOf4 } from "@reduxjs/toolkit";
|
|
2775
2782
|
var actionTypesMatcher = isAnyOf4(sendOperation);
|
|
@@ -2790,7 +2797,7 @@ var bcCancelCreateDataEpic = (action$, state$, { api }) => action$.pipe(filter44
|
|
|
2790
2797
|
return api.customAction(screenName, bcUrl, data, context, params).pipe(mergeMap29((response) => {
|
|
2791
2798
|
var _a2;
|
|
2792
2799
|
const postInvoke = (_a2 = response.postActions) == null ? void 0 : _a2[0];
|
|
2793
|
-
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);
|
|
2794
2801
|
}), catchError13((error) => {
|
|
2795
2802
|
console.error(error);
|
|
2796
2803
|
return concat22(of30(bcDeleteDataFail({ bcName })), createApiErrorObservable(error, context));
|
|
@@ -3008,7 +3015,7 @@ var changeAssociationFullEpic = (action$, state$) => action$.pipe(filter48(chang
|
|
|
3008
3015
|
return concat26(...result);
|
|
3009
3016
|
}));
|
|
3010
3017
|
// src/epics/data/saveAssociationsActiveEpic.ts
|
|
3011
|
-
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";
|
|
3012
3019
|
var saveAssociationsActiveEpic = (action$, state$, { api }) => action$.pipe(filter49(saveAssociations.match), filter49((action) => {
|
|
3013
3020
|
var _a;
|
|
3014
3021
|
return (_a = state$.value.view.popupData) == null ? void 0 : _a.active;
|
|
@@ -3024,10 +3031,10 @@ var saveAssociationsActiveEpic = (action$, state$, { api }) => action$.pipe(filt
|
|
|
3024
3031
|
return api.associate(state.screen.screenName, bcUrl, Object.values(pendingChanges).filter((i) => i._associate), params).pipe(mergeMap34((response) => {
|
|
3025
3032
|
const postInvoke = response.postActions[0];
|
|
3026
3033
|
const calleeWidget = state.view.widgets.find((widgetItem) => widgetItem.bcName === calleeBCName);
|
|
3027
|
-
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 })));
|
|
3028
3035
|
}), catchError15((err) => {
|
|
3029
3036
|
console.error(err);
|
|
3030
|
-
return
|
|
3037
|
+
return EMPTY26;
|
|
3031
3038
|
}));
|
|
3032
3039
|
}));
|
|
3033
3040
|
// src/epics/data/changeAssociationSameBcEpic.ts
|
|
@@ -3233,7 +3240,7 @@ var ObservableApiWrapper = class {
|
|
|
3233
3240
|
};
|
|
3234
3241
|
// src/api/ObservableApi.ts
|
|
3235
3242
|
import axios3 from "axios";
|
|
3236
|
-
import { EMPTY as
|
|
3243
|
+
import { EMPTY as EMPTY27, expand, map as map11, reduce } from "rxjs";
|
|
3237
3244
|
var Api = class {
|
|
3238
3245
|
constructor(instance) {
|
|
3239
3246
|
__publicField(this, "api$");
|
|
@@ -3254,7 +3261,7 @@ var Api = class {
|
|
|
3254
3261
|
fetchBcDataAll(screenName, bcUrl, params = {}) {
|
|
3255
3262
|
let currentPage = 1;
|
|
3256
3263
|
return this.fetchBcData(screenName, bcUrl, __spreadProps(__spreadValues({}, params), { _page: currentPage })).pipe(expand((response) => {
|
|
3257
|
-
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;
|
|
3258
3265
|
}), reduce((items, nextResponse) => {
|
|
3259
3266
|
return [...items, ...nextResponse.data];
|
|
3260
3267
|
}, []));
|