@fctc/sme-widget-ui 2.8.3 → 2.8.5
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 +35 -117
- package/dist/index.mjs +35 -117
- package/dist/widgets.d.mts +1 -1
- package/dist/widgets.d.ts +1 -1
- package/dist/widgets.js +35 -117
- package/dist/widgets.mjs +35 -117
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -10776,8 +10776,7 @@ var TableGroup = (props) => {
|
|
|
10776
10776
|
groupByList,
|
|
10777
10777
|
selectedRowKeys,
|
|
10778
10778
|
setSelectedRowKeys,
|
|
10779
|
-
onClickRow
|
|
10780
|
-
env
|
|
10779
|
+
onClickRow
|
|
10781
10780
|
} = props;
|
|
10782
10781
|
const {
|
|
10783
10782
|
onExpandChildGroup,
|
|
@@ -10904,8 +10903,7 @@ var TableGroup = (props) => {
|
|
|
10904
10903
|
groupByList,
|
|
10905
10904
|
selectedRowKeys,
|
|
10906
10905
|
setSelectedRowKeys,
|
|
10907
|
-
onClickRow
|
|
10908
|
-
env
|
|
10906
|
+
onClickRow
|
|
10909
10907
|
}
|
|
10910
10908
|
)
|
|
10911
10909
|
] });
|
|
@@ -10932,8 +10930,7 @@ var Row = (props) => {
|
|
|
10932
10930
|
onClickRow,
|
|
10933
10931
|
isAutoSelect,
|
|
10934
10932
|
selectedRowKeysRef,
|
|
10935
|
-
isEditTable
|
|
10936
|
-
env
|
|
10933
|
+
isEditTable
|
|
10937
10934
|
} = props;
|
|
10938
10935
|
const checkboxRef = (0, import_react13.useRef)("enabled");
|
|
10939
10936
|
const checked = (0, import_react13.useMemo)(() => {
|
|
@@ -10983,12 +10980,8 @@ var Row = (props) => {
|
|
|
10983
10980
|
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
10984
10981
|
"tr",
|
|
10985
10982
|
{
|
|
10986
|
-
"data-platform": env?.envFile?.PLATFORM === "edu" ? "edu" : "sme",
|
|
10987
10983
|
"data-row-id": row?.id,
|
|
10988
10984
|
className: `border-b border-[#e8e8e8] cursor-pointer`,
|
|
10989
|
-
style: {
|
|
10990
|
-
background: env?.envFile?.PLATFORM === "edu" ? "transparent" : indexRow % 2 === 0 ? "#FFF" : "#EEF3FB"
|
|
10991
|
-
},
|
|
10992
10985
|
children: /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(import_jsx_runtime47.Fragment, { children: [
|
|
10993
10986
|
isDisplayCheckbox && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
10994
10987
|
"td",
|
|
@@ -11088,8 +11081,7 @@ var TableBodyRow = (props) => {
|
|
|
11088
11081
|
groupByList,
|
|
11089
11082
|
setIsAutoSelect,
|
|
11090
11083
|
isAutoSelect,
|
|
11091
|
-
isEditTable
|
|
11092
|
-
env
|
|
11084
|
+
isEditTable
|
|
11093
11085
|
} = props;
|
|
11094
11086
|
return rows && rows?.length > 0 && rows?.map((row, index4) => {
|
|
11095
11087
|
return typeTable === "group" ? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
@@ -11114,8 +11106,7 @@ var TableBodyRow = (props) => {
|
|
|
11114
11106
|
tableGroupController,
|
|
11115
11107
|
setSelectedRowKeys,
|
|
11116
11108
|
selectedRowKeys,
|
|
11117
|
-
onClickRow
|
|
11118
|
-
env
|
|
11109
|
+
onClickRow
|
|
11119
11110
|
},
|
|
11120
11111
|
`record-group-${index4}`
|
|
11121
11112
|
) : /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
@@ -11138,8 +11129,7 @@ var TableBodyRow = (props) => {
|
|
|
11138
11129
|
isAutoSelect,
|
|
11139
11130
|
selectedRowKeysRef,
|
|
11140
11131
|
setSelectedRowKeys,
|
|
11141
|
-
isEditTable
|
|
11142
|
-
env
|
|
11132
|
+
isEditTable
|
|
11143
11133
|
},
|
|
11144
11134
|
`record-${index4}`
|
|
11145
11135
|
);
|
|
@@ -13090,11 +13080,10 @@ var TableHead = (props) => {
|
|
|
13090
13080
|
checkedAll,
|
|
13091
13081
|
onRemoveRow,
|
|
13092
13082
|
onToggleColumnOptional,
|
|
13093
|
-
env,
|
|
13094
13083
|
table
|
|
13095
13084
|
} = props;
|
|
13096
|
-
const headerGroups = table
|
|
13097
|
-
const headerGroup = headerGroups[0];
|
|
13085
|
+
const headerGroups = table?.getHeaderGroups();
|
|
13086
|
+
const headerGroup = headerGroups?.[0];
|
|
13098
13087
|
const visibleColumns = columns?.filter((value) => value?.optional !== "hide") ?? [];
|
|
13099
13088
|
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("thead", { className: "relative z-10", children: /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
|
|
13100
13089
|
"tr",
|
|
@@ -13104,8 +13093,7 @@ var TableHead = (props) => {
|
|
|
13104
13093
|
WebkitUserSelect: "none",
|
|
13105
13094
|
zIndex: 10,
|
|
13106
13095
|
position: "sticky",
|
|
13107
|
-
top: 0
|
|
13108
|
-
backgroundColor: env?.envFile?.PLATFORM === "edu" ? "rgb(239,241,242)" : "white"
|
|
13096
|
+
top: 0
|
|
13109
13097
|
},
|
|
13110
13098
|
className: "border-b border-[rgba(66,66,66,0.12)] ",
|
|
13111
13099
|
children: [
|
|
@@ -13157,7 +13145,7 @@ var TableHead = (props) => {
|
|
|
13157
13145
|
className: `cursor-pointer flex items-center gap-[4px] w-full group relative ${(col?.field?.type === "monetary" || col?.field?.widget === "monetary") && "justify-end"}`,
|
|
13158
13146
|
children: [
|
|
13159
13147
|
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: "cursor-pointer flex justify-between items-center gap-[4px] w-full max-w-full truncate", children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("span", { className: "truncate", children: col.title }) }),
|
|
13160
|
-
col?.field?.help &&
|
|
13148
|
+
col?.field?.help && /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(import_jsx_runtime51.Fragment, { children: [
|
|
13161
13149
|
(0, import_react_dom.createPortal)(
|
|
13162
13150
|
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
13163
13151
|
M,
|
|
@@ -33663,18 +33651,14 @@ var Many2ManyField = (props) => {
|
|
|
33663
33651
|
aid,
|
|
33664
33652
|
title,
|
|
33665
33653
|
onClose,
|
|
33666
|
-
renderField,
|
|
33667
|
-
relation,
|
|
33668
33654
|
onChoose,
|
|
33669
33655
|
onAddNew,
|
|
33670
|
-
rootField,
|
|
33671
33656
|
isDisplayCheckbox,
|
|
33672
33657
|
onAddRow,
|
|
33673
|
-
onClickRow,
|
|
33674
33658
|
evalJSONContext,
|
|
33675
|
-
tableGroupController,
|
|
33676
33659
|
many2manyController,
|
|
33677
|
-
|
|
33660
|
+
renderTable,
|
|
33661
|
+
model
|
|
33678
33662
|
} = props;
|
|
33679
33663
|
const {
|
|
33680
33664
|
handleCreateNewOnPage,
|
|
@@ -33714,7 +33698,6 @@ var Many2ManyField = (props) => {
|
|
|
33714
33698
|
setGroupBy,
|
|
33715
33699
|
clearSearch
|
|
33716
33700
|
} = searchController;
|
|
33717
|
-
const { handleCheckBoxAll, checkedAll, selectedRowKeysRef } = tableHeadController;
|
|
33718
33701
|
(0, import_react67.useEffect)(() => {
|
|
33719
33702
|
const groupItems = Array.isArray(selectedTags) ? selectedTags.filter((item) => item.type === "group_by") : [];
|
|
33720
33703
|
if (groupItems?.length > 0) {
|
|
@@ -33734,7 +33717,7 @@ var Many2ManyField = (props) => {
|
|
|
33734
33717
|
"div",
|
|
33735
33718
|
{
|
|
33736
33719
|
style: {
|
|
33737
|
-
zIndex:
|
|
33720
|
+
zIndex: 22
|
|
33738
33721
|
},
|
|
33739
33722
|
className: "fixed bottom-0 left-0 right-0 top-0",
|
|
33740
33723
|
children: [
|
|
@@ -33751,8 +33734,8 @@ var Many2ManyField = (props) => {
|
|
|
33751
33734
|
/* @__PURE__ */ (0, import_jsx_runtime109.jsx)("div", { className: "text-[20px] font-semibold", children: title }),
|
|
33752
33735
|
/* @__PURE__ */ (0, import_jsx_runtime109.jsx)("button", { className: "cursor-pointer", onClick: onClose, children: /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(CloseIcon, {}) })
|
|
33753
33736
|
] }),
|
|
33754
|
-
/* @__PURE__ */ (0, import_jsx_runtime109.jsxs)("div", { className: "grid grid-cols-3
|
|
33755
|
-
/* @__PURE__ */ (0, import_jsx_runtime109.jsx)("div", { className: "col-span-2
|
|
33737
|
+
/* @__PURE__ */ (0, import_jsx_runtime109.jsxs)("div", { className: "grid grid-cols-3 justify-between items-center py-2", children: [
|
|
33738
|
+
/* @__PURE__ */ (0, import_jsx_runtime109.jsx)("div", { className: "col-span-2", children: /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(
|
|
33756
33739
|
Search,
|
|
33757
33740
|
{
|
|
33758
33741
|
removeSearchItems,
|
|
@@ -33789,7 +33772,7 @@ var Many2ManyField = (props) => {
|
|
|
33789
33772
|
/* @__PURE__ */ (0, import_jsx_runtime109.jsx)(
|
|
33790
33773
|
PaginationView,
|
|
33791
33774
|
{
|
|
33792
|
-
className: "pagination-bar
|
|
33775
|
+
className: "pagination-bar justify-end flex-1 col-span-1",
|
|
33793
33776
|
currentPage: page,
|
|
33794
33777
|
totalCount: totalRows ?? 0,
|
|
33795
33778
|
pageSize: 10,
|
|
@@ -33803,90 +33786,25 @@ var Many2ManyField = (props) => {
|
|
|
33803
33786
|
}
|
|
33804
33787
|
)
|
|
33805
33788
|
] }),
|
|
33806
|
-
!isLoading && isFetched || isPlaceholderData ? /* @__PURE__ */ (0, import_jsx_runtime109.jsx)("div", { className: "relative overflow-y-auto", children: /* @__PURE__ */ (0, import_jsx_runtime109.jsx)("div", { className: "relative h-full w-full", children:
|
|
33807
|
-
|
|
33808
|
-
|
|
33809
|
-
|
|
33810
|
-
|
|
33811
|
-
|
|
33812
|
-
|
|
33813
|
-
|
|
33814
|
-
|
|
33815
|
-
|
|
33816
|
-
|
|
33817
|
-
|
|
33818
|
-
|
|
33819
|
-
|
|
33820
|
-
|
|
33821
|
-
|
|
33822
|
-
|
|
33823
|
-
|
|
33824
|
-
|
|
33825
|
-
checkedAll,
|
|
33826
|
-
handleCheckBoxAll
|
|
33827
|
-
}
|
|
33828
|
-
),
|
|
33829
|
-
rows?.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(
|
|
33830
|
-
TableBody,
|
|
33831
|
-
{
|
|
33832
|
-
tableGroupController,
|
|
33833
|
-
columns,
|
|
33834
|
-
rows,
|
|
33835
|
-
rootField,
|
|
33836
|
-
isDisplayCheckbox,
|
|
33837
|
-
model: relation,
|
|
33838
|
-
level: 0,
|
|
33839
|
-
renderField: ({
|
|
33840
|
-
row,
|
|
33841
|
-
col,
|
|
33842
|
-
indexRow,
|
|
33843
|
-
onChangeData,
|
|
33844
|
-
rootField: rootField2
|
|
33845
|
-
}) => {
|
|
33846
|
-
if (typeof renderField === "function") {
|
|
33847
|
-
return renderField({
|
|
33848
|
-
row,
|
|
33849
|
-
col,
|
|
33850
|
-
indexRow,
|
|
33851
|
-
onChangeData,
|
|
33852
|
-
rootField: rootField2
|
|
33853
|
-
});
|
|
33854
|
-
}
|
|
33855
|
-
},
|
|
33856
|
-
onRemoveRow: null,
|
|
33857
|
-
onAddRow,
|
|
33858
|
-
onClickRow,
|
|
33859
|
-
typeTable,
|
|
33860
|
-
selectedRowKeysRef,
|
|
33861
|
-
selectedRowKeys,
|
|
33862
|
-
setSelectedRowKeys,
|
|
33863
|
-
groupByList,
|
|
33864
|
-
specification,
|
|
33865
|
-
viewData,
|
|
33866
|
-
checkedAll,
|
|
33867
|
-
context
|
|
33868
|
-
}
|
|
33869
|
-
) : /* @__PURE__ */ (0, import_jsx_runtime109.jsx)("tr", { children: /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(
|
|
33870
|
-
"td",
|
|
33871
|
-
{
|
|
33872
|
-
className: "w-full",
|
|
33873
|
-
colSpan: columns?.length + 2,
|
|
33874
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(
|
|
33875
|
-
"div",
|
|
33876
|
-
{
|
|
33877
|
-
className: `flex flex-col items-center justify-center gap-3 py-6`,
|
|
33878
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(EmptyTable, {})
|
|
33879
|
-
}
|
|
33880
|
-
)
|
|
33881
|
-
}
|
|
33882
|
-
) })
|
|
33883
|
-
]
|
|
33884
|
-
}
|
|
33885
|
-
) })
|
|
33886
|
-
}
|
|
33887
|
-
) }) })
|
|
33888
|
-
}
|
|
33889
|
-
) }) }) : /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(LayerLoading, {}),
|
|
33789
|
+
!isLoading && isFetched || isPlaceholderData ? /* @__PURE__ */ (0, import_jsx_runtime109.jsx)("div", { className: "relative overflow-y-auto", children: /* @__PURE__ */ (0, import_jsx_runtime109.jsx)("div", { className: "relative h-full w-full", children: renderTable({
|
|
33790
|
+
columns,
|
|
33791
|
+
onToggleColumnOptional,
|
|
33792
|
+
isDisplayCheckbox,
|
|
33793
|
+
rows,
|
|
33794
|
+
model,
|
|
33795
|
+
onRemoveRow: null,
|
|
33796
|
+
onAddRow,
|
|
33797
|
+
onClickRow: (col, row) => {
|
|
33798
|
+
onChoose(row?.id);
|
|
33799
|
+
},
|
|
33800
|
+
typeTable,
|
|
33801
|
+
specification,
|
|
33802
|
+
viewData,
|
|
33803
|
+
context,
|
|
33804
|
+
selectedRowKeys,
|
|
33805
|
+
setSelectedRowKeys,
|
|
33806
|
+
groupByList
|
|
33807
|
+
}) }) }) : /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(LayerLoading, {}),
|
|
33890
33808
|
/* @__PURE__ */ (0, import_jsx_runtime109.jsxs)("div", { className: "flex items-center gap-2 mt-auto", children: [
|
|
33891
33809
|
isDisplayCheckbox && /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(
|
|
33892
33810
|
"button",
|
package/dist/index.mjs
CHANGED
|
@@ -10649,8 +10649,7 @@ var TableGroup = (props) => {
|
|
|
10649
10649
|
groupByList,
|
|
10650
10650
|
selectedRowKeys,
|
|
10651
10651
|
setSelectedRowKeys,
|
|
10652
|
-
onClickRow
|
|
10653
|
-
env
|
|
10652
|
+
onClickRow
|
|
10654
10653
|
} = props;
|
|
10655
10654
|
const {
|
|
10656
10655
|
onExpandChildGroup,
|
|
@@ -10777,8 +10776,7 @@ var TableGroup = (props) => {
|
|
|
10777
10776
|
groupByList,
|
|
10778
10777
|
selectedRowKeys,
|
|
10779
10778
|
setSelectedRowKeys,
|
|
10780
|
-
onClickRow
|
|
10781
|
-
env
|
|
10779
|
+
onClickRow
|
|
10782
10780
|
}
|
|
10783
10781
|
)
|
|
10784
10782
|
] });
|
|
@@ -10805,8 +10803,7 @@ var Row = (props) => {
|
|
|
10805
10803
|
onClickRow,
|
|
10806
10804
|
isAutoSelect,
|
|
10807
10805
|
selectedRowKeysRef,
|
|
10808
|
-
isEditTable
|
|
10809
|
-
env
|
|
10806
|
+
isEditTable
|
|
10810
10807
|
} = props;
|
|
10811
10808
|
const checkboxRef = useRef4("enabled");
|
|
10812
10809
|
const checked = useMemo3(() => {
|
|
@@ -10856,12 +10853,8 @@ var Row = (props) => {
|
|
|
10856
10853
|
return /* @__PURE__ */ jsx47(
|
|
10857
10854
|
"tr",
|
|
10858
10855
|
{
|
|
10859
|
-
"data-platform": env?.envFile?.PLATFORM === "edu" ? "edu" : "sme",
|
|
10860
10856
|
"data-row-id": row?.id,
|
|
10861
10857
|
className: `border-b border-[#e8e8e8] cursor-pointer`,
|
|
10862
|
-
style: {
|
|
10863
|
-
background: env?.envFile?.PLATFORM === "edu" ? "transparent" : indexRow % 2 === 0 ? "#FFF" : "#EEF3FB"
|
|
10864
|
-
},
|
|
10865
10858
|
children: /* @__PURE__ */ jsxs26(Fragment3, { children: [
|
|
10866
10859
|
isDisplayCheckbox && /* @__PURE__ */ jsx47(
|
|
10867
10860
|
"td",
|
|
@@ -10961,8 +10954,7 @@ var TableBodyRow = (props) => {
|
|
|
10961
10954
|
groupByList,
|
|
10962
10955
|
setIsAutoSelect,
|
|
10963
10956
|
isAutoSelect,
|
|
10964
|
-
isEditTable
|
|
10965
|
-
env
|
|
10957
|
+
isEditTable
|
|
10966
10958
|
} = props;
|
|
10967
10959
|
return rows && rows?.length > 0 && rows?.map((row, index4) => {
|
|
10968
10960
|
return typeTable === "group" ? /* @__PURE__ */ jsx48(
|
|
@@ -10987,8 +10979,7 @@ var TableBodyRow = (props) => {
|
|
|
10987
10979
|
tableGroupController,
|
|
10988
10980
|
setSelectedRowKeys,
|
|
10989
10981
|
selectedRowKeys,
|
|
10990
|
-
onClickRow
|
|
10991
|
-
env
|
|
10982
|
+
onClickRow
|
|
10992
10983
|
},
|
|
10993
10984
|
`record-group-${index4}`
|
|
10994
10985
|
) : /* @__PURE__ */ jsx48(
|
|
@@ -11011,8 +11002,7 @@ var TableBodyRow = (props) => {
|
|
|
11011
11002
|
isAutoSelect,
|
|
11012
11003
|
selectedRowKeysRef,
|
|
11013
11004
|
setSelectedRowKeys,
|
|
11014
|
-
isEditTable
|
|
11015
|
-
env
|
|
11005
|
+
isEditTable
|
|
11016
11006
|
},
|
|
11017
11007
|
`record-${index4}`
|
|
11018
11008
|
);
|
|
@@ -12963,11 +12953,10 @@ var TableHead = (props) => {
|
|
|
12963
12953
|
checkedAll,
|
|
12964
12954
|
onRemoveRow,
|
|
12965
12955
|
onToggleColumnOptional,
|
|
12966
|
-
env,
|
|
12967
12956
|
table
|
|
12968
12957
|
} = props;
|
|
12969
|
-
const headerGroups = table
|
|
12970
|
-
const headerGroup = headerGroups[0];
|
|
12958
|
+
const headerGroups = table?.getHeaderGroups();
|
|
12959
|
+
const headerGroup = headerGroups?.[0];
|
|
12971
12960
|
const visibleColumns = columns?.filter((value) => value?.optional !== "hide") ?? [];
|
|
12972
12961
|
return /* @__PURE__ */ jsx51("thead", { className: "relative z-10", children: /* @__PURE__ */ jsxs29(
|
|
12973
12962
|
"tr",
|
|
@@ -12977,8 +12966,7 @@ var TableHead = (props) => {
|
|
|
12977
12966
|
WebkitUserSelect: "none",
|
|
12978
12967
|
zIndex: 10,
|
|
12979
12968
|
position: "sticky",
|
|
12980
|
-
top: 0
|
|
12981
|
-
backgroundColor: env?.envFile?.PLATFORM === "edu" ? "rgb(239,241,242)" : "white"
|
|
12969
|
+
top: 0
|
|
12982
12970
|
},
|
|
12983
12971
|
className: "border-b border-[rgba(66,66,66,0.12)] ",
|
|
12984
12972
|
children: [
|
|
@@ -13030,7 +13018,7 @@ var TableHead = (props) => {
|
|
|
13030
13018
|
className: `cursor-pointer flex items-center gap-[4px] w-full group relative ${(col?.field?.type === "monetary" || col?.field?.widget === "monetary") && "justify-end"}`,
|
|
13031
13019
|
children: [
|
|
13032
13020
|
/* @__PURE__ */ jsx51("div", { className: "cursor-pointer flex justify-between items-center gap-[4px] w-full max-w-full truncate", children: /* @__PURE__ */ jsx51("span", { className: "truncate", children: col.title }) }),
|
|
13033
|
-
col?.field?.help &&
|
|
13021
|
+
col?.field?.help && /* @__PURE__ */ jsxs29(Fragment4, { children: [
|
|
13034
13022
|
createPortal(
|
|
13035
13023
|
/* @__PURE__ */ jsx51(
|
|
13036
13024
|
M,
|
|
@@ -33536,18 +33524,14 @@ var Many2ManyField = (props) => {
|
|
|
33536
33524
|
aid,
|
|
33537
33525
|
title,
|
|
33538
33526
|
onClose,
|
|
33539
|
-
renderField,
|
|
33540
|
-
relation,
|
|
33541
33527
|
onChoose,
|
|
33542
33528
|
onAddNew,
|
|
33543
|
-
rootField,
|
|
33544
33529
|
isDisplayCheckbox,
|
|
33545
33530
|
onAddRow,
|
|
33546
|
-
onClickRow,
|
|
33547
33531
|
evalJSONContext,
|
|
33548
|
-
tableGroupController,
|
|
33549
33532
|
many2manyController,
|
|
33550
|
-
|
|
33533
|
+
renderTable,
|
|
33534
|
+
model
|
|
33551
33535
|
} = props;
|
|
33552
33536
|
const {
|
|
33553
33537
|
handleCreateNewOnPage,
|
|
@@ -33587,7 +33571,6 @@ var Many2ManyField = (props) => {
|
|
|
33587
33571
|
setGroupBy,
|
|
33588
33572
|
clearSearch
|
|
33589
33573
|
} = searchController;
|
|
33590
|
-
const { handleCheckBoxAll, checkedAll, selectedRowKeysRef } = tableHeadController;
|
|
33591
33574
|
useEffect27(() => {
|
|
33592
33575
|
const groupItems = Array.isArray(selectedTags) ? selectedTags.filter((item) => item.type === "group_by") : [];
|
|
33593
33576
|
if (groupItems?.length > 0) {
|
|
@@ -33607,7 +33590,7 @@ var Many2ManyField = (props) => {
|
|
|
33607
33590
|
"div",
|
|
33608
33591
|
{
|
|
33609
33592
|
style: {
|
|
33610
|
-
zIndex:
|
|
33593
|
+
zIndex: 22
|
|
33611
33594
|
},
|
|
33612
33595
|
className: "fixed bottom-0 left-0 right-0 top-0",
|
|
33613
33596
|
children: [
|
|
@@ -33624,8 +33607,8 @@ var Many2ManyField = (props) => {
|
|
|
33624
33607
|
/* @__PURE__ */ jsx111("div", { className: "text-[20px] font-semibold", children: title }),
|
|
33625
33608
|
/* @__PURE__ */ jsx111("button", { className: "cursor-pointer", onClick: onClose, children: /* @__PURE__ */ jsx111(CloseIcon, {}) })
|
|
33626
33609
|
] }),
|
|
33627
|
-
/* @__PURE__ */ jsxs74("div", { className: "grid grid-cols-3
|
|
33628
|
-
/* @__PURE__ */ jsx111("div", { className: "col-span-2
|
|
33610
|
+
/* @__PURE__ */ jsxs74("div", { className: "grid grid-cols-3 justify-between items-center py-2", children: [
|
|
33611
|
+
/* @__PURE__ */ jsx111("div", { className: "col-span-2", children: /* @__PURE__ */ jsx111(
|
|
33629
33612
|
Search,
|
|
33630
33613
|
{
|
|
33631
33614
|
removeSearchItems,
|
|
@@ -33662,7 +33645,7 @@ var Many2ManyField = (props) => {
|
|
|
33662
33645
|
/* @__PURE__ */ jsx111(
|
|
33663
33646
|
PaginationView,
|
|
33664
33647
|
{
|
|
33665
|
-
className: "pagination-bar
|
|
33648
|
+
className: "pagination-bar justify-end flex-1 col-span-1",
|
|
33666
33649
|
currentPage: page,
|
|
33667
33650
|
totalCount: totalRows ?? 0,
|
|
33668
33651
|
pageSize: 10,
|
|
@@ -33676,90 +33659,25 @@ var Many2ManyField = (props) => {
|
|
|
33676
33659
|
}
|
|
33677
33660
|
)
|
|
33678
33661
|
] }),
|
|
33679
|
-
!isLoading && isFetched || isPlaceholderData ? /* @__PURE__ */ jsx111("div", { className: "relative overflow-y-auto", children: /* @__PURE__ */ jsx111("div", { className: "relative h-full w-full", children:
|
|
33680
|
-
|
|
33681
|
-
|
|
33682
|
-
|
|
33683
|
-
|
|
33684
|
-
|
|
33685
|
-
|
|
33686
|
-
|
|
33687
|
-
|
|
33688
|
-
|
|
33689
|
-
|
|
33690
|
-
|
|
33691
|
-
|
|
33692
|
-
|
|
33693
|
-
|
|
33694
|
-
|
|
33695
|
-
|
|
33696
|
-
|
|
33697
|
-
|
|
33698
|
-
checkedAll,
|
|
33699
|
-
handleCheckBoxAll
|
|
33700
|
-
}
|
|
33701
|
-
),
|
|
33702
|
-
rows?.length > 0 ? /* @__PURE__ */ jsx111(
|
|
33703
|
-
TableBody,
|
|
33704
|
-
{
|
|
33705
|
-
tableGroupController,
|
|
33706
|
-
columns,
|
|
33707
|
-
rows,
|
|
33708
|
-
rootField,
|
|
33709
|
-
isDisplayCheckbox,
|
|
33710
|
-
model: relation,
|
|
33711
|
-
level: 0,
|
|
33712
|
-
renderField: ({
|
|
33713
|
-
row,
|
|
33714
|
-
col,
|
|
33715
|
-
indexRow,
|
|
33716
|
-
onChangeData,
|
|
33717
|
-
rootField: rootField2
|
|
33718
|
-
}) => {
|
|
33719
|
-
if (typeof renderField === "function") {
|
|
33720
|
-
return renderField({
|
|
33721
|
-
row,
|
|
33722
|
-
col,
|
|
33723
|
-
indexRow,
|
|
33724
|
-
onChangeData,
|
|
33725
|
-
rootField: rootField2
|
|
33726
|
-
});
|
|
33727
|
-
}
|
|
33728
|
-
},
|
|
33729
|
-
onRemoveRow: null,
|
|
33730
|
-
onAddRow,
|
|
33731
|
-
onClickRow,
|
|
33732
|
-
typeTable,
|
|
33733
|
-
selectedRowKeysRef,
|
|
33734
|
-
selectedRowKeys,
|
|
33735
|
-
setSelectedRowKeys,
|
|
33736
|
-
groupByList,
|
|
33737
|
-
specification,
|
|
33738
|
-
viewData,
|
|
33739
|
-
checkedAll,
|
|
33740
|
-
context
|
|
33741
|
-
}
|
|
33742
|
-
) : /* @__PURE__ */ jsx111("tr", { children: /* @__PURE__ */ jsx111(
|
|
33743
|
-
"td",
|
|
33744
|
-
{
|
|
33745
|
-
className: "w-full",
|
|
33746
|
-
colSpan: columns?.length + 2,
|
|
33747
|
-
children: /* @__PURE__ */ jsx111(
|
|
33748
|
-
"div",
|
|
33749
|
-
{
|
|
33750
|
-
className: `flex flex-col items-center justify-center gap-3 py-6`,
|
|
33751
|
-
children: /* @__PURE__ */ jsx111(EmptyTable, {})
|
|
33752
|
-
}
|
|
33753
|
-
)
|
|
33754
|
-
}
|
|
33755
|
-
) })
|
|
33756
|
-
]
|
|
33757
|
-
}
|
|
33758
|
-
) })
|
|
33759
|
-
}
|
|
33760
|
-
) }) })
|
|
33761
|
-
}
|
|
33762
|
-
) }) }) : /* @__PURE__ */ jsx111(LayerLoading, {}),
|
|
33662
|
+
!isLoading && isFetched || isPlaceholderData ? /* @__PURE__ */ jsx111("div", { className: "relative overflow-y-auto", children: /* @__PURE__ */ jsx111("div", { className: "relative h-full w-full", children: renderTable({
|
|
33663
|
+
columns,
|
|
33664
|
+
onToggleColumnOptional,
|
|
33665
|
+
isDisplayCheckbox,
|
|
33666
|
+
rows,
|
|
33667
|
+
model,
|
|
33668
|
+
onRemoveRow: null,
|
|
33669
|
+
onAddRow,
|
|
33670
|
+
onClickRow: (col, row) => {
|
|
33671
|
+
onChoose(row?.id);
|
|
33672
|
+
},
|
|
33673
|
+
typeTable,
|
|
33674
|
+
specification,
|
|
33675
|
+
viewData,
|
|
33676
|
+
context,
|
|
33677
|
+
selectedRowKeys,
|
|
33678
|
+
setSelectedRowKeys,
|
|
33679
|
+
groupByList
|
|
33680
|
+
}) }) }) : /* @__PURE__ */ jsx111(LayerLoading, {}),
|
|
33763
33681
|
/* @__PURE__ */ jsxs74("div", { className: "flex items-center gap-2 mt-auto", children: [
|
|
33764
33682
|
isDisplayCheckbox && /* @__PURE__ */ jsx111(
|
|
33765
33683
|
"button",
|
package/dist/widgets.d.mts
CHANGED
|
@@ -79,7 +79,6 @@ interface TableBodyProps {
|
|
|
79
79
|
tableGroupController?: any;
|
|
80
80
|
groupByList?: any;
|
|
81
81
|
isEditTable?: boolean;
|
|
82
|
-
env?: any;
|
|
83
82
|
}
|
|
84
83
|
declare const TableBody: (props: TableBodyProps) => JSX.Element;
|
|
85
84
|
|
|
@@ -437,6 +436,7 @@ interface Many2ManyProps extends IInputFieldProps {
|
|
|
437
436
|
tableGroupController: (props: TableGroupControllerProps) => TableGroupControllerReturn;
|
|
438
437
|
many2manyController?: any;
|
|
439
438
|
tableHeadController?: any;
|
|
439
|
+
renderTable?: any;
|
|
440
440
|
}
|
|
441
441
|
|
|
442
442
|
declare const Many2ManyField: (props: Many2ManyProps) => React$1.ReactPortal;
|
package/dist/widgets.d.ts
CHANGED
|
@@ -79,7 +79,6 @@ interface TableBodyProps {
|
|
|
79
79
|
tableGroupController?: any;
|
|
80
80
|
groupByList?: any;
|
|
81
81
|
isEditTable?: boolean;
|
|
82
|
-
env?: any;
|
|
83
82
|
}
|
|
84
83
|
declare const TableBody: (props: TableBodyProps) => JSX.Element;
|
|
85
84
|
|
|
@@ -437,6 +436,7 @@ interface Many2ManyProps extends IInputFieldProps {
|
|
|
437
436
|
tableGroupController: (props: TableGroupControllerProps) => TableGroupControllerReturn;
|
|
438
437
|
many2manyController?: any;
|
|
439
438
|
tableHeadController?: any;
|
|
439
|
+
renderTable?: any;
|
|
440
440
|
}
|
|
441
441
|
|
|
442
442
|
declare const Many2ManyField: (props: Many2ManyProps) => React$1.ReactPortal;
|
package/dist/widgets.js
CHANGED
|
@@ -9768,8 +9768,7 @@ var TableGroup = (props) => {
|
|
|
9768
9768
|
groupByList,
|
|
9769
9769
|
selectedRowKeys,
|
|
9770
9770
|
setSelectedRowKeys,
|
|
9771
|
-
onClickRow
|
|
9772
|
-
env
|
|
9771
|
+
onClickRow
|
|
9773
9772
|
} = props;
|
|
9774
9773
|
const {
|
|
9775
9774
|
onExpandChildGroup,
|
|
@@ -9896,8 +9895,7 @@ var TableGroup = (props) => {
|
|
|
9896
9895
|
groupByList,
|
|
9897
9896
|
selectedRowKeys,
|
|
9898
9897
|
setSelectedRowKeys,
|
|
9899
|
-
onClickRow
|
|
9900
|
-
env
|
|
9898
|
+
onClickRow
|
|
9901
9899
|
}
|
|
9902
9900
|
)
|
|
9903
9901
|
] });
|
|
@@ -9924,8 +9922,7 @@ var Row = (props) => {
|
|
|
9924
9922
|
onClickRow,
|
|
9925
9923
|
isAutoSelect,
|
|
9926
9924
|
selectedRowKeysRef,
|
|
9927
|
-
isEditTable
|
|
9928
|
-
env
|
|
9925
|
+
isEditTable
|
|
9929
9926
|
} = props;
|
|
9930
9927
|
const checkboxRef = (0, import_react11.useRef)("enabled");
|
|
9931
9928
|
const checked = (0, import_react11.useMemo)(() => {
|
|
@@ -9975,12 +9972,8 @@ var Row = (props) => {
|
|
|
9975
9972
|
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
9976
9973
|
"tr",
|
|
9977
9974
|
{
|
|
9978
|
-
"data-platform": env?.envFile?.PLATFORM === "edu" ? "edu" : "sme",
|
|
9979
9975
|
"data-row-id": row?.id,
|
|
9980
9976
|
className: `border-b border-[#e8e8e8] cursor-pointer`,
|
|
9981
|
-
style: {
|
|
9982
|
-
background: env?.envFile?.PLATFORM === "edu" ? "transparent" : indexRow % 2 === 0 ? "#FFF" : "#EEF3FB"
|
|
9983
|
-
},
|
|
9984
9977
|
children: /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(import_jsx_runtime47.Fragment, { children: [
|
|
9985
9978
|
isDisplayCheckbox && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
9986
9979
|
"td",
|
|
@@ -10080,8 +10073,7 @@ var TableBodyRow = (props) => {
|
|
|
10080
10073
|
groupByList,
|
|
10081
10074
|
setIsAutoSelect,
|
|
10082
10075
|
isAutoSelect,
|
|
10083
|
-
isEditTable
|
|
10084
|
-
env
|
|
10076
|
+
isEditTable
|
|
10085
10077
|
} = props;
|
|
10086
10078
|
return rows && rows?.length > 0 && rows?.map((row, index4) => {
|
|
10087
10079
|
return typeTable === "group" ? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
@@ -10106,8 +10098,7 @@ var TableBodyRow = (props) => {
|
|
|
10106
10098
|
tableGroupController,
|
|
10107
10099
|
setSelectedRowKeys,
|
|
10108
10100
|
selectedRowKeys,
|
|
10109
|
-
onClickRow
|
|
10110
|
-
env
|
|
10101
|
+
onClickRow
|
|
10111
10102
|
},
|
|
10112
10103
|
`record-group-${index4}`
|
|
10113
10104
|
) : /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
@@ -10130,8 +10121,7 @@ var TableBodyRow = (props) => {
|
|
|
10130
10121
|
isAutoSelect,
|
|
10131
10122
|
selectedRowKeysRef,
|
|
10132
10123
|
setSelectedRowKeys,
|
|
10133
|
-
isEditTable
|
|
10134
|
-
env
|
|
10124
|
+
isEditTable
|
|
10135
10125
|
},
|
|
10136
10126
|
`record-${index4}`
|
|
10137
10127
|
);
|
|
@@ -12082,11 +12072,10 @@ var TableHead = (props) => {
|
|
|
12082
12072
|
checkedAll,
|
|
12083
12073
|
onRemoveRow,
|
|
12084
12074
|
onToggleColumnOptional,
|
|
12085
|
-
env,
|
|
12086
12075
|
table
|
|
12087
12076
|
} = props;
|
|
12088
|
-
const headerGroups = table
|
|
12089
|
-
const headerGroup = headerGroups[0];
|
|
12077
|
+
const headerGroups = table?.getHeaderGroups();
|
|
12078
|
+
const headerGroup = headerGroups?.[0];
|
|
12090
12079
|
const visibleColumns = columns?.filter((value) => value?.optional !== "hide") ?? [];
|
|
12091
12080
|
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("thead", { className: "relative z-10", children: /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
|
|
12092
12081
|
"tr",
|
|
@@ -12096,8 +12085,7 @@ var TableHead = (props) => {
|
|
|
12096
12085
|
WebkitUserSelect: "none",
|
|
12097
12086
|
zIndex: 10,
|
|
12098
12087
|
position: "sticky",
|
|
12099
|
-
top: 0
|
|
12100
|
-
backgroundColor: env?.envFile?.PLATFORM === "edu" ? "rgb(239,241,242)" : "white"
|
|
12088
|
+
top: 0
|
|
12101
12089
|
},
|
|
12102
12090
|
className: "border-b border-[rgba(66,66,66,0.12)] ",
|
|
12103
12091
|
children: [
|
|
@@ -12149,7 +12137,7 @@ var TableHead = (props) => {
|
|
|
12149
12137
|
className: `cursor-pointer flex items-center gap-[4px] w-full group relative ${(col?.field?.type === "monetary" || col?.field?.widget === "monetary") && "justify-end"}`,
|
|
12150
12138
|
children: [
|
|
12151
12139
|
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: "cursor-pointer flex justify-between items-center gap-[4px] w-full max-w-full truncate", children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("span", { className: "truncate", children: col.title }) }),
|
|
12152
|
-
col?.field?.help &&
|
|
12140
|
+
col?.field?.help && /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(import_jsx_runtime51.Fragment, { children: [
|
|
12153
12141
|
(0, import_react_dom.createPortal)(
|
|
12154
12142
|
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
12155
12143
|
M,
|
|
@@ -32912,18 +32900,14 @@ var Many2ManyField = (props) => {
|
|
|
32912
32900
|
aid,
|
|
32913
32901
|
title,
|
|
32914
32902
|
onClose,
|
|
32915
|
-
renderField,
|
|
32916
|
-
relation,
|
|
32917
32903
|
onChoose,
|
|
32918
32904
|
onAddNew,
|
|
32919
|
-
rootField,
|
|
32920
32905
|
isDisplayCheckbox,
|
|
32921
32906
|
onAddRow,
|
|
32922
|
-
onClickRow,
|
|
32923
32907
|
evalJSONContext,
|
|
32924
|
-
tableGroupController,
|
|
32925
32908
|
many2manyController,
|
|
32926
|
-
|
|
32909
|
+
renderTable,
|
|
32910
|
+
model
|
|
32927
32911
|
} = props;
|
|
32928
32912
|
const {
|
|
32929
32913
|
handleCreateNewOnPage,
|
|
@@ -32963,7 +32947,6 @@ var Many2ManyField = (props) => {
|
|
|
32963
32947
|
setGroupBy,
|
|
32964
32948
|
clearSearch
|
|
32965
32949
|
} = searchController;
|
|
32966
|
-
const { handleCheckBoxAll, checkedAll, selectedRowKeysRef } = tableHeadController;
|
|
32967
32950
|
(0, import_react67.useEffect)(() => {
|
|
32968
32951
|
const groupItems = Array.isArray(selectedTags) ? selectedTags.filter((item) => item.type === "group_by") : [];
|
|
32969
32952
|
if (groupItems?.length > 0) {
|
|
@@ -32983,7 +32966,7 @@ var Many2ManyField = (props) => {
|
|
|
32983
32966
|
"div",
|
|
32984
32967
|
{
|
|
32985
32968
|
style: {
|
|
32986
|
-
zIndex:
|
|
32969
|
+
zIndex: 22
|
|
32987
32970
|
},
|
|
32988
32971
|
className: "fixed bottom-0 left-0 right-0 top-0",
|
|
32989
32972
|
children: [
|
|
@@ -33000,8 +32983,8 @@ var Many2ManyField = (props) => {
|
|
|
33000
32983
|
/* @__PURE__ */ (0, import_jsx_runtime109.jsx)("div", { className: "text-[20px] font-semibold", children: title }),
|
|
33001
32984
|
/* @__PURE__ */ (0, import_jsx_runtime109.jsx)("button", { className: "cursor-pointer", onClick: onClose, children: /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(CloseIcon, {}) })
|
|
33002
32985
|
] }),
|
|
33003
|
-
/* @__PURE__ */ (0, import_jsx_runtime109.jsxs)("div", { className: "grid grid-cols-3
|
|
33004
|
-
/* @__PURE__ */ (0, import_jsx_runtime109.jsx)("div", { className: "col-span-2
|
|
32986
|
+
/* @__PURE__ */ (0, import_jsx_runtime109.jsxs)("div", { className: "grid grid-cols-3 justify-between items-center py-2", children: [
|
|
32987
|
+
/* @__PURE__ */ (0, import_jsx_runtime109.jsx)("div", { className: "col-span-2", children: /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(
|
|
33005
32988
|
Search,
|
|
33006
32989
|
{
|
|
33007
32990
|
removeSearchItems,
|
|
@@ -33038,7 +33021,7 @@ var Many2ManyField = (props) => {
|
|
|
33038
33021
|
/* @__PURE__ */ (0, import_jsx_runtime109.jsx)(
|
|
33039
33022
|
PaginationView,
|
|
33040
33023
|
{
|
|
33041
|
-
className: "pagination-bar
|
|
33024
|
+
className: "pagination-bar justify-end flex-1 col-span-1",
|
|
33042
33025
|
currentPage: page,
|
|
33043
33026
|
totalCount: totalRows ?? 0,
|
|
33044
33027
|
pageSize: 10,
|
|
@@ -33052,90 +33035,25 @@ var Many2ManyField = (props) => {
|
|
|
33052
33035
|
}
|
|
33053
33036
|
)
|
|
33054
33037
|
] }),
|
|
33055
|
-
!isLoading && isFetched || isPlaceholderData ? /* @__PURE__ */ (0, import_jsx_runtime109.jsx)("div", { className: "relative overflow-y-auto", children: /* @__PURE__ */ (0, import_jsx_runtime109.jsx)("div", { className: "relative h-full w-full", children:
|
|
33056
|
-
|
|
33057
|
-
|
|
33058
|
-
|
|
33059
|
-
|
|
33060
|
-
|
|
33061
|
-
|
|
33062
|
-
|
|
33063
|
-
|
|
33064
|
-
|
|
33065
|
-
|
|
33066
|
-
|
|
33067
|
-
|
|
33068
|
-
|
|
33069
|
-
|
|
33070
|
-
|
|
33071
|
-
|
|
33072
|
-
|
|
33073
|
-
|
|
33074
|
-
checkedAll,
|
|
33075
|
-
handleCheckBoxAll
|
|
33076
|
-
}
|
|
33077
|
-
),
|
|
33078
|
-
rows?.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(
|
|
33079
|
-
TableBody,
|
|
33080
|
-
{
|
|
33081
|
-
tableGroupController,
|
|
33082
|
-
columns,
|
|
33083
|
-
rows,
|
|
33084
|
-
rootField,
|
|
33085
|
-
isDisplayCheckbox,
|
|
33086
|
-
model: relation,
|
|
33087
|
-
level: 0,
|
|
33088
|
-
renderField: ({
|
|
33089
|
-
row,
|
|
33090
|
-
col,
|
|
33091
|
-
indexRow,
|
|
33092
|
-
onChangeData,
|
|
33093
|
-
rootField: rootField2
|
|
33094
|
-
}) => {
|
|
33095
|
-
if (typeof renderField === "function") {
|
|
33096
|
-
return renderField({
|
|
33097
|
-
row,
|
|
33098
|
-
col,
|
|
33099
|
-
indexRow,
|
|
33100
|
-
onChangeData,
|
|
33101
|
-
rootField: rootField2
|
|
33102
|
-
});
|
|
33103
|
-
}
|
|
33104
|
-
},
|
|
33105
|
-
onRemoveRow: null,
|
|
33106
|
-
onAddRow,
|
|
33107
|
-
onClickRow,
|
|
33108
|
-
typeTable,
|
|
33109
|
-
selectedRowKeysRef,
|
|
33110
|
-
selectedRowKeys,
|
|
33111
|
-
setSelectedRowKeys,
|
|
33112
|
-
groupByList,
|
|
33113
|
-
specification,
|
|
33114
|
-
viewData,
|
|
33115
|
-
checkedAll,
|
|
33116
|
-
context
|
|
33117
|
-
}
|
|
33118
|
-
) : /* @__PURE__ */ (0, import_jsx_runtime109.jsx)("tr", { children: /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(
|
|
33119
|
-
"td",
|
|
33120
|
-
{
|
|
33121
|
-
className: "w-full",
|
|
33122
|
-
colSpan: columns?.length + 2,
|
|
33123
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(
|
|
33124
|
-
"div",
|
|
33125
|
-
{
|
|
33126
|
-
className: `flex flex-col items-center justify-center gap-3 py-6`,
|
|
33127
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(EmptyTable, {})
|
|
33128
|
-
}
|
|
33129
|
-
)
|
|
33130
|
-
}
|
|
33131
|
-
) })
|
|
33132
|
-
]
|
|
33133
|
-
}
|
|
33134
|
-
) })
|
|
33135
|
-
}
|
|
33136
|
-
) }) })
|
|
33137
|
-
}
|
|
33138
|
-
) }) }) : /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(LayerLoading, {}),
|
|
33038
|
+
!isLoading && isFetched || isPlaceholderData ? /* @__PURE__ */ (0, import_jsx_runtime109.jsx)("div", { className: "relative overflow-y-auto", children: /* @__PURE__ */ (0, import_jsx_runtime109.jsx)("div", { className: "relative h-full w-full", children: renderTable({
|
|
33039
|
+
columns,
|
|
33040
|
+
onToggleColumnOptional,
|
|
33041
|
+
isDisplayCheckbox,
|
|
33042
|
+
rows,
|
|
33043
|
+
model,
|
|
33044
|
+
onRemoveRow: null,
|
|
33045
|
+
onAddRow,
|
|
33046
|
+
onClickRow: (col, row) => {
|
|
33047
|
+
onChoose(row?.id);
|
|
33048
|
+
},
|
|
33049
|
+
typeTable,
|
|
33050
|
+
specification,
|
|
33051
|
+
viewData,
|
|
33052
|
+
context,
|
|
33053
|
+
selectedRowKeys,
|
|
33054
|
+
setSelectedRowKeys,
|
|
33055
|
+
groupByList
|
|
33056
|
+
}) }) }) : /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(LayerLoading, {}),
|
|
33139
33057
|
/* @__PURE__ */ (0, import_jsx_runtime109.jsxs)("div", { className: "flex items-center gap-2 mt-auto", children: [
|
|
33140
33058
|
isDisplayCheckbox && /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(
|
|
33141
33059
|
"button",
|
package/dist/widgets.mjs
CHANGED
|
@@ -9705,8 +9705,7 @@ var TableGroup = (props) => {
|
|
|
9705
9705
|
groupByList,
|
|
9706
9706
|
selectedRowKeys,
|
|
9707
9707
|
setSelectedRowKeys,
|
|
9708
|
-
onClickRow
|
|
9709
|
-
env
|
|
9708
|
+
onClickRow
|
|
9710
9709
|
} = props;
|
|
9711
9710
|
const {
|
|
9712
9711
|
onExpandChildGroup,
|
|
@@ -9833,8 +9832,7 @@ var TableGroup = (props) => {
|
|
|
9833
9832
|
groupByList,
|
|
9834
9833
|
selectedRowKeys,
|
|
9835
9834
|
setSelectedRowKeys,
|
|
9836
|
-
onClickRow
|
|
9837
|
-
env
|
|
9835
|
+
onClickRow
|
|
9838
9836
|
}
|
|
9839
9837
|
)
|
|
9840
9838
|
] });
|
|
@@ -9861,8 +9859,7 @@ var Row = (props) => {
|
|
|
9861
9859
|
onClickRow,
|
|
9862
9860
|
isAutoSelect,
|
|
9863
9861
|
selectedRowKeysRef,
|
|
9864
|
-
isEditTable
|
|
9865
|
-
env
|
|
9862
|
+
isEditTable
|
|
9866
9863
|
} = props;
|
|
9867
9864
|
const checkboxRef = useRef2("enabled");
|
|
9868
9865
|
const checked = useMemo3(() => {
|
|
@@ -9912,12 +9909,8 @@ var Row = (props) => {
|
|
|
9912
9909
|
return /* @__PURE__ */ jsx47(
|
|
9913
9910
|
"tr",
|
|
9914
9911
|
{
|
|
9915
|
-
"data-platform": env?.envFile?.PLATFORM === "edu" ? "edu" : "sme",
|
|
9916
9912
|
"data-row-id": row?.id,
|
|
9917
9913
|
className: `border-b border-[#e8e8e8] cursor-pointer`,
|
|
9918
|
-
style: {
|
|
9919
|
-
background: env?.envFile?.PLATFORM === "edu" ? "transparent" : indexRow % 2 === 0 ? "#FFF" : "#EEF3FB"
|
|
9920
|
-
},
|
|
9921
9914
|
children: /* @__PURE__ */ jsxs26(Fragment3, { children: [
|
|
9922
9915
|
isDisplayCheckbox && /* @__PURE__ */ jsx47(
|
|
9923
9916
|
"td",
|
|
@@ -10017,8 +10010,7 @@ var TableBodyRow = (props) => {
|
|
|
10017
10010
|
groupByList,
|
|
10018
10011
|
setIsAutoSelect,
|
|
10019
10012
|
isAutoSelect,
|
|
10020
|
-
isEditTable
|
|
10021
|
-
env
|
|
10013
|
+
isEditTable
|
|
10022
10014
|
} = props;
|
|
10023
10015
|
return rows && rows?.length > 0 && rows?.map((row, index4) => {
|
|
10024
10016
|
return typeTable === "group" ? /* @__PURE__ */ jsx48(
|
|
@@ -10043,8 +10035,7 @@ var TableBodyRow = (props) => {
|
|
|
10043
10035
|
tableGroupController,
|
|
10044
10036
|
setSelectedRowKeys,
|
|
10045
10037
|
selectedRowKeys,
|
|
10046
|
-
onClickRow
|
|
10047
|
-
env
|
|
10038
|
+
onClickRow
|
|
10048
10039
|
},
|
|
10049
10040
|
`record-group-${index4}`
|
|
10050
10041
|
) : /* @__PURE__ */ jsx48(
|
|
@@ -10067,8 +10058,7 @@ var TableBodyRow = (props) => {
|
|
|
10067
10058
|
isAutoSelect,
|
|
10068
10059
|
selectedRowKeysRef,
|
|
10069
10060
|
setSelectedRowKeys,
|
|
10070
|
-
isEditTable
|
|
10071
|
-
env
|
|
10061
|
+
isEditTable
|
|
10072
10062
|
},
|
|
10073
10063
|
`record-${index4}`
|
|
10074
10064
|
);
|
|
@@ -12019,11 +12009,10 @@ var TableHead = (props) => {
|
|
|
12019
12009
|
checkedAll,
|
|
12020
12010
|
onRemoveRow,
|
|
12021
12011
|
onToggleColumnOptional,
|
|
12022
|
-
env,
|
|
12023
12012
|
table
|
|
12024
12013
|
} = props;
|
|
12025
|
-
const headerGroups = table
|
|
12026
|
-
const headerGroup = headerGroups[0];
|
|
12014
|
+
const headerGroups = table?.getHeaderGroups();
|
|
12015
|
+
const headerGroup = headerGroups?.[0];
|
|
12027
12016
|
const visibleColumns = columns?.filter((value) => value?.optional !== "hide") ?? [];
|
|
12028
12017
|
return /* @__PURE__ */ jsx51("thead", { className: "relative z-10", children: /* @__PURE__ */ jsxs29(
|
|
12029
12018
|
"tr",
|
|
@@ -12033,8 +12022,7 @@ var TableHead = (props) => {
|
|
|
12033
12022
|
WebkitUserSelect: "none",
|
|
12034
12023
|
zIndex: 10,
|
|
12035
12024
|
position: "sticky",
|
|
12036
|
-
top: 0
|
|
12037
|
-
backgroundColor: env?.envFile?.PLATFORM === "edu" ? "rgb(239,241,242)" : "white"
|
|
12025
|
+
top: 0
|
|
12038
12026
|
},
|
|
12039
12027
|
className: "border-b border-[rgba(66,66,66,0.12)] ",
|
|
12040
12028
|
children: [
|
|
@@ -12086,7 +12074,7 @@ var TableHead = (props) => {
|
|
|
12086
12074
|
className: `cursor-pointer flex items-center gap-[4px] w-full group relative ${(col?.field?.type === "monetary" || col?.field?.widget === "monetary") && "justify-end"}`,
|
|
12087
12075
|
children: [
|
|
12088
12076
|
/* @__PURE__ */ jsx51("div", { className: "cursor-pointer flex justify-between items-center gap-[4px] w-full max-w-full truncate", children: /* @__PURE__ */ jsx51("span", { className: "truncate", children: col.title }) }),
|
|
12089
|
-
col?.field?.help &&
|
|
12077
|
+
col?.field?.help && /* @__PURE__ */ jsxs29(Fragment4, { children: [
|
|
12090
12078
|
createPortal(
|
|
12091
12079
|
/* @__PURE__ */ jsx51(
|
|
12092
12080
|
M,
|
|
@@ -32849,18 +32837,14 @@ var Many2ManyField = (props) => {
|
|
|
32849
32837
|
aid,
|
|
32850
32838
|
title,
|
|
32851
32839
|
onClose,
|
|
32852
|
-
renderField,
|
|
32853
|
-
relation,
|
|
32854
32840
|
onChoose,
|
|
32855
32841
|
onAddNew,
|
|
32856
|
-
rootField,
|
|
32857
32842
|
isDisplayCheckbox,
|
|
32858
32843
|
onAddRow,
|
|
32859
|
-
onClickRow,
|
|
32860
32844
|
evalJSONContext,
|
|
32861
|
-
tableGroupController,
|
|
32862
32845
|
many2manyController,
|
|
32863
|
-
|
|
32846
|
+
renderTable,
|
|
32847
|
+
model
|
|
32864
32848
|
} = props;
|
|
32865
32849
|
const {
|
|
32866
32850
|
handleCreateNewOnPage,
|
|
@@ -32900,7 +32884,6 @@ var Many2ManyField = (props) => {
|
|
|
32900
32884
|
setGroupBy,
|
|
32901
32885
|
clearSearch
|
|
32902
32886
|
} = searchController;
|
|
32903
|
-
const { handleCheckBoxAll, checkedAll, selectedRowKeysRef } = tableHeadController;
|
|
32904
32887
|
useEffect27(() => {
|
|
32905
32888
|
const groupItems = Array.isArray(selectedTags) ? selectedTags.filter((item) => item.type === "group_by") : [];
|
|
32906
32889
|
if (groupItems?.length > 0) {
|
|
@@ -32920,7 +32903,7 @@ var Many2ManyField = (props) => {
|
|
|
32920
32903
|
"div",
|
|
32921
32904
|
{
|
|
32922
32905
|
style: {
|
|
32923
|
-
zIndex:
|
|
32906
|
+
zIndex: 22
|
|
32924
32907
|
},
|
|
32925
32908
|
className: "fixed bottom-0 left-0 right-0 top-0",
|
|
32926
32909
|
children: [
|
|
@@ -32937,8 +32920,8 @@ var Many2ManyField = (props) => {
|
|
|
32937
32920
|
/* @__PURE__ */ jsx111("div", { className: "text-[20px] font-semibold", children: title }),
|
|
32938
32921
|
/* @__PURE__ */ jsx111("button", { className: "cursor-pointer", onClick: onClose, children: /* @__PURE__ */ jsx111(CloseIcon, {}) })
|
|
32939
32922
|
] }),
|
|
32940
|
-
/* @__PURE__ */ jsxs74("div", { className: "grid grid-cols-3
|
|
32941
|
-
/* @__PURE__ */ jsx111("div", { className: "col-span-2
|
|
32923
|
+
/* @__PURE__ */ jsxs74("div", { className: "grid grid-cols-3 justify-between items-center py-2", children: [
|
|
32924
|
+
/* @__PURE__ */ jsx111("div", { className: "col-span-2", children: /* @__PURE__ */ jsx111(
|
|
32942
32925
|
Search,
|
|
32943
32926
|
{
|
|
32944
32927
|
removeSearchItems,
|
|
@@ -32975,7 +32958,7 @@ var Many2ManyField = (props) => {
|
|
|
32975
32958
|
/* @__PURE__ */ jsx111(
|
|
32976
32959
|
PaginationView,
|
|
32977
32960
|
{
|
|
32978
|
-
className: "pagination-bar
|
|
32961
|
+
className: "pagination-bar justify-end flex-1 col-span-1",
|
|
32979
32962
|
currentPage: page,
|
|
32980
32963
|
totalCount: totalRows ?? 0,
|
|
32981
32964
|
pageSize: 10,
|
|
@@ -32989,90 +32972,25 @@ var Many2ManyField = (props) => {
|
|
|
32989
32972
|
}
|
|
32990
32973
|
)
|
|
32991
32974
|
] }),
|
|
32992
|
-
!isLoading && isFetched || isPlaceholderData ? /* @__PURE__ */ jsx111("div", { className: "relative overflow-y-auto", children: /* @__PURE__ */ jsx111("div", { className: "relative h-full w-full", children:
|
|
32993
|
-
|
|
32994
|
-
|
|
32995
|
-
|
|
32996
|
-
|
|
32997
|
-
|
|
32998
|
-
|
|
32999
|
-
|
|
33000
|
-
|
|
33001
|
-
|
|
33002
|
-
|
|
33003
|
-
|
|
33004
|
-
|
|
33005
|
-
|
|
33006
|
-
|
|
33007
|
-
|
|
33008
|
-
|
|
33009
|
-
|
|
33010
|
-
|
|
33011
|
-
checkedAll,
|
|
33012
|
-
handleCheckBoxAll
|
|
33013
|
-
}
|
|
33014
|
-
),
|
|
33015
|
-
rows?.length > 0 ? /* @__PURE__ */ jsx111(
|
|
33016
|
-
TableBody,
|
|
33017
|
-
{
|
|
33018
|
-
tableGroupController,
|
|
33019
|
-
columns,
|
|
33020
|
-
rows,
|
|
33021
|
-
rootField,
|
|
33022
|
-
isDisplayCheckbox,
|
|
33023
|
-
model: relation,
|
|
33024
|
-
level: 0,
|
|
33025
|
-
renderField: ({
|
|
33026
|
-
row,
|
|
33027
|
-
col,
|
|
33028
|
-
indexRow,
|
|
33029
|
-
onChangeData,
|
|
33030
|
-
rootField: rootField2
|
|
33031
|
-
}) => {
|
|
33032
|
-
if (typeof renderField === "function") {
|
|
33033
|
-
return renderField({
|
|
33034
|
-
row,
|
|
33035
|
-
col,
|
|
33036
|
-
indexRow,
|
|
33037
|
-
onChangeData,
|
|
33038
|
-
rootField: rootField2
|
|
33039
|
-
});
|
|
33040
|
-
}
|
|
33041
|
-
},
|
|
33042
|
-
onRemoveRow: null,
|
|
33043
|
-
onAddRow,
|
|
33044
|
-
onClickRow,
|
|
33045
|
-
typeTable,
|
|
33046
|
-
selectedRowKeysRef,
|
|
33047
|
-
selectedRowKeys,
|
|
33048
|
-
setSelectedRowKeys,
|
|
33049
|
-
groupByList,
|
|
33050
|
-
specification,
|
|
33051
|
-
viewData,
|
|
33052
|
-
checkedAll,
|
|
33053
|
-
context
|
|
33054
|
-
}
|
|
33055
|
-
) : /* @__PURE__ */ jsx111("tr", { children: /* @__PURE__ */ jsx111(
|
|
33056
|
-
"td",
|
|
33057
|
-
{
|
|
33058
|
-
className: "w-full",
|
|
33059
|
-
colSpan: columns?.length + 2,
|
|
33060
|
-
children: /* @__PURE__ */ jsx111(
|
|
33061
|
-
"div",
|
|
33062
|
-
{
|
|
33063
|
-
className: `flex flex-col items-center justify-center gap-3 py-6`,
|
|
33064
|
-
children: /* @__PURE__ */ jsx111(EmptyTable, {})
|
|
33065
|
-
}
|
|
33066
|
-
)
|
|
33067
|
-
}
|
|
33068
|
-
) })
|
|
33069
|
-
]
|
|
33070
|
-
}
|
|
33071
|
-
) })
|
|
33072
|
-
}
|
|
33073
|
-
) }) })
|
|
33074
|
-
}
|
|
33075
|
-
) }) }) : /* @__PURE__ */ jsx111(LayerLoading, {}),
|
|
32975
|
+
!isLoading && isFetched || isPlaceholderData ? /* @__PURE__ */ jsx111("div", { className: "relative overflow-y-auto", children: /* @__PURE__ */ jsx111("div", { className: "relative h-full w-full", children: renderTable({
|
|
32976
|
+
columns,
|
|
32977
|
+
onToggleColumnOptional,
|
|
32978
|
+
isDisplayCheckbox,
|
|
32979
|
+
rows,
|
|
32980
|
+
model,
|
|
32981
|
+
onRemoveRow: null,
|
|
32982
|
+
onAddRow,
|
|
32983
|
+
onClickRow: (col, row) => {
|
|
32984
|
+
onChoose(row?.id);
|
|
32985
|
+
},
|
|
32986
|
+
typeTable,
|
|
32987
|
+
specification,
|
|
32988
|
+
viewData,
|
|
32989
|
+
context,
|
|
32990
|
+
selectedRowKeys,
|
|
32991
|
+
setSelectedRowKeys,
|
|
32992
|
+
groupByList
|
|
32993
|
+
}) }) }) : /* @__PURE__ */ jsx111(LayerLoading, {}),
|
|
33076
32994
|
/* @__PURE__ */ jsxs74("div", { className: "flex items-center gap-2 mt-auto", children: [
|
|
33077
32995
|
isDisplayCheckbox && /* @__PURE__ */ jsx111(
|
|
33078
32996
|
"button",
|