blixify-ui-web 0.4.96 → 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.
@@ -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,mFAusOvB,CAAC"}
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"}
@@ -710,7 +710,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
710
710
  return sort;
711
711
  };
712
712
  var handleReadQueryHocCond = function () {
713
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
713
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
714
714
  var query = (_a = renderImpSearchFilterConditions()) !== null && _a !== void 0 ? _a : [];
715
715
  var calendarSettings = false;
716
716
  if (selectedTab && selectedTab.viewType === "calendar") {
@@ -731,7 +731,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
731
731
  startDate = (0, moment_1.default)(calendarTabMonth).startOf("isoWeek").toDate();
732
732
  endDate = (0, moment_1.default)(calendarTabMonth).endOf("isoWeek").toDate();
733
733
  if ((_d = selectedTab === null || selectedTab === void 0 ? void 0 : selectedTab.calendarSettings) === null || _d === void 0 ? void 0 : _d.customView) {
734
- var _q = (_e = selectedTab === null || selectedTab === void 0 ? void 0 : selectedTab.calendarSettings) === null || _e === void 0 ? void 0 : _e.customView, view = _q.view, duration = _q.duration;
734
+ var _s = (_e = selectedTab === null || selectedTab === void 0 ? void 0 : selectedTab.calendarSettings) === null || _e === void 0 ? void 0 : _e.customView, view = _s.view, duration = _s.duration;
735
735
  if (view &&
736
736
  duration &&
737
737
  view === "week" &&
@@ -817,6 +817,18 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
817
817
  }
818
818
  calendarSettings = true;
819
819
  }
820
+ else if (selectedTab && selectedTab.viewType === "kanban") {
821
+ var kanbanTitle = (_r = (_q = selectedTab.kanbanSettings) === null || _q === void 0 ? void 0 : _q.title) !== null && _r !== void 0 ? _r : "";
822
+ if (kanbanTitle) {
823
+ query = query.map(function (q) { return (__assign(__assign({}, q), { orQueryGroupId: "1" })); });
824
+ query.push({
825
+ type: "in",
826
+ queryId: kanbanTitle,
827
+ value: ["", undefined, null],
828
+ orQueryGroupId: "2",
829
+ });
830
+ }
831
+ }
820
832
  var cond = {
821
833
  type: "list",
822
834
  query: query,
@@ -3793,7 +3805,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
3793
3805
  var listObjTableData = {};
3794
3806
  var clonedSelectedData = (0, updateModule_1.handleClonedDataAttribute)(selectedData, structure, props.devSettings.server, false, remainId);
3795
3807
  isListObject.map(function (eachListObject) {
3796
- var _a, _b, _c, _d, _e, _f, _g;
3808
+ var _a, _b, _c, _d, _e, _f;
3797
3809
  if (type === "update") {
3798
3810
  var isForm = props.onComplete ? true : false;
3799
3811
  var shouldShow = (0, updateModule_1.renderShowCondition)(eachListObject, clonedSelectedData, isForm);
@@ -3978,8 +3990,10 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
3978
3990
  listObjTableData[eachListObject.id] = [eachNewTable];
3979
3991
  return null;
3980
3992
  });
3993
+ var useTable = ((_d = props.organise) === null || _d === void 0 ? void 0 : _d.listObjectTableView) ||
3994
+ eachListObject.listObjectTableView;
3981
3995
  if (!list[eachListObject.id] && type === "update") {
3982
- if ((_d = props.organise) === null || _d === void 0 ? void 0 : _d.listObjectTableView) {
3996
+ if (useTable) {
3983
3997
  listElement.push(react_1.default.createElement(react_1.default.Fragment, null,
3984
3998
  react_1.default.createElement("div", { className: "flex justify-between mt-5" },
3985
3999
  react_1.default.createElement("h3", { className: "font-medium leading-6 text-gray-900 text-md sm:text-lg" }, eachListObject.name),
@@ -4010,9 +4024,9 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
4010
4024
  setSelectedObjectStructureId(eachListObject.id);
4011
4025
  handlePopUpModal(true);
4012
4026
  } }))),
4013
- react_1.default.createElement("div", { className: "flex flex-col space-y-2" }, ((_e = props.organise) === null || _e === void 0 ? void 0 : _e.listObjectTableView) ? (react_1.default.createElement(table_1.Table, { loading: false, data: (_f = listObjTableData[eachListObject.id]) !== null && _f !== void 0 ? _f : [], onClickRow: function (id, index) {
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) {
4014
4028
  handleSelectListObjectData(id, eachListObject.id, index);
4015
- }, className: "w-full", header: eachListObjTableHeaders })) : (react_1.default.createElement(list_1.List, { className: "my-5", list: (_g = list[eachListObject.id]) !== null && _g !== void 0 ? _g : [], showId: checkIdExists_1, loading: false, onClickRow: function (id, index) {
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) {
4016
4030
  handleSelectListObjectData(id, eachListObject.id, index);
4017
4031
  } })))));
4018
4032
  }
@@ -4205,7 +4219,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
4205
4219
  authList));
