@fctc/sme-widget-ui 1.1.0 → 1.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +166 -151
- package/dist/index.mjs +166 -151
- package/dist/widgets.js +166 -151
- package/dist/widgets.mjs +166 -151
- package/package.json +1 -1
package/dist/widgets.js
CHANGED
|
@@ -12326,8 +12326,14 @@ var TableHead = (props) => {
|
|
|
12326
12326
|
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("thead", { className: "relative z-10", children: /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
|
|
12327
12327
|
"tr",
|
|
12328
12328
|
{
|
|
12329
|
-
style: {
|
|
12330
|
-
|
|
12329
|
+
style: {
|
|
12330
|
+
userSelect: "none",
|
|
12331
|
+
WebkitUserSelect: "none",
|
|
12332
|
+
zIndex: 1,
|
|
12333
|
+
position: "sticky",
|
|
12334
|
+
top: 0
|
|
12335
|
+
},
|
|
12336
|
+
className: "border-b border-[rgba(66,66,66,0.12)] bg-white",
|
|
12331
12337
|
children: [
|
|
12332
12338
|
isDisplayCheckbox && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
12333
12339
|
"th",
|
|
@@ -12348,7 +12354,7 @@ var TableHead = (props) => {
|
|
|
12348
12354
|
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
12349
12355
|
"th",
|
|
12350
12356
|
{
|
|
12351
|
-
className: `column whitespace-nowrap text-left p-3 text-sm font-
|
|
12357
|
+
className: `column whitespace-nowrap text-left p-3 text-sm font-semibold capitalize text-[#060606]`,
|
|
12352
12358
|
children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", { className: "cursor-pointer flex justify-between items-center gap-[4px] w-full min-w-max group", children: col.title })
|
|
12353
12359
|
},
|
|
12354
12360
|
"table-head-" + index4
|
|
@@ -14875,7 +14881,7 @@ var Search = ({
|
|
|
14875
14881
|
"input",
|
|
14876
14882
|
{
|
|
14877
14883
|
value: searchString,
|
|
14878
|
-
className: "min-h-[
|
|
14884
|
+
className: "min-h-[44px] w-fit flex-1 border-none bg-transparent outline-none min-w-[50px] text-sm",
|
|
14879
14885
|
placeholder: instance.t("search..."),
|
|
14880
14886
|
onChange: (e3) => {
|
|
14881
14887
|
onSearchString(e3.target.value);
|
|
@@ -17819,7 +17825,7 @@ var CharField = (props) => {
|
|
|
17819
17825
|
disabled: readonly,
|
|
17820
17826
|
placeholder,
|
|
17821
17827
|
required: !invisible && required,
|
|
17822
|
-
className: `w-full min-h-[44px] ring-0 focus:ring-0 focus:!outline-none focus:border-[1px] focus:border-primary outline-0 bg-white border border-[rgba(66,66,66,0.12)] rounded-lg
|
|
17828
|
+
className: `w-full min-h-[44px] ring-0 focus:ring-0 focus:!outline-none focus:border-[1px] focus:border-primary outline-0 bg-white border !border-[rgba(66,66,66,0.12)] rounded-lg py-2 px-3 text-sm font-normal gap-2 opacity-100 leading-5 resize-none overflow-hidden field-sizing-content
|
|
17823
17829
|
${readonly ? "!cursor-not-allowed border-transparent text-[#5c5a5a]" : "!cursor-pointer text-[#AEAEAE]"}
|
|
17824
17830
|
`
|
|
17825
17831
|
}
|
|
@@ -33668,164 +33674,173 @@ var Many2ManyField = (props) => {
|
|
|
33668
33674
|
return (0, import_react_dom8.createPortal)(
|
|
33669
33675
|
/* @__PURE__ */ (0, import_jsx_runtime100.jsxs)("div", { className: "fixed bottom-0 left-0 right-0 top-0 z-[9999]", children: [
|
|
33670
33676
|
/* @__PURE__ */ (0, import_jsx_runtime100.jsx)("div", { className: "absolute inset-0 bg-[rgba(27,27,27,0.48)]" }),
|
|
33671
|
-
/* @__PURE__ */ (0, import_jsx_runtime100.jsx)("div", { className: "absolute inset-0 overflow-auto px-6 flex justify-center items-center", children: /* @__PURE__ */ (0, import_jsx_runtime100.jsxs)(
|
|
33672
|
-
|
|
33673
|
-
|
|
33674
|
-
|
|
33675
|
-
|
|
33676
|
-
|
|
33677
|
-
|
|
33678
|
-
|
|
33679
|
-
{
|
|
33680
|
-
|
|
33681
|
-
|
|
33682
|
-
|
|
33683
|
-
|
|
33684
|
-
|
|
33685
|
-
|
|
33686
|
-
|
|
33687
|
-
|
|
33688
|
-
|
|
33689
|
-
|
|
33690
|
-
|
|
33691
|
-
|
|
33692
|
-
|
|
33693
|
-
|
|
33694
|
-
|
|
33695
|
-
|
|
33696
|
-
|
|
33697
|
-
|
|
33698
|
-
|
|
33699
|
-
|
|
33700
|
-
|
|
33701
|
-
|
|
33702
|
-
|
|
33703
|
-
|
|
33704
|
-
|
|
33705
|
-
|
|
33706
|
-
|
|
33707
|
-
|
|
33708
|
-
|
|
33709
|
-
|
|
33710
|
-
|
|
33711
|
-
|
|
33712
|
-
|
|
33713
|
-
|
|
33714
|
-
|
|
33715
|
-
totalCount: totalRows ?? 0,
|
|
33716
|
-
pageSize: 10,
|
|
33717
|
-
onPageChange: (page2) => {
|
|
33718
|
-
if (typeof setPage === "function") {
|
|
33719
|
-
setPage(page2);
|
|
33677
|
+
/* @__PURE__ */ (0, import_jsx_runtime100.jsx)("div", { className: "absolute inset-0 overflow-auto px-6 flex justify-center items-center", children: /* @__PURE__ */ (0, import_jsx_runtime100.jsxs)(
|
|
33678
|
+
"div",
|
|
33679
|
+
{
|
|
33680
|
+
style: {
|
|
33681
|
+
zIndex: 1
|
|
33682
|
+
},
|
|
33683
|
+
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",
|
|
33684
|
+
children: [
|
|
33685
|
+
/* @__PURE__ */ (0, import_jsx_runtime100.jsxs)("div", { className: "flex justify-between items-center border-b border-[rgba(0,0,0,0.1)] pb-2", children: [
|
|
33686
|
+
/* @__PURE__ */ (0, import_jsx_runtime100.jsx)("div", { className: "text-[20px] font-semibold", children: title }),
|
|
33687
|
+
/* @__PURE__ */ (0, import_jsx_runtime100.jsx)("button", { className: "cursor-pointer", onClick: onClose, children: /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(CloseIcon, {}) })
|
|
33688
|
+
] }),
|
|
33689
|
+
/* @__PURE__ */ (0, import_jsx_runtime100.jsxs)("div", { className: "grid grid-cols-3 gap-2 items-center py-2", children: [
|
|
33690
|
+
/* @__PURE__ */ (0, import_jsx_runtime100.jsx)("div", { className: "col-span-3 sm:col-span-2 flex-1", children: /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
|
|
33691
|
+
Search,
|
|
33692
|
+
{
|
|
33693
|
+
removeSearchItems,
|
|
33694
|
+
selectedTags,
|
|
33695
|
+
filterBy,
|
|
33696
|
+
setFilterBy,
|
|
33697
|
+
searchString,
|
|
33698
|
+
onSearchString,
|
|
33699
|
+
handleAddTagSearch,
|
|
33700
|
+
searchBy,
|
|
33701
|
+
groupBy,
|
|
33702
|
+
showFiltersGroups: true,
|
|
33703
|
+
setGroupBy,
|
|
33704
|
+
setDomainList: setDomain,
|
|
33705
|
+
setPage: (pages) => {
|
|
33706
|
+
setPage?.(pages);
|
|
33707
|
+
},
|
|
33708
|
+
fieldsList: [
|
|
33709
|
+
...columns?.filter(
|
|
33710
|
+
(col) => col?.field?.type_co === "field" && col?.optional !== "hide"
|
|
33711
|
+
)?.map((col) => ({ ...col.field })) ?? []
|
|
33712
|
+
],
|
|
33713
|
+
setSelectedRowKeys,
|
|
33714
|
+
viewData,
|
|
33715
|
+
context,
|
|
33716
|
+
selectedRowKeys,
|
|
33717
|
+
aid,
|
|
33718
|
+
domainSearch,
|
|
33719
|
+
evalJSONContext,
|
|
33720
|
+
clearSearch
|
|
33720
33721
|
}
|
|
33721
|
-
},
|
|
33722
|
-
|
|
33723
|
-
|
|
33724
|
-
|
|
33725
|
-
|
|
33726
|
-
|
|
33727
|
-
|
|
33728
|
-
|
|
33729
|
-
|
|
33730
|
-
|
|
33731
|
-
|
|
33722
|
+
) }),
|
|
33723
|
+
/* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
|
|
33724
|
+
PaginationView,
|
|
33725
|
+
{
|
|
33726
|
+
className: "pagination-bar col-span-3 sm:col-span-1 justify-end flex-1",
|
|
33727
|
+
currentPage: page,
|
|
33728
|
+
totalCount: totalRows ?? 0,
|
|
33729
|
+
pageSize: 10,
|
|
33730
|
+
onPageChange: (page2) => {
|
|
33731
|
+
if (typeof setPage === "function") {
|
|
33732
|
+
setPage(page2);
|
|
33733
|
+
}
|
|
33734
|
+
},
|
|
33735
|
+
displayPageNumberDots: false,
|
|
33736
|
+
displayRowsNumberOption: false
|
|
33737
|
+
}
|
|
33738
|
+
)
|
|
33739
|
+
] }),
|
|
33740
|
+
!isDataLoading && isDataFetched || isPlaceholderData ? /* @__PURE__ */ (0, import_jsx_runtime100.jsx)("div", { className: "relative overflow-y-auto", children: /* @__PURE__ */ (0, import_jsx_runtime100.jsx)("div", { className: "relative h-full w-full", children: /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
|
|
33732
33741
|
"div",
|
|
33733
33742
|
{
|
|
33734
|
-
className: `
|
|
33735
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime100.jsx)("div", { className: "w-full h-full
|
|
33736
|
-
"
|
|
33743
|
+
className: `border-[1px] h-full border-solid border-[#dbe0e6] rounded-[10px] relative w-full overflow-hidden`,
|
|
33744
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime100.jsx)("div", { className: "flex flex-col gap-[16px] w-full h-full", children: /* @__PURE__ */ (0, import_jsx_runtime100.jsx)("div", { className: `relative w-full h-full`, children: /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
|
|
33745
|
+
"div",
|
|
33737
33746
|
{
|
|
33738
|
-
className: `
|
|
33739
|
-
children:
|
|
33740
|
-
|
|
33741
|
-
|
|
33742
|
-
|
|
33743
|
-
|
|
33744
|
-
|
|
33745
|
-
|
|
33746
|
-
|
|
33747
|
-
|
|
33748
|
-
|
|
33749
|
-
|
|
33750
|
-
|
|
33751
|
-
|
|
33752
|
-
|
|
33753
|
-
|
|
33754
|
-
|
|
33755
|
-
|
|
33756
|
-
|
|
33757
|
-
|
|
33758
|
-
|
|
33759
|
-
|
|
33760
|
-
|
|
33761
|
-
|
|
33762
|
-
|
|
33763
|
-
rootField: rootField2
|
|
33764
|
-
}) => {
|
|
33765
|
-
if (typeof renderField === "function") {
|
|
33766
|
-
return renderField({
|
|
33747
|
+
className: `flex w-full items-center h-full overflow-auto `,
|
|
33748
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime100.jsx)("div", { className: "w-full h-full max-w-full", children: /* @__PURE__ */ (0, import_jsx_runtime100.jsxs)(
|
|
33749
|
+
"table",
|
|
33750
|
+
{
|
|
33751
|
+
className: `relative w-full bg-white custom-dropdown `,
|
|
33752
|
+
children: [
|
|
33753
|
+
/* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
|
|
33754
|
+
TableHead,
|
|
33755
|
+
{
|
|
33756
|
+
columns,
|
|
33757
|
+
onToggleColumnOptional,
|
|
33758
|
+
isDisplayCheckbox,
|
|
33759
|
+
checkedAll,
|
|
33760
|
+
handleCheckBoxAll
|
|
33761
|
+
}
|
|
33762
|
+
),
|
|
33763
|
+
/* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
|
|
33764
|
+
TableBody,
|
|
33765
|
+
{
|
|
33766
|
+
columns,
|
|
33767
|
+
rows,
|
|
33768
|
+
rootField,
|
|
33769
|
+
isDisplayCheckbox,
|
|
33770
|
+
model: relation,
|
|
33771
|
+
renderField: ({
|
|
33767
33772
|
row,
|
|
33768
33773
|
col,
|
|
33769
33774
|
indexRow,
|
|
33770
33775
|
onChangeData,
|
|
33771
33776
|
rootField: rootField2
|
|
33772
|
-
})
|
|
33777
|
+
}) => {
|
|
33778
|
+
if (typeof renderField === "function") {
|
|
33779
|
+
return renderField({
|
|
33780
|
+
row,
|
|
33781
|
+
col,
|
|
33782
|
+
indexRow,
|
|
33783
|
+
onChangeData,
|
|
33784
|
+
rootField: rootField2
|
|
33785
|
+
});
|
|
33786
|
+
}
|
|
33787
|
+
},
|
|
33788
|
+
onRemoveRow: null,
|
|
33789
|
+
onAddRow,
|
|
33790
|
+
onClickRow,
|
|
33791
|
+
typeTable,
|
|
33792
|
+
selectedRowKeysRef,
|
|
33793
|
+
selectedRowKeys,
|
|
33794
|
+
setSelectedRowKeys
|
|
33773
33795
|
}
|
|
33774
|
-
|
|
33775
|
-
|
|
33776
|
-
|
|
33777
|
-
|
|
33778
|
-
typeTable,
|
|
33779
|
-
selectedRowKeysRef,
|
|
33780
|
-
selectedRowKeys,
|
|
33781
|
-
setSelectedRowKeys
|
|
33782
|
-
}
|
|
33783
|
-
)
|
|
33784
|
-
]
|
|
33796
|
+
)
|
|
33797
|
+
]
|
|
33798
|
+
}
|
|
33799
|
+
) })
|
|
33785
33800
|
}
|
|
33786
|
-
) })
|
|
33801
|
+
) }) })
|
|
33787
33802
|
}
|
|
33788
|
-
) }) })
|
|
33789
|
-
|
|
33790
|
-
|
|
33791
|
-
|
|
33792
|
-
|
|
33793
|
-
|
|
33794
|
-
|
|
33795
|
-
|
|
33796
|
-
|
|
33797
|
-
|
|
33798
|
-
className: "button-primary",
|
|
33799
|
-
children: instance.t("choose")
|
|
33800
|
-
}
|
|
33801
|
-
),
|
|
33802
|
-
optionsObject && "no_create" in optionsObject && optionsObject?.no_create === false && /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
|
|
33803
|
-
"button",
|
|
33804
|
-
{
|
|
33805
|
-
type: "button",
|
|
33806
|
-
onClick: () => {
|
|
33807
|
-
if (typeof onAddNew === "function") {
|
|
33808
|
-
onAddNew();
|
|
33809
|
-
onClose();
|
|
33810
|
-
} else {
|
|
33811
|
-
handleCreateNewOnPage();
|
|
33803
|
+
) }) }) : /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(LayerLoading, {}),
|
|
33804
|
+
/* @__PURE__ */ (0, import_jsx_runtime100.jsxs)("div", { className: "flex items-center gap-2 mt-auto", children: [
|
|
33805
|
+
isDisplayCheckbox && /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
|
|
33806
|
+
"button",
|
|
33807
|
+
{
|
|
33808
|
+
disabled: selectedRowKeys?.length === 0,
|
|
33809
|
+
type: "button",
|
|
33810
|
+
onClick: () => onChoose(selectedRowKeys),
|
|
33811
|
+
className: "button-primary",
|
|
33812
|
+
children: instance.t("choose")
|
|
33812
33813
|
}
|
|
33813
|
-
|
|
33814
|
-
|
|
33815
|
-
|
|
33816
|
-
|
|
33817
|
-
|
|
33818
|
-
|
|
33819
|
-
|
|
33820
|
-
|
|
33821
|
-
|
|
33822
|
-
|
|
33823
|
-
|
|
33824
|
-
|
|
33825
|
-
|
|
33826
|
-
|
|
33827
|
-
|
|
33828
|
-
|
|
33814
|
+
),
|
|
33815
|
+
optionsObject && "no_create" in optionsObject && optionsObject?.no_create === false && /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
|
|
33816
|
+
"button",
|
|
33817
|
+
{
|
|
33818
|
+
type: "button",
|
|
33819
|
+
onClick: () => {
|
|
33820
|
+
if (typeof onAddNew === "function") {
|
|
33821
|
+
onAddNew();
|
|
33822
|
+
onClose();
|
|
33823
|
+
} else {
|
|
33824
|
+
handleCreateNewOnPage();
|
|
33825
|
+
}
|
|
33826
|
+
},
|
|
33827
|
+
className: "button-primary",
|
|
33828
|
+
children: instance.t("new")
|
|
33829
|
+
}
|
|
33830
|
+
),
|
|
33831
|
+
/* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
|
|
33832
|
+
"button",
|
|
33833
|
+
{
|
|
33834
|
+
type: "button",
|
|
33835
|
+
onClick: onClose,
|
|
33836
|
+
className: "button-secondary",
|
|
33837
|
+
children: instance.t("cancel_button")
|
|
33838
|
+
}
|
|
33839
|
+
)
|
|
33840
|
+
] })
|
|
33841
|
+
]
|
|
33842
|
+
}
|
|
33843
|
+
) })
|
|
33829
33844
|
] }),
|
|
33830
33845
|
document.body
|
|
33831
33846
|
);
|
|
@@ -33950,7 +33965,7 @@ var Many2OneField = (props) => {
|
|
|
33950
33965
|
menuShouldScrollIntoView: false,
|
|
33951
33966
|
options: options2,
|
|
33952
33967
|
classNames: {
|
|
33953
|
-
control: ({ isFocused }) => `w-full flex min-h-[44px] ring-0 cursor-pointer outline-0 bg-white !shadow-none !rounded-[10px]
|
|
33968
|
+
control: ({ isFocused }) => `w-full flex min-h-[44px] ring-0 cursor-pointer outline-0 bg-white !shadow-none !rounded-[10px] py-2 px-3 text-sm text-[#1A1A1B] font-normal cursor-pointer gap-2 opacity-100 leading-5 resize-none overflow-hidden field-sizing-content ${isForm && (isFocused ? "!border-[1px] !border-primary !ring-0 outline-none" : "border !border-[rgba(66,66,66,0.12)]")} ${readonly && "!cursor-not-allowed"} ${isEditTable && "md:!min-w-[300px] max-w-[300px] !rounded-none !border !border-transparent !border-b !border-[#f7f7f7] hover:border-b-primary !bg-transparent min-h-auto"}`,
|
|
33954
33969
|
valueContainer: () => "!m-0 !p-0",
|
|
33955
33970
|
singleValue: () => `!m-0 ${readonly ? "!text-[#5c5a5a]" : ""}`,
|
|
33956
33971
|
input: () => "!m-0 !p-0",
|