blixify-ui-web 0.1.84 → 0.1.86
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/chart/DateRange.d.ts +25 -0
- package/lib/components/chart/DateRange.d.ts.map +1 -0
- package/lib/components/chart/DateRange.js +122 -0
- package/lib/components/chart/DateRange.js.map +1 -0
- package/lib/components/data/dataTemplate/index.d.ts +1 -0
- package/lib/components/data/dataTemplate/index.d.ts.map +1 -1
- package/lib/components/data/dataTemplate/index.js +89 -53
- package/lib/components/data/dataTemplate/index.js.map +1 -1
- package/lib/components/data/dataTemplate/model.d.ts +3 -3
- package/lib/components/data/dataTemplate/model.d.ts.map +1 -1
- package/lib/components/data/utils.d.ts.map +1 -1
- package/lib/components/data/utils.js +4 -0
- package/lib/components/data/utils.js.map +1 -1
- package/lib/components/input/address/index.d.ts +2 -1
- package/lib/components/input/address/index.d.ts.map +1 -1
- package/lib/components/input/address/index.js +3 -1
- package/lib/components/input/address/index.js.map +1 -1
- package/lib/components/input/datePicker/index.d.ts +2 -1
- package/lib/components/input/datePicker/index.d.ts.map +1 -1
- package/lib/components/input/datePicker/index.js +3 -1
- package/lib/components/input/datePicker/index.js.map +1 -1
- package/lib/components/input/select/index.d.ts +2 -1
- package/lib/components/input/select/index.d.ts.map +1 -1
- package/lib/components/input/select/index.js +3 -1
- package/lib/components/input/select/index.js.map +1 -1
- package/lib/components/input/textInput/index.d.ts +2 -1
- package/lib/components/input/textInput/index.d.ts.map +1 -1
- package/lib/components/input/textInput/index.js +4 -1
- package/lib/components/input/textInput/index.js.map +1 -1
- package/lib/components/input/uploadInput/index.d.ts +2 -1
- package/lib/components/input/uploadInput/index.d.ts.map +1 -1
- package/lib/components/input/uploadInput/index.js +11 -11
- package/lib/components/input/uploadInput/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Component } from "react";
|
|
2
|
+
export interface RangeInterface {
|
|
3
|
+
startDate: Date;
|
|
4
|
+
endDate: Date;
|
|
5
|
+
}
|
|
6
|
+
interface Props {
|
|
7
|
+
onChangeDate: (id: string, value: Date, type?: string) => void;
|
|
8
|
+
onChangeData?: () => void;
|
|
9
|
+
onResetDate?: () => void;
|
|
10
|
+
onChangeSuggestedData: (type: string) => void;
|
|
11
|
+
customDate: RangeInterface;
|
|
12
|
+
}
|
|
13
|
+
interface State {
|
|
14
|
+
dateRangeModalVisible: boolean;
|
|
15
|
+
}
|
|
16
|
+
export declare class DateRange extends Component<Props> {
|
|
17
|
+
state: State;
|
|
18
|
+
handleSetData: () => void;
|
|
19
|
+
handleResetDate: () => void;
|
|
20
|
+
handleDateRangeModalVisible: (visible: boolean) => void;
|
|
21
|
+
renderDateModalContent: () => JSX.Element;
|
|
22
|
+
render(): JSX.Element;
|
|
23
|
+
}
|
|
24
|
+
export {};
|
|
25
|
+
//# sourceMappingURL=DateRange.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DateRange.d.ts","sourceRoot":"","sources":["../../../src/components/chart/DateRange.tsx"],"names":[],"mappings":"AAEA,OAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAMzC,MAAM,WAAW,cAAc;IAC7B,SAAS,EAAE,IAAI,CAAC;IAChB,OAAO,EAAE,IAAI,CAAC;CACf;AAED,UAAU,KAAK;IACb,YAAY,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/D,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IAC1B,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;IACzB,qBAAqB,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9C,UAAU,EAAE,cAAc,CAAC;CAC5B;AAED,UAAU,KAAK;IACb,qBAAqB,EAAE,OAAO,CAAC;CAChC;AAED,qBAAa,SAAU,SAAQ,SAAS,CAAC,KAAK,CAAC;IAC7C,KAAK,EAAE,KAAK,CAEV;IAEF,aAAa,aAIX;IAEF,eAAe,aAIb;IACF,2BAA2B,YAAa,OAAO,UAI7C;IAEF,sBAAsB,oBAiCpB;IAEF,MAAM;CAwDP"}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
+
extendStatics(d, b);
|
|
13
|
+
function __() { this.constructor = d; }
|
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
+
};
|
|
16
|
+
})();
|
|
17
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
18
|
+
if (k2 === undefined) k2 = k;
|
|
19
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
20
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
21
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
22
|
+
}
|
|
23
|
+
Object.defineProperty(o, k2, desc);
|
|
24
|
+
}) : (function(o, m, k, k2) {
|
|
25
|
+
if (k2 === undefined) k2 = k;
|
|
26
|
+
o[k2] = m[k];
|
|
27
|
+
}));
|
|
28
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
29
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
30
|
+
}) : function(o, v) {
|
|
31
|
+
o["default"] = v;
|
|
32
|
+
});
|
|
33
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
34
|
+
if (mod && mod.__esModule) return mod;
|
|
35
|
+
var result = {};
|
|
36
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
37
|
+
__setModuleDefault(result, mod);
|
|
38
|
+
return result;
|
|
39
|
+
};
|
|
40
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
41
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
42
|
+
};
|
|
43
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
44
|
+
exports.DateRange = void 0;
|
|
45
|
+
var react_1 = require("@headlessui/react");
|
|
46
|
+
var moment_1 = __importDefault(require("moment"));
|
|
47
|
+
var react_2 = __importStar(require("react"));
|
|
48
|
+
var button_1 = require("../action/button");
|
|
49
|
+
var textButton_1 = require("../action/textButton");
|
|
50
|
+
var modal_1 = require("../display/modal");
|
|
51
|
+
var datePicker_1 = require("../input/datePicker");
|
|
52
|
+
var DateRange = /** @class */ (function (_super) {
|
|
53
|
+
__extends(DateRange, _super);
|
|
54
|
+
function DateRange() {
|
|
55
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
56
|
+
_this.state = {
|
|
57
|
+
dateRangeModalVisible: false,
|
|
58
|
+
};
|
|
59
|
+
_this.handleSetData = function () {
|
|
60
|
+
if (_this.props.onChangeData) {
|
|
61
|
+
_this.props.onChangeData();
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
_this.handleResetDate = function () {
|
|
65
|
+
if (_this.props.onResetDate) {
|
|
66
|
+
_this.props.onResetDate();
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
_this.handleDateRangeModalVisible = function (visible) {
|
|
70
|
+
_this.setState({
|
|
71
|
+
dateRangeModalVisible: visible,
|
|
72
|
+
});
|
|
73
|
+
};
|
|
74
|
+
_this.renderDateModalContent = function () {
|
|
75
|
+
return (react_2.default.createElement("div", { className: "px-3 sm:px-0" },
|
|
76
|
+
react_2.default.createElement(datePicker_1.InputDatePicker, { className: "mt-5 h-40", range: true, startDate: _this.props.customDate.startDate, endDate: _this.props.customDate.endDate, onChange: _this.props.onChangeDate }),
|
|
77
|
+
react_2.default.createElement("div", { className: "flex flex-row mt-6 pt-32 justify-end" },
|
|
78
|
+
react_2.default.createElement(button_1.Button, { text: "Close", size: "small", type: "light", onClick: function () {
|
|
79
|
+
_this.handleResetDate();
|
|
80
|
+
_this.handleDateRangeModalVisible(false);
|
|
81
|
+
} }),
|
|
82
|
+
react_2.default.createElement(button_1.Button, { className: "ml-4", text: "Submit", size: "small", type: "normal", onClick: function () {
|
|
83
|
+
_this.handleSetData();
|
|
84
|
+
_this.handleDateRangeModalVisible(false);
|
|
85
|
+
} }))));
|
|
86
|
+
};
|
|
87
|
+
return _this;
|
|
88
|
+
}
|
|
89
|
+
DateRange.prototype.render = function () {
|
|
90
|
+
var _this = this;
|
|
91
|
+
return (react_2.default.createElement(react_2.default.Fragment, null,
|
|
92
|
+
react_2.default.createElement(modal_1.Modal, { title: "Select Date Range", open: this.state.dateRangeModalVisible, lib: {
|
|
93
|
+
Dialog: react_1.Dialog,
|
|
94
|
+
Transition: react_1.Transition,
|
|
95
|
+
}, renderContent: this.renderDateModalContent, onClose: function () {
|
|
96
|
+
_this.handleResetDate();
|
|
97
|
+
_this.handleDateRangeModalVisible(false);
|
|
98
|
+
} }),
|
|
99
|
+
react_2.default.createElement("div", { className: "flex flex-col sm:flex-row w-full justify-center items-center" },
|
|
100
|
+
react_2.default.createElement("div", { className: "grow" }),
|
|
101
|
+
react_2.default.createElement("p", { className: "ml-3 mb-3 text-gray-700" }, "Custom Duration: "),
|
|
102
|
+
react_2.default.createElement("div", { className: "w-full mt-2 sm:w-56 sm:mt-0" },
|
|
103
|
+
react_2.default.createElement(textButton_1.TextButton, { className: "ml-3 mb-3", text: (0, moment_1.default)(this.props.customDate.startDate).format("DD-MM-YYYY") +
|
|
104
|
+
" - " +
|
|
105
|
+
(0, moment_1.default)(this.props.customDate.endDate).format("DD-MM-YYYY"), onClick: function () {
|
|
106
|
+
_this.handleDateRangeModalVisible(true);
|
|
107
|
+
} }))),
|
|
108
|
+
react_2.default.createElement("div", { className: "flex flex-col sm:flex-row w-full justify-center items-center" },
|
|
109
|
+
react_2.default.createElement("div", { className: "grow" }),
|
|
110
|
+
react_2.default.createElement("p", { className: "ml-3 mb-3 text-gray-700" }, "Suggested Duration: "),
|
|
111
|
+
react_2.default.createElement("div", { className: "w-full mt-2 sm:w-56 sm:mt-0" },
|
|
112
|
+
react_2.default.createElement(textButton_1.TextButton, { className: "ml-3 mb-3", text: "Last 7 days", onClick: function () {
|
|
113
|
+
_this.props.onChangeSuggestedData("seven");
|
|
114
|
+
} }),
|
|
115
|
+
react_2.default.createElement(textButton_1.TextButton, { className: "ml-3 mb-3", text: "Last 28 days", onClick: function () {
|
|
116
|
+
_this.props.onChangeSuggestedData("28days");
|
|
117
|
+
} })))));
|
|
118
|
+
};
|
|
119
|
+
return DateRange;
|
|
120
|
+
}(react_2.Component));
|
|
121
|
+
exports.DateRange = DateRange;
|
|
122
|
+
//# sourceMappingURL=DateRange.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DateRange.js","sourceRoot":"","sources":["../../../src/components/chart/DateRange.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2CAAuD;AACvD,kDAA4B;AAC5B,6CAAyC;AACzC,2CAA0C;AAC1C,mDAAkD;AAClD,0CAAyC;AACzC,kDAAsD;AAmBtD;IAA+B,6BAAgB;IAA/C;QAAA,qEAiHC;QAhHC,WAAK,GAAU;YACb,qBAAqB,EAAE,KAAK;SAC7B,CAAC;QAEF,mBAAa,GAAG;YACd,IAAI,KAAI,CAAC,KAAK,CAAC,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B;AAwDD,eAAO,MAAM,aAAa,aAKzB,CAAC;AAEF,eAAO,MAAM,gBAAgB,aAK5B,CAAC;AAEF,wBAAgB,YAAY,CAAC,KAAK,EAAE,KAAK,eAqnGxC"}
|
|
@@ -269,7 +269,7 @@ function DataTemplate(props) {
|
|
|
269
269
|
if (!(queryInput.queryId === eachModel.id)) return [3 /*break*/, 3];
|
|
270
270
|
if (!(eachModel.type === "reference" ||
|
|
271
271
|
eachModel.type === "listReference")) return [3 /*break*/, 2];
|
|
272
|
-
referenceRQ = new readQuery_1.ReadQuery(dbModule, props.server, (_a = eachModel.referenceSpaceId) !== null && _a !== void 0 ? _a : "", props.dbEndpoint);
|
|
272
|
+
referenceRQ = new readQuery_1.ReadQuery(dbModule, props.server, (_a = eachModel.referenceSpaceId) !== null && _a !== void 0 ? _a : "", props.dbEndpoint, props.dbAPIToken);
|
|
273
273
|
query = [];
|
|
274
274
|
if (exportReferenceSearch) {
|
|
275
275
|
query.push({
|
|
@@ -328,6 +328,7 @@ function DataTemplate(props) {
|
|
|
328
328
|
exportReferenceSearch,
|
|
329
329
|
dbModule,
|
|
330
330
|
props.dbEndpoint,
|
|
331
|
+
props.dbAPIToken,
|
|
331
332
|
props.model,
|
|
332
333
|
props.server,
|
|
333
334
|
serverId,
|
|
@@ -344,7 +345,7 @@ function DataTemplate(props) {
|
|
|
344
345
|
case 0:
|
|
345
346
|
_c.trys.push([0, 6, , 7]);
|
|
346
347
|
optionList_1 = [];
|
|
347
|
-
referenceRQ_1 = new readQuery_1.ReadQuery(dbModule, props.server, (_a = eachModel.referenceSpaceId) !== null && _a !== void 0 ? _a : "", props.dbEndpoint);
|
|
348
|
+
referenceRQ_1 = new readQuery_1.ReadQuery(dbModule, props.server, (_a = eachModel.referenceSpaceId) !== null && _a !== void 0 ? _a : "", props.dbEndpoint, props.dbAPIToken);
|
|
348
349
|
return [4 /*yield*/, referenceRQ_1.call({
|
|
349
350
|
type: "list",
|
|
350
351
|
limit: 10,
|
|
@@ -715,11 +716,10 @@ function DataTemplate(props) {
|
|
|
715
716
|
switch (_a.label) {
|
|
716
717
|
case 0:
|
|
717
718
|
clonedSelectedData = handleClonedDataAttribute(selectedData, props.model, true);
|
|
718
|
-
//INFO: Parse & Upload Data "Image & File attributes"
|
|
719
719
|
return [4 /*yield*/, handleParseImageField(id, clonedSelectedData, props.model)];
|
|
720
720
|
case 1:
|
|
721
721
|
//INFO: Parse & Upload Data "Image & File attributes"
|
|
722
|
-
_a.sent();
|
|
722
|
+
clonedSelectedData = _a.sent();
|
|
723
723
|
objectAttribute = props.model.filter(function (eachAttribute) {
|
|
724
724
|
return eachAttribute.type === "object";
|
|
725
725
|
});
|
|
@@ -729,7 +729,7 @@ function DataTemplate(props) {
|
|
|
729
729
|
switch (_b.label) {
|
|
730
730
|
case 0: return [4 /*yield*/, handleParseImageField(id, clonedSelectedData, (_a = eachObject.objectData) !== null && _a !== void 0 ? _a : [], eachObject.id)];
|
|
731
731
|
case 1:
|
|
732
|
-
_b.sent();
|
|
732
|
+
clonedSelectedData = _b.sent();
|
|
733
733
|
return [2 /*return*/, null];
|
|
734
734
|
}
|
|
735
735
|
});
|
|
@@ -745,7 +745,7 @@ function DataTemplate(props) {
|
|
|
745
745
|
switch (_b.label) {
|
|
746
746
|
case 0: return [4 /*yield*/, handleParseImageField(id, clonedSelectedData, (_a = eachObject.objectData) !== null && _a !== void 0 ? _a : [], eachObject.id, true)];
|
|
747
747
|
case 1:
|
|
748
|
-
_b.sent();
|
|
748
|
+
clonedSelectedData = _b.sent();
|
|
749
749
|
return [2 /*return*/, null];
|
|
750
750
|
}
|
|
751
751
|
});
|
|
@@ -781,7 +781,7 @@ function DataTemplate(props) {
|
|
|
781
781
|
case 0:
|
|
782
782
|
_d.trys.push([0, 6, , 7]);
|
|
783
783
|
if (!(typeof selectedField === "string")) return [3 /*break*/, 1];
|
|
784
|
-
return [2 /*return
|
|
784
|
+
return [2 /*return*/, selectedField];
|
|
785
785
|
case 1:
|
|
786
786
|
if (!(multiple &&
|
|
787
787
|
selectedField["upload"] &&
|
|
@@ -830,8 +830,9 @@ function DataTemplate(props) {
|
|
|
830
830
|
return [4 /*yield*/, handleUploadAxios((_b = eachImage.imageEndpoint) !== null && _b !== void 0 ? _b : "", imageParentId, imageCollectionName, (_c = eachImage.imageFileName) !== null && _c !== void 0 ? _c : "", selectedField)];
|
|
831
831
|
case 4:
|
|
832
832
|
responseData = _d.sent();
|
|
833
|
-
if (responseData.data)
|
|
834
|
-
|
|
833
|
+
if (responseData.data) {
|
|
834
|
+
return [2 /*return*/, responseData.data.data];
|
|
835
|
+
}
|
|
835
836
|
_d.label = 5;
|
|
836
837
|
case 5: return [3 /*break*/, 7];
|
|
837
838
|
case 6:
|
|
@@ -871,32 +872,52 @@ function DataTemplate(props) {
|
|
|
871
872
|
return eachAttribute.type === "image" || eachAttribute.type === "file";
|
|
872
873
|
});
|
|
873
874
|
return [4 /*yield*/, Promise.all(imageAttribute.map(function (eachImage) { return __awaiter(_this, void 0, void 0, function () {
|
|
874
|
-
var
|
|
875
|
-
|
|
876
|
-
|
|
875
|
+
var _a, _b, _c, _d;
|
|
876
|
+
var _this = this;
|
|
877
|
+
return __generator(this, function (_e) {
|
|
878
|
+
switch (_e.label) {
|
|
877
879
|
case 0:
|
|
878
880
|
if (!listObject) return [3 /*break*/, 3];
|
|
879
881
|
if (!objectId)
|
|
880
882
|
return [2 /*return*/];
|
|
881
883
|
if (!Array.isArray(selectedData[objectId])) return [3 /*break*/, 2];
|
|
882
|
-
return [4 /*yield*/, Promise.all(selectedData[objectId].map(function (eachListItem, index) {
|
|
883
|
-
var _a;
|
|
884
|
-
var
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
884
|
+
return [4 /*yield*/, Promise.all(selectedData[objectId].map(function (eachListItem, index) { return __awaiter(_this, void 0, void 0, function () {
|
|
885
|
+
var selectedObjectId, _a, _b;
|
|
886
|
+
var _c;
|
|
887
|
+
return __generator(this, function (_d) {
|
|
888
|
+
switch (_d.label) {
|
|
889
|
+
case 0:
|
|
890
|
+
selectedObjectId = (_c = eachListItem.id) !== null && _c !== void 0 ? _c : (0, uuid_1.v4)();
|
|
891
|
+
_a = selectedData[objectId][index];
|
|
892
|
+
_b = eachImage.id;
|
|
893
|
+
return [4 /*yield*/, uploadAsset_1(eachImage, selectedData[objectId][index][eachImage.id], selectedObjectId)];
|
|
894
|
+
case 1:
|
|
895
|
+
_a[_b] =
|
|
896
|
+
_d.sent();
|
|
897
|
+
return [2 /*return*/, null];
|
|
898
|
+
}
|
|
899
|
+
});
|
|
900
|
+
}); }))];
|
|
889
901
|
case 1:
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
case 2: return [3 /*break*/,
|
|
902
|
+
_e.sent();
|
|
903
|
+
_e.label = 2;
|
|
904
|
+
case 2: return [3 /*break*/, 7];
|
|
893
905
|
case 3:
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
uploadAsset_1(eachImage,
|
|
898
|
-
|
|
899
|
-
|
|
906
|
+
if (!objectId) return [3 /*break*/, 5];
|
|
907
|
+
_a = selectedData[objectId];
|
|
908
|
+
_b = eachImage.id;
|
|
909
|
+
return [4 /*yield*/, uploadAsset_1(eachImage, selectedData[objectId][eachImage.id])];
|
|
910
|
+
case 4:
|
|
911
|
+
_a[_b] = _e.sent();
|
|
912
|
+
return [3 /*break*/, 7];
|
|
913
|
+
case 5:
|
|
914
|
+
_c = selectedData;
|
|
915
|
+
_d = eachImage.id;
|
|
916
|
+
return [4 /*yield*/, uploadAsset_1(eachImage, selectedData[eachImage.id])];
|
|
917
|
+
case 6:
|
|
918
|
+
_c[_d] = _e.sent();
|
|
919
|
+
_e.label = 7;
|
|
920
|
+
case 7: return [2 /*return*/, null];
|
|
900
921
|
}
|
|
901
922
|
});
|
|
902
923
|
}); }))];
|
|
@@ -1009,9 +1030,12 @@ function DataTemplate(props) {
|
|
|
1009
1030
|
err_8 = _a.sent();
|
|
1010
1031
|
return [3 /*break*/, 6];
|
|
1011
1032
|
case 6:
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1033
|
+
setTimeout(function () {
|
|
1034
|
+
setLoading(false);
|
|
1035
|
+
setModalVisible(false);
|
|
1036
|
+
setDeleteModal(false);
|
|
1037
|
+
window.location.reload();
|
|
1038
|
+
}, 500);
|
|
1015
1039
|
return [2 /*return*/];
|
|
1016
1040
|
}
|
|
1017
1041
|
});
|
|
@@ -1470,6 +1494,7 @@ function DataTemplate(props) {
|
|
|
1470
1494
|
case 5: return [3 /*break*/, 7];
|
|
1471
1495
|
case 6:
|
|
1472
1496
|
err_11 = _h.sent();
|
|
1497
|
+
setLoading(false);
|
|
1473
1498
|
setNotification({
|
|
1474
1499
|
type: false,
|
|
1475
1500
|
title: "Import Error",
|
|
@@ -1852,7 +1877,8 @@ function DataTemplate(props) {
|
|
|
1852
1877
|
//INFO - Default Model Contain Id While Object Type Don't have
|
|
1853
1878
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
1854
1879
|
var clonedSelectedData = handleClonedDataAttribute(data, model);
|
|
1855
|
-
var label = eachAttribute.name
|
|
1880
|
+
var label = eachAttribute.name;
|
|
1881
|
+
var labelExtra = !eachAttribute.optional ? (react_1.default.createElement("span", { className: "text-red-500" }, " (*) ")) : undefined;
|
|
1856
1882
|
var disabled = props.type === "read"
|
|
1857
1883
|
? true
|
|
1858
1884
|
: props.type === "update" && props.id === "new"
|
|
@@ -1860,7 +1886,7 @@ function DataTemplate(props) {
|
|
|
1860
1886
|
: eachAttribute.disabled;
|
|
1861
1887
|
switch (eachAttribute.type) {
|
|
1862
1888
|
case "address":
|
|
1863
|
-
inputList.push(react_1.default.createElement(address_1.Address, { id: eachAttribute.id, label: label, value: (_a = clonedSelectedData[eachAttribute.id]) !== null && _a !== void 0 ? _a : {
|
|
1889
|
+
inputList.push(react_1.default.createElement(address_1.Address, { id: eachAttribute.id, optional: eachAttribute.optional, label: label, labelExtra: labelExtra, value: (_a = clonedSelectedData[eachAttribute.id]) !== null && _a !== void 0 ? _a : {
|
|
1864
1890
|
lat: 0,
|
|
1865
1891
|
lng: 0,
|
|
1866
1892
|
name: "",
|
|
@@ -1871,7 +1897,10 @@ function DataTemplate(props) {
|
|
|
1871
1897
|
case "object":
|
|
1872
1898
|
var objectValue = Object.values((_b = clonedSelectedData[eachAttribute.id]) !== null && _b !== void 0 ? _b : {});
|
|
1873
1899
|
inputList.push(react_1.default.createElement(react_1.default.Fragment, null,
|
|
1874
|
-
react_1.default.createElement("label", { className: "block text-sm font-medium text-gray-700" },
|
|
1900
|
+
react_1.default.createElement("label", { className: "block text-sm font-medium text-gray-700" },
|
|
1901
|
+
label,
|
|
1902
|
+
" ",
|
|
1903
|
+
labelExtra),
|
|
1875
1904
|
react_1.default.createElement("div", { className: "block bg-white w-full border cursor-pointer border-gray-300 text-gray-300 text-left rounded-md mt-1 px-5 py-3 text-base focus:border-primary-500 focus:outline-none", onClick: function () {
|
|
1876
1905
|
var _a;
|
|
1877
1906
|
setSelectedObjectStructureId(eachAttribute.id);
|
|
@@ -1900,13 +1929,13 @@ function DataTemplate(props) {
|
|
|
1900
1929
|
}
|
|
1901
1930
|
});
|
|
1902
1931
|
}
|
|
1903
|
-
inputList.push(react_1.default.createElement(select_1.Select, { ref: eachAttribute.optional ? null : formInputRef[index], id: eachAttribute.id, value: (_d = clonedSelectedData[eachAttribute.id]) !== null && _d !== void 0 ? _d : (eachAttribute.type === "list" ? "" : []), label: label, options: optionList_2, onChange: function (value) {
|
|
1932
|
+
inputList.push(react_1.default.createElement(select_1.Select, { ref: eachAttribute.optional ? null : formInputRef[index], id: eachAttribute.id, optional: eachAttribute.optional, value: (_d = clonedSelectedData[eachAttribute.id]) !== null && _d !== void 0 ? _d : (eachAttribute.type === "list" ? "" : []), label: label, labelExtra: labelExtra, options: optionList_2, onChange: function (value) {
|
|
1904
1933
|
handleOnChangeSelect(eachAttribute.id, value);
|
|
1905
1934
|
}, disabled: disabled }));
|
|
1906
1935
|
break;
|
|
1907
1936
|
case "boolean":
|
|
1908
1937
|
var value = (_e = clonedSelectedData[eachAttribute.id]) === null || _e === void 0 ? void 0 : _e.toString();
|
|
1909
|
-
inputList.push(react_1.default.createElement(select_1.Select, { ref: eachAttribute.optional ? null : formInputRef[index], id: eachAttribute.id, value: value, label: label, options: [
|
|
1938
|
+
inputList.push(react_1.default.createElement(select_1.Select, { ref: eachAttribute.optional ? null : formInputRef[index], id: eachAttribute.id, value: value, label: label, labelExtra: labelExtra, optional: eachAttribute.optional, options: [
|
|
1910
1939
|
{
|
|
1911
1940
|
key: "true",
|
|
1912
1941
|
label: "True",
|
|
@@ -1926,15 +1955,11 @@ function DataTemplate(props) {
|
|
|
1926
1955
|
if (hasImageToken) {
|
|
1927
1956
|
url = isObject
|
|
1928
1957
|
? isObjectList
|
|
1929
|
-
? (0, utils_2.renderImageUrlFromPath)(props.imageEndpoint, eachAttribute.imageCollectionName +
|
|
1930
|
-
"%2F" +
|
|
1931
|
-
props.id +
|
|
1932
|
-
"%2F" +
|
|
1933
|
-
selectedObjectId, selectedObjectStructureId, eachAttribute.imageFileName, clonedSelectedData[eachAttribute.id])
|
|
1958
|
+
? (0, utils_2.renderImageUrlFromPath)(props.imageEndpoint, eachAttribute.imageCollectionName + "%2F" + props.id, selectedObjectStructureId + "%2F" + selectedObjectId, eachAttribute.imageFileName, clonedSelectedData[eachAttribute.id])
|
|
1934
1959
|
: (0, utils_2.renderImageUrlFromPath)(props.imageEndpoint, eachAttribute.imageCollectionName + "%2F" + props.id, selectedObjectStructureId, eachAttribute.imageFileName, clonedSelectedData[eachAttribute.id])
|
|
1935
1960
|
: (0, utils_2.renderImageUrlFromPath)(props.imageEndpoint, eachAttribute.imageCollectionName, props.id, eachAttribute.imageFileName, clonedSelectedData[eachAttribute.id]);
|
|
1936
1961
|
}
|
|
1937
|
-
inputList.push(react_1.default.createElement(uploadInput_1.UploadInput, { lib: { axios: (_f = props.lib) === null || _f === void 0 ? void 0 : _f.axios }, ref: eachAttribute.optional ? null : formInputRef[index], id: eachAttribute.id, label: label, hidePreview: eachAttribute.type === "image" ? false : true, file: (_g = url !== null && url !== void 0 ? url : clonedSelectedData[eachAttribute.id]) !== null && _g !== void 0 ? _g : "", accept: eachAttribute.type === "image" ? ".png,.jpg,.jpe,.tiff" : ".pdf", fileDescription: eachAttribute.type === "image" ? undefined : "PDF up to 30MB", maxFileSize: props.maxFileSize, onChange: handleOnChangeFile, disabled: disabled }));
|
|
1962
|
+
inputList.push(react_1.default.createElement(uploadInput_1.UploadInput, { lib: { axios: (_f = props.lib) === null || _f === void 0 ? void 0 : _f.axios }, ref: eachAttribute.optional ? null : formInputRef[index], id: eachAttribute.id, label: label, labelExtra: labelExtra, optional: eachAttribute.optional, hidePreview: eachAttribute.type === "image" ? false : true, file: (_g = url !== null && url !== void 0 ? url : clonedSelectedData[eachAttribute.id]) !== null && _g !== void 0 ? _g : "", accept: eachAttribute.type === "image" ? ".png,.jpg,.jpe,.tiff" : ".pdf", fileDescription: eachAttribute.type === "image" ? undefined : "PDF up to 30MB", maxFileSize: props.maxFileSize, onChange: handleOnChangeFile, disabled: disabled }));
|
|
1938
1963
|
break;
|
|
1939
1964
|
case "multipleFile":
|
|
1940
1965
|
case "multipleImage":
|
|
@@ -1944,7 +1969,7 @@ function DataTemplate(props) {
|
|
|
1944
1969
|
fileName: (0, utils_2.renderImageUrlFromPath)(props.imageEndpoint, eachAttribute.imageCollectionName, props.id, eachImage.fileName, eachImage.token),
|
|
1945
1970
|
};
|
|
1946
1971
|
});
|
|
1947
|
-
inputList.push(react_1.default.createElement(uploadInput_1.UploadInput, { type: "multi", files: __assign(__assign({}, clonedSelectedData[eachAttribute.id]), { data: multipleDataUrl }), ref: eachAttribute.optional ? null : formInputRef[index], id: eachAttribute.id, label: label, hidePreview: eachAttribute.type === "multipleImage" ? false : true, accept: eachAttribute.type === "multipleImage"
|
|
1972
|
+
inputList.push(react_1.default.createElement(uploadInput_1.UploadInput, { type: "multi", files: __assign(__assign({}, clonedSelectedData[eachAttribute.id]), { data: multipleDataUrl }), optional: eachAttribute.optional, ref: eachAttribute.optional ? null : formInputRef[index], id: eachAttribute.id, label: label, labelExtra: labelExtra, hidePreview: eachAttribute.type === "multipleImage" ? false : true, accept: eachAttribute.type === "multipleImage"
|
|
1948
1973
|
? ".png,.jpg,.jpe,.tiff"
|
|
1949
1974
|
: ".pdf", fileDescription: eachAttribute.type === "multipleImage"
|
|
1950
1975
|
? undefined
|
|
@@ -1956,12 +1981,12 @@ function DataTemplate(props) {
|
|
|
1956
1981
|
}, disabled: disabled }));
|
|
1957
1982
|
break;
|
|
1958
1983
|
case "number":
|
|
1959
|
-
inputList.push(react_1.default.createElement(textInput_1.TextInput, { id: eachAttribute.id, ref: eachAttribute.optional ? null : formInputRef[index], type: "number", value: (_j = clonedSelectedData[eachAttribute.id]) !== null && _j !== void 0 ? _j : "", placeholder: label, label: label, onChange: handleOnChangeText, disabled: disabled }));
|
|
1984
|
+
inputList.push(react_1.default.createElement(textInput_1.TextInput, { id: eachAttribute.id, ref: eachAttribute.optional ? null : formInputRef[index], type: "number", value: (_j = clonedSelectedData[eachAttribute.id]) !== null && _j !== void 0 ? _j : "", placeholder: label, label: label, labelExtra: labelExtra, optional: eachAttribute.optional, onChange: handleOnChangeText, disabled: disabled }));
|
|
1960
1985
|
break;
|
|
1961
1986
|
case "reference":
|
|
1962
1987
|
case "listReference":
|
|
1963
1988
|
inputList.push(react_1.default.createElement(react_1.default.Fragment, null,
|
|
1964
|
-
react_1.default.createElement(select_1.Select, { ref: eachAttribute.optional ? null : formInputRef[index], id: eachAttribute.id, value: (_k = clonedSelectedData[eachAttribute.id]) !== null && _k !== void 0 ? _k : (eachAttribute.type === "reference" ? "" : []), label: label, options: isObject
|
|
1989
|
+
react_1.default.createElement(select_1.Select, { ref: eachAttribute.optional ? null : formInputRef[index], id: eachAttribute.id, value: (_k = clonedSelectedData[eachAttribute.id]) !== null && _k !== void 0 ? _k : (eachAttribute.type === "reference" ? "" : []), label: label, labelExtra: labelExtra, optional: eachAttribute.optional, options: isObject
|
|
1965
1990
|
? referencesOptions[selectedObjectStructureId + "." + eachAttribute.id]
|
|
1966
1991
|
: (_l = referencesOptions[eachAttribute.id]) !== null && _l !== void 0 ? _l : [], onChange: function (value) {
|
|
1967
1992
|
handleOnChangeSelect(eachAttribute.id, value);
|
|
@@ -1986,10 +2011,19 @@ function DataTemplate(props) {
|
|
|
1986
2011
|
}); }, disabled: disabled })));
|
|
1987
2012
|
break;
|
|
1988
2013
|
case "string":
|
|
1989
|
-
|
|
2014
|
+
case "contact":
|
|
2015
|
+
case "email":
|
|
2016
|
+
var textType = "text";
|
|
2017
|
+
if (eachAttribute.type === "contact") {
|
|
2018
|
+
textType = "mobile";
|
|
2019
|
+
}
|
|
2020
|
+
else if (eachAttribute.type === "email") {
|
|
2021
|
+
textType = "email";
|
|
2022
|
+
}
|
|
2023
|
+
inputList.push(react_1.default.createElement(textInput_1.TextInput, { id: eachAttribute.id, ref: eachAttribute.optional ? null : formInputRef[index], type: textType, value: (_m = clonedSelectedData[eachAttribute.id]) !== null && _m !== void 0 ? _m : "", placeholder: label, label: label, labelExtra: labelExtra, optional: eachAttribute.optional, onChange: handleOnChangeText, disabled: disabled }));
|
|
1990
2024
|
break;
|
|
1991
2025
|
case "date":
|
|
1992
|
-
inputList.push(react_1.default.createElement(datePicker_1.InputDatePicker, { title: label, id: eachAttribute.id, ref: eachAttribute.optional ? null : formInputRef[index], onChange: handleOnChangeDate, value: clonedSelectedData[eachAttribute.id], disabled: disabled }));
|
|
2026
|
+
inputList.push(react_1.default.createElement(datePicker_1.InputDatePicker, { title: label, labelExtra: labelExtra, id: eachAttribute.id, optional: eachAttribute.optional, ref: eachAttribute.optional ? null : formInputRef[index], onChange: handleOnChangeDate, value: clonedSelectedData[eachAttribute.id], disabled: disabled }));
|
|
1993
2027
|
break;
|
|
1994
2028
|
}
|
|
1995
2029
|
});
|
|
@@ -2040,6 +2074,8 @@ function DataTemplate(props) {
|
|
|
2040
2074
|
});
|
|
2041
2075
|
switch (model === null || model === void 0 ? void 0 : model.type) {
|
|
2042
2076
|
case "string":
|
|
2077
|
+
case "contact":
|
|
2078
|
+
case "email":
|
|
2043
2079
|
isTitle
|
|
2044
2080
|
? (eachNewList["title"] =
|
|
2045
2081
|
typeof eachValue === "string" ? eachValue : "")
|
|
@@ -2049,11 +2085,7 @@ function DataTemplate(props) {
|
|
|
2049
2085
|
case "image":
|
|
2050
2086
|
var url = void 0;
|
|
2051
2087
|
if (typeof eachValue === "string") {
|
|
2052
|
-
url = (0, utils_2.renderImageUrlFromPath)(props.imageEndpoint, model.imageCollectionName +
|
|
2053
|
-
"%2F" +
|
|
2054
|
-
props.id +
|
|
2055
|
-
"%2F" +
|
|
2056
|
-
eachObject.id, eachListObject.id, model.imageFileName, eachValue);
|
|
2088
|
+
url = (0, utils_2.renderImageUrlFromPath)(props.imageEndpoint, model.imageCollectionName + "%2F" + props.id, eachListObject.id + "%2F" + eachObject.id, model.imageFileName, eachValue);
|
|
2057
2089
|
}
|
|
2058
2090
|
else if (eachValue instanceof File) {
|
|
2059
2091
|
url = URL.createObjectURL(eachValue);
|
|
@@ -2155,6 +2187,7 @@ function DataTemplate(props) {
|
|
|
2155
2187
|
dbType: props.server,
|
|
2156
2188
|
dbCollection: props.collectionId,
|
|
2157
2189
|
dbEndpoint: props.dbEndpoint,
|
|
2190
|
+
dbAPIToken: props.dbAPIToken,
|
|
2158
2191
|
}, cond: {
|
|
2159
2192
|
type: "get",
|
|
2160
2193
|
id: props.id,
|
|
@@ -2183,6 +2216,7 @@ function DataTemplate(props) {
|
|
|
2183
2216
|
dbType: props.server,
|
|
2184
2217
|
dbCollection: props.collectionId,
|
|
2185
2218
|
dbEndpoint: props.dbEndpoint,
|
|
2219
|
+
dbAPIToken: props.dbAPIToken,
|
|
2186
2220
|
}, cond: {
|
|
2187
2221
|
type: "get",
|
|
2188
2222
|
id: props.id,
|
|
@@ -2216,6 +2250,7 @@ function DataTemplate(props) {
|
|
|
2216
2250
|
dbType: props.server,
|
|
2217
2251
|
dbCollection: props.collectionId,
|
|
2218
2252
|
dbEndpoint: props.dbEndpoint,
|
|
2253
|
+
dbAPIToken: props.dbAPIToken,
|
|
2219
2254
|
}, cond: {
|
|
2220
2255
|
type: "list",
|
|
2221
2256
|
query: renderSearchFilterConditions(),
|
|
@@ -2327,6 +2362,7 @@ function DataTemplate(props) {
|
|
|
2327
2362
|
dbType: props.server,
|
|
2328
2363
|
dbCollection: (_b = eachSettings.spaceId) !== null && _b !== void 0 ? _b : "",
|
|
2329
2364
|
dbEndpoint: props.dbEndpoint,
|
|
2365
|
+
dbAPIToken: props.dbAPIToken,
|
|
2330
2366
|
}, cond: {
|
|
2331
2367
|
type: "list",
|
|
2332
2368
|
limit: limit,
|
|
@@ -2390,7 +2426,7 @@ function DataTemplate(props) {
|
|
|
2390
2426
|
});
|
|
2391
2427
|
if (viewType === "general") {
|
|
2392
2428
|
if (dataType === "list") {
|
|
2393
|
-
return (react_1.default.createElement(table_1.Table, { paginationType: props.server === "mongoServer" ? "page" : "cursor", data: tableData, size: size, limit: limit, cursor: cursor, loading: tableLoading, checkbox: true, selectAll: selectAll, selectedIds: selectedIds, selectAllText: selectAll ? "from filter" : "", multiActionButton: react_1.default.createElement(textButton_1.TextButton, { text: "Delete", onClick: function () {
|
|
2429
|
+
return (react_1.default.createElement(table_1.Table, { paginationType: props.server === "mongoServer" ? "page" : "cursor", data: tableData, size: size, limit: limit, cursor: cursor, loading: tableLoading, checkbox: true, selectAll: selectAll, selectedIds: selectedIds, selectAllText: selectAll ? "from filter" : "", multiActionButton: react_1.default.createElement(textButton_1.TextButton, { className: "text-sm", text: "Delete", onClick: function () {
|
|
2394
2430
|
setDeleteModal(true);
|
|
2395
2431
|
} }), handleSelectAll: handleSelectAllPages, handleSelectedIds: handleSelectIds, header: renderTableHeader(), pageIndex: pageIndex, onClickRow: function (id) {
|
|
2396
2432
|
handleNavigate("".concat(props.localURLEndpoint, "?data=").concat(id, "&type=read&collection=").concat(props.collectionId, "&view=general"));
|