blixify-ui-web 0.4.148 → 0.4.149

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;AAuEf,OAAO,EACL,iBAAiB,EAKlB,MAAM,kBAAkB,CAAC;AAoB1B,eAAO,MAAM,YAAY,mFA+0OvB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/data/dataTemplate/index.tsx"],"names":[],"mappings":"AA8BA,OAAO,KAQN,MAAM,OAAO,CAAC;AAuEf,OAAO,EACL,iBAAiB,EAKlB,MAAM,kBAAkB,CAAC;AAoB1B,eAAO,MAAM,YAAY,mFA61OvB,CAAC"}
@@ -906,6 +906,8 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
906
906
  handlePopUpModal(true, id);
907
907
  }
908
908
  else {
909
+ setSelectedIds([]);
910
+ setSelectAll(false);
909
911
  (_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.handleNavigate) === null || _b === void 0 ? void 0 : _b.call(_a, props.type, props.id, id);
910
912
  }
911
913
  };
@@ -4184,6 +4186,32 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
4184
4186
  filterModel_1.push(eachModel);
4185
4187
  return null;
4186
4188
  });
4189
+ var handleOnFailValidation = function (refList) {
4190
+ var _a;
4191
+ if ((refList === null || refList === void 0 ? void 0 : refList.length) > 0) {
4192
+ var modalFormRefIds_1 = modalFormInputRefs
4193
+ .map(function (ref) { var _a, _b; return (_b = (_a = ref.current) === null || _a === void 0 ? void 0 : _a.props) === null || _b === void 0 ? void 0 : _b.id; })
4194
+ .filter(Boolean);
4195
+ var prioritizedRef = refList.find(function (id) { return modalFormRefIds_1.includes(id); }) || refList[0];
4196
+ var foundId_1 = prioritizedRef;
4197
+ if (foundId_1) {
4198
+ var foundModel = filterModel_1.find(function (eachModel) { return eachModel.id === foundId_1; });
4199
+ var newTabId = (_a = foundModel === null || foundModel === void 0 ? void 0 : foundModel.tabId) !== null && _a !== void 0 ? _a : "";
4200
+ handleUpdateTabId(newTabId);
4201
+ setTimeout(function () {
4202
+ var element = document.getElementById(foundId_1);
4203
+ if (element) {
4204
+ var rect = element.getBoundingClientRect();
4205
+ var scrollTop = window.pageYOffset + rect.top - window.innerHeight / 2;
4206
+ window.scrollTo({
4207
+ top: scrollTop,
4208
+ behavior: "smooth",
4209
+ });
4210
+ }
4211
+ }, 300);
4212
+ }
4213
+ }
4214
+ };
4187
4215
  var hasTabAlign_1 = ((_t = props.organise) === null || _t === void 0 ? void 0 : _t.tabAlign) || ((_u = props.space) === null || _u === void 0 ? void 0 : _u.tabAlign);
4188
4216
  var leftTabAlign = ((_v = props.organise) === null || _v === void 0 ? void 0 : _v.tabAlign) === "left" ||
4189
4217
  ((_w = props.space) === null || _w === void 0 ? void 0 : _w.tabAlign) === "left";
@@ -4253,35 +4281,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
4253
4281
  var tabId = uniqueTabIds_1[stepIndex];
4254
4282
  handleUpdateTabId(tabId);
4255
4283
  } })),
