@fctc/sme-widget-ui 2.8.4 → 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 CHANGED
@@ -13082,8 +13082,8 @@ var TableHead = (props) => {
13082
13082
  onToggleColumnOptional,
13083
13083
  table
13084
13084
  } = props;
13085
- const headerGroups = table.getHeaderGroups();
13086
- const headerGroup = headerGroups[0];
13085
+ const headerGroups = table?.getHeaderGroups();
13086
+ const headerGroup = headerGroups?.[0];
13087
13087
  const visibleColumns = columns?.filter((value) => value?.optional !== "hide") ?? [];
13088
13088
  return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("thead", { className: "relative z-10", children: /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
13089
13089
  "tr",
@@ -33651,18 +33651,14 @@ var Many2ManyField = (props) => {
33651
33651
  aid,
33652
33652
  title,
33653
33653
  onClose,
33654
- renderField,
33655
- relation,
33656
33654
  onChoose,
33657
33655
  onAddNew,
33658
- rootField,
33659
33656
  isDisplayCheckbox,
33660
33657
  onAddRow,
33661
- onClickRow,
33662
33658
  evalJSONContext,
33663
- tableGroupController,
33664
33659
  many2manyController,
33665
- tableHeadController
33660
+ renderTable,
33661
+ model
33666
33662
  } = props;
33667
33663
  const {
33668
33664
  handleCreateNewOnPage,
@@ -33702,7 +33698,6 @@ var Many2ManyField = (props) => {
33702
33698
  setGroupBy,
33703
33699
  clearSearch
33704
33700
  } = searchController;
33705
- const { handleCheckBoxAll, checkedAll, selectedRowKeysRef } = tableHeadController;
33706
33701
  (0, import_react67.useEffect)(() => {
33707
33702
  const groupItems = Array.isArray(selectedTags) ? selectedTags.filter((item) => item.type === "group_by") : [];
33708
33703
  if (groupItems?.length > 0) {
@@ -33722,7 +33717,7 @@ var Many2ManyField = (props) => {
33722
33717
  "div",
33723
33718
  {
33724
33719
  style: {
33725
- zIndex: 999
33720
+ zIndex: 22
33726
33721
  },
33727
33722
  className: "fixed bottom-0 left-0 right-0 top-0",
33728
33723
  children: [
@@ -33739,8 +33734,8 @@ var Many2ManyField = (props) => {
33739
33734
  /* @__PURE__ */ (0, import_jsx_runtime109.jsx)("div", { className: "text-[20px] font-semibold", children: title }),
33740
33735
  /* @__PURE__ */ (0, import_jsx_runtime109.jsx)("button", { className: "cursor-pointer", onClick: onClose, children: /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(CloseIcon, {}) })
33741
33736
  ] }),
33742
- /* @__PURE__ */ (0, import_jsx_runtime109.jsxs)("div", { className: "grid grid-cols-3 gap-2 items-center py-2", children: [
33743
- /* @__PURE__ */ (0, import_jsx_runtime109.jsx)("div", { className: "col-span-2 flex-1", children: /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(
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)(
33744
33739
  Search,
33745
33740
  {
33746
33741
  removeSearchItems,
@@ -33777,7 +33772,7 @@ var Many2ManyField = (props) => {
33777
33772
  /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(
33778
33773
  PaginationView,
33779
33774
  {
33780
- className: "pagination-bar col-span-1 justify-end flex-1",
33775
+ className: "pagination-bar justify-end flex-1 col-span-1",
33781
33776
  currentPage: page,
33782
33777
  totalCount: totalRows ?? 0,
33783
33778
  pageSize: 10,
@@ -33791,90 +33786,25 @@ var Many2ManyField = (props) => {
33791
33786
  }
33792
33787
  )
33793
33788
  ] }),
33794
- !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: /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(
33795
- "div",
33796
- {
33797
- className: `border-y h-full border-solid border-[#dbe0e6] rounded-[10px] relative w-full overflow-hidden`,
33798
- children: /* @__PURE__ */ (0, import_jsx_runtime109.jsx)("div", { className: "flex flex-col gap-[16px] w-full h-full", children: /* @__PURE__ */ (0, import_jsx_runtime109.jsx)("div", { className: `relative w-full h-full`, children: /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(
33799
- "div",
33800
- {
33801
- className: `flex w-full items-center h-full overflow-auto `,
33802
- children: /* @__PURE__ */ (0, import_jsx_runtime109.jsx)("div", { className: "w-full h-full max-w-full", children: /* @__PURE__ */ (0, import_jsx_runtime109.jsxs)(
33803
- "table",
33804
- {
33805
- className: `relative w-full bg-white custom-dropdown `,
33806
- children: [
33807
- /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(
33808
- TableHead,
33809
- {
33810
- columns,
33811
- onToggleColumnOptional,
33812
- isDisplayCheckbox,
33813
- checkedAll,
33814
- handleCheckBoxAll
33815
- }
33816
- ),
33817
- rows?.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(
33818
- TableBody,
33819
- {
33820
- tableGroupController,
33821
- columns,
33822
- rows,
33823
- rootField,
33824
- isDisplayCheckbox,
33825
- model: relation,
33826
- level: 0,
33827
- renderField: ({
33828
- row,
33829
- col,
33830
- indexRow,
33831
- onChangeData,
33832
- rootField: rootField2
33833
- }) => {
33834
- if (typeof renderField === "function") {
33835
- return renderField({
33836
- row,
33837
- col,
33838
- indexRow,
33839
- onChangeData,
33840
- rootField: rootField2
33841
- });
33842
- }
33843
- },
33844
- onRemoveRow: null,
33845
- onAddRow,
33846
- onClickRow,
33847
- typeTable,
33848
- selectedRowKeysRef,
33849
- selectedRowKeys,
33850
- setSelectedRowKeys,
33851
- groupByList,
33852
- specification,
33853
- viewData,
33854
- checkedAll,
33855
- context
33856
- }
33857
- ) : /* @__PURE__ */ (0, import_jsx_runtime109.jsx)("tr", { children: /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(
33858
- "td",
33859
- {
33860
- className: "w-full",
33861
- colSpan: columns?.length + 2,
33862
- children: /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(
33863
- "div",
33864
- {
33865
- className: `flex flex-col items-center justify-center gap-3 py-6`,
33866
- children: /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(EmptyTable, {})
33867
- }
33868
- )
33869
- }
33870
- ) })
33871
- ]
33872
- }
33873
- ) })
33874
- }
33875
- ) }) })
33876
- }
33877
- ) }) }) : /* @__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, {}),
33878
33808
  /* @__PURE__ */ (0, import_jsx_runtime109.jsxs)("div", { className: "flex items-center gap-2 mt-auto", children: [
33879
33809
  isDisplayCheckbox && /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(
33880
33810
  "button",
package/dist/index.mjs CHANGED
@@ -12955,8 +12955,8 @@ var TableHead = (props) => {
12955
12955
  onToggleColumnOptional,
12956
12956
  table
12957
12957
  } = props;
12958
- const headerGroups = table.getHeaderGroups();
12959
- const headerGroup = headerGroups[0];
12958
+ const headerGroups = table?.getHeaderGroups();
12959
+ const headerGroup = headerGroups?.[0];
12960
12960
  const visibleColumns = columns?.filter((value) => value?.optional !== "hide") ?? [];
12961
12961
  return /* @__PURE__ */ jsx51("thead", { className: "relative z-10", children: /* @__PURE__ */ jsxs29(
12962
12962
  "tr",
@@ -33524,18 +33524,14 @@ var Many2ManyField = (props) => {
33524
33524
  aid,
33525
33525
  title,
33526
33526
  onClose,
33527
- renderField,
33528
- relation,
33529
33527
  onChoose,
33530
33528
  onAddNew,
33531
- rootField,
33532
33529
  isDisplayCheckbox,
33533
33530
  onAddRow,
33534
- onClickRow,
33535
33531
  evalJSONContext,
33536
- tableGroupController,
33537
33532
  many2manyController,
33538
- tableHeadController
33533
+ renderTable,
33534
+ model
33539
33535
  } = props;
33540
33536
  const {
33541
33537
  handleCreateNewOnPage,
@@ -33575,7 +33571,6 @@ var Many2ManyField = (props) => {
33575
33571
  setGroupBy,
33576
33572
  clearSearch
33577
33573
  } = searchController;
33578
- const { handleCheckBoxAll, checkedAll, selectedRowKeysRef } = tableHeadController;
33579
33574
  useEffect27(() => {
33580
33575
  const groupItems = Array.isArray(selectedTags) ? selectedTags.filter((item) => item.type === "group_by") : [];
33581
33576
  if (groupItems?.length > 0) {
@@ -33595,7 +33590,7 @@ var Many2ManyField = (props) => {
33595
33590
  "div",
33596
33591
  {
33597
33592
  style: {
33598
- zIndex: 999
33593
+ zIndex: 22
33599
33594
  },
33600
33595
  className: "fixed bottom-0 left-0 right-0 top-0",
33601
33596
  children: [
@@ -33612,8 +33607,8 @@ var Many2ManyField = (props) => {
33612
33607
  /* @__PURE__ */ jsx111("div", { className: "text-[20px] font-semibold", children: title }),
33613
33608
  /* @__PURE__ */ jsx111("button", { className: "cursor-pointer", onClick: onClose, children: /* @__PURE__ */ jsx111(CloseIcon, {}) })
33614
33609
  ] }),
33615
- /* @__PURE__ */ jsxs74("div", { className: "grid grid-cols-3 gap-2 items-center py-2", children: [
33616
- /* @__PURE__ */ jsx111("div", { className: "col-span-2 flex-1", children: /* @__PURE__ */ jsx111(
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(
33617
33612
  Search,
33618
33613
  {
33619
33614
  removeSearchItems,
@@ -33650,7 +33645,7 @@ var Many2ManyField = (props) => {
33650
33645
  /* @__PURE__ */ jsx111(
33651
33646
  PaginationView,
33652
33647
  {
33653
- className: "pagination-bar col-span-1 justify-end flex-1",
33648
+ className: "pagination-bar justify-end flex-1 col-span-1",
33654
33649
  currentPage: page,
33655
33650
  totalCount: totalRows ?? 0,
33656
33651
  pageSize: 10,
@@ -33664,90 +33659,25 @@ var Many2ManyField = (props) => {
33664
33659
  }
33665
33660
  )
33666
33661
  ] }),
33667
- !isLoading && isFetched || isPlaceholderData ? /* @__PURE__ */ jsx111("div", { className: "relative overflow-y-auto", children: /* @__PURE__ */ jsx111("div", { className: "relative h-full w-full", children: /* @__PURE__ */ jsx111(
33668
- "div",
33669
- {
33670
- className: `border-y h-full border-solid border-[#dbe0e6] rounded-[10px] relative w-full overflow-hidden`,
33671
- children: /* @__PURE__ */ jsx111("div", { className: "flex flex-col gap-[16px] w-full h-full", children: /* @__PURE__ */ jsx111("div", { className: `relative w-full h-full`, children: /* @__PURE__ */ jsx111(
33672
- "div",
33673
- {
33674
- className: `flex w-full items-center h-full overflow-auto `,
33675
- children: /* @__PURE__ */ jsx111("div", { className: "w-full h-full max-w-full", children: /* @__PURE__ */ jsxs74(
33676
- "table",
33677
- {
33678
- className: `relative w-full bg-white custom-dropdown `,
33679
- children: [
33680
- /* @__PURE__ */ jsx111(
33681
- TableHead,
33682
- {
33683
- columns,
33684
- onToggleColumnOptional,
33685
- isDisplayCheckbox,
33686
- checkedAll,
33687
- handleCheckBoxAll
33688
- }
33689
- ),
33690
- rows?.length > 0 ? /* @__PURE__ */ jsx111(
33691
- TableBody,
33692
- {
33693
- tableGroupController,
33694
- columns,
33695
- rows,
33696
- rootField,
33697
- isDisplayCheckbox,
33698
- model: relation,
33699
- level: 0,
33700
- renderField: ({
33701
- row,
33702
- col,
33703
- indexRow,
33704
- onChangeData,
33705
- rootField: rootField2
33706
- }) => {
33707
- if (typeof renderField === "function") {
33708
- return renderField({
33709
- row,
33710
- col,
33711
- indexRow,
33712
- onChangeData,
33713
- rootField: rootField2
33714
- });
33715
- }
33716
- },
33717
- onRemoveRow: null,
33718
- onAddRow,
33719
- onClickRow,
33720
- typeTable,
33721
- selectedRowKeysRef,
33722
- selectedRowKeys,
33723
- setSelectedRowKeys,
33724
- groupByList,
33725
- specification,
33726
- viewData,
33727
- checkedAll,
33728
- context
33729
- }
33730
- ) : /* @__PURE__ */ jsx111("tr", { children: /* @__PURE__ */ jsx111(
33731
- "td",
33732
- {
33733
- className: "w-full",
33734
- colSpan: columns?.length + 2,
33735
- children: /* @__PURE__ */ jsx111(
33736
- "div",
33737
- {
33738
- className: `flex flex-col items-center justify-center gap-3 py-6`,
33739
- children: /* @__PURE__ */ jsx111(EmptyTable, {})
33740
- }
33741
- )
33742
- }
33743
- ) })
33744
- ]
33745
- }
33746
- ) })
33747
- }
33748
- ) }) })
33749
- }
33750
- ) }) }) : /* @__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, {}),
33751
33681
  /* @__PURE__ */ jsxs74("div", { className: "flex items-center gap-2 mt-auto", children: [
33752
33682
  isDisplayCheckbox && /* @__PURE__ */ jsx111(
33753
33683
  "button",
@@ -436,6 +436,7 @@ interface Many2ManyProps extends IInputFieldProps {
436
436
  tableGroupController: (props: TableGroupControllerProps) => TableGroupControllerReturn;
437
437
  many2manyController?: any;
438
438
  tableHeadController?: any;
439
+ renderTable?: any;
439
440
  }
440
441
 
441
442
  declare const Many2ManyField: (props: Many2ManyProps) => React$1.ReactPortal;
package/dist/widgets.d.ts CHANGED
@@ -436,6 +436,7 @@ interface Many2ManyProps extends IInputFieldProps {
436
436
  tableGroupController: (props: TableGroupControllerProps) => TableGroupControllerReturn;
437
437
  many2manyController?: any;
438
438
  tableHeadController?: any;
439
+ renderTable?: any;
439
440
  }
440
441
 
441
442
  declare const Many2ManyField: (props: Many2ManyProps) => React$1.ReactPortal;
package/dist/widgets.js CHANGED
@@ -12074,8 +12074,8 @@ var TableHead = (props) => {
12074
12074
  onToggleColumnOptional,
12075
12075
  table
12076
12076
  } = props;
12077
- const headerGroups = table.getHeaderGroups();
12078
- const headerGroup = headerGroups[0];
12077
+ const headerGroups = table?.getHeaderGroups();
12078
+ const headerGroup = headerGroups?.[0];
12079
12079
  const visibleColumns = columns?.filter((value) => value?.optional !== "hide") ?? [];
12080
12080
  return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("thead", { className: "relative z-10", children: /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
12081
12081
  "tr",
@@ -32900,18 +32900,14 @@ var Many2ManyField = (props) => {
32900
32900
  aid,
32901
32901
  title,
32902
32902
  onClose,
32903
- renderField,
32904
- relation,
32905
32903
  onChoose,
32906
32904
  onAddNew,
32907
- rootField,
32908
32905
  isDisplayCheckbox,
32909
32906
  onAddRow,
32910
- onClickRow,
32911
32907
  evalJSONContext,
32912
- tableGroupController,
32913
32908
  many2manyController,
32914
- tableHeadController
32909
+ renderTable,
32910
+ model
32915
32911
  } = props;
32916
32912
  const {
32917
32913
  handleCreateNewOnPage,
@@ -32951,7 +32947,6 @@ var Many2ManyField = (props) => {
32951
32947
  setGroupBy,
32952
32948
  clearSearch
32953
32949
  } = searchController;
32954
- const { handleCheckBoxAll, checkedAll, selectedRowKeysRef } = tableHeadController;
32955
32950
  (0, import_react67.useEffect)(() => {
32956
32951
  const groupItems = Array.isArray(selectedTags) ? selectedTags.filter((item) => item.type === "group_by") : [];
32957
32952
  if (groupItems?.length > 0) {
@@ -32971,7 +32966,7 @@ var Many2ManyField = (props) => {
32971
32966
  "div",
32972
32967
  {
32973
32968
  style: {
32974
- zIndex: 999
32969
+ zIndex: 22
32975
32970
  },
32976
32971
  className: "fixed bottom-0 left-0 right-0 top-0",
32977
32972
  children: [
@@ -32988,8 +32983,8 @@ var Many2ManyField = (props) => {
32988
32983
  /* @__PURE__ */ (0, import_jsx_runtime109.jsx)("div", { className: "text-[20px] font-semibold", children: title }),
32989
32984
  /* @__PURE__ */ (0, import_jsx_runtime109.jsx)("button", { className: "cursor-pointer", onClick: onClose, children: /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(CloseIcon, {}) })
32990
32985
  ] }),
32991
- /* @__PURE__ */ (0, import_jsx_runtime109.jsxs)("div", { className: "grid grid-cols-3 gap-2 items-center py-2", children: [
32992
- /* @__PURE__ */ (0, import_jsx_runtime109.jsx)("div", { className: "col-span-2 flex-1", children: /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(
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)(
32993
32988
  Search,
32994
32989
  {
32995
32990
  removeSearchItems,
@@ -33026,7 +33021,7 @@ var Many2ManyField = (props) => {
33026
33021
  /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(
33027
33022
  PaginationView,
33028
33023
  {
33029
- className: "pagination-bar col-span-1 justify-end flex-1",
33024
+ className: "pagination-bar justify-end flex-1 col-span-1",
33030
33025
  currentPage: page,
33031
33026
  totalCount: totalRows ?? 0,
33032
33027
  pageSize: 10,
@@ -33040,90 +33035,25 @@ var Many2ManyField = (props) => {
33040
33035
  }
33041
33036
  )
33042
33037
  ] }),
33043
- !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: /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(
33044
- "div",
33045
- {
33046
- className: `border-y h-full border-solid border-[#dbe0e6] rounded-[10px] relative w-full overflow-hidden`,
33047
- children: /* @__PURE__ */ (0, import_jsx_runtime109.jsx)("div", { className: "flex flex-col gap-[16px] w-full h-full", children: /* @__PURE__ */ (0, import_jsx_runtime109.jsx)("div", { className: `relative w-full h-full`, children: /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(
33048
- "div",
33049
- {
33050
- className: `flex w-full items-center h-full overflow-auto `,
33051
- children: /* @__PURE__ */ (0, import_jsx_runtime109.jsx)("div", { className: "w-full h-full max-w-full", children: /* @__PURE__ */ (0, import_jsx_runtime109.jsxs)(
33052
- "table",
33053
- {
33054
- className: `relative w-full bg-white custom-dropdown `,
33055
- children: [
33056
- /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(
33057
- TableHead,
33058
- {
33059
- columns,
33060
- onToggleColumnOptional,
33061
- isDisplayCheckbox,
33062
- checkedAll,
33063
- handleCheckBoxAll
33064
- }
33065
- ),
33066
- rows?.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(
33067
- TableBody,
33068
- {
33069
- tableGroupController,
33070
- columns,
33071
- rows,
33072
- rootField,
33073
- isDisplayCheckbox,
33074
- model: relation,
33075
- level: 0,
33076
- renderField: ({
33077
- row,
33078
- col,
33079
- indexRow,
33080
- onChangeData,
33081
- rootField: rootField2
33082
- }) => {
33083
- if (typeof renderField === "function") {
33084
- return renderField({
33085
- row,
33086
- col,
33087
- indexRow,
33088
- onChangeData,
33089
- rootField: rootField2
33090
- });
33091
- }
33092
- },
33093
- onRemoveRow: null,
33094
- onAddRow,
33095
- onClickRow,
33096
- typeTable,
33097
- selectedRowKeysRef,
33098
- selectedRowKeys,
33099
- setSelectedRowKeys,
33100
- groupByList,
33101
- specification,
33102
- viewData,
33103
- checkedAll,
33104
- context
33105
- }
33106
- ) : /* @__PURE__ */ (0, import_jsx_runtime109.jsx)("tr", { children: /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(
33107
- "td",
33108
- {
33109
- className: "w-full",
33110
- colSpan: columns?.length + 2,
33111
- children: /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(
33112
- "div",
33113
- {
33114
- className: `flex flex-col items-center justify-center gap-3 py-6`,
33115
- children: /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(EmptyTable, {})
33116
- }
33117
- )
33118
- }
33119
- ) })
33120
- ]
33121
- }
33122
- ) })
33123
- }
33124
- ) }) })
33125
- }
33126
- ) }) }) : /* @__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, {}),
33127
33057
  /* @__PURE__ */ (0, import_jsx_runtime109.jsxs)("div", { className: "flex items-center gap-2 mt-auto", children: [
33128
33058
  isDisplayCheckbox && /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(
33129
33059
  "button",
package/dist/widgets.mjs CHANGED
@@ -12011,8 +12011,8 @@ var TableHead = (props) => {
12011
12011
  onToggleColumnOptional,
12012
12012
  table
12013
12013
  } = props;
12014
- const headerGroups = table.getHeaderGroups();
12015
- const headerGroup = headerGroups[0];
12014
+ const headerGroups = table?.getHeaderGroups();
12015
+ const headerGroup = headerGroups?.[0];
12016
12016
  const visibleColumns = columns?.filter((value) => value?.optional !== "hide") ?? [];
12017
12017
  return /* @__PURE__ */ jsx51("thead", { className: "relative z-10", children: /* @__PURE__ */ jsxs29(
12018
12018
  "tr",
@@ -32837,18 +32837,14 @@ var Many2ManyField = (props) => {
32837
32837
  aid,
32838
32838
  title,
32839
32839
  onClose,
32840
- renderField,
32841
- relation,
32842
32840
  onChoose,
32843
32841
  onAddNew,
32844
- rootField,
32845
32842
  isDisplayCheckbox,
32846
32843
  onAddRow,
32847
- onClickRow,
32848
32844
  evalJSONContext,
32849
- tableGroupController,
32850
32845
  many2manyController,
32851
- tableHeadController
32846
+ renderTable,
32847
+ model
32852
32848
  } = props;
32853
32849
  const {
32854
32850
  handleCreateNewOnPage,
@@ -32888,7 +32884,6 @@ var Many2ManyField = (props) => {
32888
32884
  setGroupBy,
32889
32885
  clearSearch
32890
32886
  } = searchController;
32891
- const { handleCheckBoxAll, checkedAll, selectedRowKeysRef } = tableHeadController;
32892
32887
  useEffect27(() => {
32893
32888
  const groupItems = Array.isArray(selectedTags) ? selectedTags.filter((item) => item.type === "group_by") : [];
32894
32889
  if (groupItems?.length > 0) {
@@ -32908,7 +32903,7 @@ var Many2ManyField = (props) => {
32908
32903
  "div",
32909
32904
  {
32910
32905
  style: {
32911
- zIndex: 999
32906
+ zIndex: 22
32912
32907
  },
32913
32908
  className: "fixed bottom-0 left-0 right-0 top-0",
32914
32909
  children: [
@@ -32925,8 +32920,8 @@ var Many2ManyField = (props) => {
32925
32920
  /* @__PURE__ */ jsx111("div", { className: "text-[20px] font-semibold", children: title }),
32926
32921
  /* @__PURE__ */ jsx111("button", { className: "cursor-pointer", onClick: onClose, children: /* @__PURE__ */ jsx111(CloseIcon, {}) })
32927
32922
  ] }),
32928
- /* @__PURE__ */ jsxs74("div", { className: "grid grid-cols-3 gap-2 items-center py-2", children: [
32929
- /* @__PURE__ */ jsx111("div", { className: "col-span-2 flex-1", children: /* @__PURE__ */ jsx111(
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(
32930
32925
  Search,
32931
32926
  {
32932
32927
  removeSearchItems,
@@ -32963,7 +32958,7 @@ var Many2ManyField = (props) => {
32963
32958
  /* @__PURE__ */ jsx111(
32964
32959
  PaginationView,
32965
32960
  {
32966
- className: "pagination-bar col-span-1 justify-end flex-1",
32961
+ className: "pagination-bar justify-end flex-1 col-span-1",
32967
32962
  currentPage: page,
32968
32963
  totalCount: totalRows ?? 0,
32969
32964
  pageSize: 10,
@@ -32977,90 +32972,25 @@ var Many2ManyField = (props) => {
32977
32972
  }
32978
32973
  )
32979
32974
  ] }),
32980
- !isLoading && isFetched || isPlaceholderData ? /* @__PURE__ */ jsx111("div", { className: "relative overflow-y-auto", children: /* @__PURE__ */ jsx111("div", { className: "relative h-full w-full", children: /* @__PURE__ */ jsx111(
32981
- "div",
32982
- {
32983
- className: `border-y h-full border-solid border-[#dbe0e6] rounded-[10px] relative w-full overflow-hidden`,
32984
- children: /* @__PURE__ */ jsx111("div", { className: "flex flex-col gap-[16px] w-full h-full", children: /* @__PURE__ */ jsx111("div", { className: `relative w-full h-full`, children: /* @__PURE__ */ jsx111(
32985
- "div",
32986
- {
32987
- className: `flex w-full items-center h-full overflow-auto `,
32988
- children: /* @__PURE__ */ jsx111("div", { className: "w-full h-full max-w-full", children: /* @__PURE__ */ jsxs74(
32989
- "table",
32990
- {
32991
- className: `relative w-full bg-white custom-dropdown `,
32992
- children: [
32993
- /* @__PURE__ */ jsx111(
32994
- TableHead,
32995
- {
32996
- columns,
32997
- onToggleColumnOptional,
32998
- isDisplayCheckbox,
32999
- checkedAll,
33000
- handleCheckBoxAll
33001
- }
33002
- ),
33003
- rows?.length > 0 ? /* @__PURE__ */ jsx111(
33004
- TableBody,
33005
- {
33006
- tableGroupController,
33007
- columns,
33008
- rows,
33009
- rootField,
33010
- isDisplayCheckbox,
33011
- model: relation,
33012
- level: 0,
33013
- renderField: ({
33014
- row,
33015
- col,
33016
- indexRow,
33017
- onChangeData,
33018
- rootField: rootField2
33019
- }) => {
33020
- if (typeof renderField === "function") {
33021
- return renderField({
33022
- row,
33023
- col,
33024
- indexRow,
33025
- onChangeData,
33026
- rootField: rootField2
33027
- });
33028
- }
33029
- },
33030
- onRemoveRow: null,
33031
- onAddRow,
33032
- onClickRow,
33033
- typeTable,
33034
- selectedRowKeysRef,
33035
- selectedRowKeys,
33036
- setSelectedRowKeys,
33037
- groupByList,
33038
- specification,
33039
- viewData,
33040
- checkedAll,
33041
- context
33042
- }
33043
- ) : /* @__PURE__ */ jsx111("tr", { children: /* @__PURE__ */ jsx111(
33044
- "td",
33045
- {
33046
- className: "w-full",
33047
- colSpan: columns?.length + 2,
33048
- children: /* @__PURE__ */ jsx111(
33049
- "div",
33050
- {
33051
- className: `flex flex-col items-center justify-center gap-3 py-6`,
33052
- children: /* @__PURE__ */ jsx111(EmptyTable, {})
33053
- }
33054
- )
33055
- }
33056
- ) })
33057
- ]
33058
- }
33059
- ) })
33060
- }
33061
- ) }) })
33062
- }
33063
- ) }) }) : /* @__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, {}),
33064
32994
  /* @__PURE__ */ jsxs74("div", { className: "flex items-center gap-2 mt-auto", children: [
33065
32995
  isDisplayCheckbox && /* @__PURE__ */ jsx111(
33066
32996
  "button",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fctc/sme-widget-ui",
3
- "version": "2.8.4",
3
+ "version": "2.8.5",
4
4
  "main": "dist/index.cjs",
5
5
  "module": "dist/index.mjs",
6
6
  "types": "dist/index.d.ts",