@fctc/sme-widget-ui 1.0.8 → 1.1.0
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 +143 -115
- package/dist/index.mjs +143 -115
- package/dist/widgets.d.mts +1 -1
- package/dist/widgets.d.ts +1 -1
- package/dist/widgets.js +143 -115
- package/dist/widgets.mjs +143 -115
- package/package.json +2 -2
- package/dist/.babelrc +0 -7
- package/dist/.editorconfig +0 -10
- package/dist/.eslintignore +0 -6
- package/dist/.eslintrc.cjs +0 -66
- package/dist/.gitattributes +0 -4
- package/dist/.prettierrc +0 -4
package/dist/index.js
CHANGED
|
@@ -14839,103 +14839,115 @@ var PopupFilter = ({
|
|
|
14839
14839
|
setGroupBy,
|
|
14840
14840
|
fields
|
|
14841
14841
|
}) => {
|
|
14842
|
-
return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
14842
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
14843
14843
|
"div",
|
|
14844
14844
|
{
|
|
14845
|
-
|
|
14846
|
-
|
|
14847
|
-
|
|
14848
|
-
|
|
14849
|
-
|
|
14850
|
-
|
|
14851
|
-
|
|
14852
|
-
|
|
14853
|
-
|
|
14854
|
-
|
|
14855
|
-
|
|
14856
|
-
|
|
14857
|
-
|
|
14858
|
-
|
|
14859
|
-
|
|
14860
|
-
|
|
14861
|
-
|
|
14862
|
-
|
|
14863
|
-
|
|
14864
|
-
|
|
14865
|
-
|
|
14866
|
-
|
|
14867
|
-
|
|
14868
|
-
|
|
14869
|
-
|
|
14870
|
-
|
|
14871
|
-
|
|
14872
|
-
|
|
14845
|
+
style: {
|
|
14846
|
+
position: "absolute",
|
|
14847
|
+
top: "calc(100% + 3px)",
|
|
14848
|
+
right: 0,
|
|
14849
|
+
zIndex: 33
|
|
14850
|
+
},
|
|
14851
|
+
className: "popup-filter w-full overflow-x-auto rounded-lg border bg-white border-none shadow-xl",
|
|
14852
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(
|
|
14853
|
+
"div",
|
|
14854
|
+
{
|
|
14855
|
+
className: `flex py-3 ${(filterBy?.length === 0 || groupBy?.length === 0) && "!grid-cols-1"}`,
|
|
14856
|
+
children: [
|
|
14857
|
+
filterBy?.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "filter-by w-full px-3", children: [
|
|
14858
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "flex w-fit items-center justify-start gap-2 px-3 py-1", children: [
|
|
14859
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(FilterIcon, { className: "filter-by-icon text-primary" }),
|
|
14860
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { className: "font-bold text-sm text-[#212529]", children: instance.t("filter_by") })
|
|
14861
|
+
] }),
|
|
14862
|
+
filterBy?.reduce((acc, item, index4, array) => {
|
|
14863
|
+
const prevItem = array[index4 - 1];
|
|
14864
|
+
const isDifferentGroup = prevItem && prevItem?.group_index !== item?.group_index;
|
|
14865
|
+
const isExist = item?.active;
|
|
14866
|
+
if (isDifferentGroup) {
|
|
14867
|
+
acc.push(/* @__PURE__ */ (0, import_jsx_runtime54.jsx)("hr", { className: "my-2" }, "separator-" + index4));
|
|
14868
|
+
}
|
|
14869
|
+
acc.push(
|
|
14870
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(
|
|
14871
|
+
"button",
|
|
14872
|
+
{
|
|
14873
|
+
className: `filter-by-item w-full flex items-center gap-2 bg-white px-3 py-1 text-left cursor-pointer ${isExist ? "filter-by-checked font-semibold " : "hover:!bg-[rgba(0,0,0,0.08)]"}`,
|
|
14874
|
+
onClick: () => {
|
|
14875
|
+
const newFilterBy = filterBy?.map(
|
|
14876
|
+
(tag) => tag?.name === item?.name ? { ...tag, active: !tag?.active } : tag
|
|
14877
|
+
);
|
|
14878
|
+
setFilterBy(newFilterBy);
|
|
14879
|
+
if (isExist) {
|
|
14880
|
+
typeof removeSearchItems === "function" && removeSearchItems(
|
|
14881
|
+
`${SearchType.FILTER}_${item.group_index}`,
|
|
14882
|
+
item
|
|
14883
|
+
);
|
|
14884
|
+
return;
|
|
14885
|
+
}
|
|
14886
|
+
typeof handleAddTagSearch === "function" && handleAddTagSearch({
|
|
14887
|
+
name: item?.name,
|
|
14888
|
+
value: item?.string ?? item?.help,
|
|
14889
|
+
domain: item?.domain,
|
|
14890
|
+
groupIndex: item?.group_index,
|
|
14891
|
+
type: SearchType.FILTER
|
|
14892
|
+
});
|
|
14893
|
+
},
|
|
14894
|
+
children: [
|
|
14895
|
+
isExist && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(CheckIcon, {}),
|
|
14896
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { className: "text-sm", children: item?.string ?? item?.help })
|
|
14897
|
+
]
|
|
14898
|
+
},
|
|
14899
|
+
"filter-" + index4
|
|
14900
|
+
)
|
|
14901
|
+
);
|
|
14902
|
+
return acc;
|
|
14903
|
+
}, [])
|
|
14904
|
+
] }),
|
|
14905
|
+
filterBy?.length > 0 && groupBy?.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { className: "h-['initial'] w-[1px] bg-[#dee2e6]" }),
|
|
14906
|
+
groupBy?.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "group-by w-full px-3", children: [
|
|
14907
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "flex w-fit items-center justify-start gap-2 px-3 py-1", children: [
|
|
14908
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(GroupByIcon, { className: "group-by-icon text-primary" }),
|
|
14909
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { className: "font-bold text-sm text-[#212529]", children: instance.t("group_by") })
|
|
14910
|
+
] }),
|
|
14911
|
+
groupBy?.map((item, index4) => {
|
|
14912
|
+
const isExist = item?.active;
|
|
14913
|
+
if (!item.string) return;
|
|
14914
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(
|
|
14915
|
+
"button",
|
|
14916
|
+
{
|
|
14917
|
+
onClick: () => {
|
|
14918
|
+
const formatArray = groupBy.map(
|
|
14919
|
+
(tag) => tag?.name === item?.name ? { ...tag, active: !tag?.active } : tag
|
|
14873
14920
|
);
|
|
14874
|
-
|
|
14875
|
-
|
|
14876
|
-
|
|
14877
|
-
|
|
14878
|
-
|
|
14879
|
-
|
|
14880
|
-
|
|
14881
|
-
|
|
14882
|
-
|
|
14921
|
+
setGroupBy(formatArray);
|
|
14922
|
+
if (isExist) {
|
|
14923
|
+
typeof removeSearchItems === "function" && removeSearchItems(`${SearchType.GROUP}`, item);
|
|
14924
|
+
return;
|
|
14925
|
+
}
|
|
14926
|
+
typeof handleAddTagSearch === "function" && handleAddTagSearch({
|
|
14927
|
+
name: item?.name,
|
|
14928
|
+
value: item?.string,
|
|
14929
|
+
type: SearchType.GROUP,
|
|
14930
|
+
context: JSON.parse(item?.context.replace(/'/g, '"')),
|
|
14931
|
+
active: !isExist,
|
|
14932
|
+
dataIndex: index4,
|
|
14933
|
+
fieldsGroup: fields
|
|
14934
|
+
});
|
|
14935
|
+
},
|
|
14936
|
+
className: `group-by-item w-full flex items-center gap-2 bg-white px-3 py-1 text-left cursor-pointer ${isExist ? "group-by-checked font-semibold" : "hover:!bg-[rgba(0,0,0,0.08)]"}`,
|
|
14937
|
+
children: [
|
|
14938
|
+
isExist && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(CheckIcon, {}),
|
|
14939
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { className: "text-sm", children: item?.string })
|
|
14940
|
+
]
|
|
14883
14941
|
},
|
|
14884
|
-
|
|
14885
|
-
|
|
14886
|
-
|
|
14887
|
-
|
|
14888
|
-
|
|
14889
|
-
|
|
14890
|
-
|
|
14891
|
-
);
|
|
14892
|
-
return acc;
|
|
14893
|
-
}, [])
|
|
14894
|
-
] }),
|
|
14895
|
-
filterBy?.length > 0 && groupBy?.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { className: "h-['initial'] w-[1px] bg-[#dee2e6]" }),
|
|
14896
|
-
groupBy?.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "group-by w-full px-3", children: [
|
|
14897
|
-
/* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "flex w-fit items-center justify-start gap-2 px-3 py-1", children: [
|
|
14898
|
-
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(GroupByIcon, { className: "group-by-icon text-primary" }),
|
|
14899
|
-
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { className: "font-bold text-sm text-[#212529]", children: instance.t("group_by") })
|
|
14900
|
-
] }),
|
|
14901
|
-
groupBy?.map((item, index4) => {
|
|
14902
|
-
const isExist = item?.active;
|
|
14903
|
-
if (!item.string) return;
|
|
14904
|
-
return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(
|
|
14905
|
-
"button",
|
|
14906
|
-
{
|
|
14907
|
-
onClick: () => {
|
|
14908
|
-
const formatArray = groupBy.map(
|
|
14909
|
-
(tag) => tag?.name === item?.name ? { ...tag, active: !tag?.active } : tag
|
|
14910
|
-
);
|
|
14911
|
-
setGroupBy(formatArray);
|
|
14912
|
-
if (isExist) {
|
|
14913
|
-
typeof removeSearchItems === "function" && removeSearchItems(`${SearchType.GROUP}`, item);
|
|
14914
|
-
return;
|
|
14915
|
-
}
|
|
14916
|
-
typeof handleAddTagSearch === "function" && handleAddTagSearch({
|
|
14917
|
-
name: item?.name,
|
|
14918
|
-
value: item?.string,
|
|
14919
|
-
type: SearchType.GROUP,
|
|
14920
|
-
context: JSON.parse(item?.context.replace(/'/g, '"')),
|
|
14921
|
-
active: !isExist,
|
|
14922
|
-
dataIndex: index4,
|
|
14923
|
-
fieldsGroup: fields
|
|
14924
|
-
});
|
|
14925
|
-
},
|
|
14926
|
-
className: `group-by-item w-full flex items-center gap-2 bg-white px-3 py-1 text-left cursor-pointer ${isExist ? "group-by-checked font-semibold" : "hover:!bg-[rgba(0,0,0,0.08)]"}`,
|
|
14927
|
-
children: [
|
|
14928
|
-
isExist && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(CheckIcon, {}),
|
|
14929
|
-
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { className: "text-sm", children: item?.string })
|
|
14930
|
-
]
|
|
14931
|
-
},
|
|
14932
|
-
"groupby-" + index4 + 1
|
|
14933
|
-
);
|
|
14934
|
-
})
|
|
14935
|
-
] })
|
|
14936
|
-
]
|
|
14942
|
+
"groupby-" + index4 + 1
|
|
14943
|
+
);
|
|
14944
|
+
})
|
|
14945
|
+
] })
|
|
14946
|
+
]
|
|
14947
|
+
}
|
|
14948
|
+
)
|
|
14937
14949
|
}
|
|
14938
|
-
)
|
|
14950
|
+
);
|
|
14939
14951
|
};
|
|
14940
14952
|
|
|
14941
14953
|
// src/widgets/advanced/search/search-item/index.tsx
|
|
@@ -32233,7 +32245,7 @@ var DateField = (props) => {
|
|
|
32233
32245
|
isForm2 && /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(CalandarIcon, {})
|
|
32234
32246
|
] })
|
|
32235
32247
|
);
|
|
32236
|
-
if (!isForm) {
|
|
32248
|
+
if (!isForm && !isEditTable) {
|
|
32237
32249
|
return /* @__PURE__ */ (0, import_jsx_runtime77.jsx)("span", { children: value && (0, import_moment2.default)(value).isValid() ? (0, import_moment2.default)(value).add(7, "hours").format(formatDate2) : "" });
|
|
32238
32250
|
} else {
|
|
32239
32251
|
return /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
|
|
@@ -33568,15 +33580,8 @@ var SelectDropdownField = (props) => {
|
|
|
33568
33580
|
value: val[0],
|
|
33569
33581
|
label: val[1]
|
|
33570
33582
|
})) : [];
|
|
33571
|
-
if (!isForm) {
|
|
33572
|
-
|
|
33573
|
-
return value2 && /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(
|
|
33574
|
-
"span",
|
|
33575
|
-
{
|
|
33576
|
-
className: `${props.className} px-2 py-1 rounded border text-xs font-medium leading-[16px]`,
|
|
33577
|
-
children: value2
|
|
33578
|
-
}
|
|
33579
|
-
);
|
|
33583
|
+
if (!isForm && !isEditTable) {
|
|
33584
|
+
return /* @__PURE__ */ (0, import_jsx_runtime95.jsx)("span", { children: options2?.find((item) => item?.value === value)?.label });
|
|
33580
33585
|
} else {
|
|
33581
33586
|
return /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(
|
|
33582
33587
|
Controller,
|
|
@@ -33617,20 +33622,43 @@ var SelectDropdownField = (props) => {
|
|
|
33617
33622
|
StateManagedSelect$1,
|
|
33618
33623
|
{
|
|
33619
33624
|
...commonProps,
|
|
33620
|
-
|
|
33621
|
-
control: () =>
|
|
33622
|
-
|
|
33623
|
-
|
|
33624
|
-
|
|
33625
|
-
|
|
33626
|
-
|
|
33627
|
-
|
|
33628
|
-
|
|
33629
|
-
|
|
33630
|
-
|
|
33631
|
-
|
|
33632
|
-
|
|
33625
|
+
styles: {
|
|
33626
|
+
control: (base, state) => ({
|
|
33627
|
+
...base,
|
|
33628
|
+
display: "flex",
|
|
33629
|
+
minHeight: "44px",
|
|
33630
|
+
cursor: readonly ? "not-allowed" : "pointer",
|
|
33631
|
+
backgroundColor: "#f7f7f7",
|
|
33632
|
+
borderRadius: isEditTable ? "0px" : "10px",
|
|
33633
|
+
padding: "4px 0px",
|
|
33634
|
+
border: isForm ? state.isFocused ? "1px solid var(--primary)" : "1px solid transparent" : "none",
|
|
33635
|
+
boxShadow: "none",
|
|
33636
|
+
"&:hover": {
|
|
33637
|
+
borderColor: "var(--primary)"
|
|
33638
|
+
},
|
|
33639
|
+
...isEditTable && {
|
|
33640
|
+
minWidth: "300px",
|
|
33641
|
+
maxWidth: "300px",
|
|
33642
|
+
borderBottom: "1px solid transparent",
|
|
33643
|
+
background: "transparent"
|
|
33644
|
+
}
|
|
33645
|
+
}),
|
|
33646
|
+
clearIndicator: (base) => ({
|
|
33647
|
+
...base,
|
|
33648
|
+
padding: "0"
|
|
33649
|
+
}),
|
|
33650
|
+
menuPortal: (base) => ({
|
|
33651
|
+
...base,
|
|
33652
|
+
zIndex: 9999
|
|
33653
|
+
}),
|
|
33654
|
+
menu: (base) => ({
|
|
33655
|
+
...base,
|
|
33656
|
+
zIndex: 9999,
|
|
33657
|
+
width: isEditTable ? "300px" : "100%",
|
|
33658
|
+
minWidth: isEditTable ? "300px" : "100%"
|
|
33659
|
+
})
|
|
33633
33660
|
},
|
|
33661
|
+
menuPortalTarget: typeof window !== "undefined" ? document.body : null,
|
|
33634
33662
|
components: {
|
|
33635
33663
|
IndicatorSeparator: () => null,
|
|
33636
33664
|
DropdownIndicator: (props2) => readonly || !isEditTable ? null : /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(components.DropdownIndicator, { ...props2 })
|
package/dist/index.mjs
CHANGED
|
@@ -14720,103 +14720,115 @@ var PopupFilter = ({
|
|
|
14720
14720
|
setGroupBy,
|
|
14721
14721
|
fields
|
|
14722
14722
|
}) => {
|
|
14723
|
-
return /* @__PURE__ */ jsx54(
|
|
14723
|
+
return /* @__PURE__ */ jsx54(
|
|
14724
14724
|
"div",
|
|
14725
14725
|
{
|
|
14726
|
-
|
|
14727
|
-
|
|
14728
|
-
|
|
14729
|
-
|
|
14730
|
-
|
|
14731
|
-
|
|
14732
|
-
|
|
14733
|
-
|
|
14734
|
-
|
|
14735
|
-
|
|
14736
|
-
|
|
14737
|
-
|
|
14738
|
-
|
|
14739
|
-
|
|
14740
|
-
|
|
14741
|
-
|
|
14742
|
-
|
|
14743
|
-
|
|
14744
|
-
|
|
14745
|
-
|
|
14746
|
-
|
|
14747
|
-
|
|
14748
|
-
|
|
14749
|
-
|
|
14750
|
-
|
|
14751
|
-
|
|
14752
|
-
|
|
14753
|
-
|
|
14726
|
+
style: {
|
|
14727
|
+
position: "absolute",
|
|
14728
|
+
top: "calc(100% + 3px)",
|
|
14729
|
+
right: 0,
|
|
14730
|
+
zIndex: 33
|
|
14731
|
+
},
|
|
14732
|
+
className: "popup-filter w-full overflow-x-auto rounded-lg border bg-white border-none shadow-xl",
|
|
14733
|
+
children: /* @__PURE__ */ jsxs35(
|
|
14734
|
+
"div",
|
|
14735
|
+
{
|
|
14736
|
+
className: `flex py-3 ${(filterBy?.length === 0 || groupBy?.length === 0) && "!grid-cols-1"}`,
|
|
14737
|
+
children: [
|
|
14738
|
+
filterBy?.length > 0 && /* @__PURE__ */ jsxs35("div", { className: "filter-by w-full px-3", children: [
|
|
14739
|
+
/* @__PURE__ */ jsxs35("div", { className: "flex w-fit items-center justify-start gap-2 px-3 py-1", children: [
|
|
14740
|
+
/* @__PURE__ */ jsx54(FilterIcon, { className: "filter-by-icon text-primary" }),
|
|
14741
|
+
/* @__PURE__ */ jsx54("span", { className: "font-bold text-sm text-[#212529]", children: instance.t("filter_by") })
|
|
14742
|
+
] }),
|
|
14743
|
+
filterBy?.reduce((acc, item, index4, array) => {
|
|
14744
|
+
const prevItem = array[index4 - 1];
|
|
14745
|
+
const isDifferentGroup = prevItem && prevItem?.group_index !== item?.group_index;
|
|
14746
|
+
const isExist = item?.active;
|
|
14747
|
+
if (isDifferentGroup) {
|
|
14748
|
+
acc.push(/* @__PURE__ */ jsx54("hr", { className: "my-2" }, "separator-" + index4));
|
|
14749
|
+
}
|
|
14750
|
+
acc.push(
|
|
14751
|
+
/* @__PURE__ */ jsxs35(
|
|
14752
|
+
"button",
|
|
14753
|
+
{
|
|
14754
|
+
className: `filter-by-item w-full flex items-center gap-2 bg-white px-3 py-1 text-left cursor-pointer ${isExist ? "filter-by-checked font-semibold " : "hover:!bg-[rgba(0,0,0,0.08)]"}`,
|
|
14755
|
+
onClick: () => {
|
|
14756
|
+
const newFilterBy = filterBy?.map(
|
|
14757
|
+
(tag) => tag?.name === item?.name ? { ...tag, active: !tag?.active } : tag
|
|
14758
|
+
);
|
|
14759
|
+
setFilterBy(newFilterBy);
|
|
14760
|
+
if (isExist) {
|
|
14761
|
+
typeof removeSearchItems === "function" && removeSearchItems(
|
|
14762
|
+
`${SearchType.FILTER}_${item.group_index}`,
|
|
14763
|
+
item
|
|
14764
|
+
);
|
|
14765
|
+
return;
|
|
14766
|
+
}
|
|
14767
|
+
typeof handleAddTagSearch === "function" && handleAddTagSearch({
|
|
14768
|
+
name: item?.name,
|
|
14769
|
+
value: item?.string ?? item?.help,
|
|
14770
|
+
domain: item?.domain,
|
|
14771
|
+
groupIndex: item?.group_index,
|
|
14772
|
+
type: SearchType.FILTER
|
|
14773
|
+
});
|
|
14774
|
+
},
|
|
14775
|
+
children: [
|
|
14776
|
+
isExist && /* @__PURE__ */ jsx54(CheckIcon, {}),
|
|
14777
|
+
/* @__PURE__ */ jsx54("span", { className: "text-sm", children: item?.string ?? item?.help })
|
|
14778
|
+
]
|
|
14779
|
+
},
|
|
14780
|
+
"filter-" + index4
|
|
14781
|
+
)
|
|
14782
|
+
);
|
|
14783
|
+
return acc;
|
|
14784
|
+
}, [])
|
|
14785
|
+
] }),
|
|
14786
|
+
filterBy?.length > 0 && groupBy?.length > 0 && /* @__PURE__ */ jsx54("div", { className: "h-['initial'] w-[1px] bg-[#dee2e6]" }),
|
|
14787
|
+
groupBy?.length > 0 && /* @__PURE__ */ jsxs35("div", { className: "group-by w-full px-3", children: [
|
|
14788
|
+
/* @__PURE__ */ jsxs35("div", { className: "flex w-fit items-center justify-start gap-2 px-3 py-1", children: [
|
|
14789
|
+
/* @__PURE__ */ jsx54(GroupByIcon, { className: "group-by-icon text-primary" }),
|
|
14790
|
+
/* @__PURE__ */ jsx54("span", { className: "font-bold text-sm text-[#212529]", children: instance.t("group_by") })
|
|
14791
|
+
] }),
|
|
14792
|
+
groupBy?.map((item, index4) => {
|
|
14793
|
+
const isExist = item?.active;
|
|
14794
|
+
if (!item.string) return;
|
|
14795
|
+
return /* @__PURE__ */ jsxs35(
|
|
14796
|
+
"button",
|
|
14797
|
+
{
|
|
14798
|
+
onClick: () => {
|
|
14799
|
+
const formatArray = groupBy.map(
|
|
14800
|
+
(tag) => tag?.name === item?.name ? { ...tag, active: !tag?.active } : tag
|
|
14754
14801
|
);
|
|
14755
|
-
|
|
14756
|
-
|
|
14757
|
-
|
|
14758
|
-
|
|
14759
|
-
|
|
14760
|
-
|
|
14761
|
-
|
|
14762
|
-
|
|
14763
|
-
|
|
14802
|
+
setGroupBy(formatArray);
|
|
14803
|
+
if (isExist) {
|
|
14804
|
+
typeof removeSearchItems === "function" && removeSearchItems(`${SearchType.GROUP}`, item);
|
|
14805
|
+
return;
|
|
14806
|
+
}
|
|
14807
|
+
typeof handleAddTagSearch === "function" && handleAddTagSearch({
|
|
14808
|
+
name: item?.name,
|
|
14809
|
+
value: item?.string,
|
|
14810
|
+
type: SearchType.GROUP,
|
|
14811
|
+
context: JSON.parse(item?.context.replace(/'/g, '"')),
|
|
14812
|
+
active: !isExist,
|
|
14813
|
+
dataIndex: index4,
|
|
14814
|
+
fieldsGroup: fields
|
|
14815
|
+
});
|
|
14816
|
+
},
|
|
14817
|
+
className: `group-by-item w-full flex items-center gap-2 bg-white px-3 py-1 text-left cursor-pointer ${isExist ? "group-by-checked font-semibold" : "hover:!bg-[rgba(0,0,0,0.08)]"}`,
|
|
14818
|
+
children: [
|
|
14819
|
+
isExist && /* @__PURE__ */ jsx54(CheckIcon, {}),
|
|
14820
|
+
/* @__PURE__ */ jsx54("span", { className: "text-sm", children: item?.string })
|
|
14821
|
+
]
|
|
14764
14822
|
},
|
|
14765
|
-
|
|
14766
|
-
|
|
14767
|
-
|
|
14768
|
-
|
|
14769
|
-
|
|
14770
|
-
|
|
14771
|
-
|
|
14772
|
-
);
|
|
14773
|
-
return acc;
|
|
14774
|
-
}, [])
|
|
14775
|
-
] }),
|
|
14776
|
-
filterBy?.length > 0 && groupBy?.length > 0 && /* @__PURE__ */ jsx54("div", { className: "h-['initial'] w-[1px] bg-[#dee2e6]" }),
|
|
14777
|
-
groupBy?.length > 0 && /* @__PURE__ */ jsxs35("div", { className: "group-by w-full px-3", children: [
|
|
14778
|
-
/* @__PURE__ */ jsxs35("div", { className: "flex w-fit items-center justify-start gap-2 px-3 py-1", children: [
|
|
14779
|
-
/* @__PURE__ */ jsx54(GroupByIcon, { className: "group-by-icon text-primary" }),
|
|
14780
|
-
/* @__PURE__ */ jsx54("span", { className: "font-bold text-sm text-[#212529]", children: instance.t("group_by") })
|
|
14781
|
-
] }),
|
|
14782
|
-
groupBy?.map((item, index4) => {
|
|
14783
|
-
const isExist = item?.active;
|
|
14784
|
-
if (!item.string) return;
|
|
14785
|
-
return /* @__PURE__ */ jsxs35(
|
|
14786
|
-
"button",
|
|
14787
|
-
{
|
|
14788
|
-
onClick: () => {
|
|
14789
|
-
const formatArray = groupBy.map(
|
|
14790
|
-
(tag) => tag?.name === item?.name ? { ...tag, active: !tag?.active } : tag
|
|
14791
|
-
);
|
|
14792
|
-
setGroupBy(formatArray);
|
|
14793
|
-
if (isExist) {
|
|
14794
|
-
typeof removeSearchItems === "function" && removeSearchItems(`${SearchType.GROUP}`, item);
|
|
14795
|
-
return;
|
|
14796
|
-
}
|
|
14797
|
-
typeof handleAddTagSearch === "function" && handleAddTagSearch({
|
|
14798
|
-
name: item?.name,
|
|
14799
|
-
value: item?.string,
|
|
14800
|
-
type: SearchType.GROUP,
|
|
14801
|
-
context: JSON.parse(item?.context.replace(/'/g, '"')),
|
|
14802
|
-
active: !isExist,
|
|
14803
|
-
dataIndex: index4,
|
|
14804
|
-
fieldsGroup: fields
|
|
14805
|
-
});
|
|
14806
|
-
},
|
|
14807
|
-
className: `group-by-item w-full flex items-center gap-2 bg-white px-3 py-1 text-left cursor-pointer ${isExist ? "group-by-checked font-semibold" : "hover:!bg-[rgba(0,0,0,0.08)]"}`,
|
|
14808
|
-
children: [
|
|
14809
|
-
isExist && /* @__PURE__ */ jsx54(CheckIcon, {}),
|
|
14810
|
-
/* @__PURE__ */ jsx54("span", { className: "text-sm", children: item?.string })
|
|
14811
|
-
]
|
|
14812
|
-
},
|
|
14813
|
-
"groupby-" + index4 + 1
|
|
14814
|
-
);
|
|
14815
|
-
})
|
|
14816
|
-
] })
|
|
14817
|
-
]
|
|
14823
|
+
"groupby-" + index4 + 1
|
|
14824
|
+
);
|
|
14825
|
+
})
|
|
14826
|
+
] })
|
|
14827
|
+
]
|
|
14828
|
+
}
|
|
14829
|
+
)
|
|
14818
14830
|
}
|
|
14819
|
-
)
|
|
14831
|
+
);
|
|
14820
14832
|
};
|
|
14821
14833
|
|
|
14822
14834
|
// src/widgets/advanced/search/search-item/index.tsx
|
|
@@ -32114,7 +32126,7 @@ var DateField = (props) => {
|
|
|
32114
32126
|
isForm2 && /* @__PURE__ */ jsx79(CalandarIcon, {})
|
|
32115
32127
|
] })
|
|
32116
32128
|
);
|
|
32117
|
-
if (!isForm) {
|
|
32129
|
+
if (!isForm && !isEditTable) {
|
|
32118
32130
|
return /* @__PURE__ */ jsx79("span", { children: value && (0, import_moment2.default)(value).isValid() ? (0, import_moment2.default)(value).add(7, "hours").format(formatDate2) : "" });
|
|
32119
32131
|
} else {
|
|
32120
32132
|
return /* @__PURE__ */ jsx79(
|
|
@@ -33449,15 +33461,8 @@ var SelectDropdownField = (props) => {
|
|
|
33449
33461
|
value: val[0],
|
|
33450
33462
|
label: val[1]
|
|
33451
33463
|
})) : [];
|
|
33452
|
-
if (!isForm) {
|
|
33453
|
-
|
|
33454
|
-
return value2 && /* @__PURE__ */ jsx97(
|
|
33455
|
-
"span",
|
|
33456
|
-
{
|
|
33457
|
-
className: `${props.className} px-2 py-1 rounded border text-xs font-medium leading-[16px]`,
|
|
33458
|
-
children: value2
|
|
33459
|
-
}
|
|
33460
|
-
);
|
|
33464
|
+
if (!isForm && !isEditTable) {
|
|
33465
|
+
return /* @__PURE__ */ jsx97("span", { children: options2?.find((item) => item?.value === value)?.label });
|
|
33461
33466
|
} else {
|
|
33462
33467
|
return /* @__PURE__ */ jsx97(
|
|
33463
33468
|
Controller,
|
|
@@ -33498,20 +33503,43 @@ var SelectDropdownField = (props) => {
|
|
|
33498
33503
|
StateManagedSelect$1,
|
|
33499
33504
|
{
|
|
33500
33505
|
...commonProps,
|
|
33501
|
-
|
|
33502
|
-
control: () =>
|
|
33503
|
-
|
|
33504
|
-
|
|
33505
|
-
|
|
33506
|
-
|
|
33507
|
-
|
|
33508
|
-
|
|
33509
|
-
|
|
33510
|
-
|
|
33511
|
-
|
|
33512
|
-
|
|
33513
|
-
|
|
33506
|
+
styles: {
|
|
33507
|
+
control: (base, state) => ({
|
|
33508
|
+
...base,
|
|
33509
|
+
display: "flex",
|
|
33510
|
+
minHeight: "44px",
|
|
33511
|
+
cursor: readonly ? "not-allowed" : "pointer",
|
|
33512
|
+
backgroundColor: "#f7f7f7",
|
|
33513
|
+
borderRadius: isEditTable ? "0px" : "10px",
|
|
33514
|
+
padding: "4px 0px",
|
|
33515
|
+
border: isForm ? state.isFocused ? "1px solid var(--primary)" : "1px solid transparent" : "none",
|
|
33516
|
+
boxShadow: "none",
|
|
33517
|
+
"&:hover": {
|
|
33518
|
+
borderColor: "var(--primary)"
|
|
33519
|
+
},
|
|
33520
|
+
...isEditTable && {
|
|
33521
|
+
minWidth: "300px",
|
|
33522
|
+
maxWidth: "300px",
|
|
33523
|
+
borderBottom: "1px solid transparent",
|
|
33524
|
+
background: "transparent"
|
|
33525
|
+
}
|
|
33526
|
+
}),
|
|
33527
|
+
clearIndicator: (base) => ({
|
|
33528
|
+
...base,
|
|
33529
|
+
padding: "0"
|
|
33530
|
+
}),
|
|
33531
|
+
menuPortal: (base) => ({
|
|
33532
|
+
...base,
|
|
33533
|
+
zIndex: 9999
|
|
33534
|
+
}),
|
|
33535
|
+
menu: (base) => ({
|
|
33536
|
+
...base,
|
|
33537
|
+
zIndex: 9999,
|
|
33538
|
+
width: isEditTable ? "300px" : "100%",
|
|
33539
|
+
minWidth: isEditTable ? "300px" : "100%"
|
|
33540
|
+
})
|
|
33514
33541
|
},
|
|
33542
|
+
menuPortalTarget: typeof window !== "undefined" ? document.body : null,
|
|
33515
33543
|
components: {
|
|
33516
33544
|
IndicatorSeparator: () => null,
|
|
33517
33545
|
DropdownIndicator: (props2) => readonly || !isEditTable ? null : /* @__PURE__ */ jsx97(components.DropdownIndicator, { ...props2 })
|
package/dist/widgets.d.mts
CHANGED
|
@@ -277,7 +277,7 @@ interface ISelectDropdownProps extends IInputFieldProps {
|
|
|
277
277
|
selection?: [string | number, string][] | any;
|
|
278
278
|
}
|
|
279
279
|
|
|
280
|
-
declare const SelectDropdownField: (props: ISelectDropdownProps) =>
|
|
280
|
+
declare const SelectDropdownField: (props: ISelectDropdownProps) => JSX.Element;
|
|
281
281
|
|
|
282
282
|
declare const TextAreaField: (props: IInputFieldProps) => JSX.Element;
|
|
283
283
|
|
package/dist/widgets.d.ts
CHANGED
|
@@ -277,7 +277,7 @@ interface ISelectDropdownProps extends IInputFieldProps {
|
|
|
277
277
|
selection?: [string | number, string][] | any;
|
|
278
278
|
}
|
|
279
279
|
|
|
280
|
-
declare const SelectDropdownField: (props: ISelectDropdownProps) =>
|
|
280
|
+
declare const SelectDropdownField: (props: ISelectDropdownProps) => JSX.Element;
|
|
281
281
|
|
|
282
282
|
declare const TextAreaField: (props: IInputFieldProps) => JSX.Element;
|
|
283
283
|
|