blixify-ui-web 0.2.45 → 0.2.47

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.
Files changed (33) hide show
  1. package/lib/components/data/dataTemplate/index.d.ts.map +1 -1
  2. package/lib/components/data/dataTemplate/index.js +74 -3
  3. package/lib/components/data/dataTemplate/index.js.map +1 -1
  4. package/lib/components/data/dataTemplate/settingsModal.d.ts +6 -1
  5. package/lib/components/data/dataTemplate/settingsModal.d.ts.map +1 -1
  6. package/lib/components/data/dataTemplate/settingsModal.js +60 -4
  7. package/lib/components/data/dataTemplate/settingsModal.js.map +1 -1
  8. package/lib/components/data/dataTemplate/spaceModel.d.ts +7 -1
  9. package/lib/components/data/dataTemplate/spaceModel.d.ts.map +1 -1
  10. package/lib/components/data/listModule.d.ts +0 -1
  11. package/lib/components/data/listModule.d.ts.map +1 -1
  12. package/lib/components/data/listModule.js +5 -160
  13. package/lib/components/data/listModule.js.map +1 -1
  14. package/lib/components/data/moduleUtils.d.ts +4 -0
  15. package/lib/components/data/moduleUtils.d.ts.map +1 -0
  16. package/lib/components/data/moduleUtils.js +217 -0
  17. package/lib/components/data/moduleUtils.js.map +1 -0
  18. package/lib/components/data/readModule.d.ts +0 -1
  19. package/lib/components/data/readModule.d.ts.map +1 -1
  20. package/lib/components/data/readModule.js +3 -20
  21. package/lib/components/data/readModule.js.map +1 -1
  22. package/lib/components/display/detailList/index.d.ts.map +1 -1
  23. package/lib/components/display/detailList/index.js +3 -2
  24. package/lib/components/display/detailList/index.js.map +1 -1
  25. package/lib/components/display/mapView/index.d.ts +52 -0
  26. package/lib/components/display/mapView/index.d.ts.map +1 -0
  27. package/lib/components/display/mapView/index.js +400 -0
  28. package/lib/components/display/mapView/index.js.map +1 -0
  29. package/lib/components/index.d.ts +1 -2
  30. package/lib/components/index.d.ts.map +1 -1
  31. package/lib/components/index.js +4 -6
  32. package/lib/components/index.js.map +1 -1
  33. package/package.json +3 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/data/dataTemplate/index.tsx"],"names":[],"mappings":"AAsBA,OAAO,KAQN,MAAM,OAAO,CAAC;AAsDf,OAAO,EACL,iBAAiB,EAKlB,MAAM,kBAAkB,CAAC;AAO1B,eAAO,MAAM,YAAY,mFA+jJvB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/data/dataTemplate/index.tsx"],"names":[],"mappings":"AAsBA,OAAO,KAQN,MAAM,OAAO,CAAC;AAsDf,OAAO,EACL,iBAAiB,EAKlB,MAAM,kBAAkB,CAAC;AAQ1B,eAAO,MAAM,YAAY,mFA2pJvB,CAAC"}
@@ -130,6 +130,7 @@ var dataStateModel_1 = require("./dataStateModel");
130
130
  var indexedDb_1 = require("./indexedDb");
131
131
  var pagination_1 = require("./pagination");
132
132
  var settingsModal_1 = require("./settingsModal");
133
+ var mapView_1 = require("../../display/mapView");
133
134
  exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
134
135
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
135
136
  var formRef = (0, react_1.createRef)();
@@ -302,7 +303,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
302
303
  }
303
304
  }, [props.type, props.id]);
304
305
  (0, react_1.useEffect)(function () {
305
- var _a, _b, _c, _d;
306
+ var _a, _b, _c, _d, _e;
306
307
  if (!selectedTab) {
307
308
  var currentTab = (_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.extendedTabs) === null || _b === void 0 ? void 0 : _b.find(function (eachTab) { var _a; return (0, utils_1.lowercaseTextToId)(eachTab.name) === ((_a = props.organise) === null || _a === void 0 ? void 0 : _a.viewId); });
308
309
  if (currentTab) {
@@ -321,6 +322,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
321
322
  viewImage: currentTab.viewImage,
322
323
  calendarSettings: (_c = currentTab.calendarSettings) !== null && _c !== void 0 ? _c : undefined,
323
324
  feedsSettings: (_d = currentTab.feedsSettings) !== null && _d !== void 0 ? _d : undefined,
325
+ mapSettings: (_e = currentTab.mapSettings) !== null && _e !== void 0 ? _e : undefined,
324
326
  });
325
327
  if (listRQueryHocRef.current)
326
328
  listRQueryHocRef.current.handleRefresh();
@@ -475,7 +477,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
475
477
  sort: handleReadQueryHocSort(query),
476
478
  limit: limit,
477
479
  };
478
- if (calendarSettings) {
480
+ if (calendarSettings || (selectedTab && selectedTab.viewType === "map")) {
479
481
  cond.limit = undefined;
480
482
  cond.stopLimit = true;
481
483
  }
@@ -2870,7 +2872,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
2870
2872
  if (((_d = props.organise) === null || _d === void 0 ? void 0 : _d.extendedTabs) &&
2871
2873
  ((_e = props.organise.extendedTabs) === null || _e === void 0 ? void 0 : _e.length) > 0) {
2872
2874
  (_f = props.organise) === null || _f === void 0 ? void 0 : _f.extendedTabs.map(function (eachTab) {
2873
- var _a, _b;
2875
+ var _a, _b, _c;
2874
2876
  var hrefPoint = "".concat(props.localURLEndpoint, "?type=").concat(props.type, "&collection=").concat(props.collectionId);
2875
2877
  if (props.id)
2876
2878
  hrefPoint += "&data=".concat(props.id);
@@ -2884,6 +2886,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
2884
2886
  viewImage: eachTab.viewImage,
2885
2887
  calendarSettings: (_a = eachTab.calendarSettings) !== null && _a !== void 0 ? _a : undefined,
2886
2888
  feedsSettings: (_b = eachTab.feedsSettings) !== null && _b !== void 0 ? _b : undefined,
2889
+ mapSettings: (_c = eachTab.mapSettings) !== null && _c !== void 0 ? _c : undefined,
2887
2890
  };
2888
2891
  if (eachTab.viewType === "iframe")
2889
2892
  tabData["iframeSrc"] = eachTab.src;
@@ -3478,6 +3481,74 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
3478
3481
  react_1.default.createElement("div", { className: "my-10" }),
3479
3482
  contentList_1.length > 0 && !((_u = props.organise) === null || _u === void 0 ? void 0 : _u.hidePagination) && (react_1.default.createElement(pagination_1.Pagination, { data: tableData, size: size, limit: limit, cursor: cursor, pageIndex: pageIndex, paginationType: isFirebase ? "cursor" : "page", handleUpdatePageIndex: handlePagination, darkMode: (_v = props.organise) === null || _v === void 0 ? void 0 : _v.darkMode }))))));
