blixify-ui-web 0.4.97 → 0.4.98
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 +47 -26
- package/lib/components/data/dataTemplate/index.js.map +1 -1
- package/lib/components/data/dataTemplate/model.d.ts +1 -0
- 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 +1 -0
- package/lib/components/data/utils.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/data/dataTemplate/index.tsx"],"names":[],"mappings":"AA8BA,OAAO,KAQN,MAAM,OAAO,CAAC;AAoEf,OAAO,EACL,iBAAiB,EAKlB,MAAM,kBAAkB,CAAC;AAoB1B,eAAO,MAAM,YAAY,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/data/dataTemplate/index.tsx"],"names":[],"mappings":"AA8BA,OAAO,KAQN,MAAM,OAAO,CAAC;AAoEf,OAAO,EACL,iBAAiB,EAKlB,MAAM,kBAAkB,CAAC;AAoB1B,eAAO,MAAM,YAAY,mFAqwOvB,CAAC"}
|
|
@@ -3805,7 +3805,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
3805
3805
|
var listObjTableData = {};
|
|
3806
3806
|
var clonedSelectedData = (0, updateModule_1.handleClonedDataAttribute)(selectedData, structure, props.devSettings.server, false, remainId);
|
|
3807
3807
|
isListObject.map(function (eachListObject) {
|
|
3808
|
-
var _a, _b, _c, _d, _e, _f
|
|
3808
|
+
var _a, _b, _c, _d, _e, _f;
|
|
3809
3809
|
if (type === "update") {
|
|
3810
3810
|
var isForm = props.onComplete ? true : false;
|
|
3811
3811
|
var shouldShow = (0, updateModule_1.renderShowCondition)(eachListObject, clonedSelectedData, isForm);
|
|
@@ -3990,8 +3990,10 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
3990
3990
|
listObjTableData[eachListObject.id] = [eachNewTable];
|
|
3991
3991
|
return null;
|
|
3992
3992
|
});
|
|
3993
|
+
var useTable = ((_d = props.organise) === null || _d === void 0 ? void 0 : _d.listObjectTableView) ||
|
|
3994
|
+
eachListObject.listObjectTableView;
|
|
3993
3995
|
if (!list[eachListObject.id] && type === "update") {
|
|
3994
|
-
if (
|
|
3996
|
+
if (useTable) {
|
|
3995
3997
|
listElement.push(react_1.default.createElement(react_1.default.Fragment, null,
|
|
3996
3998
|
react_1.default.createElement("div", { className: "flex justify-between mt-5" },
|
|
3997
3999
|
react_1.default.createElement("h3", { className: "font-medium leading-6 text-gray-900 text-md sm:text-lg" }, eachListObject.name),
|
|
@@ -4022,9 +4024,9 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
4022
4024
|
setSelectedObjectStructureId(eachListObject.id);
|
|
4023
4025
|
handlePopUpModal(true);
|
|
4024
4026
|
} }))),
|
|
4025
|
-
react_1.default.createElement("div", { className: "flex flex-col space-y-2" },
|
|
4027
|
+
react_1.default.createElement("div", { className: "flex flex-col space-y-2" }, useTable ? (react_1.default.createElement(table_1.Table, { loading: false, data: (_e = listObjTableData[eachListObject.id]) !== null && _e !== void 0 ? _e : [], onClickRow: function (id, index) {
|
|
4026
4028
|
handleSelectListObjectData(id, eachListObject.id, index);
|
|
4027
|
-
}, className: "w-full", header: eachListObjTableHeaders })) : (react_1.default.createElement(list_1.List, { className: "my-5", list: (
|
|
4029
|
+
}, className: "w-full", header: eachListObjTableHeaders })) : (react_1.default.createElement(list_1.List, { className: "my-5", list: (_f = list[eachListObject.id]) !== null && _f !== void 0 ? _f : [], showId: checkIdExists_1, loading: false, onClickRow: function (id, index) {
|
|
4028
4030
|
handleSelectListObjectData(id, eachListObject.id, index);
|
|
4029
4031
|
} })))));
|
|
4030
4032
|
}
|
|
@@ -4217,7 +4219,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
4217
4219
|
authList));
|
|
4218
4220
|
};
|
|
4219
4221
|
var renderContent = function () {
|
|
4220
|
-
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;
|
|
4222
|
+
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;
|
|
4221
4223
|
var isBottom = ((_a = props.bareSettings) === null || _a === void 0 ? void 0 : _a.bareUpdateActionBottom) ? true : false;
|
|
4222
4224
|
var tabs = renderTabs();
|
|
4223
4225
|
var pages = [
|
|
@@ -4302,10 +4304,15 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
4302
4304
|
filterModel_1.push(eachModel);
|
|
4303
4305
|
return null;
|
|
4304
4306
|
});
|
|
4307
|
+
var hasTabAlign_1 = (_s = props.organise) === null || _s === void 0 ? void 0 : _s.tabAlign;
|
|
4305
4308
|
var uniqueTabIds = Array.from(new Set(filterModel_1
|
|
4306
4309
|
.map(function (item) { return item.tabId; })
|
|
4307
4310
|
.filter(function (id) { return id !== undefined; })));
|
|
4308
|
-
|
|
4311
|
+
var shouldIncludeOthers = hasTabAlign_1 &&
|
|
4312
|
+
filterModel_1.some(function (eachModel) { return eachModel.id !== "id" && !eachModel.tabId; });
|
|
4313
|
+
if (shouldIncludeOthers) {
|
|
4314
|
+
uniqueTabIds.push("");
|
|
4315
|
+
}
|
|
4309
4316
|
var tabBars = uniqueTabIds.map(function (tabId) { return ({
|
|
4310
4317
|
id: tabId,
|
|
4311
4318
|
name: tabId ? tabId : "Others",
|
|
@@ -4316,7 +4323,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
4316
4323
|
props.id && props.id !== "new" && structure.length >= 1 && (react_1.default.createElement(readQueryHoc_1.ReadQueryHoc, { ref: readQueryHocRef, database: {
|
|
4317
4324
|
dbModule: dbModule,
|
|
4318
4325
|
dbType: devSettings.server,
|
|
4319
|
-
dbCollection: (
|
|
4326
|
+
dbCollection: (_u = (_t = props === null || props === void 0 ? void 0 : props.space) === null || _t === void 0 ? void 0 : _t.pipelineDefaultSpaceId) !== null && _u !== void 0 ? _u : props.collectionId,
|
|
4320
4327
|
dbEndpoint: devSettings.dbEndpoint,
|
|
4321
4328
|
dbAPIToken: devSettings.dbAPIToken,
|
|
4322
4329
|
dbUserToken: devSettings.dbUserToken,
|
|
@@ -4324,22 +4331,22 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
4324
4331
|
type: "get",
|
|
4325
4332
|
id: props.id,
|
|
4326
4333
|
pipeline: pipeline,
|
|
4327
|
-
}, offline: (
|
|
4334
|
+
}, offline: (_v = props.bareSettings) === null || _v === void 0 ? void 0 : _v.bareOffline, onChangeData: handleRetrieveSelectedData, onError: handleGetItemError })),
|
|
4328
4335
|
renderBreadcrumb(pages),
|
|
4329
4336
|
react_1.default.createElement("div", { className: "flex flex-col py-2 sm:items-center sm:flex-row" },
|
|
4330
4337
|
react_1.default.createElement("div", { className: "flex flex-col w-full" },
|
|
4331
4338
|
react_1.default.createElement("p", { className: "text-xl font-medium" }, props.title),
|
|
4332
4339
|
react_1.default.createElement("span", { className: "text-sm text-gray-500" }, props.description)),
|
|
4333
4340
|
!isBottom && renderActionButtons(props.type)),
|
|
4334
|
-
react_1.default.createElement("div", { className: "w-full ".concat(((
|
|
4341
|
+
hasTabAlign_1 ? (react_1.default.createElement("div", { className: "w-full ".concat(((_w = props.organise) === null || _w === void 0 ? void 0 : _w.tabAlign) === "left"
|
|
4335
4342
|
? "grid sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-5"
|
|
4336
4343
|
: "") },
|
|
4337
|
-
react_1.default.createElement("div", { className: "w-full" }, ((
|
|
4344
|
+
react_1.default.createElement("div", { className: "w-full" }, ((_x = props.organise) === null || _x === void 0 ? void 0 : _x.tabAlign) === "left" &&
|
|
4338
4345
|
uniqueTabIds.length >= 1 && (react_1.default.createElement(bars_1.Bars, { bars: tabBars, selectedId: activeTab || "others", onClick: function (tabId) { return setActiveTab(tabId); } }))),
|
|
4339
|
-
react_1.default.createElement("div", { className: "w-full ".concat(((
|
|
4346
|
+
react_1.default.createElement("div", { className: "w-full ".concat(((_y = props.organise) === null || _y === void 0 ? void 0 : _y.tabAlign) === "left"
|
|
4340
4347
|
? " md:col-span-2 lg:col-span-3"
|
|
4341
4348
|
: "") },
|
|
4342
|
-
((
|
|
4349
|
+
((_z = props.organise) === null || _z === void 0 ? void 0 : _z.tabAlign) === "top" &&
|
|
4343
4350
|
uniqueTabIds.length >= 1 && (react_1.default.createElement(bars_1.Bars, { bars: tabBars, selectedId: activeTab || "others", onClick: function (tabId) { return setActiveTab(tabId); }, horizontal: true })),
|
|
4344
4351
|
react_1.default.createElement(form_1.Form, { className: "mt-6", ref: formRef, refList: modalFormInputRefs, handleComplete: handleSubmit, disabledOnEnter: disabledOnEnter_1, handleOnFailValidation: function (refList) {
|
|
4345
4352
|
var _a, _b, _c;
|
|
@@ -4352,18 +4359,32 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
4352
4359
|
}
|
|
4353
4360
|
}
|
|
4354
4361
|
} },
|
|
4355
|
-
uniqueTabIds.map(function (tabId) {
|
|
4356
|
-
|
|
4357
|
-
|
|
4358
|
-
|
|
4359
|
-
|
|
4360
|
-
|
|
4361
|
-
|
|
4362
|
-
|
|
4363
|
-
((
|
|
4362
|
+
uniqueTabIds.map(function (tabId) {
|
|
4363
|
+
var filterByTab = filterModel_1
|
|
4364
|
+
.map(function (model, index) { return (__assign(__assign({}, model), { refIndex: index })); })
|
|
4365
|
+
.filter(function (model) {
|
|
4366
|
+
var _a;
|
|
4367
|
+
var modelTabId = (_a = model.tabId) !== null && _a !== void 0 ? _a : "";
|
|
4368
|
+
return tabId === modelTabId;
|
|
4369
|
+
});
|
|
4370
|
+
return (react_1.default.createElement("div", { key: tabId, className: "w-full grid ".concat(formColumn, " gap-6 ").concat(hasTabAlign_1
|
|
4371
|
+
? activeTab === tabId
|
|
4372
|
+
? ""
|
|
4373
|
+
: "hidden"
|
|
4374
|
+
: "") }, renderDataTemplateFormContent(selectedData, filterByTab, modalFormInputRefs, false, false)));
|
|
4375
|
+
}),
|
|
4376
|
+
((_0 = props.bareSettings) === null || _0 === void 0 ? void 0 : _0.bareUpdateComponent) &&
|
|
4377
|
+
((_1 = props.bareSettings) === null || _1 === void 0 ? void 0 : _1.bareUpdateComponent(selectedData))),
|
|
4364
4378
|
react_1.default.createElement("div", { className: "mt-8" }, renderListAddress(props.type)),
|
|
4365
4379
|
react_1.default.createElement("div", { className: "mt-8" }, renderListObject(props.type)),
|
|
4366
|
-
isBottom && renderActionButtons(props.type, true))))
|
|
4380
|
+
isBottom && renderActionButtons(props.type, true)))) : (react_1.default.createElement("div", null,
|
|
4381
|
+
react_1.default.createElement(form_1.Form, { className: "grid ".concat(formColumn, " gap-6 mt-6"), ref: formRef, refList: modalFormInputRefs, handleComplete: handleSubmit, disabledOnEnter: disabledOnEnter_1 },
|
|
4382
|
+
renderDataTemplateFormContent(selectedData, filterModel_1, modalFormInputRefs, false, false),
|
|
4383
|
+
((_2 = props.bareSettings) === null || _2 === void 0 ? void 0 : _2.bareUpdateComponent) &&
|
|
4384
|
+
((_3 = props.bareSettings) === null || _3 === void 0 ? void 0 : _3.bareUpdateComponent(selectedData))),
|
|
4385
|
+
react_1.default.createElement("div", { className: "mt-8" }, renderListAddress(props.type)),
|
|
4386
|
+
react_1.default.createElement("div", { className: "mt-8" }, renderListObject(props.type)),
|
|
4387
|
+
isBottom && renderActionButtons(props.type, true)))));
|
|
4367
4388
|
case "list":
|
|
4368
4389
|
var filterComponent_1 = renderSearchContent();
|
|
4369
4390
|
var dataComponent = renderTabContent(tabs, props.type, viewType);
|
|
@@ -4371,14 +4392,14 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
4371
4392
|
var listReadQueryHOC = (react_1.default.createElement(readQueryHoc_1.ReadQueryHoc, { ref: listRQueryHocRef, database: {
|
|
4372
4393
|
dbModule: dbModule,
|
|
4373
4394
|
dbType: devSettings.server,
|
|
4374
|
-
dbCollection: (
|
|
4395
|
+
dbCollection: (_5 = (_4 = props === null || props === void 0 ? void 0 : props.space) === null || _4 === void 0 ? void 0 : _4.pipelineDefaultSpaceId) !== null && _5 !== void 0 ? _5 : props.collectionId,
|
|
4375
4396
|
dbEndpoint: devSettings.dbEndpoint,
|
|
4376
4397
|
dbAPIToken: devSettings.dbAPIToken,
|
|
4377
4398
|
dbUserToken: devSettings.dbUserToken,
|
|
4378
|
-
}, cond: handleReadQueryHocCond(), offline: (
|
|
4399
|
+
}, cond: handleReadQueryHocCond(), offline: (_6 = props.bareSettings) === null || _6 === void 0 ? void 0 : _6.bareOffline, onChangeData: function (data) {
|
|
4379
4400
|
handleGetListData(data, "", "");
|
|
4380
4401
|
}, onError: handleGetItemError }));
|
|
4381
|
-
if ((
|
|
4402
|
+
if ((_7 = props.renderSettings) === null || _7 === void 0 ? void 0 : _7.renderListUI) {
|
|
4382
4403
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
4383
4404
|
listReadQueryHOC,
|
|
4384
4405
|
props.renderSettings.renderListUI(actionComponent, filterComponent_1, dataComponent)));
|
|
@@ -4476,7 +4497,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
4476
4497
|
renderListFilterElements(),
|
|
4477
4498
|
renderListActionElements()),
|
|
4478
4499
|
renderListNewRowFilterElements(),
|
|
4479
|
-
schemaPresent && (react_1.default.createElement(tabs_1.Tabs, { tabs: tabs, selectedId: viewType, linkType: props.linkType, custom: props.custom, onClick: function (id) { return handleSelectTab(id); }, darkMode: (
|
|
4500
|
+
schemaPresent && (react_1.default.createElement(tabs_1.Tabs, { tabs: tabs, selectedId: viewType, linkType: props.linkType, custom: props.custom, onClick: function (id) { return handleSelectTab(id); }, darkMode: (_8 = props.organise) === null || _8 === void 0 ? void 0 : _8.darkMode })),
|
|
4480
4501
|
renderTabContent(tabs, props.type, viewType),
|
|
4481
4502
|
isBottom && renderActionButtons(props.type, true)));
|
|
4482
4503
|
default:
|