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