@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/index.js +166 -157
- package/dist/index.mjs +166 -157
- package/dist/widgets.js +166 -157
- package/dist/widgets.mjs +166 -157
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -33908,176 +33908,185 @@ var Many2ManyField = (props) => {
|
|
|
33908
33908
|
clearSearch
|
|
33909
33909
|
} = searchController;
|
|
33910
33910
|
return createPortal5(
|
|
33911
|
-
/* @__PURE__ */ jsxs71(
|
|
33912
|
-
|
|
33913
|
-
|
|
33914
|
-
|
|
33915
|
-
|
|
33916
|
-
|
|
33917
|
-
|
|
33918
|
-
|
|
33919
|
-
|
|
33920
|
-
children:
|
|
33921
|
-
|
|
33922
|
-
|
|
33923
|
-
|
|
33924
|
-
|
|
33925
|
-
|
|
33926
|
-
|
|
33927
|
-
|
|
33928
|
-
{
|
|
33929
|
-
|
|
33930
|
-
|
|
33931
|
-
|
|
33932
|
-
|
|
33933
|
-
|
|
33934
|
-
|
|
33935
|
-
|
|
33936
|
-
|
|
33937
|
-
|
|
33938
|
-
|
|
33939
|
-
|
|
33940
|
-
|
|
33941
|
-
|
|
33942
|
-
|
|
33943
|
-
|
|
33944
|
-
|
|
33945
|
-
|
|
33946
|
-
|
|
33947
|
-
|
|
33948
|
-
|
|
33949
|
-
|
|
33950
|
-
|
|
33951
|
-
|
|
33952
|
-
|
|
33953
|
-
|
|
33954
|
-
|
|
33955
|
-
|
|
33956
|
-
|
|
33957
|
-
|
|
33958
|
-
|
|
33959
|
-
|
|
33960
|
-
|
|
33961
|
-
|
|
33962
|
-
|
|
33963
|
-
|
|
33964
|
-
totalCount: totalRows ?? 0,
|
|
33965
|
-
pageSize: 10,
|
|
33966
|
-
onPageChange: (page2) => {
|
|
33967
|
-
if (typeof setPage === "function") {
|
|
33968
|
-
setPage(page2);
|
|
33911
|
+
/* @__PURE__ */ jsxs71(
|
|
33912
|
+
"div",
|
|
33913
|
+
{
|
|
33914
|
+
style: {
|
|
33915
|
+
zIndex: 99999
|
|
33916
|
+
},
|
|
33917
|
+
className: "fixed bottom-0 left-0 right-0 top-0",
|
|
33918
|
+
children: [
|
|
33919
|
+
/* @__PURE__ */ jsx102("div", { className: "absolute inset-0 bg-[rgba(27,27,27,0.48)]" }),
|
|
33920
|
+
/* @__PURE__ */ jsx102("div", { className: "absolute inset-0 overflow-auto px-6 flex justify-center items-center", children: /* @__PURE__ */ jsxs71(
|
|
33921
|
+
"div",
|
|
33922
|
+
{
|
|
33923
|
+
style: {
|
|
33924
|
+
zIndex: 1
|
|
33925
|
+
},
|
|
33926
|
+
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",
|
|
33927
|
+
children: [
|
|
33928
|
+
/* @__PURE__ */ jsxs71("div", { className: "flex justify-between items-center border-b border-[rgba(0,0,0,0.1)] pb-2", children: [
|
|
33929
|
+
/* @__PURE__ */ jsx102("div", { className: "text-[20px] font-semibold", children: title }),
|
|
33930
|
+
/* @__PURE__ */ jsx102("button", { className: "cursor-pointer", onClick: onClose, children: /* @__PURE__ */ jsx102(CloseIcon, {}) })
|
|
33931
|
+
] }),
|
|
33932
|
+
/* @__PURE__ */ jsxs71("div", { className: "grid grid-cols-3 gap-2 items-center py-2", children: [
|
|
33933
|
+
/* @__PURE__ */ jsx102("div", { className: "col-span-3 sm:col-span-2 flex-1", children: /* @__PURE__ */ jsx102(
|
|
33934
|
+
Search,
|
|
33935
|
+
{
|
|
33936
|
+
removeSearchItems,
|
|
33937
|
+
selectedTags,
|
|
33938
|
+
filterBy,
|
|
33939
|
+
setFilterBy,
|
|
33940
|
+
searchString,
|
|
33941
|
+
onSearchString,
|
|
33942
|
+
handleAddTagSearch,
|
|
33943
|
+
searchBy,
|
|
33944
|
+
groupBy,
|
|
33945
|
+
showFiltersGroups: true,
|
|
33946
|
+
setGroupBy,
|
|
33947
|
+
setDomainList: setDomain,
|
|
33948
|
+
setPage: (pages) => {
|
|
33949
|
+
setPage?.(pages);
|
|
33950
|
+
},
|
|
33951
|
+
fieldsList: [
|
|
33952
|
+
...columns?.filter(
|
|
33953
|
+
(col) => col?.field?.type_co === "field" && col?.optional !== "hide"
|
|
33954
|
+
)?.map((col) => ({ ...col.field })) ?? []
|
|
33955
|
+
],
|
|
33956
|
+
setSelectedRowKeys,
|
|
33957
|
+
viewData,
|
|
33958
|
+
context,
|
|
33959
|
+
selectedRowKeys,
|
|
33960
|
+
aid,
|
|
33961
|
+
domainSearch,
|
|
33962
|
+
evalJSONContext,
|
|
33963
|
+
clearSearch
|
|
33969
33964
|
}
|
|
33970
|
-
},
|
|
33971
|
-
|
|
33972
|
-
|
|
33973
|
-
|
|
33974
|
-
|
|
33975
|
-
|
|
33976
|
-
|
|
33977
|
-
|
|
33978
|
-
|
|
33979
|
-
|
|
33980
|
-
|
|
33965
|
+
) }),
|
|
33966
|
+
/* @__PURE__ */ jsx102(
|
|
33967
|
+
PaginationView,
|
|
33968
|
+
{
|
|
33969
|
+
className: "pagination-bar col-span-3 sm:col-span-1 justify-end flex-1",
|
|
33970
|
+
currentPage: page,
|
|
33971
|
+
totalCount: totalRows ?? 0,
|
|
33972
|
+
pageSize: 10,
|
|
33973
|
+
onPageChange: (page2) => {
|
|
33974
|
+
if (typeof setPage === "function") {
|
|
33975
|
+
setPage(page2);
|
|
33976
|
+
}
|
|
33977
|
+
},
|
|
33978
|
+
displayPageNumberDots: false,
|
|
33979
|
+
displayRowsNumberOption: false
|
|
33980
|
+
}
|
|
33981
|
+
)
|
|
33982
|
+
] }),
|
|
33983
|
+
!isDataLoading && isDataFetched || isPlaceholderData ? /* @__PURE__ */ jsx102("div", { className: "relative overflow-y-auto", children: /* @__PURE__ */ jsx102("div", { className: "relative h-full w-full", children: /* @__PURE__ */ jsx102(
|
|
33981
33984
|
"div",
|
|
33982
33985
|
{
|
|
33983
|
-
className: `
|
|
33984
|
-
children: /* @__PURE__ */ jsx102("div", { className: "w-full h-full
|
|
33985
|
-
"
|
|
33986
|
+
className: `border-[1px] h-full border-solid border-[#dbe0e6] rounded-[10px] relative w-full overflow-hidden`,
|
|
33987
|
+
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(
|
|
33988
|
+
"div",
|
|
33986
33989
|
{
|
|
33987
|
-
className: `
|
|
33988
|
-
children:
|
|
33989
|
-
|
|
33990
|
-
|
|
33991
|
-
|
|
33992
|
-
|
|
33993
|
-
|
|
33994
|
-
|
|
33995
|
-
|
|
33996
|
-
|
|
33997
|
-
|
|
33998
|
-
|
|
33999
|
-
|
|
34000
|
-
|
|
34001
|
-
|
|
34002
|
-
|
|
34003
|
-
|
|
34004
|
-
|
|
34005
|
-
|
|
34006
|
-
|
|
34007
|
-
|
|
34008
|
-
|
|
34009
|
-
|
|
34010
|
-
|
|
34011
|
-
|
|
34012
|
-
rootField: rootField2
|
|
34013
|
-
}) => {
|
|
34014
|
-
if (typeof renderField === "function") {
|
|
34015
|
-
return renderField({
|
|
33990
|
+
className: `flex w-full items-center h-full overflow-auto `,
|
|
33991
|
+
children: /* @__PURE__ */ jsx102("div", { className: "w-full h-full max-w-full", children: /* @__PURE__ */ jsxs71(
|
|
33992
|
+
"table",
|
|
33993
|
+
{
|
|
33994
|
+
className: `relative w-full bg-white custom-dropdown `,
|
|
33995
|
+
children: [
|
|
33996
|
+
/* @__PURE__ */ jsx102(
|
|
33997
|
+
TableHead,
|
|
33998
|
+
{
|
|
33999
|
+
columns,
|
|
34000
|
+
onToggleColumnOptional,
|
|
34001
|
+
isDisplayCheckbox,
|
|
34002
|
+
checkedAll,
|
|
34003
|
+
handleCheckBoxAll
|
|
34004
|
+
}
|
|
34005
|
+
),
|
|
34006
|
+
/* @__PURE__ */ jsx102(
|
|
34007
|
+
TableBody,
|
|
34008
|
+
{
|
|
34009
|
+
columns,
|
|
34010
|
+
rows,
|
|
34011
|
+
rootField,
|
|
34012
|
+
isDisplayCheckbox,
|
|
34013
|
+
model: relation,
|
|
34014
|
+
renderField: ({
|
|
34016
34015
|
row,
|
|
34017
34016
|
col,
|
|
34018
34017
|
indexRow,
|
|
34019
34018
|
onChangeData,
|
|
34020
34019
|
rootField: rootField2
|
|
34021
|
-
})
|
|
34020
|
+
}) => {
|
|
34021
|
+
if (typeof renderField === "function") {
|
|
34022
|
+
return renderField({
|
|
34023
|
+
row,
|
|
34024
|
+
col,
|
|
34025
|
+
indexRow,
|
|
34026
|
+
onChangeData,
|
|
34027
|
+
rootField: rootField2
|
|
34028
|
+
});
|
|
34029
|
+
}
|
|
34030
|
+
},
|
|
34031
|
+
onRemoveRow: null,
|
|
34032
|
+
onAddRow,
|
|
34033
|
+
onClickRow,
|
|
34034
|
+
typeTable,
|
|
34035
|
+
selectedRowKeysRef,
|
|
34036
|
+
selectedRowKeys,
|
|
34037
|
+
setSelectedRowKeys
|
|
34022
34038
|
}
|
|
34023
|
-
|
|
34024
|
-
|
|
34025
|
-
|
|
34026
|
-
|
|
34027
|
-
typeTable,
|
|
34028
|
-
selectedRowKeysRef,
|
|
34029
|
-
selectedRowKeys,
|
|
34030
|
-
setSelectedRowKeys
|
|
34031
|
-
}
|
|
34032
|
-
)
|
|
34033
|
-
]
|
|
34039
|
+
)
|
|
34040
|
+
]
|
|
34041
|
+
}
|
|
34042
|
+
) })
|
|
34034
34043
|
}
|
|
34035
|
-
) })
|
|
34044
|
+
) }) })
|
|
34036
34045
|
}
|
|
34037
|
-
) }) })
|
|
34038
|
-
|
|
34039
|
-
|
|
34040
|
-
|
|
34041
|
-
|
|
34042
|
-
|
|
34043
|
-
|
|
34044
|
-
|
|
34045
|
-
|
|
34046
|
-
|
|
34047
|
-
className: "button-primary",
|
|
34048
|
-
children: instance.t("choose")
|
|
34049
|
-
}
|
|
34050
|
-
),
|
|
34051
|
-
optionsObject && "no_create" in optionsObject && optionsObject?.no_create === false && /* @__PURE__ */ jsx102(
|
|
34052
|
-
"button",
|
|
34053
|
-
{
|
|
34054
|
-
type: "button",
|
|
34055
|
-
onClick: () => {
|
|
34056
|
-
if (typeof onAddNew === "function") {
|
|
34057
|
-
onAddNew();
|
|
34058
|
-
onClose();
|
|
34059
|
-
} else {
|
|
34060
|
-
handleCreateNewOnPage();
|
|
34046
|
+
) }) }) : /* @__PURE__ */ jsx102(LayerLoading, {}),
|
|
34047
|
+
/* @__PURE__ */ jsxs71("div", { className: "flex items-center gap-2 mt-auto", children: [
|
|
34048
|
+
isDisplayCheckbox && /* @__PURE__ */ jsx102(
|
|
34049
|
+
"button",
|
|
34050
|
+
{
|
|
34051
|
+
disabled: selectedRowKeys?.length === 0,
|
|
34052
|
+
type: "button",
|
|
34053
|
+
onClick: () => onChoose(selectedRowKeys),
|
|
34054
|
+
className: "button-primary",
|
|
34055
|
+
children: instance.t("choose")
|
|
34061
34056
|
}
|
|
34062
|
-
|
|
34063
|
-
|
|
34064
|
-
|
|
34065
|
-
|
|
34066
|
-
|
|
34067
|
-
|
|
34068
|
-
|
|
34069
|
-
|
|
34070
|
-
|
|
34071
|
-
|
|
34072
|
-
|
|
34073
|
-
|
|
34074
|
-
|
|
34075
|
-
|
|
34076
|
-
|
|
34077
|
-
|
|
34078
|
-
|
|
34079
|
-
|
|
34080
|
-
|
|
34057
|
+
),
|
|
34058
|
+
optionsObject && "no_create" in optionsObject && optionsObject?.no_create === false && /* @__PURE__ */ jsx102(
|
|
34059
|
+
"button",
|
|
34060
|
+
{
|
|
34061
|
+
type: "button",
|
|
34062
|
+
onClick: () => {
|
|
34063
|
+
if (typeof onAddNew === "function") {
|
|
34064
|
+
onAddNew();
|
|
34065
|
+
onClose();
|
|
34066
|
+
} else {
|
|
34067
|
+
handleCreateNewOnPage();
|
|
34068
|
+
}
|
|
34069
|
+
},
|
|
34070
|
+
className: "button-primary",
|
|
34071
|
+
children: instance.t("new")
|
|
34072
|
+
}
|
|
34073
|
+
),
|
|
34074
|
+
/* @__PURE__ */ jsx102(
|
|
34075
|
+
"button",
|
|
34076
|
+
{
|
|
34077
|
+
type: "button",
|
|
34078
|
+
onClick: onClose,
|
|
34079
|
+
className: "button-secondary",
|
|
34080
|
+
children: instance.t("cancel_button")
|
|
34081
|
+
}
|
|
34082
|
+
)
|
|
34083
|
+
] })
|
|
34084
|
+
]
|
|
34085
|
+
}
|
|
34086
|
+
) })
|
|
34087
|
+
]
|
|
34088
|
+
}
|
|
34089
|
+
),
|
|
34081
34090
|
document.body
|
|
34082
34091
|
);
|
|
34083
34092
|
};
|