@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/widgets.mjs
CHANGED
|
@@ -11948,9 +11948,12 @@ var TableBodyRow = (props) => {
|
|
|
11948
11948
|
isForm,
|
|
11949
11949
|
typeCo,
|
|
11950
11950
|
selectedRowKeys,
|
|
11951
|
+
tableGroupController,
|
|
11952
|
+
groupByList,
|
|
11953
|
+
setIsAutoSelect,
|
|
11954
|
+
isAutoSelect,
|
|
11951
11955
|
isEditTable
|
|
11952
11956
|
} = props;
|
|
11953
|
-
const [isAutoSelect, setIsAutoSelect] = useState2(false);
|
|
11954
11957
|
const rootStyle = getComputedStyle(document.documentElement);
|
|
11955
11958
|
const colorPrimary = rootStyle.getPropertyValue("--primary").trim();
|
|
11956
11959
|
return rows && rows?.length > 0 ? rows?.map((row, index4) => {
|
|
@@ -11958,21 +11961,24 @@ var TableBodyRow = (props) => {
|
|
|
11958
11961
|
TableGroup,
|
|
11959
11962
|
{
|
|
11960
11963
|
columns,
|
|
11961
|
-
indexRow: index4,
|
|
11962
11964
|
rows,
|
|
11963
11965
|
row,
|
|
11966
|
+
indexRow: index4,
|
|
11964
11967
|
model,
|
|
11965
11968
|
viewData,
|
|
11966
11969
|
renderField,
|
|
11967
11970
|
level: level + 1,
|
|
11968
11971
|
specification,
|
|
11969
|
-
domain: row?.__domain,
|
|
11970
11972
|
context,
|
|
11971
11973
|
checkedAll,
|
|
11972
11974
|
isDisplayCheckbox,
|
|
11973
11975
|
selectedRowKeysRef,
|
|
11974
11976
|
isAutoSelect,
|
|
11975
|
-
setIsAutoSelect
|
|
11977
|
+
setIsAutoSelect,
|
|
11978
|
+
groupByList,
|
|
11979
|
+
tableGroupController,
|
|
11980
|
+
setSelectedRowKeys,
|
|
11981
|
+
selectedRowKeys
|
|
11976
11982
|
},
|
|
11977
11983
|
`record-group-${index4}`
|
|
11978
11984
|
) : /* @__PURE__ */ jsx42(
|
|
@@ -12011,7 +12017,15 @@ var TableBodyRow = (props) => {
|
|
|
12011
12017
|
) }) });
|
|
12012
12018
|
};
|
|
12013
12019
|
var TableBody = (props) => {
|
|
12014
|
-
|
|
12020
|
+
const [isAutoSelect, setIsAutoSelect] = useState2(false);
|
|
12021
|
+
return /* @__PURE__ */ jsx42("tbody", { className: "overflow-hidden", children: /* @__PURE__ */ jsx42(
|
|
12022
|
+
TableBodyRow,
|
|
12023
|
+
{
|
|
12024
|
+
...props,
|
|
12025
|
+
isAutoSelect,
|
|
12026
|
+
setIsAutoSelect
|
|
12027
|
+
}
|
|
12028
|
+
) });
|
|
12015
12029
|
};
|
|
12016
12030
|
|
|
12017
12031
|
// src/widgets/advanced/table/table-filter.tsx
|
|
@@ -33610,176 +33624,185 @@ var Many2ManyField = (props) => {
|
|
|
33610
33624
|
clearSearch
|
|
33611
33625
|
} = searchController;
|
|
33612
33626
|
return createPortal5(
|
|
33613
|
-
/* @__PURE__ */ jsxs71(
|
|
33614
|
-
|
|
33615
|
-
|
|
33616
|
-
|
|
33617
|
-
|
|
33618
|
-
|
|
33619
|
-
|
|
33620
|
-
|
|
33621
|
-
|
|
33622
|
-
children:
|
|
33623
|
-
|
|
33624
|
-
|
|
33625
|
-
|
|
33626
|
-
|
|
33627
|
-
|
|
33628
|
-
|
|
33629
|
-
|
|
33630
|
-
{
|
|
33631
|
-
|
|
33632
|
-
|
|
33633
|
-
|
|
33634
|
-
|
|
33635
|
-
|
|
33636
|
-
|
|
33637
|
-
|
|
33638
|
-
|
|
33639
|
-
|
|
33640
|
-
|
|
33641
|
-
|
|
33642
|
-
|
|
33643
|
-
|
|
33644
|
-
|
|
33645
|
-
|
|
33646
|
-
|
|
33647
|
-
|
|
33648
|
-
|
|
33649
|
-
|
|
33650
|
-
|
|
33651
|
-
|
|
33652
|
-
|
|
33653
|
-
|
|
33654
|
-
|
|
33655
|
-
|
|
33656
|
-
|
|
33657
|
-
|
|
33658
|
-
|
|
33659
|
-
|
|
33660
|
-
|
|
33661
|
-
|
|
33662
|
-
|
|
33663
|
-
|
|
33664
|
-
|
|
33665
|
-
|
|
33666
|
-
totalCount: totalRows ?? 0,
|
|
33667
|
-
pageSize: 10,
|
|
33668
|
-
onPageChange: (page2) => {
|
|
33669
|
-
if (typeof setPage === "function") {
|
|
33670
|
-
setPage(page2);
|
|
33627
|
+
/* @__PURE__ */ jsxs71(
|
|
33628
|
+
"div",
|
|
33629
|
+
{
|
|
33630
|
+
style: {
|
|
33631
|
+
zIndex: 99999
|
|
33632
|
+
},
|
|
33633
|
+
className: "fixed bottom-0 left-0 right-0 top-0",
|
|
33634
|
+
children: [
|
|
33635
|
+
/* @__PURE__ */ jsx102("div", { className: "absolute inset-0 bg-[rgba(27,27,27,0.48)]" }),
|
|
33636
|
+
/* @__PURE__ */ jsx102("div", { className: "absolute inset-0 overflow-auto px-6 flex justify-center items-center", children: /* @__PURE__ */ jsxs71(
|
|
33637
|
+
"div",
|
|
33638
|
+
{
|
|
33639
|
+
style: {
|
|
33640
|
+
zIndex: 1
|
|
33641
|
+
},
|
|
33642
|
+
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",
|
|
33643
|
+
children: [
|
|
33644
|
+
/* @__PURE__ */ jsxs71("div", { className: "flex justify-between items-center border-b border-[rgba(0,0,0,0.1)] pb-2", children: [
|
|
33645
|
+
/* @__PURE__ */ jsx102("div", { className: "text-[20px] font-semibold", children: title }),
|
|
33646
|
+
/* @__PURE__ */ jsx102("button", { className: "cursor-pointer", onClick: onClose, children: /* @__PURE__ */ jsx102(CloseIcon, {}) })
|
|
33647
|
+
] }),
|
|
33648
|
+
/* @__PURE__ */ jsxs71("div", { className: "grid grid-cols-3 gap-2 items-center py-2", children: [
|
|
33649
|
+
/* @__PURE__ */ jsx102("div", { className: "col-span-3 sm:col-span-2 flex-1", children: /* @__PURE__ */ jsx102(
|
|
33650
|
+
Search,
|
|
33651
|
+
{
|
|
33652
|
+
removeSearchItems,
|
|
33653
|
+
selectedTags,
|
|
33654
|
+
filterBy,
|
|
33655
|
+
setFilterBy,
|
|
33656
|
+
searchString,
|
|
33657
|
+
onSearchString,
|
|
33658
|
+
handleAddTagSearch,
|
|
33659
|
+
searchBy,
|
|
33660
|
+
groupBy,
|
|
33661
|
+
showFiltersGroups: true,
|
|
33662
|
+
setGroupBy,
|
|
33663
|
+
setDomainList: setDomain,
|
|
33664
|
+
setPage: (pages) => {
|
|
33665
|
+
setPage?.(pages);
|
|
33666
|
+
},
|
|
33667
|
+
fieldsList: [
|
|
33668
|
+
...columns?.filter(
|
|
33669
|
+
(col) => col?.field?.type_co === "field" && col?.optional !== "hide"
|
|
33670
|
+
)?.map((col) => ({ ...col.field })) ?? []
|
|
33671
|
+
],
|
|
33672
|
+
setSelectedRowKeys,
|
|
33673
|
+
viewData,
|
|
33674
|
+
context,
|
|
33675
|
+
selectedRowKeys,
|
|
33676
|
+
aid,
|
|
33677
|
+
domainSearch,
|
|
33678
|
+
evalJSONContext,
|
|
33679
|
+
clearSearch
|
|
33671
33680
|
}
|
|
33672
|
-
},
|
|
33673
|
-
|
|
33674
|
-
|
|
33675
|
-
|
|
33676
|
-
|
|
33677
|
-
|
|
33678
|
-
|
|
33679
|
-
|
|
33680
|
-
|
|
33681
|
-
|
|
33682
|
-
|
|
33681
|
+
) }),
|
|
33682
|
+
/* @__PURE__ */ jsx102(
|
|
33683
|
+
PaginationView,
|
|
33684
|
+
{
|
|
33685
|
+
className: "pagination-bar col-span-3 sm:col-span-1 justify-end flex-1",
|
|
33686
|
+
currentPage: page,
|
|
33687
|
+
totalCount: totalRows ?? 0,
|
|
33688
|
+
pageSize: 10,
|
|
33689
|
+
onPageChange: (page2) => {
|
|
33690
|
+
if (typeof setPage === "function") {
|
|
33691
|
+
setPage(page2);
|
|
33692
|
+
}
|
|
33693
|
+
},
|
|
33694
|
+
displayPageNumberDots: false,
|
|
33695
|
+
displayRowsNumberOption: false
|
|
33696
|
+
}
|
|
33697
|
+
)
|
|
33698
|
+
] }),
|
|
33699
|
+
!isDataLoading && isDataFetched || isPlaceholderData ? /* @__PURE__ */ jsx102("div", { className: "relative overflow-y-auto", children: /* @__PURE__ */ jsx102("div", { className: "relative h-full w-full", children: /* @__PURE__ */ jsx102(
|
|
33683
33700
|
"div",
|
|
33684
33701
|
{
|
|
33685
|
-
className: `
|
|
33686
|
-
children: /* @__PURE__ */ jsx102("div", { className: "w-full h-full
|
|
33687
|
-
"
|
|
33702
|
+
className: `border-[1px] h-full border-solid border-[#dbe0e6] rounded-[10px] relative w-full overflow-hidden`,
|
|
33703
|
+
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(
|
|
33704
|
+
"div",
|
|
33688
33705
|
{
|
|
33689
|
-
className: `
|
|
33690
|
-
children:
|
|
33691
|
-
|
|
33692
|
-
|
|
33693
|
-
|
|
33694
|
-
|
|
33695
|
-
|
|
33696
|
-
|
|
33697
|
-
|
|
33698
|
-
|
|
33699
|
-
|
|
33700
|
-
|
|
33701
|
-
|
|
33702
|
-
|
|
33703
|
-
|
|
33704
|
-
|
|
33705
|
-
|
|
33706
|
-
|
|
33707
|
-
|
|
33708
|
-
|
|
33709
|
-
|
|
33710
|
-
|
|
33711
|
-
|
|
33712
|
-
|
|
33713
|
-
|
|
33714
|
-
rootField: rootField2
|
|
33715
|
-
}) => {
|
|
33716
|
-
if (typeof renderField === "function") {
|
|
33717
|
-
return renderField({
|
|
33706
|
+
className: `flex w-full items-center h-full overflow-auto `,
|
|
33707
|
+
children: /* @__PURE__ */ jsx102("div", { className: "w-full h-full max-w-full", children: /* @__PURE__ */ jsxs71(
|
|
33708
|
+
"table",
|
|
33709
|
+
{
|
|
33710
|
+
className: `relative w-full bg-white custom-dropdown `,
|
|
33711
|
+
children: [
|
|
33712
|
+
/* @__PURE__ */ jsx102(
|
|
33713
|
+
TableHead,
|
|
33714
|
+
{
|
|
33715
|
+
columns,
|
|
33716
|
+
onToggleColumnOptional,
|
|
33717
|
+
isDisplayCheckbox,
|
|
33718
|
+
checkedAll,
|
|
33719
|
+
handleCheckBoxAll
|
|
33720
|
+
}
|
|
33721
|
+
),
|
|
33722
|
+
/* @__PURE__ */ jsx102(
|
|
33723
|
+
TableBody,
|
|
33724
|
+
{
|
|
33725
|
+
columns,
|
|
33726
|
+
rows,
|
|
33727
|
+
rootField,
|
|
33728
|
+
isDisplayCheckbox,
|
|
33729
|
+
model: relation,
|
|
33730
|
+
renderField: ({
|
|
33718
33731
|
row,
|
|
33719
33732
|
col,
|
|
33720
33733
|
indexRow,
|
|
33721
33734
|
onChangeData,
|
|
33722
33735
|
rootField: rootField2
|
|
33723
|
-
})
|
|
33736
|
+
}) => {
|
|
33737
|
+
if (typeof renderField === "function") {
|
|
33738
|
+
return renderField({
|
|
33739
|
+
row,
|
|
33740
|
+
col,
|
|
33741
|
+
indexRow,
|
|
33742
|
+
onChangeData,
|
|
33743
|
+
rootField: rootField2
|
|
33744
|
+
});
|
|
33745
|
+
}
|
|
33746
|
+
},
|
|
33747
|
+
onRemoveRow: null,
|
|
33748
|
+
onAddRow,
|
|
33749
|
+
onClickRow,
|
|
33750
|
+
typeTable,
|
|
33751
|
+
selectedRowKeysRef,
|
|
33752
|
+
selectedRowKeys,
|
|
33753
|
+
setSelectedRowKeys
|
|
33724
33754
|
}
|
|
33725
|
-
|
|
33726
|
-
|
|
33727
|
-
|
|
33728
|
-
|
|
33729
|
-
typeTable,
|
|
33730
|
-
selectedRowKeysRef,
|
|
33731
|
-
selectedRowKeys,
|
|
33732
|
-
setSelectedRowKeys
|
|
33733
|
-
}
|
|
33734
|
-
)
|
|
33735
|
-
]
|
|
33755
|
+
)
|
|
33756
|
+
]
|
|
33757
|
+
}
|
|
33758
|
+
) })
|
|
33736
33759
|
}
|
|
33737
|
-
) })
|
|
33760
|
+
) }) })
|
|
33738
33761
|
}
|
|
33739
|
-
) }) })
|
|
33740
|
-
|
|
33741
|
-
|
|
33742
|
-
|
|
33743
|
-
|
|
33744
|
-
|
|
33745
|
-
|
|
33746
|
-
|
|
33747
|
-
|
|
33748
|
-
|
|
33749
|
-
className: "button-primary",
|
|
33750
|
-
children: instance.t("choose")
|
|
33751
|
-
}
|
|
33752
|
-
),
|
|
33753
|
-
optionsObject && "no_create" in optionsObject && optionsObject?.no_create === false && /* @__PURE__ */ jsx102(
|
|
33754
|
-
"button",
|
|
33755
|
-
{
|
|
33756
|
-
type: "button",
|
|
33757
|
-
onClick: () => {
|
|
33758
|
-
if (typeof onAddNew === "function") {
|
|
33759
|
-
onAddNew();
|
|
33760
|
-
onClose();
|
|
33761
|
-
} else {
|
|
33762
|
-
handleCreateNewOnPage();
|
|
33762
|
+
) }) }) : /* @__PURE__ */ jsx102(LayerLoading, {}),
|
|
33763
|
+
/* @__PURE__ */ jsxs71("div", { className: "flex items-center gap-2 mt-auto", children: [
|
|
33764
|
+
isDisplayCheckbox && /* @__PURE__ */ jsx102(
|
|
33765
|
+
"button",
|
|
33766
|
+
{
|
|
33767
|
+
disabled: selectedRowKeys?.length === 0,
|
|
33768
|
+
type: "button",
|
|
33769
|
+
onClick: () => onChoose(selectedRowKeys),
|
|
33770
|
+
className: "button-primary",
|
|
33771
|
+
children: instance.t("choose")
|
|
33763
33772
|
}
|
|
33764
|
-
|
|
33765
|
-
|
|
33766
|
-
|
|
33767
|
-
|
|
33768
|
-
|
|
33769
|
-
|
|
33770
|
-
|
|
33771
|
-
|
|
33772
|
-
|
|
33773
|
-
|
|
33774
|
-
|
|
33775
|
-
|
|
33776
|
-
|
|
33777
|
-
|
|
33778
|
-
|
|
33779
|
-
|
|
33780
|
-
|
|
33781
|
-
|
|
33782
|
-
|
|
33773
|
+
),
|
|
33774
|
+
optionsObject && "no_create" in optionsObject && optionsObject?.no_create === false && /* @__PURE__ */ jsx102(
|
|
33775
|
+
"button",
|
|
33776
|
+
{
|
|
33777
|
+
type: "button",
|
|
33778
|
+
onClick: () => {
|
|
33779
|
+
if (typeof onAddNew === "function") {
|
|
33780
|
+
onAddNew();
|
|
33781
|
+
onClose();
|
|
33782
|
+
} else {
|
|
33783
|
+
handleCreateNewOnPage();
|
|
33784
|
+
}
|
|
33785
|
+
},
|
|
33786
|
+
className: "button-primary",
|
|
33787
|
+
children: instance.t("new")
|
|
33788
|
+
}
|
|
33789
|
+
),
|
|
33790
|
+
/* @__PURE__ */ jsx102(
|
|
33791
|
+
"button",
|
|
33792
|
+
{
|
|
33793
|
+
type: "button",
|
|
33794
|
+
onClick: onClose,
|
|
33795
|
+
className: "button-secondary",
|
|
33796
|
+
children: instance.t("cancel_button")
|
|
33797
|
+
}
|
|
33798
|
+
)
|
|
33799
|
+
] })
|
|
33800
|
+
]
|
|
33801
|
+
}
|
|
33802
|
+
) })
|
|
33803
|
+
]
|
|
33804
|
+
}
|
|
33805
|
+
),
|
|
33783
33806
|
document.body
|
|
33784
33807
|
);
|
|
33785
33808
|
};
|