4206
4220
  };
4207
4221
  var renderContent = function () {
4208
- 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;
4209
4223
  var isBottom = ((_a = props.bareSettings) === null || _a === void 0 ? void 0 : _a.bareUpdateActionBottom) ? true : false;
4210
4224
  var tabs = renderTabs();
4211
4225
  var pages = [
@@ -4290,10 +4304,15 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
4290
4304
  filterModel_1.push(eachModel);
4291
4305
  return null;
4292
4306
  });
4307
+ var hasTabAlign_1 = (_s = props.organise) === null || _s === void 0 ? void 0 : _s.tabAlign;
4293
4308
  var uniqueTabIds = Array.from(new Set(filterModel_1
4294
4309
  .map(function (item) { return item.tabId; })
4295
4310
  .filter(function (id) { return id !== undefined; })));
4296
- uniqueTabIds.push("");
4311
+ var shouldIncludeOthers = hasTabAlign_1 &&
4312
+ filterModel_1.some(function (eachModel) { return eachModel.id !== "id" && !eachModel.tabId; });
4313
+ if (shouldIncludeOthers) {
4314
+ uniqueTabIds.push("");
4315
+ }
4297
4316
  var tabBars = uniqueTabIds.map(function (tabId) { return ({
4298
4317
  id: tabId,
4299
4318
  name: tabId ? tabId : "Others",
@@ -4304,7 +4323,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
4304
4323
  props.id && props.id !== "new" && structure.length >= 1 && (react_1.default.createElement(readQueryHoc_1.ReadQueryHoc, { ref: readQueryHocRef, database: {
4305
4324
  dbModule: dbModule,
4306
4325
  dbType: devSettings.server,
4307
- dbCollection: (_t = (_s = props === null || props === void 0 ? void 0 : props.space) === null || _s === void 0 ? void 0 : _s.pipelineDefaultSpaceId) !== null && _t !== void 0 ? _t : props.collectionId,
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,
4308
4327
  dbEndpoint: devSettings.dbEndpoint,
4309
4328
  dbAPIToken: devSettings.dbAPIToken,
4310
4329
  dbUserToken: devSettings.dbUserToken,
@@ -4312,22 +4331,22 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
4312
4331
  type: "get",
4313
4332
  id: props.id,
4314
4333
  pipeline: pipeline,
4315
- }, offline: (_u = props.bareSettings) === null || _u === void 0 ? void 0 : _u.bareOffline, onChangeData: handleRetrieveSelectedData, onError: handleGetItemError })),
4334
+ }, offline: (_v = props.bareSettings) === null || _v === void 0 ? void 0 : _v.bareOffline, onChangeData: handleRetrieveSelectedData, onError: handleGetItemError })),
4316
4335
  renderBreadcrumb(pages),
4317
4336
  react_1.default.createElement("div", { className: "flex flex-col py-2 sm:items-center sm:flex-row" },
4318
4337
  react_1.default.createElement("div", { className: "flex flex-col w-full" },
4319
4338
  react_1.default.createElement("p", { className: "text-xl font-medium" }, props.title),
4320
4339
  react_1.default.createElement("span", { className: "text-sm text-gray-500" }, props.description)),
4321
4340
  !isBottom && renderActionButtons(props.type)),