3480
3483
  }
3484
+ else if (selectedTabData.viewType === "map") {
3485
+ var mapSettings_1 = selectedTabData.mapSettings;
3486
+ if (mapSettings_1) {
3487
+ var mapMarkerList_1 = [];
3488
+ var uniqueGroupList_1 = [];
3489
+ var markerColorMap_1 = {};
3490
+ var markerColorList_1 = [
3491
+ "red",
3492
+ "blue",
3493
+ "green",
3494
+ "yellow",
3495
+ "orange",
3496
+ "purple",
3497
+ ];
3498
+ if (mapSettings_1.group) {
3499
+ spaceTableData.map(function (eachData) {
3500
+ if (eachData[mapSettings_1.group] &&
3501
+ !uniqueGroupList_1.includes(eachData[mapSettings_1.group])) {
3502
+ uniqueGroupList_1.push(eachData[mapSettings_1.group]);
3503
+ }
3504
+ return null;
3505
+ });
3506
+ uniqueGroupList_1.forEach(function (group, index) {
3507
+ var colorIndex = index % markerColorList_1.length;
3508
+ markerColorMap_1[group] = markerColorList_1[colorIndex];
3509
+ });
3510
+ }
3511
+ var InfoWindowContent = function (id, data) {
3512
+ return (react_1.default.createElement("div", { key: id, className: "w-72 break-words font-normal" },
3513
+ react_1.default.createElement("p", { className: "text-primary-500 font-semibold text-base" }, data.title),
3514
+ react_1.default.createElement("p", { className: "text-primary-500 font-semibold text-sm" }, data.group),
3515
+ react_1.default.createElement("p", { className: "text-sm" }, data.address)));
3516
+ };
3517
+ spaceTableData.map(function (eachData) {
3518
+ var _a, _b, _c, _d, _e, _f, _g, _h;
3519
+ var eachMarkerColor = mapSettings_1.group
3520
+ ? markerColorMap_1[eachData[mapSettings_1.group]] || "red"
3521
+ : "red";
3522
+ if (eachData[mapSettings_1.address]) {
3523
+ mapMarkerList_1.push({
3524
+ id: eachData.id,
3525
+ coord: {
3526
+ lat: (_b = (_a = eachData[mapSettings_1.address]) === null || _a === void 0 ? void 0 : _a.lat) !== null && _b !== void 0 ? _b : 0,
3527
+ lng: (_d = (_c = eachData[mapSettings_1.address]) === null || _c === void 0 ? void 0 : _c.lng) !== null && _d !== void 0 ? _d : 0,
3528
+ },
3529
+ color: eachMarkerColor,
3530
+ data: {
3531
+ title: mapSettings_1.title
3532
+ ? (_e = eachData[mapSettings_1.title]) !== null && _e !== void 0 ? _e : ""
3533
+ : "",
3534
+ address: (_g = (_f = eachData[mapSettings_1.address]) === null || _f === void 0 ? void 0 : _f.name) !== null && _g !== void 0 ? _g : "",
3535
+ group: mapSettings_1.group
3536
+ ? (_h = eachData[mapSettings_1.group]) !== null && _h !== void 0 ? _h : ""
3537
+ : "",
3538
+ },
3539
+ });
3540
+ }
3541
+ return null;
3542
+ });
3543
+ return (react_1.default.createElement("div", { className: "w-full h-[700px]" },
3544
+ react_1.default.createElement(mapView_1.MapView, { markerList: mapMarkerList_1, enableMapControl: true, enablePolygonSelect: true, infoWindowComponent: InfoWindowContent, handleSelectPolygon: function (ids) { return setSelectedIds(ids); }, handleUpdateOnClick: function () { return setBatchUpdateModal(true); }, handleDeleteOnClick: function () {
3545
+ handleGenerateDeletePasscode();
3546
+ setDeleteModal(true);
3547
+ } })));
3548
+ }
3549
+ else
3550
+ return react_1.default.createElement(react_1.default.Fragment, null);
3551
+ }
3481
3552
  else if (selectedTabData.renderComp) {
3482
3553
  return react_1.default.createElement(react_1.default.Fragment, null, selectedTabData.renderComp());
3483
3554
  }