@fctc/sme-widget-ui 1.1.2 → 1.1.4
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/.babelrc +7 -0
- package/dist/.editorconfig +10 -0
- package/dist/.eslintignore +6 -0
- package/dist/.eslintrc.cjs +66 -0
- package/dist/.gitattributes +4 -0
- package/dist/.prettierrc +4 -0
- package/dist/index.js +185 -162
- package/dist/index.mjs +185 -162
- package/dist/widgets.d.mts +2 -0
- package/dist/widgets.d.ts +2 -0
- package/dist/widgets.js +185 -162
- package/dist/widgets.mjs +185 -162
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -12291,9 +12291,12 @@ var TableBodyRow = (props) => {
|
|
|
12291
12291
|
isForm,
|
|
12292
12292
|
typeCo,
|
|
12293
12293
|
selectedRowKeys,
|
|
12294
|
+
tableGroupController,
|
|
12295
|
+
groupByList,
|
|
12296
|
+
setIsAutoSelect,
|
|
12297
|
+
isAutoSelect,
|
|
12294
12298
|
isEditTable
|
|
12295
12299
|
} = props;
|
|
12296
|
-
const [isAutoSelect, setIsAutoSelect] = useState2(false);
|
|
12297
12300
|
const rootStyle = getComputedStyle(document.documentElement);
|
|
12298
12301
|
const colorPrimary = rootStyle.getPropertyValue("--primary").trim();
|
|
12299
12302
|
return rows && rows?.length > 0 ? rows?.map((row, index4) => {
|
|
@@ -12301,21 +12304,24 @@ var TableBodyRow = (props) => {
|
|
|
12301
12304
|
TableGroup,
|
|
12302
12305
|
{
|
|
12303
12306
|
columns,
|
|
12304
|
-
indexRow: index4,
|
|
12305
12307
|
rows,
|
|
12306
12308
|
row,
|
|
12309
|
+
indexRow: index4,
|
|
12307
12310
|
model,
|
|
12308
12311
|
viewData,
|
|
12309
12312
|
renderField,
|
|
12310
12313
|
level: level + 1,
|
|
12311
12314
|
specification,
|
|
12312
|
-
domain: row?.__domain,
|
|
12313
12315
|
context,
|
|
12314
12316
|
checkedAll,
|
|
12315
12317
|
isDisplayCheckbox,
|
|
12316
12318
|
selectedRowKeysRef,
|
|
12317
12319
|
isAutoSelect,
|
|
12318
|
-
setIsAutoSelect
|
|
12320
|
+
setIsAutoSelect,
|
|
12321
|
+
groupByList,
|
|
12322
|
+
tableGroupController,
|
|
12323
|
+
setSelectedRowKeys,
|
|
12324
|
+
selectedRowKeys
|
|
12319
12325
|
},
|
|
12320
12326
|
`record-group-${index4}`
|
|
12321
12327
|
) : /* @__PURE__ */ jsx42(
|
|
@@ -12354,7 +12360,15 @@ var TableBodyRow = (props) => {
|
|
|
12354
12360
|
) }) });
|
|
12355
12361
|
};
|
|
12356
12362
|
var TableBody = (props) => {
|
|
12357
|
-
|
|
12363
|
+
const [isAutoSelect, setIsAutoSelect] = useState2(false);
|
|
12364
|
+
return /* @__PURE__ */ jsx42("tbody", { className: "overflow-hidden", children: /* @__PURE__ */ jsx42(
|
|
12365
|
+
TableBodyRow,
|
|
12366
|
+
{
|
|
12367
|
+
...props,
|
|
12368
|
+
isAutoSelect,
|
|
12369
|
+
setIsAutoSelect
|
|
12370
|
+
}
|
|
12371
|
+
) });
|
|
12358
12372
|
};
|
|
12359
12373
|
|
|
12360
12374
|
// src/widgets/advanced/table/table-filter.tsx
|
|
@@ -33908,176 +33922,185 @@ var Many2ManyField = (props) => {
|
|
|
33908
33922
|
clearSearch
|
|
33909
33923
|
} = searchController;
|
|
33910
33924
|
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);
|
|
33925
|
+
/* @__PURE__ */ jsxs71(
|
|
33926
|
+
"div",
|
|
33927
|
+
{
|
|
33928
|
+
style: {
|
|
33929
|
+
zIndex: 99999
|
|
33930
|
+
},
|
|
33931
|
+
className: "fixed bottom-0 left-0 right-0 top-0",
|
|
33932
|
+
children: [
|
|
33933
|
+
/* @__PURE__ */ jsx102("div", { className: "absolute inset-0 bg-[rgba(27,27,27,0.48)]" }),
|
|
33934
|
+
/* @__PURE__ */ jsx102("div", { className: "absolute inset-0 overflow-auto px-6 flex justify-center items-center", children: /* @__PURE__ */ jsxs71(
|
|
33935
|
+
"div",
|
|
33936
|
+
{
|
|
33937
|
+
style: {
|
|
33938
|
+
zIndex: 1
|
|
33939
|
+
},
|
|
33940
|
+
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",
|
|
33941
|
+
children: [
|
|
33942
|
+
/* @__PURE__ */ jsxs71("div", { className: "flex justify-between items-center border-b border-[rgba(0,0,0,0.1)] pb-2", children: [
|
|
33943
|
+
/* @__PURE__ */ jsx102("div", { className: "text-[20px] font-semibold", children: title }),
|
|
33944
|
+
/* @__PURE__ */ jsx102("button", { className: "cursor-pointer", onClick: onClose, children: /* @__PURE__ */ jsx102(CloseIcon, {}) })
|
|
33945
|
+
] }),
|
|
33946
|
+
/* @__PURE__ */ jsxs71("div", { className: "grid grid-cols-3 gap-2 items-center py-2", children: [
|
|
33947
|
+
/* @__PURE__ */ jsx102("div", { className: "col-span-3 sm:col-span-2 flex-1", children: /* @__PURE__ */ jsx102(
|
|
33948
|
+
Search,
|
|
33949
|
+
{
|
|
33950
|
+
removeSearchItems,
|
|
33951
|
+
selectedTags,
|
|
33952
|
+
filterBy,
|
|
33953
|
+
setFilterBy,
|
|
33954
|
+
searchString,
|
|
33955
|
+
onSearchString,
|
|
33956
|
+
handleAddTagSearch,
|
|
33957
|
+
searchBy,
|
|
33958
|
+
groupBy,
|
|
33959
|
+
showFiltersGroups: true,
|
|
33960
|
+
setGroupBy,
|
|
33961
|
+
setDomainList: setDomain,
|
|
33962
|
+
setPage: (pages) => {
|
|
33963
|
+
setPage?.(pages);
|
|
33964
|
+
},
|
|
33965
|
+
fieldsList: [
|
|
33966
|
+
...columns?.filter(
|
|
33967
|
+
(col) => col?.field?.type_co === "field" && col?.optional !== "hide"
|
|
33968
|
+
)?.map((col) => ({ ...col.field })) ?? []
|
|
33969
|
+
],
|
|
33970
|
+
setSelectedRowKeys,
|
|
33971
|
+
viewData,
|
|
33972
|
+
context,
|
|
33973
|
+
selectedRowKeys,
|
|
33974
|
+
aid,
|
|
33975
|
+
domainSearch,
|
|
33976
|
+
evalJSONContext,
|
|
33977
|
+
clearSearch
|
|
33969
33978
|
}
|
|
33970
|
-
},
|
|
33971
|
-
|
|
33972
|
-
|
|
33973
|
-
|
|
33974
|
-
|
|
33975
|
-
|
|
33976
|
-
|
|
33977
|
-
|
|
33978
|
-
|
|
33979
|
-
|
|
33980
|
-
|
|
33979
|
+
) }),
|
|
33980
|
+
/* @__PURE__ */ jsx102(
|
|
33981
|
+
PaginationView,
|
|
33982
|
+
{
|
|
33983
|
+
className: "pagination-bar col-span-3 sm:col-span-1 justify-end flex-1",
|
|
33984
|
+
currentPage: page,
|
|
33985
|
+
totalCount: totalRows ?? 0,
|
|
33986
|
+
pageSize: 10,
|
|
33987
|
+
onPageChange: (page2) => {
|
|
33988
|
+
if (typeof setPage === "function") {
|
|
33989
|
+
setPage(page2);
|
|
33990
|
+
}
|
|
33991
|
+
},
|
|
33992
|
+
displayPageNumberDots: false,
|
|
33993
|
+
displayRowsNumberOption: false
|
|
33994
|
+
}
|
|
33995
|
+
)
|
|
33996
|
+
] }),
|
|
33997
|
+
!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
33998
|
"div",
|
|
33982
33999
|
{
|
|
33983
|
-
className: `
|
|
33984
|
-
children: /* @__PURE__ */ jsx102("div", { className: "w-full h-full
|
|
33985
|
-
"
|
|
34000
|
+
className: `border-[1px] h-full border-solid border-[#dbe0e6] rounded-[10px] relative w-full overflow-hidden`,
|
|
34001
|
+
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(
|
|
34002
|
+
"div",
|
|
33986
34003
|
{
|
|
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({
|
|
34004
|
+
className: `flex w-full items-center h-full overflow-auto `,
|
|
34005
|
+
children: /* @__PURE__ */ jsx102("div", { className: "w-full h-full max-w-full", children: /* @__PURE__ */ jsxs71(
|
|
34006
|
+
"table",
|
|
34007
|
+
{
|
|
34008
|
+
className: `relative w-full bg-white custom-dropdown `,
|
|
34009
|
+
children: [
|
|
34010
|
+
/* @__PURE__ */ jsx102(
|
|
34011
|
+
TableHead,
|
|
34012
|
+
{
|
|
34013
|
+
columns,
|
|
34014
|
+
onToggleColumnOptional,
|
|
34015
|
+
isDisplayCheckbox,
|
|
34016
|
+
checkedAll,
|
|
34017
|
+
handleCheckBoxAll
|
|
34018
|
+
}
|
|
34019
|
+
),
|
|
34020
|
+
/* @__PURE__ */ jsx102(
|
|
34021
|
+
TableBody,
|
|
34022
|
+
{
|
|
34023
|
+
columns,
|
|
34024
|
+
rows,
|
|
34025
|
+
rootField,
|
|
34026
|
+
isDisplayCheckbox,
|
|
34027
|
+
model: relation,
|
|
34028
|
+
renderField: ({
|
|
34016
34029
|
row,
|
|
34017
34030
|
col,
|
|
34018
34031
|
indexRow,
|
|
34019
34032
|
onChangeData,
|
|
34020
34033
|
rootField: rootField2
|
|
34021
|
-
})
|
|
34034
|
+
}) => {
|
|
34035
|
+
if (typeof renderField === "function") {
|
|
34036
|
+
return renderField({
|
|
34037
|
+
row,
|
|
34038
|
+
col,
|
|
34039
|
+
indexRow,
|
|
34040
|
+
onChangeData,
|
|
34041
|
+
rootField: rootField2
|
|
34042
|
+
});
|
|
34043
|
+
}
|
|
34044
|
+
},
|
|
34045
|
+
onRemoveRow: null,
|
|
34046
|
+
onAddRow,
|
|
34047
|
+
onClickRow,
|
|
34048
|
+
typeTable,
|
|
34049
|
+
selectedRowKeysRef,
|
|
34050
|
+
selectedRowKeys,
|
|
34051
|
+
setSelectedRowKeys
|
|
34022
34052
|
}
|
|
34023
|
-
|
|
34024
|
-
|
|
34025
|
-
|
|
34026
|
-
|
|
34027
|
-
typeTable,
|
|
34028
|
-
selectedRowKeysRef,
|
|
34029
|
-
selectedRowKeys,
|
|
34030
|
-
setSelectedRowKeys
|
|
34031
|
-
}
|
|
34032
|
-
)
|
|
34033
|
-
]
|
|
34053
|
+
)
|
|
34054
|
+
]
|
|
34055
|
+
}
|
|
34056
|
+
) })
|
|
34034
34057
|
}
|
|
34035
|
-
) })
|
|
34058
|
+
) }) })
|
|
34036
34059
|
}
|
|
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();
|
|
34060
|
+
) }) }) : /* @__PURE__ */ jsx102(LayerLoading, {}),
|
|
34061
|
+
/* @__PURE__ */ jsxs71("div", { className: "flex items-center gap-2 mt-auto", children: [
|
|
34062
|
+
isDisplayCheckbox && /* @__PURE__ */ jsx102(
|
|
34063
|
+
"button",
|
|
34064
|
+
{
|
|
34065
|
+
disabled: selectedRowKeys?.length === 0,
|
|
34066
|
+
type: "button",
|
|
34067
|
+
onClick: () => onChoose(selectedRowKeys),
|
|
34068
|
+
className: "button-primary",
|
|
34069
|
+
children: instance.t("choose")
|
|
34061
34070
|
}
|
|
34062
|
-
|
|
34063
|
-
|
|
34064
|
-
|
|
34065
|
-
|
|
34066
|
-
|
|
34067
|
-
|
|
34068
|
-
|
|
34069
|
-
|
|
34070
|
-
|
|
34071
|
-
|
|
34072
|
-
|
|
34073
|
-
|
|
34074
|
-
|
|
34075
|
-
|
|
34076
|
-
|
|
34077
|
-
|
|
34078
|
-
|
|
34079
|
-
|
|
34080
|
-
|
|
34071
|
+
),
|
|
34072
|
+
optionsObject && "no_create" in optionsObject && optionsObject?.no_create === false && /* @__PURE__ */ jsx102(
|
|
34073
|
+
"button",
|
|
34074
|
+
{
|
|
34075
|
+
type: "button",
|
|
34076
|
+
onClick: () => {
|
|
34077
|
+
if (typeof onAddNew === "function") {
|
|
34078
|
+
onAddNew();
|
|
34079
|
+
onClose();
|
|
34080
|
+
} else {
|
|
34081
|
+
handleCreateNewOnPage();
|
|
34082
|
+
}
|
|
34083
|
+
},
|
|
34084
|
+
className: "button-primary",
|
|
34085
|
+
children: instance.t("new")
|
|
34086
|
+
}
|
|
34087
|
+
),
|
|
34088
|
+
/* @__PURE__ */ jsx102(
|
|
34089
|
+
"button",
|
|
34090
|
+
{
|
|
34091
|
+
type: "button",
|
|
34092
|
+
onClick: onClose,
|
|
34093
|
+
className: "button-secondary",
|
|
34094
|
+
children: instance.t("cancel_button")
|
|
34095
|
+
}
|
|
34096
|
+
)
|
|
34097
|
+
] })
|
|
34098
|
+
]
|
|
34099
|
+
}
|
|
34100
|
+
) })
|
|
34101
|
+
]
|
|
34102
|
+
}
|
|
34103
|
+
),
|
|
34081
34104
|
document.body
|
|
34082
34105
|
);
|
|
34083
34106
|
};
|
package/dist/widgets.d.mts
CHANGED
package/dist/widgets.d.ts
CHANGED