4256
- react_1.default.createElement(form_1.Form, { className: "mt-6", ref: formRef, refList: __spreadArray(__spreadArray([], modalFormInputRefs, true), flexTableRefs, true), handleComplete: handleSubmit, disabledOnEnter: disabledOnEnter_1, handleOnFailValidation: function (refList) {
4257
- var _a;
4258
- if ((refList === null || refList === void 0 ? void 0 : refList.length) > 0) {
4259
- var modalFormRefIds_1 = modalFormInputRefs
4260
- .map(function (ref) { var _a, _b; return (_b = (_a = ref.current) === null || _a === void 0 ? void 0 : _a.props) === null || _b === void 0 ? void 0 : _b.id; })
4261
- .filter(Boolean);
4262
- var prioritizedRef = refList.find(function (id) { return modalFormRefIds_1.includes(id); }) ||
4263
- refList[0];
4264
- var foundId_1 = prioritizedRef;
4265
- if (foundId_1) {
4266
- var foundModel = filterModel_1.find(function (eachModel) { return eachModel.id === foundId_1; });
4267
- var newTabId = (_a = foundModel === null || foundModel === void 0 ? void 0 : foundModel.tabId) !== null && _a !== void 0 ? _a : "";
4268
- handleUpdateTabId(newTabId);
4269
- setTimeout(function () {
4270
- var element = document.getElementById(foundId_1);
4271
- if (element) {
4272
- var rect = element.getBoundingClientRect();
4273
- var scrollTop = window.pageYOffset +
4274
- rect.top -
4275
- window.innerHeight / 2;
4276
- window.scrollTo({
4277
- top: scrollTop,
4278
- behavior: "smooth",
4279
- });
4280
- }
4281
- }, 300);
4282
- }
4283
- }
4284
- } },
4284
+ react_1.default.createElement(form_1.Form, { className: "mt-6", ref: formRef, refList: __spreadArray(__spreadArray([], modalFormInputRefs, true), flexTableRefs, true), handleComplete: handleSubmit, disabledOnEnter: disabledOnEnter_1, handleOnFailValidation: handleOnFailValidation },
4285
4285
  uniqueTabIds_1.map(function (tabId) {
4286
4286
  var filterByTab = filterModel_1
4287
4287
  .map(function (model, index) { return (__assign(__assign({}, model), { refIndex: index })); })
@@ -4302,7 +4302,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
4302
4302
  react_1.default.createElement("div", { className: "mt-8" }, renderListObject(props.type)),
4303
4303
  isBottom &&
4304
4304
  renderActionButtons(props.type, true, hasTabAlign_1, uniqueTabIds_1)))) : (react_1.default.createElement("div", null,
4305
- react_1.default.createElement(form_1.Form, { className: "grid ".concat(formColumn, " gap-6 mt-6"), ref: formRef, refList: __spreadArray(__spreadArray([], modalFormInputRefs, true), flexTableRefs, true), handleComplete: handleSubmit, disabledOnEnter: disabledOnEnter_1 },
4305
+ react_1.default.createElement(form_1.Form, { className: "grid ".concat(formColumn, " gap-6 mt-6"), ref: formRef, refList: __spreadArray(__spreadArray([], modalFormInputRefs, true), flexTableRefs, true), handleComplete: handleSubmit, disabledOnEnter: disabledOnEnter_1, handleOnFailValidation: handleOnFailValidation },
4306
4306
  renderDataTemplateFormContent(selectedData, filterModel_1, modalFormInputRefs, false, false),
4307
4307
  ((_9 = props.bareSettings) === null || _9 === void 0 ? void 0 : _9.bareUpdateComponent) &&
4308
4308
  ((_10 = props.bareSettings) === null || _10 === void 0 ? void 0 : _10.bareUpdateComponent(selectedData))),
@@ -4433,7 +4433,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
4433
4433
  //SECTION: Render Utils
4434
4434
  //=====================================================================================
4435
4435
  var renderDataTemplateFormContent = function (state, model, ref, isObject, isObjectList, modalInput, parentData, markdownReadOnly) {
4436
- var _a, _b, _c, _d, _e, _f, _g, _h;
4436
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
4437
4437
  return (0, updateModule_1.renderDataTemplateForm)(state, model, ref, {
4438
4438
  handleOnChangeAddress: handleOnChangeAddress,
4439
4439
  handleOnChangeText: handleOnChangeText,
@@ -4482,7 +4482,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
4482
4482
  handleSelectListObjectData: handleSelectListObjectData,
4483
4483
  renderObjectTags: renderObjectTags,
4484
4484
  setSelectedData: setSelectedData,
4485
- }, { signing: signatureSigning, setSigning: setSignatureSigning }, { readOnly: markdownReadOnly ? true : false }, props.onComplete ? true : false, (_f = props.bareSettings) === null || _f === void 0 ? void 0 : _f.bareOffline, (_g = props.bareSettings) === null || _g === void 0 ? void 0 : _g.bareUpdateOneColumn, (_h = props.bareSettings) === null || _h === void 0 ? void 0 : _h.bareSelectCustomBtns);
4485
+ }, { signing: signatureSigning, setSigning: setSignatureSigning }, { readOnly: markdownReadOnly ? true : false }, props.onComplete ? true : false, (_f = props.bareSettings) === null || _f === void 0 ? void 0 : _f.bareOffline, (_g = props.bareSettings) === null || _g === void 0 ? void 0 : _g.bareUpdateOneColumn, (_h = props.bareSettings) === null || _h === void 0 ? void 0 : _h.bareSelectCustomBtns, (_j = props.bareSettings) === null || _j === void 0 ? void 0 : _j.bareUpdateIndividualComponent);
4486
4486
  };
4487
4487
  var renderGridAndListData = function (imageTag, type, kanbanGroupId, useColumnName) {
4488
4488
  var _a, _b;
@@ -4712,10 +4712,17 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
4712
4712
  feedsSettings: (_c = eachTab.feedsSettings) !== null && _c !== void 0 ? _c : undefined,
4713
4713
  mapSettings: (_d = eachTab.mapSettings) !== null && _d !== void 0 ? _d : undefined,
4714
4714
  };
4715
- if (eachTab.viewType === "iframe")
4716
- tabData["iframeSrc"] = eachTab.src;
4717
- else
4715
+ if (eachTab.viewType === "iframe") {
4716
+ if (typeof eachTab.src === "string") {
4717
+ tabData["iframeSrc"] = eachTab.src;
4718
+ }
4719
+ else if (eachTab.src) {
4720
+ tabData["customComponent"] = eachTab.src;
4721
+ }
4722
+ }
4723
+ else {
4718
4724
  tabData["viewImage"] = eachTab.viewImage;
4725
+ }
4719
4726
  if (eachTab.type === props.type) {
4720
4727
  tabs.push(__assign(__assign({}, tabData), (!((_e = props.edit) === null || _e === void 0 ? void 0 : _e.disabledTabsDeleteBtn) && {
4721
4728
  del: (react_1.default.createElement(outline_1.XMarkIcon, { className: "h-4 w-4 ml-2 self-center text-red-600 hover:text-red-400 ", onClick: function (e) {
@@ -5063,7 +5070,12 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
5063
5070
  }, darkMode: (_j = props.organise) === null || _j === void 0 ? void 0 : _j.darkMode }))));
5064
5071
  }
5065
5072
  else if (selectedTabData.viewType === "iframe") {
5066
- return (react_1.default.createElement("iframe", { id: "blixify-iframe", className: "w-full mt-5", style: { height: "70vh" }, src: (_k = selectedTabData === null || selectedTabData === void 0 ? void 0 : selectedTabData.iframeSrc) !== null && _k !== void 0 ? _k : "", title: (_l = selectedTabData === null || selectedTabData === void 0 ? void 0 : selectedTabData.id) !== null && _l !== void 0 ? _l : "", onLoad: props.onLoadIframe }));
5073
+ if (selectedTabData === null || selectedTabData === void 0 ? void 0 : selectedTabData.customComponent) {
5074
+ return selectedTabData.customComponent;
5075
+ }
5076
+ else {
5077
+ return (react_1.default.createElement("iframe", { id: "blixify-iframe", className: "w-full mt-5", style: { height: "70vh" }, src: (_k = selectedTabData === null || selectedTabData === void 0 ? void 0 : selectedTabData.iframeSrc) !== null && _k !== void 0 ? _k : "", title: (_l = selectedTabData === null || selectedTabData === void 0 ? void 0 : selectedTabData.id) !== null && _l !== void 0 ? _l : "", onLoad: props.onLoadIframe }));
5078
+ }
5067
5079
  }
5068
5080
  else if (selectedTabData.viewType === "list") {
5069
5081
  return (react_1.default.createElement(react_1.default.Fragment, null,