@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.js
CHANGED
|
@@ -34027,176 +34027,185 @@ var Many2ManyField = (props) => {
|
|
|
34027
34027
|
clearSearch
|
|
34028
34028
|
} = searchController;
|
|
34029
34029
|
return (0, import_react_dom8.createPortal)(
|
|
34030
|
-
/* @__PURE__ */ (0, import_jsx_runtime100.jsxs)(
|
|
34031
|
-
|
|
34032
|
-
|
|
34033
|
-
|
|
34034
|
-
|
|
34035
|
-
|
|
34036
|
-
|
|
34037
|
-
|
|
34038
|
-
|
|
34039
|
-
children:
|
|
34040
|
-
|
|
34041
|
-
|
|
34042
|
-
|
|
34043
|
-
|
|
34044
|
-
|
|
34045
|
-
|
|
34046
|
-
|
|
34047
|
-
{
|
|
34048
|
-
|
|
34049
|
-
|
|
34050
|
-
|
|
34051
|
-
|
|
34052
|
-
|
|
34053
|
-
|
|
34054
|
-
|
|
34055
|
-
|
|
34056
|
-
|
|
34057
|
-
|
|
34058
|
-
|
|
34059
|
-
|
|
34060
|
-
|
|
34061
|
-
|
|
34062
|
-
|
|
34063
|
-
|
|
34064
|
-
|
|
34065
|
-
|
|
34066
|
-
|
|
34067
|
-
|
|
34068
|
-
|
|
34069
|
-
|
|
34070
|
-
|
|
34071
|
-
|
|
34072
|
-
|
|
34073
|
-
|
|
34074
|
-
|
|
34075
|
-
|
|
34076
|
-
|
|
34077
|
-
|
|
34078
|
-
|
|
34079
|
-
|
|
34080
|
-
|
|
34081
|
-
|
|
34082
|
-
|
|
34083
|
-
totalCount: totalRows ?? 0,
|
|
34084
|
-
pageSize: 10,
|
|
34085
|
-
onPageChange: (page2) => {
|
|
34086
|
-
if (typeof setPage === "function") {
|
|
34087
|
-
setPage(page2);
|
|
34030
|
+
/* @__PURE__ */ (0, import_jsx_runtime100.jsxs)(
|
|
34031
|
+
"div",
|
|
34032
|
+
{
|
|
34033
|
+
style: {
|
|
34034
|
+
zIndex: 99999
|
|
34035
|
+
},
|
|
34036
|
+
className: "fixed bottom-0 left-0 right-0 top-0",
|
|
34037
|
+
children: [
|
|
34038
|
+
/* @__PURE__ */ (0, import_jsx_runtime100.jsx)("div", { className: "absolute inset-0 bg-[rgba(27,27,27,0.48)]" }),
|
|
34039
|
+
/* @__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)(
|
|
34040
|
+
"div",
|
|
34041
|
+
{
|
|
34042
|
+
style: {
|
|
34043
|
+
zIndex: 1
|
|
34044
|
+
},
|
|
34045
|
+
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",
|
|
34046
|
+
children: [
|
|
34047
|
+
/* @__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: [
|
|
34048
|
+
/* @__PURE__ */ (0, import_jsx_runtime100.jsx)("div", { className: "text-[20px] font-semibold", children: title }),
|
|
34049
|
+
/* @__PURE__ */ (0, import_jsx_runtime100.jsx)("button", { className: "cursor-pointer", onClick: onClose, children: /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(CloseIcon, {}) })
|
|
34050
|
+
] }),
|
|
34051
|
+
/* @__PURE__ */ (0, import_jsx_runtime100.jsxs)("div", { className: "grid grid-cols-3 gap-2 items-center py-2", children: [
|
|
34052
|
+
/* @__PURE__ */ (0, import_jsx_runtime100.jsx)("div", { className: "col-span-3 sm:col-span-2 flex-1", children: /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
|
|
34053
|
+
Search,
|
|
34054
|
+
{
|
|
34055
|
+
removeSearchItems,
|
|
34056
|
+
selectedTags,
|
|
34057
|
+
filterBy,
|
|
34058
|
+
setFilterBy,
|
|
34059
|
+
searchString,
|
|
34060
|
+
onSearchString,
|
|
34061
|
+
handleAddTagSearch,
|
|
34062
|
+
searchBy,
|
|
34063
|
+
groupBy,
|
|
34064
|
+
showFiltersGroups: true,
|
|
34065
|
+
setGroupBy,
|
|
34066
|
+
setDomainList: setDomain,
|
|
34067
|
+
setPage: (pages) => {
|
|
34068
|
+
setPage?.(pages);
|
|
34069
|
+
},
|
|
34070
|
+
fieldsList: [
|
|
34071
|
+
...columns?.filter(
|
|
34072
|
+
(col) => col?.field?.type_co === "field" && col?.optional !== "hide"
|
|
34073
|
+
)?.map((col) => ({ ...col.field })) ?? []
|
|
34074
|
+
],
|
|
34075
|
+
setSelectedRowKeys,
|
|
34076
|
+
viewData,
|
|
34077
|
+
context,
|
|
34078
|
+
selectedRowKeys,
|
|
34079
|
+
aid,
|
|
34080
|
+
domainSearch,
|
|
34081
|
+
evalJSONContext,
|
|
34082
|
+
clearSearch
|
|
34088
34083
|
}
|
|
34089
|
-
},
|
|
34090
|
-
|
|
34091
|
-
|
|
34092
|
-
|
|
34093
|
-
|
|
34094
|
-
|
|
34095
|
-
|
|
34096
|
-
|
|
34097
|
-
|
|
34098
|
-
|
|
34099
|
-
|
|
34084
|
+
) }),
|
|
34085
|
+
/* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
|
|
34086
|
+
PaginationView,
|
|
34087
|
+
{
|
|
34088
|
+
className: "pagination-bar col-span-3 sm:col-span-1 justify-end flex-1",
|
|
34089
|
+
currentPage: page,
|
|
34090
|
+
totalCount: totalRows ?? 0,
|
|
34091
|
+
pageSize: 10,
|
|
34092
|
+
onPageChange: (page2) => {
|
|
34093
|
+
if (typeof setPage === "function") {
|
|
34094
|
+
setPage(page2);
|
|
34095
|
+
}
|
|
34096
|
+
},
|
|
34097
|
+
displayPageNumberDots: false,
|
|
34098
|
+
displayRowsNumberOption: false
|
|
34099
|
+
}
|
|
34100
|
+
)
|
|
34101
|
+
] }),
|
|
34102
|
+
!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)(
|
|
34100
34103
|
"div",
|
|
34101
34104
|
{
|
|
34102
|
-
className: `
|
|
34103
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime100.jsx)("div", { className: "w-full h-full
|
|
34104
|
-
"
|
|
34105
|
+
className: `border-[1px] h-full border-solid border-[#dbe0e6] rounded-[10px] relative w-full overflow-hidden`,
|
|
34106
|
+
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)(
|
|
34107
|
+
"div",
|
|
34105
34108
|
{
|
|
34106
|
-
className: `
|
|
34107
|
-
children:
|
|
34108
|
-
|
|
34109
|
-
|
|
34110
|
-
|
|
34111
|
-
|
|
34112
|
-
|
|
34113
|
-
|
|
34114
|
-
|
|
34115
|
-
|
|
34116
|
-
|
|
34117
|
-
|
|
34118
|
-
|
|
34119
|
-
|
|
34120
|
-
|
|
34121
|
-
|
|
34122
|
-
|
|
34123
|
-
|
|
34124
|
-
|
|
34125
|
-
|
|
34126
|
-
|
|
34127
|
-
|
|
34128
|
-
|
|
34129
|
-
|
|
34130
|
-
|
|
34131
|
-
rootField: rootField2
|
|
34132
|
-
}) => {
|
|
34133
|
-
if (typeof renderField === "function") {
|
|
34134
|
-
return renderField({
|
|
34109
|
+
className: `flex w-full items-center h-full overflow-auto `,
|
|
34110
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime100.jsx)("div", { className: "w-full h-full max-w-full", children: /* @__PURE__ */ (0, import_jsx_runtime100.jsxs)(
|
|
34111
|
+
"table",
|
|
34112
|
+
{
|
|
34113
|
+
className: `relative w-full bg-white custom-dropdown `,
|
|
34114
|
+
children: [
|
|
34115
|
+
/* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
|
|
34116
|
+
TableHead,
|
|
34117
|
+
{
|
|
34118
|
+
columns,
|
|
34119
|
+
onToggleColumnOptional,
|
|
34120
|
+
isDisplayCheckbox,
|
|
34121
|
+
checkedAll,
|
|
34122
|
+
handleCheckBoxAll
|
|
34123
|
+
}
|
|
34124
|
+
),
|
|
34125
|
+
/* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
|
|
34126
|
+
TableBody,
|
|
34127
|
+
{
|
|
34128
|
+
columns,
|
|
34129
|
+
rows,
|
|
34130
|
+
rootField,
|
|
34131
|
+
isDisplayCheckbox,
|
|
34132
|
+
model: relation,
|
|
34133
|
+
renderField: ({
|
|
34135
34134
|
row,
|
|
34136
34135
|
col,
|
|
34137
34136
|
indexRow,
|
|
34138
34137
|
onChangeData,
|
|
34139
34138
|
rootField: rootField2
|
|
34140
|
-
})
|
|
34139
|
+
}) => {
|
|
34140
|
+
if (typeof renderField === "function") {
|
|
34141
|
+
return renderField({
|
|
34142
|
+
row,
|
|
34143
|
+
col,
|
|
34144
|
+
indexRow,
|
|
34145
|
+
onChangeData,
|
|
34146
|
+
rootField: rootField2
|
|
34147
|
+
});
|
|
34148
|
+
}
|
|
34149
|
+
},
|
|
34150
|
+
onRemoveRow: null,
|
|
34151
|
+
onAddRow,
|
|
34152
|
+
onClickRow,
|
|
34153
|
+
typeTable,
|
|
34154
|
+
selectedRowKeysRef,
|
|
34155
|
+
selectedRowKeys,
|
|
34156
|
+
setSelectedRowKeys
|
|
34141
34157
|
}
|
|
34142
|
-
|
|
34143
|
-
|
|
34144
|
-
|
|
34145
|
-
|
|
34146
|
-
typeTable,
|
|
34147
|
-
selectedRowKeysRef,
|
|
34148
|
-
selectedRowKeys,
|
|
34149
|
-
setSelectedRowKeys
|
|
34150
|
-
}
|
|
34151
|
-
)
|
|
34152
|
-
]
|
|
34158
|
+
)
|
|
34159
|
+
]
|
|
34160
|
+
}
|
|
34161
|
+
) })
|
|
34153
34162
|
}
|
|
34154
|
-
) })
|
|
34163
|
+
) }) })
|
|
34155
34164
|
}
|
|
34156
|
-
) }) })
|
|
34157
|
-
|
|
34158
|
-
|
|
34159
|
-
|
|
34160
|
-
|
|
34161
|
-
|
|
34162
|
-
|
|
34163
|
-
|
|
34164
|
-
|
|
34165
|
-
|
|
34166
|
-
className: "button-primary",
|
|
34167
|
-
children: instance.t("choose")
|
|
34168
|
-
}
|
|
34169
|
-
),
|
|
34170
|
-
optionsObject && "no_create" in optionsObject && optionsObject?.no_create === false && /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
|
|
34171
|
-
"button",
|
|
34172
|
-
{
|
|
34173
|
-
type: "button",
|
|
34174
|
-
onClick: () => {
|
|
34175
|
-
if (typeof onAddNew === "function") {
|
|
34176
|
-
onAddNew();
|
|
34177
|
-
onClose();
|
|
34178
|
-
} else {
|
|
34179
|
-
handleCreateNewOnPage();
|
|
34165
|
+
) }) }) : /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(LayerLoading, {}),
|
|
34166
|
+
/* @__PURE__ */ (0, import_jsx_runtime100.jsxs)("div", { className: "flex items-center gap-2 mt-auto", children: [
|
|
34167
|
+
isDisplayCheckbox && /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
|
|
34168
|
+
"button",
|
|
34169
|
+
{
|
|
34170
|
+
disabled: selectedRowKeys?.length === 0,
|
|
34171
|
+
type: "button",
|
|
34172
|
+
onClick: () => onChoose(selectedRowKeys),
|
|
34173
|
+
className: "button-primary",
|
|
34174
|
+
children: instance.t("choose")
|
|
34180
34175
|
}
|
|
34181
|
-
|
|
34182
|
-
|
|
34183
|
-
|
|
34184
|
-
|
|
34185
|
-
|
|
34186
|
-
|
|
34187
|
-
|
|
34188
|
-
|
|
34189
|
-
|
|
34190
|
-
|
|
34191
|
-
|
|
34192
|
-
|
|
34193
|
-
|
|
34194
|
-
|
|
34195
|
-
|
|
34196
|
-
|
|
34197
|
-
|
|
34198
|
-
|
|
34199
|
-
|
|
34176
|
+
),
|
|
34177
|
+
optionsObject && "no_create" in optionsObject && optionsObject?.no_create === false && /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
|
|
34178
|
+
"button",
|
|
34179
|
+
{
|
|
34180
|
+
type: "button",
|
|
34181
|
+
onClick: () => {
|
|
34182
|
+
if (typeof onAddNew === "function") {
|
|
34183
|
+
onAddNew();
|
|
34184
|
+
onClose();
|
|
34185
|
+
} else {
|
|
34186
|
+
handleCreateNewOnPage();
|
|
34187
|
+
}
|
|
34188
|
+
},
|
|
34189
|
+
className: "button-primary",
|
|
34190
|
+
children: instance.t("new")
|
|
34191
|
+
}
|
|
34192
|
+
),
|
|
34193
|
+
/* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
|
|
34194
|
+
"button",
|
|
34195
|
+
{
|
|
34196
|
+
type: "button",
|
|
34197
|
+
onClick: onClose,
|
|
34198
|
+
className: "button-secondary",
|
|
34199
|
+
children: instance.t("cancel_button")
|
|
34200
|
+
}
|
|
34201
|
+
)
|
|
34202
|
+
] })
|
|
34203
|
+
]
|
|
34204
|
+
}
|
|
34205
|
+
) })
|
|
34206
|
+
]
|
|
34207
|
+
}
|
|
34208
|
+
),
|
|
34200
34209
|
document.body
|
|
34201
34210
|
);
|
|
34202
34211
|
};
|