4322
- react_1.default.createElement("div", { className: "w-full ".concat(((_v = props.organise) === null || _v === void 0 ? void 0 : _v.tabAlign) === "left"
4341
+ hasTabAlign_1 ? (react_1.default.createElement("div", { className: "w-full ".concat(((_w = props.organise) === null || _w === void 0 ? void 0 : _w.tabAlign) === "left"
4323
4342
  ? "grid sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-5"
4324
4343
  : "") },
4325
- react_1.default.createElement("div", { className: "w-full" }, ((_w = props.organise) === null || _w === void 0 ? void 0 : _w.tabAlign) === "left" &&
4344
+ react_1.default.createElement("div", { className: "w-full" }, ((_x = props.organise) === null || _x === void 0 ? void 0 : _x.tabAlign) === "left" &&
4326
4345
  uniqueTabIds.length >= 1 && (react_1.default.createElement(bars_1.Bars, { bars: tabBars, selectedId: activeTab || "others", onClick: function (tabId) { return setActiveTab(tabId); } }))),
4327
- react_1.default.createElement("div", { className: "w-full ".concat(((_x = props.organise) === null || _x === void 0 ? void 0 : _x.tabAlign) === "left"
4346
+ react_1.default.createElement("div", { className: "w-full ".concat(((_y = props.organise) === null || _y === void 0 ? void 0 : _y.tabAlign) === "left"
4328
4347
  ? " md:col-span-2 lg:col-span-3"
4329
4348
  : "") },
4330
- ((_y = props.organise) === null || _y === void 0 ? void 0 : _y.tabAlign) === "top" &&
4349
+ ((_z = props.organise) === null || _z === void 0 ? void 0 : _z.tabAlign) === "top" &&
4331
4350
  uniqueTabIds.length >= 1 && (react_1.default.createElement(bars_1.Bars, { bars: tabBars, selectedId: activeTab || "others", onClick: function (tabId) { return setActiveTab(tabId); }, horizontal: true })),
4332
4351
  react_1.default.createElement(form_1.Form, { className: "mt-6", ref: formRef, refList: modalFormInputRefs, handleComplete: handleSubmit, disabledOnEnter: disabledOnEnter_1, handleOnFailValidation: function (refList) {
4333
4352
  var _a, _b, _c;
@@ -4340,18 +4359,32 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
4340
4359
  }
4341
4360
  }
4342
4361
  } },
4343
- uniqueTabIds.map(function (tabId) { return (react_1.default.createElement("div", { key: tabId, className: "w-full grid ".concat(formColumn, " gap-6 ").concat(activeTab === tabId ? "" : "hidden") }, renderDataTemplateFormContent(selectedData, filterModel_1
4344
- .map(function (model, index) { return (__assign(__assign({}, model), { refIndex: index })); })
4345
- .filter(function (model) {
4346
- var _a;
4347
- var modelTabId = (_a = model.tabId) !== null && _a !== void 0 ? _a : "";
4348
- return tabId === modelTabId;
4349
- }), modalFormInputRefs, false, false))); }),
4350
- ((_z = props.bareSettings) === null || _z === void 0 ? void 0 : _z.bareUpdateComponent) &&
4351
- ((_0 = props.bareSettings) === null || _0 === void 0 ? void 0 : _0.bareUpdateComponent(selectedData))),
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))),
4352
4378
  react_1.default.createElement("div", { className: "mt-8" }, renderListAddress(props.type)),
4353
4379
  react_1.default.createElement("div", { className: "mt-8" }, renderListObject(props.type)),
4354
- 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)))));
4355
4388
  case "list":
4356
4389
  var filterComponent_1 = renderSearchContent();
4357
4390
  var dataComponent = renderTabContent(tabs, props.type, viewType);
@@ -4359,14 +4392,14 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
4359
4392
  var listReadQueryHOC = (react_1.default.createElement(readQueryHoc_1.ReadQueryHoc, { ref: listRQueryHocRef, database: {
4360
4393
  dbModule: dbModule,
4361
4394
  dbType: devSettings.server,
4362
- dbCollection: (_2 = (_1 = props === null || props === void 0 ? void 0 : props.space) === null || _1 === void 0 ? void 0 : _1.pipelineDefaultSpaceId) !== null && _2 !== void 0 ? _2 : props.collectionId,
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,
4363
4396
  dbEndpoint: devSettings.dbEndpoint,
4364
4397
  dbAPIToken: devSettings.dbAPIToken,
4365
4398
  dbUserToken: devSettings.dbUserToken,
4366
- }, cond: handleReadQueryHocCond(), offline: (_3 = props.bareSettings) === null || _3 === void 0 ? void 0 : _3.bareOffline, onChangeData: function (data) {
4399
+ }, cond: handleReadQueryHocCond(), offline: (_6 = props.bareSettings) === null || _6 === void 0 ? void 0 : _6.bareOffline, onChangeData: function (data) {
4367
4400
  handleGetListData(data, "", "");
4368
4401
  }, onError: handleGetItemError }));
4369
- if ((_4 = props.renderSettings) === null || _4 === void 0 ? void 0 : _4.renderListUI) {
4402
+ if ((_7 = props.renderSettings) === null || _7 === void 0 ? void 0 : _7.renderListUI) {
4370
4403
  return (react_1.default.createElement(react_1.default.Fragment, null,
4371
4404
  listReadQueryHOC,
4372
4405
  props.renderSettings.renderListUI(actionComponent, filterComponent_1, dataComponent)));
@@ -4464,7 +4497,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
4464
4497
  renderListFilterElements(),
4465
4498
  renderListActionElements()),
4466
4499
  renderListNewRowFilterElements(),
4467
- 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: (_5 = props.organise) === null || _5 === void 0 ? void 0 : _5.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 })),
4468
4501
  renderTabContent(tabs, props.type, viewType),
4469
4502
  isBottom && renderActionButtons(props.type, true)));
4470
4503
  default: