@fctc/sme-widget-ui 1.1.1 → 1.1.3

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/dist/widgets.js CHANGED
@@ -33672,167 +33672,185 @@ var Many2ManyField = (props) => {
33672
33672
  clearSearch
33673
33673
  } = searchController;
33674
33674
  return (0, import_react_dom8.createPortal)(
33675
- /* @__PURE__ */ (0, import_jsx_runtime100.jsxs)("div", { className: "fixed bottom-0 left-0 right-0 top-0 z-[9999]", children: [
33676
- /* @__PURE__ */ (0, import_jsx_runtime100.jsx)("div", { className: "absolute inset-0 bg-[rgba(27,27,27,0.48)]" }),
33677
- /* @__PURE__ */ (0, import_jsx_runtime100.jsx)("div", { className: "absolute inset-0 overflow-auto px-6 flex justify-center items-center", children: /* @__PURE__ */ (0, import_jsx_runtime100.jsxs)("div", { className: "relative z-[1] p-4 flex flex-col gap-2 max-w-full lg:max-w-[1000px] lg:min-w-[1000px] transform rounded-3xl bg-[#FFF] min-h-[90%] max-h-[90%] h-fit", children: [
33678
- /* @__PURE__ */ (0, import_jsx_runtime100.jsxs)("div", { className: "flex justify-between items-center border-b border-[rgba(0,0,0,0.1)] pb-2", children: [
33679
- /* @__PURE__ */ (0, import_jsx_runtime100.jsx)("div", { className: "text-[20px] font-semibold", children: title }),
33680
- /* @__PURE__ */ (0, import_jsx_runtime100.jsx)("button", { className: "cursor-pointer", onClick: onClose, children: /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(CloseIcon, {}) })
33681
- ] }),
33682
- /* @__PURE__ */ (0, import_jsx_runtime100.jsxs)("div", { className: "grid grid-cols-3 gap-2 items-center py-2", children: [
33683
- /* @__PURE__ */ (0, import_jsx_runtime100.jsx)("div", { className: "col-span-3 sm:col-span-2 flex-1", children: /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
33684
- Search,
33685
- {
33686
- removeSearchItems,
33687
- selectedTags,
33688
- filterBy,
33689
- setFilterBy,
33690
- searchString,
33691
- onSearchString,
33692
- handleAddTagSearch,
33693
- searchBy,
33694
- groupBy,
33695
- showFiltersGroups: true,
33696
- setGroupBy,
33697
- setDomainList: setDomain,
33698
- setPage: (pages) => {
33699
- setPage?.(pages);
33700
- },
33701
- fieldsList: [
33702
- ...columns?.filter(
33703
- (col) => col?.field?.type_co === "field" && col?.optional !== "hide"
33704
- )?.map((col) => ({ ...col.field })) ?? []
33705
- ],
33706
- setSelectedRowKeys,
33707
- viewData,
33708
- context,
33709
- selectedRowKeys,
33710
- aid,
33711
- domainSearch,
33712
- evalJSONContext,
33713
- clearSearch
33714
- }
33715
- ) }),
33716
- /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
33717
- PaginationView,
33675
+ /* @__PURE__ */ (0, import_jsx_runtime100.jsxs)(
33676
+ "div",
33677
+ {
33678
+ style: {
33679
+ zIndex: 99999
33680
+ },
33681
+ className: "fixed bottom-0 left-0 right-0 top-0",
33682
+ children: [
33683
+ /* @__PURE__ */ (0, import_jsx_runtime100.jsx)("div", { className: "absolute inset-0 bg-[rgba(27,27,27,0.48)]" }),
33684
+ /* @__PURE__ */ (0, import_jsx_runtime100.jsx)("div", { className: "absolute inset-0 overflow-auto px-6 flex justify-center items-center", children: /* @__PURE__ */ (0, import_jsx_runtime100.jsxs)(
33685
+ "div",
33718
33686
  {
33719
- className: "pagination-bar col-span-3 sm:col-span-1 justify-end flex-1",
33720
- currentPage: page,
33721
- totalCount: totalRows ?? 0,
33722
- pageSize: 10,
33723
- onPageChange: (page2) => {
33724
- if (typeof setPage === "function") {
33725
- setPage(page2);
33726
- }
33687
+ style: {
33688
+ zIndex: 1
33727
33689
  },
33728
- displayPageNumberDots: false,
33729
- displayRowsNumberOption: false
33730
- }
33731
- )
33732
- ] }),
33733
- !isDataLoading && isDataFetched || isPlaceholderData ? /* @__PURE__ */ (0, import_jsx_runtime100.jsx)("div", { className: "relative overflow-y-auto", children: /* @__PURE__ */ (0, import_jsx_runtime100.jsx)("div", { className: "relative h-full w-full", children: /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
33734
- "div",
33735
- {
33736
- className: `border-[1px] h-full border-solid border-[#dbe0e6] rounded-[10px] relative w-full overflow-hidden`,
33737
- children: /* @__PURE__ */ (0, import_jsx_runtime100.jsx)("div", { className: "flex flex-col gap-[16px] w-full h-full", children: /* @__PURE__ */ (0, import_jsx_runtime100.jsx)("div", { className: `relative w-full h-full`, children: /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
33738
- "div",
33739
- {
33740
- className: `flex w-full items-center h-full overflow-auto `,
33741
- children: /* @__PURE__ */ (0, import_jsx_runtime100.jsx)("div", { className: "w-full h-full max-w-full", children: /* @__PURE__ */ (0, import_jsx_runtime100.jsxs)(
33742
- "table",
33743
- {
33744
- className: `relative w-full bg-white custom-dropdown `,
33745
- children: [
33746
- /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
33747
- TableHead,
33748
- {
33749
- columns,
33750
- onToggleColumnOptional,
33751
- isDisplayCheckbox,
33752
- checkedAll,
33753
- handleCheckBoxAll
33754
- }
33755
- ),
33756
- /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
33757
- TableBody,
33758
- {
33759
- columns,
33760
- rows,
33761
- rootField,
33762
- isDisplayCheckbox,
33763
- model: relation,
33764
- renderField: ({
33765
- row,
33766
- col,
33767
- indexRow,
33768
- onChangeData,
33769
- rootField: rootField2
33770
- }) => {
33771
- if (typeof renderField === "function") {
33772
- return renderField({
33773
- row,
33774
- col,
33775
- indexRow,
33776
- onChangeData,
33777
- rootField: rootField2
33778
- });
33779
- }
33780
- },
33781
- onRemoveRow: null,
33782
- onAddRow,
33783
- onClickRow,
33784
- typeTable,
33785
- selectedRowKeysRef,
33786
- selectedRowKeys,
33787
- setSelectedRowKeys
33690
+ className: "relative p-4 flex flex-col gap-2 max-w-full lg:max-w-[1000px] lg:min-w-[1000px] transform rounded-3xl bg-[#FFF] min-h-[90%] max-h-[90%] h-fit",
33691
+ children: [
33692
+ /* @__PURE__ */ (0, import_jsx_runtime100.jsxs)("div", { className: "flex justify-between items-center border-b border-[rgba(0,0,0,0.1)] pb-2", children: [
33693
+ /* @__PURE__ */ (0, import_jsx_runtime100.jsx)("div", { className: "text-[20px] font-semibold", children: title }),
33694
+ /* @__PURE__ */ (0, import_jsx_runtime100.jsx)("button", { className: "cursor-pointer", onClick: onClose, children: /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(CloseIcon, {}) })
33695
+ ] }),
33696
+ /* @__PURE__ */ (0, import_jsx_runtime100.jsxs)("div", { className: "grid grid-cols-3 gap-2 items-center py-2", children: [
33697
+ /* @__PURE__ */ (0, import_jsx_runtime100.jsx)("div", { className: "col-span-3 sm:col-span-2 flex-1", children: /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
33698
+ Search,
33699
+ {
33700
+ removeSearchItems,
33701
+ selectedTags,
33702
+ filterBy,
33703
+ setFilterBy,
33704
+ searchString,
33705
+ onSearchString,
33706
+ handleAddTagSearch,
33707
+ searchBy,
33708
+ groupBy,
33709
+ showFiltersGroups: true,
33710
+ setGroupBy,
33711
+ setDomainList: setDomain,
33712
+ setPage: (pages) => {
33713
+ setPage?.(pages);
33714
+ },
33715
+ fieldsList: [
33716
+ ...columns?.filter(
33717
+ (col) => col?.field?.type_co === "field" && col?.optional !== "hide"
33718
+ )?.map((col) => ({ ...col.field })) ?? []
33719
+ ],
33720
+ setSelectedRowKeys,
33721
+ viewData,
33722
+ context,
33723
+ selectedRowKeys,
33724
+ aid,
33725
+ domainSearch,
33726
+ evalJSONContext,
33727
+ clearSearch
33728
+ }
33729
+ ) }),
33730
+ /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
33731
+ PaginationView,
33732
+ {
33733
+ className: "pagination-bar col-span-3 sm:col-span-1 justify-end flex-1",
33734
+ currentPage: page,
33735
+ totalCount: totalRows ?? 0,
33736
+ pageSize: 10,
33737
+ onPageChange: (page2) => {
33738
+ if (typeof setPage === "function") {
33739
+ setPage(page2);
33788
33740
  }
33789
- )
33790
- ]
33741
+ },
33742
+ displayPageNumberDots: false,
33743
+ displayRowsNumberOption: false
33744
+ }
33745
+ )
33746
+ ] }),
33747
+ !isDataLoading && isDataFetched || isPlaceholderData ? /* @__PURE__ */ (0, import_jsx_runtime100.jsx)("div", { className: "relative overflow-y-auto", children: /* @__PURE__ */ (0, import_jsx_runtime100.jsx)("div", { className: "relative h-full w-full", children: /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
33748
+ "div",
33749
+ {
33750
+ className: `border-[1px] h-full border-solid border-[#dbe0e6] rounded-[10px] relative w-full overflow-hidden`,
33751
+ children: /* @__PURE__ */ (0, import_jsx_runtime100.jsx)("div", { className: "flex flex-col gap-[16px] w-full h-full", children: /* @__PURE__ */ (0, import_jsx_runtime100.jsx)("div", { className: `relative w-full h-full`, children: /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
33752
+ "div",
33753
+ {
33754
+ className: `flex w-full items-center h-full overflow-auto `,
33755
+ children: /* @__PURE__ */ (0, import_jsx_runtime100.jsx)("div", { className: "w-full h-full max-w-full", children: /* @__PURE__ */ (0, import_jsx_runtime100.jsxs)(
33756
+ "table",
33757
+ {
33758
+ className: `relative w-full bg-white custom-dropdown `,
33759
+ children: [
33760
+ /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
33761
+ TableHead,
33762
+ {
33763
+ columns,
33764
+ onToggleColumnOptional,
33765
+ isDisplayCheckbox,
33766
+ checkedAll,
33767
+ handleCheckBoxAll
33768
+ }
33769
+ ),
33770
+ /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
33771
+ TableBody,
33772
+ {
33773
+ columns,
33774
+ rows,
33775
+ rootField,
33776
+ isDisplayCheckbox,
33777
+ model: relation,
33778
+ renderField: ({
33779
+ row,
33780
+ col,
33781
+ indexRow,
33782
+ onChangeData,
33783
+ rootField: rootField2
33784
+ }) => {
33785
+ if (typeof renderField === "function") {
33786
+ return renderField({
33787
+ row,
33788
+ col,
33789
+ indexRow,
33790
+ onChangeData,
33791
+ rootField: rootField2
33792
+ });
33793
+ }
33794
+ },
33795
+ onRemoveRow: null,
33796
+ onAddRow,
33797
+ onClickRow,
33798
+ typeTable,
33799
+ selectedRowKeysRef,
33800
+ selectedRowKeys,
33801
+ setSelectedRowKeys
33802
+ }
33803
+ )
33804
+ ]
33805
+ }
33806
+ ) })
33807
+ }
33808
+ ) }) })
33791
33809
  }
33792
- ) })
33793
- }
33794
- ) }) })
33795
- }
33796
- ) }) }) : /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(LayerLoading, {}),
33797
- /* @__PURE__ */ (0, import_jsx_runtime100.jsxs)("div", { className: "flex items-center gap-2 mt-auto", children: [
33798
- isDisplayCheckbox && /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
33799
- "button",
33800
- {
33801
- disabled: selectedRowKeys?.length === 0,
33802
- type: "button",
33803
- onClick: () => onChoose(selectedRowKeys),
33804
- className: "button-primary",
33805
- children: instance.t("choose")
33806
- }
33807
- ),
33808
- optionsObject && "no_create" in optionsObject && optionsObject?.no_create === false && /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
33809
- "button",
33810
- {
33811
- type: "button",
33812
- onClick: () => {
33813
- if (typeof onAddNew === "function") {
33814
- onAddNew();
33815
- onClose();
33816
- } else {
33817
- handleCreateNewOnPage();
33818
- }
33819
- },
33820
- className: "button-primary",
33821
- children: instance.t("new")
33822
- }
33823
- ),
33824
- /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
33825
- "button",
33826
- {
33827
- type: "button",
33828
- onClick: onClose,
33829
- className: "button-secondary",
33830
- children: instance.t("cancel_button")
33810
+ ) }) }) : /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(LayerLoading, {}),
33811
+ /* @__PURE__ */ (0, import_jsx_runtime100.jsxs)("div", { className: "flex items-center gap-2 mt-auto", children: [
33812
+ isDisplayCheckbox && /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
33813
+ "button",
33814
+ {
33815
+ disabled: selectedRowKeys?.length === 0,
33816
+ type: "button",
33817
+ onClick: () => onChoose(selectedRowKeys),
33818
+ className: "button-primary",
33819
+ children: instance.t("choose")
33820
+ }
33821
+ ),
33822
+ optionsObject && "no_create" in optionsObject && optionsObject?.no_create === false && /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
33823
+ "button",
33824
+ {
33825
+ type: "button",
33826
+ onClick: () => {
33827
+ if (typeof onAddNew === "function") {
33828
+ onAddNew();
33829
+ onClose();
33830
+ } else {
33831
+ handleCreateNewOnPage();
33832
+ }
33833
+ },
33834
+ className: "button-primary",
33835
+ children: instance.t("new")
33836
+ }
33837
+ ),
33838
+ /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
33839
+ "button",
33840
+ {
33841
+ type: "button",
33842
+ onClick: onClose,
33843
+ className: "button-secondary",
33844
+ children: instance.t("cancel_button")
33845
+ }
33846
+ )
33847
+ ] })
33848
+ ]
33831
33849
  }
33832
- )
33833
- ] })
33834
- ] }) })
33835
- ] }),
33850
+ ) })
33851
+ ]
33852
+ }
33853
+ ),
33836
33854
  document.body
33837
33855
  );
33838
33856
  };