@fctc/sme-widget-ui 1.1.1 → 1.1.2

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
@@ -33674,164 +33674,173 @@ var Many2ManyField = (props) => {
33674
33674
  return (0, import_react_dom8.createPortal)(
33675
33675
  /* @__PURE__ */ (0, import_jsx_runtime100.jsxs)("div", { className: "fixed bottom-0 left-0 right-0 top-0 z-[9999]", children: [
33676
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,
33718
- {
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);
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
33726
33721
  }
33727
- },
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)(
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);
33733
+ }
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)(
33738
33741
  "div",
33739
33742
  {
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
+ 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)(
33745
+ "div",
33743
33746
  {
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({
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
+ {
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: ({
33773
33772
  row,
33774
33773
  col,
33775
33774
  indexRow,
33776
33775
  onChangeData,
33777
33776
  rootField: rootField2
33778
- });
33777
+ }) => {
33778
+ if (typeof renderField === "function") {
33779
+ return renderField({
33780
+ row,
33781
+ col,
33782
+ indexRow,
33783
+ onChangeData,
33784
+ rootField: rootField2
33785
+ });
33786
+ }
33787
+ },
33788
+ onRemoveRow: null,
33789
+ onAddRow,
33790
+ onClickRow,
33791
+ typeTable,
33792
+ selectedRowKeysRef,
33793
+ selectedRowKeys,
33794
+ setSelectedRowKeys
33779
33795
  }
33780
- },
33781
- onRemoveRow: null,
33782
- onAddRow,
33783
- onClickRow,
33784
- typeTable,
33785
- selectedRowKeysRef,
33786
- selectedRowKeys,
33787
- setSelectedRowKeys
33788
- }
33789
- )
33790
- ]
33796
+ )
33797
+ ]
33798
+ }
33799
+ ) })
33791
33800
  }
33792
- ) })
33801
+ ) }) })
33793
33802
  }
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();
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")
33818
33813
  }
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")
33831
- }
33832
- )
33833
- ] })
33834
- ] }) })
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();
33825
+ }
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
+ ) })
33835
33844
  ] }),
33836
33845
  document.body
33837
33846
  );