@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/index.js +174 -156
- package/dist/index.mjs +174 -156
- package/dist/widgets.js +174 -156
- package/dist/widgets.mjs +174 -156
- package/package.json +1 -1
package/dist/widgets.mjs
CHANGED
|
@@ -33610,167 +33610,185 @@ var Many2ManyField = (props) => {
|
|
|
33610
33610
|
clearSearch
|
|
33611
33611
|
} = searchController;
|
|
33612
33612
|
return createPortal5(
|
|
33613
|
-
/* @__PURE__ */ jsxs71(
|
|
33614
|
-
|
|
33615
|
-
|
|
33616
|
-
|
|
33617
|
-
|
|
33618
|
-
|
|
33619
|
-
|
|
33620
|
-
|
|
33621
|
-
/* @__PURE__ */ jsx102("div", { className: "
|
|
33622
|
-
|
|
33623
|
-
|
|
33624
|
-
removeSearchItems,
|
|
33625
|
-
selectedTags,
|
|
33626
|
-
filterBy,
|
|
33627
|
-
setFilterBy,
|
|
33628
|
-
searchString,
|
|
33629
|
-
onSearchString,
|
|
33630
|
-
handleAddTagSearch,
|
|
33631
|
-
searchBy,
|
|
33632
|
-
groupBy,
|
|
33633
|
-
showFiltersGroups: true,
|
|
33634
|
-
setGroupBy,
|
|
33635
|
-
setDomainList: setDomain,
|
|
33636
|
-
setPage: (pages) => {
|
|
33637
|
-
setPage?.(pages);
|
|
33638
|
-
},
|
|
33639
|
-
fieldsList: [
|
|
33640
|
-
...columns?.filter(
|
|
33641
|
-
(col) => col?.field?.type_co === "field" && col?.optional !== "hide"
|
|
33642
|
-
)?.map((col) => ({ ...col.field })) ?? []
|
|
33643
|
-
],
|
|
33644
|
-
setSelectedRowKeys,
|
|
33645
|
-
viewData,
|
|
33646
|
-
context,
|
|
33647
|
-
selectedRowKeys,
|
|
33648
|
-
aid,
|
|
33649
|
-
domainSearch,
|
|
33650
|
-
evalJSONContext,
|
|
33651
|
-
clearSearch
|
|
33652
|
-
}
|
|
33653
|
-
) }),
|
|
33654
|
-
/* @__PURE__ */ jsx102(
|
|
33655
|
-
PaginationView,
|
|
33613
|
+
/* @__PURE__ */ jsxs71(
|
|
33614
|
+
"div",
|
|
33615
|
+
{
|
|
33616
|
+
style: {
|
|
33617
|
+
zIndex: 99999
|
|
33618
|
+
},
|
|
33619
|
+
className: "fixed bottom-0 left-0 right-0 top-0",
|
|
33620
|
+
children: [
|
|
33621
|
+
/* @__PURE__ */ jsx102("div", { className: "absolute inset-0 bg-[rgba(27,27,27,0.48)]" }),
|
|
33622
|
+
/* @__PURE__ */ jsx102("div", { className: "absolute inset-0 overflow-auto px-6 flex justify-center items-center", children: /* @__PURE__ */ jsxs71(
|
|
33623
|
+
"div",
|
|
33656
33624
|
{
|
|
33657
|
-
|
|
33658
|
-
|
|
33659
|
-
totalCount: totalRows ?? 0,
|
|
33660
|
-
pageSize: 10,
|
|
33661
|
-
onPageChange: (page2) => {
|
|
33662
|
-
if (typeof setPage === "function") {
|
|
33663
|
-
setPage(page2);
|
|
33664
|
-
}
|
|
33625
|
+
style: {
|
|
33626
|
+
zIndex: 1
|
|
33665
33627
|
},
|
|
33666
|
-
|
|
33667
|
-
|
|
33668
|
-
|
|
33669
|
-
|
|
33670
|
-
|
|
33671
|
-
|
|
33672
|
-
|
|
33673
|
-
|
|
33674
|
-
|
|
33675
|
-
|
|
33676
|
-
|
|
33677
|
-
|
|
33678
|
-
|
|
33679
|
-
|
|
33680
|
-
|
|
33681
|
-
|
|
33682
|
-
|
|
33683
|
-
|
|
33684
|
-
|
|
33685
|
-
|
|
33686
|
-
|
|
33687
|
-
|
|
33688
|
-
|
|
33689
|
-
|
|
33690
|
-
|
|
33691
|
-
|
|
33692
|
-
|
|
33693
|
-
|
|
33694
|
-
|
|
33695
|
-
|
|
33696
|
-
|
|
33697
|
-
|
|
33698
|
-
|
|
33699
|
-
|
|
33700
|
-
|
|
33701
|
-
|
|
33702
|
-
|
|
33703
|
-
|
|
33704
|
-
|
|
33705
|
-
|
|
33706
|
-
|
|
33707
|
-
|
|
33708
|
-
|
|
33709
|
-
|
|
33710
|
-
|
|
33711
|
-
|
|
33712
|
-
|
|
33713
|
-
|
|
33714
|
-
|
|
33715
|
-
|
|
33716
|
-
});
|
|
33717
|
-
}
|
|
33718
|
-
},
|
|
33719
|
-
onRemoveRow: null,
|
|
33720
|
-
onAddRow,
|
|
33721
|
-
onClickRow,
|
|
33722
|
-
typeTable,
|
|
33723
|
-
selectedRowKeysRef,
|
|
33724
|
-
selectedRowKeys,
|
|
33725
|
-
setSelectedRowKeys
|
|
33628
|
+
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",
|
|
33629
|
+
children: [
|
|
33630
|
+
/* @__PURE__ */ jsxs71("div", { className: "flex justify-between items-center border-b border-[rgba(0,0,0,0.1)] pb-2", children: [
|
|
33631
|
+
/* @__PURE__ */ jsx102("div", { className: "text-[20px] font-semibold", children: title }),
|
|
33632
|
+
/* @__PURE__ */ jsx102("button", { className: "cursor-pointer", onClick: onClose, children: /* @__PURE__ */ jsx102(CloseIcon, {}) })
|
|
33633
|
+
] }),
|
|
33634
|
+
/* @__PURE__ */ jsxs71("div", { className: "grid grid-cols-3 gap-2 items-center py-2", children: [
|
|
33635
|
+
/* @__PURE__ */ jsx102("div", { className: "col-span-3 sm:col-span-2 flex-1", children: /* @__PURE__ */ jsx102(
|
|
33636
|
+
Search,
|
|
33637
|
+
{
|
|
33638
|
+
removeSearchItems,
|
|
33639
|
+
selectedTags,
|
|
33640
|
+
filterBy,
|
|
33641
|
+
setFilterBy,
|
|
33642
|
+
searchString,
|
|
33643
|
+
onSearchString,
|
|
33644
|
+
handleAddTagSearch,
|
|
33645
|
+
searchBy,
|
|
33646
|
+
groupBy,
|
|
33647
|
+
showFiltersGroups: true,
|
|
33648
|
+
setGroupBy,
|
|
33649
|
+
setDomainList: setDomain,
|
|
33650
|
+
setPage: (pages) => {
|
|
33651
|
+
setPage?.(pages);
|
|
33652
|
+
},
|
|
33653
|
+
fieldsList: [
|
|
33654
|
+
...columns?.filter(
|
|
33655
|
+
(col) => col?.field?.type_co === "field" && col?.optional !== "hide"
|
|
33656
|
+
)?.map((col) => ({ ...col.field })) ?? []
|
|
33657
|
+
],
|
|
33658
|
+
setSelectedRowKeys,
|
|
33659
|
+
viewData,
|
|
33660
|
+
context,
|
|
33661
|
+
selectedRowKeys,
|
|
33662
|
+
aid,
|
|
33663
|
+
domainSearch,
|
|
33664
|
+
evalJSONContext,
|
|
33665
|
+
clearSearch
|
|
33666
|
+
}
|
|
33667
|
+
) }),
|
|
33668
|
+
/* @__PURE__ */ jsx102(
|
|
33669
|
+
PaginationView,
|
|
33670
|
+
{
|
|
33671
|
+
className: "pagination-bar col-span-3 sm:col-span-1 justify-end flex-1",
|
|
33672
|
+
currentPage: page,
|
|
33673
|
+
totalCount: totalRows ?? 0,
|
|
33674
|
+
pageSize: 10,
|
|
33675
|
+
onPageChange: (page2) => {
|
|
33676
|
+
if (typeof setPage === "function") {
|
|
33677
|
+
setPage(page2);
|
|
33726
33678
|
}
|
|
33727
|
-
|
|
33728
|
-
|
|
33679
|
+
},
|
|
33680
|
+
displayPageNumberDots: false,
|
|
33681
|
+
displayRowsNumberOption: false
|
|
33682
|
+
}
|
|
33683
|
+
)
|
|
33684
|
+
] }),
|
|
33685
|
+
!isDataLoading && isDataFetched || isPlaceholderData ? /* @__PURE__ */ jsx102("div", { className: "relative overflow-y-auto", children: /* @__PURE__ */ jsx102("div", { className: "relative h-full w-full", children: /* @__PURE__ */ jsx102(
|
|
33686
|
+
"div",
|
|
33687
|
+
{
|
|
33688
|
+
className: `border-[1px] h-full border-solid border-[#dbe0e6] rounded-[10px] relative w-full overflow-hidden`,
|
|
33689
|
+
children: /* @__PURE__ */ jsx102("div", { className: "flex flex-col gap-[16px] w-full h-full", children: /* @__PURE__ */ jsx102("div", { className: `relative w-full h-full`, children: /* @__PURE__ */ jsx102(
|
|
33690
|
+
"div",
|
|
33691
|
+
{
|
|
33692
|
+
className: `flex w-full items-center h-full overflow-auto `,
|
|
33693
|
+
children: /* @__PURE__ */ jsx102("div", { className: "w-full h-full max-w-full", children: /* @__PURE__ */ jsxs71(
|
|
33694
|
+
"table",
|
|
33695
|
+
{
|
|
33696
|
+
className: `relative w-full bg-white custom-dropdown `,
|
|
33697
|
+
children: [
|
|
33698
|
+
/* @__PURE__ */ jsx102(
|
|
33699
|
+
TableHead,
|
|
33700
|
+
{
|
|
33701
|
+
columns,
|
|
33702
|
+
onToggleColumnOptional,
|
|
33703
|
+
isDisplayCheckbox,
|
|
33704
|
+
checkedAll,
|
|
33705
|
+
handleCheckBoxAll
|
|
33706
|
+
}
|
|
33707
|
+
),
|
|
33708
|
+
/* @__PURE__ */ jsx102(
|
|
33709
|
+
TableBody,
|
|
33710
|
+
{
|
|
33711
|
+
columns,
|
|
33712
|
+
rows,
|
|
33713
|
+
rootField,
|
|
33714
|
+
isDisplayCheckbox,
|
|
33715
|
+
model: relation,
|
|
33716
|
+
renderField: ({
|
|
33717
|
+
row,
|
|
33718
|
+
col,
|
|
33719
|
+
indexRow,
|
|
33720
|
+
onChangeData,
|
|
33721
|
+
rootField: rootField2
|
|
33722
|
+
}) => {
|
|
33723
|
+
if (typeof renderField === "function") {
|
|
33724
|
+
return renderField({
|
|
33725
|
+
row,
|
|
33726
|
+
col,
|
|
33727
|
+
indexRow,
|
|
33728
|
+
onChangeData,
|
|
33729
|
+
rootField: rootField2
|
|
33730
|
+
});
|
|
33731
|
+
}
|
|
33732
|
+
},
|
|
33733
|
+
onRemoveRow: null,
|
|
33734
|
+
onAddRow,
|
|
33735
|
+
onClickRow,
|
|
33736
|
+
typeTable,
|
|
33737
|
+
selectedRowKeysRef,
|
|
33738
|
+
selectedRowKeys,
|
|
33739
|
+
setSelectedRowKeys
|
|
33740
|
+
}
|
|
33741
|
+
)
|
|
33742
|
+
]
|
|
33743
|
+
}
|
|
33744
|
+
) })
|
|
33745
|
+
}
|
|
33746
|
+
) }) })
|
|
33729
33747
|
}
|
|
33730
|
-
) })
|
|
33731
|
-
|
|
33732
|
-
|
|
33733
|
-
|
|
33734
|
-
|
|
33735
|
-
|
|
33736
|
-
|
|
33737
|
-
|
|
33738
|
-
|
|
33739
|
-
|
|
33740
|
-
|
|
33741
|
-
|
|
33742
|
-
|
|
33743
|
-
|
|
33744
|
-
|
|
33745
|
-
|
|
33746
|
-
|
|
33747
|
-
|
|
33748
|
-
|
|
33749
|
-
|
|
33750
|
-
|
|
33751
|
-
|
|
33752
|
-
|
|
33753
|
-
|
|
33754
|
-
|
|
33755
|
-
|
|
33756
|
-
|
|
33757
|
-
|
|
33758
|
-
|
|
33759
|
-
|
|
33760
|
-
|
|
33761
|
-
|
|
33762
|
-
|
|
33763
|
-
|
|
33764
|
-
|
|
33765
|
-
|
|
33766
|
-
|
|
33767
|
-
|
|
33768
|
-
|
|
33748
|
+
) }) }) : /* @__PURE__ */ jsx102(LayerLoading, {}),
|
|
33749
|
+
/* @__PURE__ */ jsxs71("div", { className: "flex items-center gap-2 mt-auto", children: [
|
|
33750
|
+
isDisplayCheckbox && /* @__PURE__ */ jsx102(
|
|
33751
|
+
"button",
|
|
33752
|
+
{
|
|
33753
|
+
disabled: selectedRowKeys?.length === 0,
|
|
33754
|
+
type: "button",
|
|
33755
|
+
onClick: () => onChoose(selectedRowKeys),
|
|
33756
|
+
className: "button-primary",
|
|
33757
|
+
children: instance.t("choose")
|
|
33758
|
+
}
|
|
33759
|
+
),
|
|
33760
|
+
optionsObject && "no_create" in optionsObject && optionsObject?.no_create === false && /* @__PURE__ */ jsx102(
|
|
33761
|
+
"button",
|
|
33762
|
+
{
|
|
33763
|
+
type: "button",
|
|
33764
|
+
onClick: () => {
|
|
33765
|
+
if (typeof onAddNew === "function") {
|
|
33766
|
+
onAddNew();
|
|
33767
|
+
onClose();
|
|
33768
|
+
} else {
|
|
33769
|
+
handleCreateNewOnPage();
|
|
33770
|
+
}
|
|
33771
|
+
},
|
|
33772
|
+
className: "button-primary",
|
|
33773
|
+
children: instance.t("new")
|
|
33774
|
+
}
|
|
33775
|
+
),
|
|
33776
|
+
/* @__PURE__ */ jsx102(
|
|
33777
|
+
"button",
|
|
33778
|
+
{
|
|
33779
|
+
type: "button",
|
|
33780
|
+
onClick: onClose,
|
|
33781
|
+
className: "button-secondary",
|
|
33782
|
+
children: instance.t("cancel_button")
|
|
33783
|
+
}
|
|
33784
|
+
)
|
|
33785
|
+
] })
|
|
33786
|
+
]
|
|
33769
33787
|
}
|
|
33770
|
-
)
|
|
33771
|
-
]
|
|
33772
|
-
|
|
33773
|
-
|
|
33788
|
+
) })
|
|
33789
|
+
]
|
|
33790
|
+
}
|
|
33791
|
+
),
|
|
33774
33792
|
document.body
|
|
33775
33793
|
);
|
|
33776
33794
|
};
|