blixify-ui-web 1.2.23 → 1.2.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/components/data/dataTemplate/index.d.ts.map +1 -1
- package/lib/components/data/dataTemplate/index.js +300 -109
- package/lib/components/data/dataTemplate/index.js.map +1 -1
- package/lib/components/data/dataTemplate/model.d.ts +10 -0
- package/lib/components/data/dataTemplate/model.d.ts.map +1 -1
- package/lib/components/data/listModule.d.ts.map +1 -1
- package/lib/components/data/listModule.js +5 -9
- package/lib/components/data/listModule.js.map +1 -1
- package/lib/components/display/newKanban/index.d.ts +10 -0
- package/lib/components/display/newKanban/index.d.ts.map +1 -1
- package/lib/components/display/newKanban/index.js +134 -54
- package/lib/components/display/newKanban/index.js.map +1 -1
- package/lib/components/display/newList/index.d.ts +48 -5
- package/lib/components/display/newList/index.d.ts.map +1 -1
- package/lib/components/display/newList/index.js +453 -31
- package/lib/components/display/newList/index.js.map +1 -1
- package/lib/components/display/newTable/index.d.ts +15 -0
- package/lib/components/display/newTable/index.d.ts.map +1 -1
- package/lib/components/display/newTable/index.js +170 -43
- package/lib/components/display/newTable/index.js.map +1 -1
- package/lib/components/display/table/index.d.ts +3 -0
- package/lib/components/display/table/index.d.ts.map +1 -1
- package/lib/components/display/table/index.js +30 -22
- package/lib/components/display/table/index.js.map +1 -1
- package/lib/components/index.d.ts +2 -0
- package/lib/components/index.d.ts.map +1 -1
- package/lib/components/index.js.map +1 -1
- package/lib/components/input/address/index.d.ts.map +1 -1
- package/lib/components/input/address/index.js.map +1 -1
- package/lib/components/input/textInput/index.d.ts.map +1 -1
- package/lib/components/input/textInput/index.js.map +1 -1
- package/lib/tail.css +2 -2
- package/package.json +1 -1
|
@@ -117,6 +117,10 @@ var modal_1 = require("../../display/modal");
|
|
|
117
117
|
var notification_1 = require("../../display/notification");
|
|
118
118
|
var stepper_1 = require("../../display/stepper");
|
|
119
119
|
var table_1 = require("../../display/table");
|
|
120
|
+
var newTable_1 = require("../../display/newTable");
|
|
121
|
+
var newList_1 = require("../../display/newList");
|
|
122
|
+
var newKanban_1 = require("../../display/newKanban");
|
|
123
|
+
var newCalendar_1 = require("../../display/newCalendar");
|
|
120
124
|
var address_1 = require("../../input/address");
|
|
121
125
|
var canvas_1 = require("../../input/canvas");
|
|
122
126
|
var form_1 = require("../../input/form");
|
|
@@ -2599,8 +2603,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
2599
2603
|
}); }))];
|
|
2600
2604
|
case 2:
|
|
2601
2605
|
_c.sent();
|
|
2602
|
-
hadValidEntries = uploadedData_1.length > 0 ||
|
|
2603
|
-
selectedField["upload"].length === 0;
|
|
2606
|
+
hadValidEntries = uploadedData_1.length > 0 || selectedField["upload"].length === 0;
|
|
2604
2607
|
if (!hadValidEntries)
|
|
2605
2608
|
return [2 /*return*/, selectedField];
|
|
2606
2609
|
return [2 /*return*/, selectedField["data"].concat(uploadedData_1)];
|
|
@@ -3770,17 +3773,17 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
3770
3773
|
});
|
|
3771
3774
|
}); };
|
|
3772
3775
|
var handleSubmitData = function (type, rowId, columnId, data, offlineId, isOfflineUpdate, isDraft) { return __awaiter(void 0, void 0, void 0, function () {
|
|
3773
|
-
var selectedId, id, createSelectedData_1, uniqueDataStructure, uniqueColumnId, res, offlineDataResp, offlineData, clonedForOffline, tempData, selectedIndex_3, err_20, isExistingDoc, newRecordData_1, changedAttributeIds, baseDraftValue, hasBaseDraftChange, offlineDataResp, clonedForOffline, tempData, selectedIndex_4, offlineData, err_21, dataToSubmit_2, changedAttributeIds, baseDraftValue, hasBaseDraftChange, operationType, selectedIndex_5, dataId, err_22, offlineDataResp, offlineData, clonedForOffline, tempData, selectedIndex_6, _a;
|
|
3774
|
-
var _b, _c;
|
|
3775
|
-
var
|
|
3776
|
-
return __generator(this, function (
|
|
3777
|
-
switch (
|
|
3776
|
+
var selectedId, id, createSelectedData_1, uniqueDataStructure, uniqueColumnId, res, offlineDataResp, offlineData, clonedForOffline, tempData, selectedIndex_3, err_20, isExistingDoc, newRecordData_1, changedAttributeIds, baseDraftValue, hasBaseDraftChange, offlineDataResp, clonedForOffline, tempData, selectedIndex_4, offlineData, err_21, dataToSubmit_2, changedAttributeIds, baseDraftValue, hasBaseDraftChange, operationType, selectedIndex_5, wentToServer, dataId, err_22, offlineDataResp, offlineData, clonedForOffline, tempData, selectedIndex_6, _a;
|
|
3777
|
+
var _b, _c, _d;
|
|
3778
|
+
var _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;
|
|
3779
|
+
return __generator(this, function (_y) {
|
|
3780
|
+
switch (_y.label) {
|
|
3778
3781
|
case 0:
|
|
3779
3782
|
selectedId = "";
|
|
3780
3783
|
id = "";
|
|
3781
|
-
|
|
3784
|
+
_y.label = 1;
|
|
3782
3785
|
case 1:
|
|
3783
|
-
|
|
3786
|
+
_y.trys.push([1, 39, , 45]);
|
|
3784
3787
|
if (type === "update")
|
|
3785
3788
|
selectedId = rowId !== null && rowId !== void 0 ? rowId : "";
|
|
3786
3789
|
else if (type === "create")
|
|
@@ -3798,24 +3801,26 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
3798
3801
|
id = (0, uuid_1.v4)();
|
|
3799
3802
|
}
|
|
3800
3803
|
else
|
|
3801
|
-
id = (
|
|
3804
|
+
id = (_e = props.id) !== null && _e !== void 0 ? _e : "";
|
|
3802
3805
|
if (offlineId) {
|
|
3803
3806
|
selectedId = offlineId;
|
|
3804
3807
|
id = offlineId;
|
|
3805
3808
|
}
|
|
3806
|
-
if (!(isOffline &&
|
|
3809
|
+
if (!(isOffline &&
|
|
3810
|
+
!(isOfflineNetworkListener && !isNetworkOffline) &&
|
|
3811
|
+
!offlineId)) return [3 /*break*/, 2];
|
|
3807
3812
|
createSelectedData_1 = selectedData;
|
|
3808
3813
|
return [3 /*break*/, 4];
|
|
3809
3814
|
case 2: return [4 /*yield*/, handleUploadImage(id, data)];
|
|
3810
3815
|
case 3:
|
|
3811
|
-
createSelectedData_1 =
|
|
3812
|
-
|
|
3816
|
+
createSelectedData_1 = _y.sent();
|
|
3817
|
+
_y.label = 4;
|
|
3813
3818
|
case 4:
|
|
3814
3819
|
uniqueDataStructure = structure.filter(function (eachStructure) {
|
|
3815
3820
|
return eachStructure.unique;
|
|
3816
3821
|
});
|
|
3817
3822
|
uniqueColumnId = uniqueDataStructure.length > 0 ? uniqueDataStructure[0].id : undefined;
|
|
3818
|
-
if ((
|
|
3823
|
+
if ((_f = props.bareSettings) === null || _f === void 0 ? void 0 : _f.bareUpdatePrefill) {
|
|
3819
3824
|
props.bareSettings.bareUpdatePrefill(selectedData).map(function (eachField) {
|
|
3820
3825
|
var key = eachField.key, value = eachField.value;
|
|
3821
3826
|
createSelectedData_1[key] = value;
|
|
@@ -3829,13 +3834,13 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
3829
3834
|
if (isDraft)
|
|
3830
3835
|
createSelectedData_1["baseDraft"] = true;
|
|
3831
3836
|
if (!isOffline) return [3 /*break*/, 10];
|
|
3832
|
-
|
|
3837
|
+
_y.label = 5;
|
|
3833
3838
|
case 5:
|
|
3834
|
-
|
|
3839
|
+
_y.trys.push([5, 8, , 9]);
|
|
3835
3840
|
return [4 /*yield*/, indexedDb_1.indexedDb.getValue("local", props.collectionId)];
|
|
3836
3841
|
case 6:
|
|
3837
|
-
offlineDataResp =
|
|
3838
|
-
offlineData = (
|
|
3842
|
+
offlineDataResp = _y.sent();
|
|
3843
|
+
offlineData = (_g = offlineDataResp === null || offlineDataResp === void 0 ? void 0 : offlineDataResp.data) !== null && _g !== void 0 ? _g : [];
|
|
3839
3844
|
clonedForOffline = (0, updateModule_1.handleClonedDataAttribute)(selectedData, structure, props.devSettings.server, true, showId);
|
|
3840
3845
|
tempData = (0, updateModule_1.handleParseOfflineWrite)(clonedForOffline, structure);
|
|
3841
3846
|
// INFO: Stamp the _id on the offline entry so subsequent saves can find and update it
|
|
@@ -3878,22 +3883,22 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
3878
3883
|
type: props.collectionId,
|
|
3879
3884
|
})];
|
|
3880
3885
|
case 7:
|
|
3881
|
-
|
|
3886
|
+
_y.sent();
|
|
3882
3887
|
res = true;
|
|
3883
3888
|
return [3 /*break*/, 9];
|
|
3884
3889
|
case 8:
|
|
3885
|
-
err_20 =
|
|
3890
|
+
err_20 = _y.sent();
|
|
3886
3891
|
return [3 /*break*/, 9];
|
|
3887
3892
|
case 9: return [3 /*break*/, 16];
|
|
3888
3893
|
case 10:
|
|
3889
3894
|
if (!((idField && selectedData[idField]) ||
|
|
3890
|
-
((
|
|
3891
|
-
isExistingDoc = ((
|
|
3895
|
+
((_h = props.bareSettings) === null || _h === void 0 ? void 0 : _h.bareUpsertPartialUpdate))) return [3 /*break*/, 12];
|
|
3896
|
+
isExistingDoc = ((_j = props.bareSettings) === null || _j === void 0 ? void 0 : _j.bareUpsertPartialUpdate) &&
|
|
3892
3897
|
loadedSelectedData.current != null;
|
|
3893
3898
|
if (isExistingDoc) {
|
|
3894
3899
|
changedAttributeIds = (0, updateModule_1.compareUpdatedFields)(loadedSelectedData.current, createSelectedData_1).changedAttributeIds;
|
|
3895
3900
|
baseDraftValue = isDraft ? true : false;
|
|
3896
|
-
hasBaseDraftChange = ((
|
|
3901
|
+
hasBaseDraftChange = ((_l = (_k = loadedSelectedData.current) === null || _k === void 0 ? void 0 : _k["baseDraft"]) !== null && _l !== void 0 ? _l : false) !==
|
|
3897
3902
|
baseDraftValue;
|
|
3898
3903
|
// INFO: if nothing changed (including baseDraft), skip the write
|
|
3899
3904
|
if (changedAttributeIds.length === 0 && !hasBaseDraftChange)
|
|
@@ -3944,7 +3949,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
3944
3949
|
upsert: true,
|
|
3945
3950
|
})];
|
|
3946
3951
|
case 11:
|
|
3947
|
-
res =
|
|
3952
|
+
res = _y.sent();
|
|
3948
3953
|
return [3 /*break*/, 16];
|
|
3949
3954
|
case 12:
|
|
3950
3955
|
// INFO: stepper create guard — if a create is already in-flight, queue this
|
|
@@ -3964,7 +3969,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
3964
3969
|
})];
|
|
3965
3970
|
case 13:
|
|
3966
3971
|
//INFO: [CREATE] Create new data
|
|
3967
|
-
res =
|
|
3972
|
+
res = _y.sent();
|
|
3968
3973
|
if (!(selectedId === "new")) return [3 /*break*/, 16];
|
|
3969
3974
|
isCreatingRef.current = false;
|
|
3970
3975
|
if (!pendingDraftSaveRef.current) return [3 /*break*/, 15];
|
|
@@ -3976,21 +3981,23 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
3976
3981
|
})];
|
|
3977
3982
|
case 14:
|
|
3978
3983
|
// INFO: replay as update — inflightIdRef.current holds the real _id
|
|
3979
|
-
|
|
3980
|
-
|
|
3984
|
+
_y.sent();
|
|
3985
|
+
_y.label = 15;
|
|
3981
3986
|
case 15:
|
|
3982
3987
|
inflightIdRef.current = "";
|
|
3983
|
-
|
|
3988
|
+
_y.label = 16;
|
|
3984
3989
|
case 16: return [3 /*break*/, 25];
|
|
3985
3990
|
case 17:
|
|
3986
3991
|
if (!selectedId) return [3 /*break*/, 25];
|
|
3987
|
-
if (!(isOffline &&
|
|
3988
|
-
|
|
3992
|
+
if (!(isOffline &&
|
|
3993
|
+
!(isOfflineNetworkListener && !isNetworkOffline) &&
|
|
3994
|
+
!offlineId)) return [3 /*break*/, 23];
|
|
3995
|
+
_y.label = 18;
|
|
3989
3996
|
case 18:
|
|
3990
|
-
|
|
3997
|
+
_y.trys.push([18, 21, , 22]);
|
|
3991
3998
|
return [4 /*yield*/, indexedDb_1.indexedDb.getValue("local", props.collectionId)];
|
|
3992
3999
|
case 19:
|
|
3993
|
-
offlineDataResp =
|
|
4000
|
+
offlineDataResp = _y.sent();
|
|
3994
4001
|
clonedForOffline = (0, updateModule_1.handleClonedDataAttribute)(selectedData, structure, props.devSettings.server, true, showId);
|
|
3995
4002
|
tempData = (0, updateModule_1.handleParseOfflineWrite)(clonedForOffline, structure);
|
|
3996
4003
|
tempData[serverId] = selectedId;
|
|
@@ -4002,7 +4009,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
4002
4009
|
tempData.syncStatus = "pending";
|
|
4003
4010
|
tempData.baseOnline = true; // INFO: existing server doc, updated offline
|
|
4004
4011
|
selectedIndex_4 = -1;
|
|
4005
|
-
offlineData = (
|
|
4012
|
+
offlineData = (_m = offlineDataResp === null || offlineDataResp === void 0 ? void 0 : offlineDataResp.data) !== null && _m !== void 0 ? _m : [];
|
|
4006
4013
|
offlineData.map(function (eachOfflineData, index) {
|
|
4007
4014
|
var offlineDataId = eachOfflineData[serverId];
|
|
4008
4015
|
if (selectedId === offlineDataId)
|
|
@@ -4032,11 +4039,11 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
4032
4039
|
type: props.collectionId,
|
|
4033
4040
|
})];
|
|
4034
4041
|
case 20:
|
|
4035
|
-
|
|
4042
|
+
_y.sent();
|
|
4036
4043
|
res = true;
|
|
4037
4044
|
return [3 /*break*/, 22];
|
|
4038
4045
|
case 21:
|
|
4039
|
-
err_21 =
|
|
4046
|
+
err_21 = _y.sent();
|
|
4040
4047
|
return [3 /*break*/, 22];
|
|
4041
4048
|
case 22: return [3 /*break*/, 25];
|
|
4042
4049
|
case 23:
|
|
@@ -4045,10 +4052,10 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
4045
4052
|
_b[columnId] = createSelectedData_1[columnId],
|
|
4046
4053
|
_b);
|
|
4047
4054
|
}
|
|
4048
|
-
else if ((
|
|
4049
|
-
changedAttributeIds = (0, updateModule_1.compareUpdatedFields)((
|
|
4055
|
+
else if ((_o = props.bareSettings) === null || _o === void 0 ? void 0 : _o.bareUpsertPartialUpdate) {
|
|
4056
|
+
changedAttributeIds = (0, updateModule_1.compareUpdatedFields)((_p = loadedSelectedData.current) !== null && _p !== void 0 ? _p : {}, createSelectedData_1).changedAttributeIds;
|
|
4050
4057
|
baseDraftValue = isDraft ? true : false;
|
|
4051
|
-
hasBaseDraftChange = ((
|
|
4058
|
+
hasBaseDraftChange = ((_r = (_q = loadedSelectedData.current) === null || _q === void 0 ? void 0 : _q["baseDraft"]) !== null && _r !== void 0 ? _r : false) !==
|
|
4052
4059
|
baseDraftValue;
|
|
4053
4060
|
// INFO: if nothing changed (including baseDraft), skip the write entirely
|
|
4054
4061
|
if (changedAttributeIds.length === 0 && !hasBaseDraftChange)
|
|
@@ -4117,13 +4124,13 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
4117
4124
|
// doesn't exist yet (covers deterministicId passed directly as props.id).
|
|
4118
4125
|
// Also applies to offline upload path so the doc is created if it was
|
|
4119
4126
|
// deleted between the existence check and the write call.
|
|
4120
|
-
upsert: ((
|
|
4127
|
+
upsert: ((_s = props.bareSettings) === null || _s === void 0 ? void 0 : _s.bareUpsertPartialUpdate) && !isOfflineUpdate
|
|
4121
4128
|
? true
|
|
4122
4129
|
: undefined,
|
|
4123
4130
|
})];
|
|
4124
4131
|
case 24:
|
|
4125
|
-
res =
|
|
4126
|
-
|
|
4132
|
+
res = _y.sent();
|
|
4133
|
+
_y.label = 25;
|
|
4127
4134
|
case 25:
|
|
4128
4135
|
if (!(type === "update" || type === "create")) return [3 /*break*/, 33];
|
|
4129
4136
|
if (!res) return [3 /*break*/, 32];
|
|
@@ -4139,28 +4146,37 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
4139
4146
|
});
|
|
4140
4147
|
return [4 /*yield*/, handleGetListData({ data: tableData[selectedIndex_5] }, "update", rowId)];
|
|
4141
4148
|
case 26:
|
|
4142
|
-
|
|
4143
|
-
|
|
4149
|
+
_y.sent();
|
|
4150
|
+
_y.label = 27;
|
|
4144
4151
|
case 27: return [3 /*break*/, 30];
|
|
4145
4152
|
case 28: return [4 /*yield*/, handleGetListData({ data: [createSelectedData_1] }, "create")];
|
|
4146
4153
|
case 29:
|
|
4147
|
-
|
|
4148
|
-
|
|
4154
|
+
_y.sent();
|
|
4155
|
+
_y.label = 30;
|
|
4149
4156
|
case 30:
|
|
4150
|
-
if (!((
|
|
4157
|
+
if (!((_t = props.bareSettings) === null || _t === void 0 ? void 0 : _t.bareUpdateHandlePostComplete)) return [3 /*break*/, 32];
|
|
4151
4158
|
return [4 /*yield*/, props.bareSettings.bareUpdateHandlePostComplete(__assign((_c = {}, _c[serverId] = id, _c), createSelectedData_1))];
|
|
4152
4159
|
case 31:
|
|
4153
|
-
|
|
4154
|
-
|
|
4155
|
-
case 32: return [3 /*break*/,
|
|
4160
|
+
_y.sent();
|
|
4161
|
+
_y.label = 32;
|
|
4162
|
+
case 32: return [3 /*break*/, 38];
|
|
4156
4163
|
case 33:
|
|
4157
4164
|
createSelectedData_1[serverId] = id;
|
|
4158
4165
|
if (!!isOffline) return [3 /*break*/, 35];
|
|
4159
4166
|
return [4 /*yield*/, handleGetListData({ data: [createSelectedData_1] }, selectedId === "new" ? "create" : "update", id)];
|
|
4160
4167
|
case 34:
|
|
4161
|
-
|
|
4162
|
-
|
|
4168
|
+
_y.sent();
|
|
4169
|
+
_y.label = 35;
|
|
4163
4170
|
case 35:
|
|
4171
|
+
wentToServer = res &&
|
|
4172
|
+
!offlineId &&
|
|
4173
|
+
(!isOffline || (isOfflineNetworkListener && !isNetworkOffline));
|
|
4174
|
+
if (!(wentToServer && ((_u = props.bareSettings) === null || _u === void 0 ? void 0 : _u.bareUpdateHandlePostComplete))) return [3 /*break*/, 37];
|
|
4175
|
+
return [4 /*yield*/, props.bareSettings.bareUpdateHandlePostComplete(__assign((_d = {}, _d[serverId] = id, _d), createSelectedData_1))];
|
|
4176
|
+
case 36:
|
|
4177
|
+
_y.sent();
|
|
4178
|
+
_y.label = 37;
|
|
4179
|
+
case 37:
|
|
4164
4180
|
setNotification({
|
|
4165
4181
|
type: true,
|
|
4166
4182
|
title: props.id === "new"
|
|
@@ -4170,12 +4186,12 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
4170
4186
|
? "Data sucessfully created"
|
|
4171
4187
|
: "Data sucessfully updated",
|
|
4172
4188
|
});
|
|
4173
|
-
|
|
4174
|
-
case
|
|
4189
|
+
_y.label = 38;
|
|
4190
|
+
case 38:
|
|
4175
4191
|
dataId = res ? id : "";
|
|
4176
4192
|
return [2 /*return*/, dataId];
|
|
4177
|
-
case
|
|
4178
|
-
err_22 =
|
|
4193
|
+
case 39:
|
|
4194
|
+
err_22 = _y.sent();
|
|
4179
4195
|
console.log("error", err_22);
|
|
4180
4196
|
// INFO: clear in-flight guard on failure so the next save retries as a create
|
|
4181
4197
|
if (isCreatingRef.current) {
|
|
@@ -4183,18 +4199,18 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
4183
4199
|
pendingDraftSaveRef.current = false;
|
|
4184
4200
|
inflightIdRef.current = "";
|
|
4185
4201
|
}
|
|
4186
|
-
if (!(((
|
|
4202
|
+
if (!(((_v = props.bareSettings) === null || _v === void 0 ? void 0 : _v.bareOffline) &&
|
|
4187
4203
|
id &&
|
|
4188
4204
|
!offlineId &&
|
|
4189
4205
|
!isOfflineUpdate &&
|
|
4190
|
-
!err_22.response)) return [3 /*break*/,
|
|
4191
|
-
|
|
4192
|
-
case
|
|
4193
|
-
|
|
4206
|
+
!err_22.response)) return [3 /*break*/, 44];
|
|
4207
|
+
_y.label = 40;
|
|
4208
|
+
case 40:
|
|
4209
|
+
_y.trys.push([40, 43, , 44]);
|
|
4194
4210
|
return [4 /*yield*/, indexedDb_1.indexedDb.getValue("local", props.collectionId)];
|
|
4195
|
-
case
|
|
4196
|
-
offlineDataResp =
|
|
4197
|
-
offlineData = (
|
|
4211
|
+
case 41:
|
|
4212
|
+
offlineDataResp = _y.sent();
|
|
4213
|
+
offlineData = (_w = offlineDataResp === null || offlineDataResp === void 0 ? void 0 : offlineDataResp.data) !== null && _w !== void 0 ? _w : [];
|
|
4198
4214
|
clonedForOffline = (0, updateModule_1.handleClonedDataAttribute)(selectedData, structure, props.devSettings.server, true, showId);
|
|
4199
4215
|
tempData = (0, updateModule_1.handleParseOfflineWrite)(clonedForOffline, structure);
|
|
4200
4216
|
if (!tempData[serverId])
|
|
@@ -4230,8 +4246,8 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
4230
4246
|
data: offlineData,
|
|
4231
4247
|
type: props.collectionId,
|
|
4232
4248
|
})];
|
|
4233
|
-
case
|
|
4234
|
-
|
|
4249
|
+
case 42:
|
|
4250
|
+
_y.sent();
|
|
4235
4251
|
setNotification({
|
|
4236
4252
|
type: false,
|
|
4237
4253
|
title: selectedId === "new"
|
|
@@ -4242,12 +4258,12 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
4242
4258
|
handleCheckOfflineDataLength();
|
|
4243
4259
|
// INFO: return id so handleSubmit can navigate as if the save succeeded
|
|
4244
4260
|
return [2 /*return*/, id];
|
|
4245
|
-
case
|
|
4246
|
-
_a =
|
|
4247
|
-
return [3 /*break*/,
|
|
4248
|
-
case
|
|
4261
|
+
case 43:
|
|
4262
|
+
_a = _y.sent();
|
|
4263
|
+
return [3 /*break*/, 44];
|
|
4264
|
+
case 44:
|
|
4249
4265
|
if (err_22.response && err_22.response.status === 400) {
|
|
4250
|
-
if (typeof ((
|
|
4266
|
+
if (typeof ((_x = err_22.response.data) === null || _x === void 0 ? void 0 : _x.err) === "string")
|
|
4251
4267
|
setNotification({
|
|
4252
4268
|
type: false,
|
|
4253
4269
|
title: "Error",
|
|
@@ -4260,8 +4276,8 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
4260
4276
|
msg: "Please contact our administrator for assistance or try your request again later. We apologize for any inconvenience",
|
|
4261
4277
|
});
|
|
4262
4278
|
}
|
|
4263
|
-
return [3 /*break*/,
|
|
4264
|
-
case
|
|
4279
|
+
return [3 /*break*/, 45];
|
|
4280
|
+
case 45: return [2 /*return*/];
|
|
4265
4281
|
}
|
|
4266
4282
|
});
|
|
4267
4283
|
}); };
|
|
@@ -7198,7 +7214,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
7198
7214
|
return (react_1.default.createElement(settingsModal_1.ExpressionModal, { selectedId: id, model: structure, renderReferenceLabelOptions: (_a = props.organise) === null || _a === void 0 ? void 0 : _a.renderReferenceLabelOptions, renderReferenceSpaceOptions: (_b = props.organise) === null || _b === void 0 ? void 0 : _b.renderReferenceSpaceOptions, onAddModelSchema: (_c = props.organise) === null || _c === void 0 ? void 0 : _c.onAddColumns, onClose: onClose }));
|
|
7199
7215
|
};
|
|
7200
7216
|
var renderGroupTable = function (multipleSelect) {
|
|
7201
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5;
|
|
7217
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34, _35, _36, _37;
|
|
7202
7218
|
if (groupId) {
|
|
7203
7219
|
var groupAttributeDS_1 = structure.find(function (eachDS) { return eachDS.id === groupId; });
|
|
7204
7220
|
var groupedSpaceTableData = spaceTableData.reduce(function (acc, eachData) {
|
|
@@ -7321,25 +7337,131 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
7321
7337
|
}
|
|
7322
7338
|
}
|
|
7323
7339
|
else {
|
|
7324
|
-
|
|
7340
|
+
// INFO: when bareNewDTW is enabled, render NewTable instead of legacy Table
|
|
7341
|
+
if ((_a = props.bareSettings) === null || _a === void 0 ? void 0 : _a.bareNewDTW) {
|
|
7342
|
+
return (react_1.default.createElement(newTable_1.NewTable, { showId: showId, paginationType: renderResolvedPaginationType(), data: tableData, spaceData: spaceTableData !== null && spaceTableData !== void 0 ? spaceTableData : [], size: size !== null && size !== void 0 ? size : 0, limit: limit, cursor: cursor !== null && cursor !== void 0 ? cursor : "", loading: tableLoading !== null && tableLoading !== void 0 ? tableLoading : true, checkbox: multipleSelect, selectAll: selectAll, selectedIds: selectedIds, selectAllText: selectAll ? "from filter" : "", disableSelectFullData: (_c = (_b = props.organise) === null || _b === void 0 ? void 0 : _b.disableSelectFullData) === null || _c === void 0 ? void 0 : _c.table, mobileView: (_d = props.bareSettings) === null || _d === void 0 ? void 0 : _d.bareListMobileView, mobileTooltip: (_e = props.bareSettings) === null || _e === void 0 ? void 0 : _e.bareMobileTooltip, multiActionFloatingBtns: __spreadArray(__spreadArray(__spreadArray(__spreadArray([], (!((_f = props.edit) === null || _f === void 0 ? void 0 : _f.disabledUpdate) &&
|
|
7343
|
+
!((_g = props.bareSettings) === null || _g === void 0 ? void 0 : _g.bareHideTableExtraMultipleAction)
|
|
7344
|
+
? [
|
|
7345
|
+
{
|
|
7346
|
+
id: "draft",
|
|
7347
|
+
btnText: "Change to Draft",
|
|
7348
|
+
onClick: function () { return handleBatchDraftData(); },
|
|
7349
|
+
hide: selectedIds.length === 0,
|
|
7350
|
+
},
|
|
7351
|
+
{
|
|
7352
|
+
id: "clone",
|
|
7353
|
+
btnText: "Clone Items",
|
|
7354
|
+
onClick: function () { return handleCloneSelectedData(); },
|
|
7355
|
+
hide: selectedIds.length === 0,
|
|
7356
|
+
},
|
|
7357
|
+
]
|
|
7358
|
+
: []), true), (((_h = props.edit) === null || _h === void 0 ? void 0 : _h.deleteBtn)
|
|
7359
|
+
? [
|
|
7360
|
+
{
|
|
7361
|
+
id: "delete",
|
|
7362
|
+
btnText: "Delete",
|
|
7363
|
+
onClick: function () {
|
|
7364
|
+
handleGenerateDeletePasscode();
|
|
7365
|
+
setDeleteModal(true);
|
|
7366
|
+
},
|
|
7367
|
+
},
|
|
7368
|
+
]
|
|
7369
|
+
: []), true), (!isFirebase && !((_j = props.edit) === null || _j === void 0 ? void 0 : _j.disableBatchUpdate)
|
|
7370
|
+
? [
|
|
7371
|
+
{
|
|
7372
|
+
id: "update",
|
|
7373
|
+
btnText: "Update",
|
|
7374
|
+
onClick: function () { return setBatchUpdateModal(true); },
|
|
7375
|
+
},
|
|
7376
|
+
]
|
|
7377
|
+
: []), true), (((_k = props.bareSettings) === null || _k === void 0 ? void 0 : _k.bareListMultipleSelectAddtionalActions)
|
|
7378
|
+
? props.bareSettings.bareListMultipleSelectAddtionalActions.map(function (eachButton) { return ({
|
|
7379
|
+
id: "dt-list-multi-action-btn-" + eachButton.text,
|
|
7380
|
+
btnText: eachButton.text,
|
|
7381
|
+
onClick: function () {
|
|
7382
|
+
var _a, _b;
|
|
7383
|
+
return (_a = eachButton.onClick) === null || _a === void 0 ? void 0 : _a.call(eachButton, selectedIds, selectAll, (_b = renderImpSearchFilterConditions()) !== null && _b !== void 0 ? _b : []);
|
|
7384
|
+
},
|
|
7385
|
+
}); })
|
|
7386
|
+
: []), true), multiActionFloatingOffset: (_l = props.bareSettings) === null || _l === void 0 ? void 0 : _l.bareListFloatingActionOffset, handleSelectAll: handleSelectAllPages, handleSelectedIds: handleSelectIds, header: renderTableHeader(), pageIndex: pageIndex !== null && pageIndex !== void 0 ? pageIndex : 0, onClickRow: function (id) {
|
|
7387
|
+
var _a, _b;
|
|
7388
|
+
(_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.handleNavigate) === null || _b === void 0 ? void 0 : _b.call(_a, "read", id, "general");
|
|
7389
|
+
}, linkType: props.linkType, custom: props.custom, newTabUrl: (_o = (_m = props.newTabUrl) === null || _m === void 0 ? void 0 : _m.default) !== null && _o !== void 0 ? _o : "".concat(props.localURLEndpoint, "?data="), addNewTabUrl: (_q = (_p = props.newTabUrl) === null || _p === void 0 ? void 0 : _p.addons) !== null && _q !== void 0 ? _q : "&type=read&collection=".concat(props.collectionId, "&view=general"), handleUpdatePageIndex: function (value) {
|
|
7390
|
+
handlePagination(value);
|
|
7391
|
+
}, className: "mt-5", devSettings: props.devSettings, bareSettings: props.bareSettings, fixedPagination: (_r = props.organise) === null || _r === void 0 ? void 0 : _r.fixedPagination, advSettings: {
|
|
7392
|
+
addColumnEnabled: (_s = props.organise) === null || _s === void 0 ? void 0 : _s.addColumnEnabled,
|
|
7393
|
+
renderAddColumnElements: renderAddMathColumn,
|
|
7394
|
+
dragEnabled: (_t = props.organise) === null || _t === void 0 ? void 0 : _t.advDragEnabled,
|
|
7395
|
+
sortEnabled: (_u = props.organise) === null || _u === void 0 ? void 0 : _u.advSortEnabled,
|
|
7396
|
+
filterEnabled: ((_v = props.bareSettings) === null || _v === void 0 ? void 0 : _v.bareFlexFilters)
|
|
7397
|
+
? false
|
|
7398
|
+
: (_w = props.organise) === null || _w === void 0 ? void 0 : _w.advFilterEnabled,
|
|
7399
|
+
sortId: (_x = props.organise) === null || _x === void 0 ? void 0 : _x.sort,
|
|
7400
|
+
sortOptions: (_z = (_y = props.organise) === null || _y === void 0 ? void 0 : _y.renderReferenceLabelOptions) === null || _z === void 0 ? void 0 : _z.call(_y),
|
|
7401
|
+
onSortColumn: (_0 = props.organise) === null || _0 === void 0 ? void 0 : _0.onChangeSort,
|
|
7402
|
+
onDragColumn: (_1 = props.organise) === null || _1 === void 0 ? void 0 : _1.onChangeDrag,
|
|
7403
|
+
filterOptions: additionalQuery === null || additionalQuery === void 0 ? void 0 : additionalQuery.map(function (eachQuery) {
|
|
7404
|
+
var _a;
|
|
7405
|
+
return {
|
|
7406
|
+
key: eachQuery.value,
|
|
7407
|
+
label: (_a = eachQuery.label) !== null && _a !== void 0 ? _a : "",
|
|
7408
|
+
};
|
|
7409
|
+
}),
|
|
7410
|
+
renderFilterElements: function (id) {
|
|
7411
|
+
var selectedQuery = additionalQuery === null || additionalQuery === void 0 ? void 0 : additionalQuery.filter(function (eachQuery) {
|
|
7412
|
+
return eachQuery.value === id;
|
|
7413
|
+
});
|
|
7414
|
+
var selectedModelList = structure.filter(function (eachModel) { return eachModel.id === id; });
|
|
7415
|
+
var newQuery = (0, listModule_1.renderSearchAdditionalQueries)(selectedModelList, selectedQuery);
|
|
7416
|
+
return renderSearchContent(newQuery);
|
|
7417
|
+
},
|
|
7418
|
+
}, editable: {
|
|
7419
|
+
active: ((_2 = props.edit) === null || _2 === void 0 ? void 0 : _2.listEditable) && !props.edit.disabledUpdate
|
|
7420
|
+
? true
|
|
7421
|
+
: false,
|
|
7422
|
+
onUpdateData: function (rowId, columnId, data) { return __awaiter(void 0, void 0, void 0, function () {
|
|
7423
|
+
return __generator(this, function (_a) {
|
|
7424
|
+
switch (_a.label) {
|
|
7425
|
+
case 0: return [4 /*yield*/, handleSubmitData("update", rowId, columnId, data)];
|
|
7426
|
+
case 1:
|
|
7427
|
+
_a.sent();
|
|
7428
|
+
return [2 /*return*/];
|
|
7429
|
+
}
|
|
7430
|
+
});
|
|
7431
|
+
}); },
|
|
7432
|
+
}, addable: {
|
|
7433
|
+
active: ((_3 = props.edit) === null || _3 === void 0 ? void 0 : _3.listAddable) ? true : false,
|
|
7434
|
+
onAddData: function (data) { return __awaiter(void 0, void 0, void 0, function () {
|
|
7435
|
+
return __generator(this, function (_a) {
|
|
7436
|
+
switch (_a.label) {
|
|
7437
|
+
case 0: return [4 /*yield*/, handleSubmitData("create", "", "", data)];
|
|
7438
|
+
case 1:
|
|
7439
|
+
_a.sent();
|
|
7440
|
+
return [2 /*return*/];
|
|
7441
|
+
}
|
|
7442
|
+
});
|
|
7443
|
+
}); },
|
|
7444
|
+
}, darkMode: (_4 = props.organise) === null || _4 === void 0 ? void 0 : _4.darkMode, hidePagination: (_5 = props.organise) === null || _5 === void 0 ? void 0 : _5.hidePagination, customPaginationSize: customPaginationSize, disableEllipsisOnLongWord: (_6 = props.organise) === null || _6 === void 0 ? void 0 : _6.disableEllipsisOnLongWord, pinColumns: (_7 = props.bareSettings) === null || _7 === void 0 ? void 0 : _7.bareListTablePinColumns }));
|
|
7445
|
+
}
|
|
7446
|
+
return (react_1.default.createElement(table_1.Table, { showId: showId, paginationType: renderResolvedPaginationType(), data: tableData, spaceData: spaceTableData !== null && spaceTableData !== void 0 ? spaceTableData : [], size: size !== null && size !== void 0 ? size : 0, limit: limit, cursor: cursor !== null && cursor !== void 0 ? cursor : "", loading: tableLoading !== null && tableLoading !== void 0 ? tableLoading : true, checkbox: multipleSelect, selectAll: selectAll, selectedIds: selectedIds, selectAllText: selectAll ? "from filter" : "", disableSelectFullData: (_9 = (_8 = props.organise) === null || _8 === void 0 ? void 0 : _8.disableSelectFullData) === null || _9 === void 0 ? void 0 : _9.table, multiActionButton: react_1.default.createElement("div", { className: "flex flex-row space-x-3" },
|
|
7325
7447
|
selectedIds.length > 0 &&
|
|
7326
|
-
!((
|
|
7327
|
-
!((
|
|
7448
|
+
!((_10 = props.edit) === null || _10 === void 0 ? void 0 : _10.disabledUpdate) &&
|
|
7449
|
+
!((_11 = props.bareSettings) === null || _11 === void 0 ? void 0 : _11.bareHideTableExtraMultipleAction) && (react_1.default.createElement(react_1.default.Fragment, null,
|
|
7328
7450
|
react_1.default.createElement(textButton_1.TextButton, { className: "text-sm", text: "Change to Draft", disable: loading, onClick: function () {
|
|
7329
7451
|
handleBatchDraftData();
|
|
7330
7452
|
} }),
|
|
7331
7453
|
react_1.default.createElement(textButton_1.TextButton, { className: "text-sm", text: "Clone Items", disable: loading, onClick: function () {
|
|
7332
7454
|
handleCloneSelectedData();
|
|
7333
7455
|
} }))),
|
|
7334
|
-
((
|
|
7456
|
+
((_12 = props.edit) === null || _12 === void 0 ? void 0 : _12.deleteBtn) && (react_1.default.createElement(textButton_1.TextButton, { className: "text-sm text-red-500 hover:text-red-600", text: "Delete", onClick: function () {
|
|
7335
7457
|
handleGenerateDeletePasscode();
|
|
7336
7458
|
setDeleteModal(true);
|
|
7337
7459
|
} })),
|
|
7338
|
-
!isFirebase && !((
|
|
7460
|
+
!isFirebase && !((_13 = props.edit) === null || _13 === void 0 ? void 0 : _13.disableBatchUpdate) && (react_1.default.createElement(textButton_1.TextButton, { className: "text-sm", text: "Update", onClick: function () {
|
|
7339
7461
|
setBatchUpdateModal(true);
|
|
7340
7462
|
} })),
|
|
7341
|
-
((
|
|
7342
|
-
((
|
|
7463
|
+
((_14 = props.bareSettings) === null || _14 === void 0 ? void 0 : _14.bareListMultipleSelectAddtionalActions) &&
|
|
7464
|
+
((_16 = (_15 = props.bareSettings) === null || _15 === void 0 ? void 0 : _15.bareListMultipleSelectAddtionalActions) === null || _16 === void 0 ? void 0 : _16.map(function (eachButton) {
|
|
7343
7465
|
return (react_1.default.createElement(textButton_1.TextButton, { className: "text-sm ".concat(eachButton.className), text: eachButton.text, onClick: function () {
|
|
7344
7466
|
var _a, _b;
|
|
7345
7467
|
(_a = eachButton.onClick) === null || _a === void 0 ? void 0 : _a.call(eachButton, selectedIds, selectAll, (_b = renderImpSearchFilterConditions()) !== null && _b !== void 0 ? _b : []);
|
|
@@ -7347,20 +7469,20 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
7347
7469
|
}))), handleSelectAll: handleSelectAllPages, handleSelectedIds: handleSelectIds, header: renderTableHeader(), pageIndex: pageIndex !== null && pageIndex !== void 0 ? pageIndex : 0, onClickRow: function (id) {
|
|
7348
7470
|
var _a, _b;
|
|
7349
7471
|
(_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.handleNavigate) === null || _b === void 0 ? void 0 : _b.call(_a, "read", id, "general");
|
|
7350
|
-
}, linkType: props.linkType, custom: props.custom, newTabUrl: (
|
|
7472
|
+
}, linkType: props.linkType, custom: props.custom, newTabUrl: (_18 = (_17 = props.newTabUrl) === null || _17 === void 0 ? void 0 : _17.default) !== null && _18 !== void 0 ? _18 : "".concat(props.localURLEndpoint, "?data="), addNewTabUrl: (_20 = (_19 = props.newTabUrl) === null || _19 === void 0 ? void 0 : _19.addons) !== null && _20 !== void 0 ? _20 : "&type=read&collection=".concat(props.collectionId, "&view=general"), handleUpdatePageIndex: function (value) {
|
|
7351
7473
|
handlePagination(value);
|
|
7352
|
-
}, className: "mt-5", lib: { axios: (
|
|
7353
|
-
addColumnEnabled: (
|
|
7474
|
+
}, className: "mt-5", lib: { axios: (_21 = props.lib) === null || _21 === void 0 ? void 0 : _21.axios }, devSettings: props.devSettings, bareSettings: props.bareSettings, fixedPagination: (_22 = props.organise) === null || _22 === void 0 ? void 0 : _22.fixedPagination, advSettings: {
|
|
7475
|
+
addColumnEnabled: (_23 = props.organise) === null || _23 === void 0 ? void 0 : _23.addColumnEnabled,
|
|
7354
7476
|
renderAddColumnElements: renderAddMathColumn,
|
|
7355
|
-
dragEnabled: (
|
|
7356
|
-
sortEnabled: (
|
|
7357
|
-
filterEnabled: ((
|
|
7477
|
+
dragEnabled: (_24 = props.organise) === null || _24 === void 0 ? void 0 : _24.advDragEnabled,
|
|
7478
|
+
sortEnabled: (_25 = props.organise) === null || _25 === void 0 ? void 0 : _25.advSortEnabled,
|
|
7479
|
+
filterEnabled: ((_26 = props.bareSettings) === null || _26 === void 0 ? void 0 : _26.bareFlexFilters)
|
|
7358
7480
|
? false
|
|
7359
|
-
: (
|
|
7360
|
-
sortId: (
|
|
7361
|
-
sortOptions: (
|
|
7362
|
-
onSortColumn: (
|
|
7363
|
-
onDragColumn: (
|
|
7481
|
+
: (_27 = props.organise) === null || _27 === void 0 ? void 0 : _27.advFilterEnabled,
|
|
7482
|
+
sortId: (_28 = props.organise) === null || _28 === void 0 ? void 0 : _28.sort,
|
|
7483
|
+
sortOptions: (_30 = (_29 = props.organise) === null || _29 === void 0 ? void 0 : _29.renderReferenceLabelOptions) === null || _30 === void 0 ? void 0 : _30.call(_29),
|
|
7484
|
+
onSortColumn: (_31 = props.organise) === null || _31 === void 0 ? void 0 : _31.onChangeSort,
|
|
7485
|
+
onDragColumn: (_32 = props.organise) === null || _32 === void 0 ? void 0 : _32.onChangeDrag,
|
|
7364
7486
|
filterOptions: additionalQuery === null || additionalQuery === void 0 ? void 0 : additionalQuery.map(function (eachQuery) {
|
|
7365
7487
|
var _a;
|
|
7366
7488
|
return {
|
|
@@ -7377,7 +7499,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
7377
7499
|
return renderSearchContent(newQuery);
|
|
7378
7500
|
},
|
|
7379
7501
|
}, editable: {
|
|
7380
|
-
active: ((
|
|
7502
|
+
active: ((_33 = props.edit) === null || _33 === void 0 ? void 0 : _33.listEditable) && !props.edit.disabledUpdate
|
|
7381
7503
|
? true
|
|
7382
7504
|
: false,
|
|
7383
7505
|
onUpdateData: function (rowId, columnId, data) { return __awaiter(void 0, void 0, void 0, function () {
|
|
@@ -7391,7 +7513,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
7391
7513
|
});
|
|
7392
7514
|
}); },
|
|
7393
7515
|
}, addable: {
|
|
7394
|
-
active: ((
|
|
7516
|
+
active: ((_34 = props.edit) === null || _34 === void 0 ? void 0 : _34.listAddable) ? true : false,
|
|
7395
7517
|
onAddData: function (data) { return __awaiter(void 0, void 0, void 0, function () {
|
|
7396
7518
|
return __generator(this, function (_a) {
|
|
7397
7519
|
switch (_a.label) {
|
|
@@ -7402,11 +7524,11 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
7402
7524
|
}
|
|
7403
7525
|
});
|
|
7404
7526
|
}); },
|
|
7405
|
-
}, darkMode: (
|
|
7527
|
+
}, darkMode: (_35 = props.organise) === null || _35 === void 0 ? void 0 : _35.darkMode, hidePagination: (_36 = props.organise) === null || _36 === void 0 ? void 0 : _36.hidePagination, customPaginationSize: customPaginationSize, disableEllipsisOnLongWord: (_37 = props.organise) === null || _37 === void 0 ? void 0 : _37.disableEllipsisOnLongWord }));
|
|
7406
7528
|
}
|
|
7407
7529
|
};
|
|
7408
7530
|
var renderTabContent = function (tabs, dataType, viewType) {
|
|
7409
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11;
|
|
7531
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29;
|
|
7410
7532
|
var selectedTabData = tabs.find(function (eachTab) {
|
|
7411
7533
|
if (eachTab.id === viewType) {
|
|
7412
7534
|
return eachTab;
|
|
@@ -7587,27 +7709,50 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
7587
7709
|
}
|
|
7588
7710
|
}
|
|
7589
7711
|
else if (selectedTabData.viewType === "list") {
|
|
7712
|
+
// INFO: when bareNewDTW is enabled, render NewList instead of legacy List
|
|
7713
|
+
if ((_q = props.bareSettings) === null || _q === void 0 ? void 0 : _q.bareNewDTW) {
|
|
7714
|
+
return (react_1.default.createElement(newList_1.NewList, { paginationType: renderResolvedPaginationType(), list: renderGridAndListData(selectedTabData.viewImage, "list"), size: size, limit: limit, cursor: cursor, loading: tableLoading, pageIndex: pageIndex, checkbox: multipleSelect, selectAll: selectAll, selectedIds: selectedIds, disableSelectFullData: (_s = (_r = props.organise) === null || _r === void 0 ? void 0 : _r.disableSelectFullData) === null || _s === void 0 ? void 0 : _s.list, handleSelectAll: handleSelectAllPages, handleSelectedIds: handleSelectIds, selectAllText: selectAll ? "from filter" : "", multiActionButton: react_1.default.createElement("div", { className: "flex flex-row space-x-3" },
|
|
7715
|
+
selectedIds.length > 0 && !((_t = props.edit) === null || _t === void 0 ? void 0 : _t.disabledUpdate) && (react_1.default.createElement(react_1.default.Fragment, null,
|
|
7716
|
+
react_1.default.createElement(textButton_1.TextButton, { className: "text-sm", text: "Change to Draft", disable: loading, onClick: function () {
|
|
7717
|
+
handleBatchDraftData();
|
|
7718
|
+
} }),
|
|
7719
|
+
react_1.default.createElement(textButton_1.TextButton, { className: "text-sm", text: "Clone Items", disable: loading, onClick: function () {
|
|
7720
|
+
handleCloneSelectedData();
|
|
7721
|
+
} }))),
|
|
7722
|
+
((_u = props.edit) === null || _u === void 0 ? void 0 : _u.deleteBtn) && (react_1.default.createElement(textButton_1.TextButton, { className: "text-sm text-red-500 hover:text-red-600", text: "Delete", onClick: function () {
|
|
7723
|
+
handleGenerateDeletePasscode();
|
|
7724
|
+
setDeleteModal(true);
|
|
7725
|
+
} })),
|
|
7726
|
+
!isFirebase && !((_v = props.edit) === null || _v === void 0 ? void 0 : _v.disabledUpdate) && (react_1.default.createElement(textButton_1.TextButton, { className: "text-sm", text: "Update", onClick: function () {
|
|
7727
|
+
setBatchUpdateModal(true);
|
|
7728
|
+
} }))), onClickRow: function (id) {
|
|
7729
|
+
var _a, _b;
|
|
7730
|
+
(_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.handleNavigate) === null || _b === void 0 ? void 0 : _b.call(_a, "read", id, "general");
|
|
7731
|
+
}, linkType: props.linkType, custom: props.custom, newTabUrl: (_x = (_w = props.newTabUrl) === null || _w === void 0 ? void 0 : _w.default) !== null && _x !== void 0 ? _x : "".concat(props.localURLEndpoint, "?data="), addNewTabUrl: (_z = (_y = props.newTabUrl) === null || _y === void 0 ? void 0 : _y.addons) !== null && _z !== void 0 ? _z : "&type=read&collection=".concat(props.collectionId, "&view=general"), handleUpdatePageIndex: function (value) {
|
|
7732
|
+
handlePagination(value);
|
|
7733
|
+
}, darkMode: (_0 = props.organise) === null || _0 === void 0 ? void 0 : _0.darkMode, className: "mt-5", hidePagination: (_1 = props.organise) === null || _1 === void 0 ? void 0 : _1.hidePagination, customPaginationSize: customPaginationSize, mobileTooltip: (_2 = props.bareSettings) === null || _2 === void 0 ? void 0 : _2.bareListMobileTooltip }));
|
|
7734
|
+
}
|
|
7590
7735
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
7591
|
-
react_1.default.createElement(list_1.List, { paginationType: renderResolvedPaginationType(), list: renderGridAndListData(selectedTabData.viewImage, "list"), size: size, limit: limit, cursor: cursor, loading: tableLoading, pageIndex: pageIndex, checkbox: multipleSelect, selectAll: selectAll, selectedIds: selectedIds, disableSelectFullData: (
|
|
7592
|
-
selectedIds.length > 0 && !((
|
|
7736
|
+
react_1.default.createElement(list_1.List, { paginationType: renderResolvedPaginationType(), list: renderGridAndListData(selectedTabData.viewImage, "list"), size: size, limit: limit, cursor: cursor, loading: tableLoading, pageIndex: pageIndex, checkbox: multipleSelect, selectAll: selectAll, selectedIds: selectedIds, disableSelectFullData: (_4 = (_3 = props.organise) === null || _3 === void 0 ? void 0 : _3.disableSelectFullData) === null || _4 === void 0 ? void 0 : _4.list, handleSelectAll: handleSelectAllPages, handleSelectedIds: handleSelectIds, selectAllText: selectAll ? "from filter" : "", multiActionButton: react_1.default.createElement("div", { className: "flex flex-row space-x-3" },
|
|
7737
|
+
selectedIds.length > 0 && !((_5 = props.edit) === null || _5 === void 0 ? void 0 : _5.disabledUpdate) && (react_1.default.createElement(react_1.default.Fragment, null,
|
|
7593
7738
|
react_1.default.createElement(textButton_1.TextButton, { className: "text-sm", text: "Change to Draft", disable: loading, onClick: function () {
|
|
7594
7739
|
handleBatchDraftData();
|
|
7595
7740
|
} }),
|
|
7596
7741
|
react_1.default.createElement(textButton_1.TextButton, { className: "text-sm", text: "Clone Items", disable: loading, onClick: function () {
|
|
7597
7742
|
handleCloneSelectedData();
|
|
7598
7743
|
} }))),
|
|
7599
|
-
((
|
|
7744
|
+
((_6 = props.edit) === null || _6 === void 0 ? void 0 : _6.deleteBtn) && (react_1.default.createElement(textButton_1.TextButton, { className: "text-sm text-red-500 hover:text-red-600", text: "Delete", onClick: function () {
|
|
7600
7745
|
handleGenerateDeletePasscode();
|
|
7601
7746
|
setDeleteModal(true);
|
|
7602
7747
|
} })),
|
|
7603
|
-
!isFirebase && !((
|
|
7748
|
+
!isFirebase && !((_7 = props.edit) === null || _7 === void 0 ? void 0 : _7.disabledUpdate) && (react_1.default.createElement(textButton_1.TextButton, { className: "text-sm", text: "Update", onClick: function () {
|
|
7604
7749
|
setBatchUpdateModal(true);
|
|
7605
7750
|
} }))), onClickRow: function (id) {
|
|
7606
7751
|
var _a, _b;
|
|
7607
7752
|
(_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.handleNavigate) === null || _b === void 0 ? void 0 : _b.call(_a, "read", id, "general");
|
|
7608
|
-
}, linkType: props.linkType, custom: props.custom, newTabUrl: (
|
|
7753
|
+
}, linkType: props.linkType, custom: props.custom, newTabUrl: (_9 = (_8 = props.newTabUrl) === null || _8 === void 0 ? void 0 : _8.default) !== null && _9 !== void 0 ? _9 : "".concat(props.localURLEndpoint, "?data="), addNewTabUrl: (_11 = (_10 = props.newTabUrl) === null || _10 === void 0 ? void 0 : _10.addons) !== null && _11 !== void 0 ? _11 : "&type=read&collection=".concat(props.collectionId, "&view=general"), handleUpdatePageIndex: function (value) {
|
|
7609
7754
|
handlePagination(value);
|
|
7610
|
-
}, className: "mt-5", hidePagination: (
|
|
7755
|
+
}, className: "mt-5", hidePagination: (_12 = props.organise) === null || _12 === void 0 ? void 0 : _12.hidePagination, customPaginationSize: customPaginationSize })));
|
|
7611
7756
|
}
|
|
7612
7757
|
else if (selectedTabData.viewType === "grid") {
|
|
7613
7758
|
var isScrollMode = renderCheckScrollMode();
|
|
@@ -7615,9 +7760,9 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
7615
7760
|
react_1.default.createElement(grid_1.Grid, { paginationType: renderResolvedPaginationType(), data: renderGridAndListData(selectedTabData.viewImage, "grid"), size: size, limit: limit, cursor: cursor, loading: tableLoading, horizontalScroll: isScrollMode, pageIndex: pageIndex, onClickData: function (id) {
|
|
7616
7761
|
var _a, _b;
|
|
7617
7762
|
(_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.handleNavigate) === null || _b === void 0 ? void 0 : _b.call(_a, "read", id, "general");
|
|
7618
|
-
}, linkType: props.linkType, custom: props.custom, newTabUrl: (
|
|
7763
|
+
}, linkType: props.linkType, custom: props.custom, newTabUrl: (_14 = (_13 = props.newTabUrl) === null || _13 === void 0 ? void 0 : _13.default) !== null && _14 !== void 0 ? _14 : "".concat(props.localURLEndpoint, "?data="), addNewTabUrl: (_16 = (_15 = props.newTabUrl) === null || _15 === void 0 ? void 0 : _15.addons) !== null && _16 !== void 0 ? _16 : "&type=read&collection=".concat(props.collectionId, "&view=general"), handleUpdatePageIndex: function (value) {
|
|
7619
7764
|
handlePagination(value);
|
|
7620
|
-
}, imgContain: selectedTabData === null || selectedTabData === void 0 ? void 0 : selectedTabData.gridContain, gridColClassName: (
|
|
7765
|
+
}, imgContain: selectedTabData === null || selectedTabData === void 0 ? void 0 : selectedTabData.gridContain, gridColClassName: (_17 = props.bareSettings) === null || _17 === void 0 ? void 0 : _17.bareListGridColClassName, className: "mt-5", hidePagination: (_18 = props.organise) === null || _18 === void 0 ? void 0 : _18.hidePagination, customPaginationSize: customPaginationSize })));
|
|
7621
7766
|
}
|
|
7622
7767
|
else if (selectedTabData.viewType === "calendar") {
|
|
7623
7768
|
var calendarSettings_1 = selectedTab === null || selectedTab === void 0 ? void 0 : selectedTab.calendarSettings;
|
|
@@ -7711,7 +7856,38 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
7711
7856
|
}
|
|
7712
7857
|
return eventAvailabilities;
|
|
7713
7858
|
};
|
|
7714
|
-
|
|
7859
|
+
// INFO: when bareNewDTW is enabled, render NewCalendar instead of legacy Calendar
|
|
7860
|
+
if ((_19 = props.bareSettings) === null || _19 === void 0 ? void 0 : _19.bareNewDTW) {
|
|
7861
|
+
var newCalendarEvents = renderEventAvailabilities().map(function (ev) {
|
|
7862
|
+
var _a, _b, _c, _d;
|
|
7863
|
+
return ({
|
|
7864
|
+
id: (_a = ev.id) !== null && _a !== void 0 ? _a : "",
|
|
7865
|
+
title: (_b = ev.title) !== null && _b !== void 0 ? _b : "",
|
|
7866
|
+
start: (_d = (_c = ev.start) !== null && _c !== void 0 ? _c : ev.date) !== null && _d !== void 0 ? _d : new Date(),
|
|
7867
|
+
end: ev.end,
|
|
7868
|
+
type: ev.status,
|
|
7869
|
+
color: ev.bgColor,
|
|
7870
|
+
bgColor: ev.bgColor,
|
|
7871
|
+
hoverColor: ev.hoverColor,
|
|
7872
|
+
textColor: ev.textColor,
|
|
7873
|
+
status: ev.status,
|
|
7874
|
+
date: ev.date,
|
|
7875
|
+
});
|
|
7876
|
+
});
|
|
7877
|
+
return (react_1.default.createElement("div", { className: "mt-4" }, tableLoading ? (react_1.default.createElement(loading_1.Loading, null)) : (react_1.default.createElement(newCalendar_1.NewCalendar, { variant: "fullMonth", events: newCalendarEvents, selectedDate: calendarTabMonth, onSelectDate: function (date) {
|
|
7878
|
+
var startOfMonth = (0, dayjs_1.default)(calendarTabMonth).startOf("month");
|
|
7879
|
+
var endOfMonth = (0, dayjs_1.default)(calendarTabMonth).endOf("month");
|
|
7880
|
+
if (!(0, dayjs_1.default)(date).isBetween(startOfMonth, endOfMonth)) {
|
|
7881
|
+
setTableLoading(true);
|
|
7882
|
+
}
|
|
7883
|
+
setCalendarTabMonth(date);
|
|
7884
|
+
}, onClickEvent: function (event) {
|
|
7885
|
+
var _a, _b;
|
|
7886
|
+
if (event.id)
|
|
7887
|
+
(_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.handleNavigate) === null || _b === void 0 ? void 0 : _b.call(_a, "read", event.id, "general");
|
|
7888
|
+
}, darkMode: (_20 = props.organise) === null || _20 === void 0 ? void 0 : _20.darkMode, className: "w-full" }))));
|
|
7889
|
+
}
|
|
7890
|
+
return (react_1.default.createElement("div", { className: "mt-4" }, tableLoading ? (react_1.default.createElement(loading_1.Loading, null)) : (react_1.default.createElement(calendar_1.Calendar, { currentDate: calendarTabMonth, calendarView: (_21 = calendarSettings_1 === null || calendarSettings_1 === void 0 ? void 0 : calendarSettings_1.defaultView) !== null && _21 !== void 0 ? _21 : calendarView, handleMonthChange: function (date) {
|
|
7715
7891
|
var startOfMonth = (0, dayjs_1.default)(calendarTabMonth).startOf("month");
|
|
7716
7892
|
var endOfMonth = (0, dayjs_1.default)(calendarTabMonth).endOf("month");
|
|
7717
7893
|
if (!(0, dayjs_1.default)(date).isBetween(startOfMonth, endOfMonth)) {
|
|
@@ -7729,7 +7905,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
7729
7905
|
else if (selectedTabData.viewType === "feeds") {
|
|
7730
7906
|
var contentList_1 = [];
|
|
7731
7907
|
var feedsSettings_1 = selectedTabData.feedsSettings;
|
|
7732
|
-
var customFeedsData = (
|
|
7908
|
+
var customFeedsData = (_22 = feedsSettings_1 === null || feedsSettings_1 === void 0 ? void 0 : feedsSettings_1.customFeedsData) === null || _22 === void 0 ? void 0 : _22.call(feedsSettings_1, tableData, spaceTableData);
|
|
7733
7909
|
if (customFeedsData && customFeedsData.length > 0) {
|
|
7734
7910
|
customFeedsData.map(function (eachData) {
|
|
7735
7911
|
var _a, _b, _c, _d;
|
|
@@ -7770,11 +7946,11 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
7770
7946
|
});
|
|
7771
7947
|
}
|
|
7772
7948
|
return (react_1.default.createElement("div", { className: "mt-4" }, tableLoading ? (react_1.default.createElement(loading_1.Loading, null)) : (react_1.default.createElement("div", { className: "p-4 bg-white rounded-lg" },
|
|
7773
|
-
react_1.default.createElement(feeds_1.Feeds, { bold: true, content: contentList_1, darkMode: (
|
|
7949
|
+
react_1.default.createElement(feeds_1.Feeds, { bold: true, content: contentList_1, darkMode: (_23 = props.organise) === null || _23 === void 0 ? void 0 : _23.darkMode }),
|
|
7774
7950
|
react_1.default.createElement("div", { className: "my-10" }),
|
|
7775
|
-
contentList_1.length > 0 && !((
|
|
7951
|
+
contentList_1.length > 0 && !((_24 = props.organise) === null || _24 === void 0 ? void 0 : _24.hidePagination) && (react_1.default.createElement(pagination_1.Pagination, { data: tableData, size: size, limit: limit, cursor: cursor, pageIndex: pageIndex, paginationType: renderResolvedPaginationType(), handleUpdatePageIndex: function (value) {
|
|
7776
7952
|
handlePagination(value);
|
|
7777
|
-
}, darkMode: (
|
|
7953
|
+
}, darkMode: (_25 = props.organise) === null || _25 === void 0 ? void 0 : _25.darkMode, customPaginationSize: customPaginationSize }))))));
|
|
7778
7954
|
}
|
|
7779
7955
|
else if (selectedTabData.viewType === "map") {
|
|
7780
7956
|
var mapSettings_1 = selectedTabData.mapSettings;
|
|
@@ -7873,7 +8049,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
7873
8049
|
}
|
|
7874
8050
|
else if (selectedTabData.viewType === "kanban") {
|
|
7875
8051
|
var kanbanSettings = selectedTab === null || selectedTab === void 0 ? void 0 : selectedTab.kanbanSettings;
|
|
7876
|
-
var kanbanTitle_2 = (
|
|
8052
|
+
var kanbanTitle_2 = (_26 = kanbanSettings === null || kanbanSettings === void 0 ? void 0 : kanbanSettings.title) !== null && _26 !== void 0 ? _26 : "";
|
|
7877
8053
|
var nullColumn_1 = false;
|
|
7878
8054
|
var groupBy_1 = [];
|
|
7879
8055
|
var groupLabel_1 = [];
|
|
@@ -7893,6 +8069,21 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
7893
8069
|
return null;
|
|
7894
8070
|
});
|
|
7895
8071
|
var kanbanData = renderGridAndListData("", "kanban", kanbanTitle_2, kanbanSettings === null || kanbanSettings === void 0 ? void 0 : kanbanSettings.useColumnName);
|
|
8072
|
+
// INFO: when bareNewDTW is enabled, render NewKanban instead of legacy Kanban
|
|
8073
|
+
if ((_27 = props.bareSettings) === null || _27 === void 0 ? void 0 : _27.bareNewDTW) {
|
|
8074
|
+
return (react_1.default.createElement(newKanban_1.NewKanban, { className: "inline-flex", data: kanbanData, loading: tableLoading, groupBy: groupBy_1, groupId: kanbanTitle_2 !== null && kanbanTitle_2 !== void 0 ? kanbanTitle_2 : "", groupLabel: groupLabel_1.length > 0 ? groupLabel_1 : undefined, nullColumn: nullColumn_1, alertMessage: kanbanData.length === limit
|
|
8075
|
+
? "Data has exceeded limit, please apply filters"
|
|
8076
|
+
: "", groupCluster: kanbanSettings === null || kanbanSettings === void 0 ? void 0 : kanbanSettings.groupCluster, draggable: true, droppable: kanbanDroppable, mobileView: (_28 = props.bareSettings) === null || _28 === void 0 ? void 0 : _28.bareListMobileView, onUpdateData: function (cardId, _fromCol, toCol) {
|
|
8077
|
+
var _a;
|
|
8078
|
+
setKanbanDroppable(false);
|
|
8079
|
+
handleSubmitData("update", cardId, kanbanTitle_2, (_a = {},
|
|
8080
|
+
_a[kanbanTitle_2] = toCol,
|
|
8081
|
+
_a)).then(function () { return setKanbanDroppable(true); });
|
|
8082
|
+
}, onClickData: function (id) {
|
|
8083
|
+
var _a, _b;
|
|
8084
|
+
(_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.handleNavigate) === null || _b === void 0 ? void 0 : _b.call(_a, "read", id, "general");
|
|
8085
|
+
}, darkMode: (_29 = props.organise) === null || _29 === void 0 ? void 0 : _29.darkMode }));
|
|
8086
|
+
}
|
|
7896
8087
|
return (react_1.default.createElement(kanban_1.Kanban, { className: "inline-flex", data: kanbanData, loading: tableLoading, groupBy: groupBy_1, groupId: kanbanTitle_2 !== null && kanbanTitle_2 !== void 0 ? kanbanTitle_2 : "", groupLabel: groupLabel_1.length > 0 ? groupLabel_1 : undefined, nullColumn: nullColumn_1, alertMessage: kanbanData.length === limit
|
|
7897
8088
|
? "Data has exceeded limit, please apply filters"
|
|
7898
8089
|
: "", groupCluster: kanbanSettings === null || kanbanSettings === void 0 ? void 0 : kanbanSettings.groupCluster, draggable: true, droppable: kanbanDroppable, onUpdateData: function (data) { return __awaiter(void 0, void 0, void 0, function () {
|