@fctc/sme-widget-ui 2.7.3 → 2.7.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.css +1 -1
- package/dist/index.js +176 -168
- package/dist/index.mjs +177 -169
- package/dist/widgets.css +1 -1
- package/dist/widgets.d.mts +1 -1
- package/dist/widgets.d.ts +1 -1
- package/dist/widgets.js +257 -249
- package/dist/widgets.mjs +249 -241
- package/package.json +1 -1
package/dist/widgets.mjs
CHANGED
|
@@ -14318,9 +14318,12 @@ var Button = React2.forwardRef(
|
|
|
14318
14318
|
return /* @__PURE__ */ jsx54(
|
|
14319
14319
|
"button",
|
|
14320
14320
|
{
|
|
14321
|
+
style: {
|
|
14322
|
+
background: "#008F3C"
|
|
14323
|
+
},
|
|
14321
14324
|
className: `${`inline-flex items-center justify-center rounded-md text-sm font-medium
|
|
14322
14325
|
transition-all duration-200 focus-visible:outline-none focus-visible:ring-1
|
|
14323
|
-
disabled:pointer-events-none disabled:opacity-50 px-8 py-3 border
|
|
14326
|
+
disabled:pointer-events-none disabled:opacity-50 px-8 py-3 border text-white
|
|
14324
14327
|
${isLoading ? "bg-opacity-50 cursor-not-allowed" : "hover:bg-opacity-75 active:scale-95 cursor-pointer"}`} ${className}`,
|
|
14325
14328
|
ref,
|
|
14326
14329
|
type,
|
|
@@ -14615,7 +14618,7 @@ var PopupFilter = ({
|
|
|
14615
14618
|
right: 0,
|
|
14616
14619
|
zIndex: 33
|
|
14617
14620
|
},
|
|
14618
|
-
className: "popup-filter w-full overflow-x-auto rounded-lg border
|
|
14621
|
+
className: "popup-filter w-full overflow-x-auto rounded-lg border bg-white border-none shadow-xl",
|
|
14619
14622
|
children: /* @__PURE__ */ jsxs38(
|
|
14620
14623
|
"div",
|
|
14621
14624
|
{
|
|
@@ -14718,7 +14721,190 @@ var PopupFilter = ({
|
|
|
14718
14721
|
};
|
|
14719
14722
|
|
|
14720
14723
|
// src/widgets/advanced/search/search-item/index.tsx
|
|
14721
|
-
import {
|
|
14724
|
+
import { useState as useState5, useEffect as useEffect7 } from "react";
|
|
14725
|
+
|
|
14726
|
+
// src/widgets/advanced/search/search-list/index.tsx
|
|
14727
|
+
import { jsx as jsx63, jsxs as jsxs39 } from "react/jsx-runtime";
|
|
14728
|
+
var SearchList = ({
|
|
14729
|
+
handleAddTagSearch,
|
|
14730
|
+
handleMouseEnter,
|
|
14731
|
+
handleMouseLeave,
|
|
14732
|
+
searchBy,
|
|
14733
|
+
searchString,
|
|
14734
|
+
hoveredIndexSearchList
|
|
14735
|
+
}) => {
|
|
14736
|
+
const { t: t3 } = useI18n();
|
|
14737
|
+
return /* @__PURE__ */ jsx63(
|
|
14738
|
+
"div",
|
|
14739
|
+
{
|
|
14740
|
+
style: {
|
|
14741
|
+
position: "absolute",
|
|
14742
|
+
top: "calc(100% + 5px)",
|
|
14743
|
+
left: 0,
|
|
14744
|
+
right: 0,
|
|
14745
|
+
zIndex: 31
|
|
14746
|
+
},
|
|
14747
|
+
className: `${searchString === "" ? "hidden" : "block"} w-full overflow-x-auto rounded-[0.25rem] border-none bg-white shadow-lg`,
|
|
14748
|
+
children: searchBy?.map((searchItem, index4) => {
|
|
14749
|
+
if (searchItem?.type === "date" || searchItem?.type === "datetime") {
|
|
14750
|
+
if (!validateAndParseDate(searchString, searchItem?.type === "datetime"))
|
|
14751
|
+
return;
|
|
14752
|
+
}
|
|
14753
|
+
return /* @__PURE__ */ jsxs39(
|
|
14754
|
+
"button",
|
|
14755
|
+
{
|
|
14756
|
+
onClick: () => {
|
|
14757
|
+
typeof handleAddTagSearch === "function" && handleAddTagSearch({
|
|
14758
|
+
title: searchItem?.title,
|
|
14759
|
+
name: searchItem?.name,
|
|
14760
|
+
value: searchString,
|
|
14761
|
+
domain: searchItem?.filter_domain,
|
|
14762
|
+
operator: searchItem?.operator,
|
|
14763
|
+
type: SearchType.SEARCH,
|
|
14764
|
+
modelType: searchItem?.type,
|
|
14765
|
+
widget: searchItem?.widget,
|
|
14766
|
+
dataIndex: searchItem?.dataIndex
|
|
14767
|
+
});
|
|
14768
|
+
},
|
|
14769
|
+
onMouseEnter: () => typeof handleMouseEnter === "function" && handleMouseEnter(index4),
|
|
14770
|
+
onMouseLeave: () => typeof handleMouseLeave === "function" && handleMouseLeave(),
|
|
14771
|
+
style: {
|
|
14772
|
+
display: "block",
|
|
14773
|
+
width: "100%",
|
|
14774
|
+
cursor: "pointer",
|
|
14775
|
+
whiteSpace: "nowrap",
|
|
14776
|
+
padding: "2px 12px",
|
|
14777
|
+
paddingTop: "4px",
|
|
14778
|
+
paddingBottom: "4px",
|
|
14779
|
+
textAlign: "left",
|
|
14780
|
+
transitionDuration: "0ms",
|
|
14781
|
+
backgroundColor: hoveredIndexSearchList === index4 ? "rgba(0,0,0,0.08)" : "white",
|
|
14782
|
+
fontSize: "14px"
|
|
14783
|
+
},
|
|
14784
|
+
children: [
|
|
14785
|
+
t3("search"),
|
|
14786
|
+
" ",
|
|
14787
|
+
/* @__PURE__ */ jsx63("span", { className: "font-bold", children: searchItem?.title }),
|
|
14788
|
+
" ",
|
|
14789
|
+
t3("for"),
|
|
14790
|
+
":",
|
|
14791
|
+
" ",
|
|
14792
|
+
/* @__PURE__ */ jsx63("span", { className: "custom-input-result text-primary font-bold italic", children: searchString })
|
|
14793
|
+
]
|
|
14794
|
+
},
|
|
14795
|
+
"header-" + index4 + 1
|
|
14796
|
+
);
|
|
14797
|
+
})
|
|
14798
|
+
}
|
|
14799
|
+
);
|
|
14800
|
+
};
|
|
14801
|
+
|
|
14802
|
+
// src/widgets/advanced/search/tag-search/index.tsx
|
|
14803
|
+
import { Fragment as Fragment8 } from "react";
|
|
14804
|
+
import { Fragment as Fragment9, jsx as jsx64, jsxs as jsxs40 } from "react/jsx-runtime";
|
|
14805
|
+
var TagSearch = ({
|
|
14806
|
+
removeSearchItems,
|
|
14807
|
+
selectedTags,
|
|
14808
|
+
filterBy,
|
|
14809
|
+
setFilterBy
|
|
14810
|
+
}) => {
|
|
14811
|
+
const { t: t3 } = useI18n();
|
|
14812
|
+
return selectedTags?.length > 0 && selectedTags?.map((tag, index4) => {
|
|
14813
|
+
if (tag?.values?.length > 0) {
|
|
14814
|
+
if (tag?.type !== "group_by") {
|
|
14815
|
+
return /* @__PURE__ */ jsxs40(
|
|
14816
|
+
"div",
|
|
14817
|
+
{
|
|
14818
|
+
className: "flex min-h-full overflow-hidden rounded bg-[#E9ECEF] hover:shadow-xl",
|
|
14819
|
+
children: [
|
|
14820
|
+
/* @__PURE__ */ jsx64("div", { className: "bg-primary flex items-center justify-center px-2 text-sm font-semibold leading-[1.5] text-white", children: tag?.type === SearchType.SEARCH ? tag?.title : /* @__PURE__ */ jsx64(FilterIcon, {}) }),
|
|
14821
|
+
/* @__PURE__ */ jsx64(
|
|
14822
|
+
"div",
|
|
14823
|
+
{
|
|
14824
|
+
style: {
|
|
14825
|
+
paddingLeft: "8px"
|
|
14826
|
+
},
|
|
14827
|
+
className: "align-middle text-[#495057] text-[14px]",
|
|
14828
|
+
children: tag.values.map((value, idx) => {
|
|
14829
|
+
return /* @__PURE__ */ jsxs40(Fragment8, { children: [
|
|
14830
|
+
/* @__PURE__ */ jsx64("span", { children: value }),
|
|
14831
|
+
idx < tag.values.length - 1 && /* @__PURE__ */ jsxs40("span", { className: "text-sm italic text-[#495057] text-opacity-50", children: [
|
|
14832
|
+
" ",
|
|
14833
|
+
t3("or"),
|
|
14834
|
+
" "
|
|
14835
|
+
] })
|
|
14836
|
+
] }, idx);
|
|
14837
|
+
})
|
|
14838
|
+
}
|
|
14839
|
+
),
|
|
14840
|
+
/* @__PURE__ */ jsx64(
|
|
14841
|
+
"button",
|
|
14842
|
+
{
|
|
14843
|
+
className: "px-2 text-sm font-bold",
|
|
14844
|
+
onClick: () => {
|
|
14845
|
+
typeof removeSearchItems === "function" && removeSearchItems(
|
|
14846
|
+
tag?.type === SearchType.FILTER ? `${SearchType.FILTER}_${tag?.name}` : tag?.name
|
|
14847
|
+
);
|
|
14848
|
+
if (tag?.type === SearchType.FILTER) {
|
|
14849
|
+
setFilterBy(
|
|
14850
|
+
filterBy?.map((item) => ({
|
|
14851
|
+
...item,
|
|
14852
|
+
active: false
|
|
14853
|
+
}))
|
|
14854
|
+
);
|
|
14855
|
+
}
|
|
14856
|
+
},
|
|
14857
|
+
children: /* @__PURE__ */ jsx64(CloseIcon, { className: "size-4 cursor-pointer" })
|
|
14858
|
+
}
|
|
14859
|
+
)
|
|
14860
|
+
]
|
|
14861
|
+
},
|
|
14862
|
+
"selected-tag-" + index4
|
|
14863
|
+
);
|
|
14864
|
+
} else if (tag?.type === "group_by") {
|
|
14865
|
+
return /* @__PURE__ */ jsx64(
|
|
14866
|
+
"div",
|
|
14867
|
+
{
|
|
14868
|
+
className: "flex min-h-full overflow-hidden",
|
|
14869
|
+
children: /* @__PURE__ */ jsx64("div", { className: "flex flex-wrap items-center gap-2 align-middle text-[#495057] text-[14px]", children: tag?.values?.length > 0 && tag?.values.map(
|
|
14870
|
+
(value, indexValue) => value?.strings?.length > 0 && /* @__PURE__ */ jsxs40(
|
|
14871
|
+
"div",
|
|
14872
|
+
{
|
|
14873
|
+
className: "flex gap-2 overflow-hidden rounded bg-[#E9ECEF] hover:shadow-xl",
|
|
14874
|
+
children: [
|
|
14875
|
+
/* @__PURE__ */ jsx64("div", { className: "bg-primary flex items-center justify-center px-2 text-sm font-semibold leading-[1.5] text-white", children: /* @__PURE__ */ jsx64(GroupByIcon, {}) }),
|
|
14876
|
+
value?.strings?.map((string, idx) => /* @__PURE__ */ jsxs40(Fragment9, { children: [
|
|
14877
|
+
/* @__PURE__ */ jsx64("span", { children: string }),
|
|
14878
|
+
idx < value?.strings.length - 1 && /* @__PURE__ */ jsxs40("span", { className: "text-sm italic text-[#495057] text-opacity-50", children: [
|
|
14879
|
+
" ",
|
|
14880
|
+
"> ",
|
|
14881
|
+
" "
|
|
14882
|
+
] })
|
|
14883
|
+
] })),
|
|
14884
|
+
/* @__PURE__ */ jsx64(
|
|
14885
|
+
"button",
|
|
14886
|
+
{
|
|
14887
|
+
className: "pr-2 text-sm font-bold",
|
|
14888
|
+
onClick: () => {
|
|
14889
|
+
if (tag?.type === SearchType.GROUP) {
|
|
14890
|
+
typeof removeSearchItems === "function" && removeSearchItems(`${SearchType.GROUP}`);
|
|
14891
|
+
}
|
|
14892
|
+
},
|
|
14893
|
+
children: /* @__PURE__ */ jsx64(CloseIcon, { className: "size-4 cursor-pointer" })
|
|
14894
|
+
}
|
|
14895
|
+
)
|
|
14896
|
+
]
|
|
14897
|
+
},
|
|
14898
|
+
`group-by-${index4}-${indexValue}`
|
|
14899
|
+
)
|
|
14900
|
+
) })
|
|
14901
|
+
},
|
|
14902
|
+
"selected-tag-" + index4
|
|
14903
|
+
);
|
|
14904
|
+
}
|
|
14905
|
+
}
|
|
14906
|
+
});
|
|
14907
|
+
};
|
|
14722
14908
|
|
|
14723
14909
|
// src/hooks/use-click-outside.ts
|
|
14724
14910
|
import { useEffect as useEffect5, useRef as useRef3 } from "react";
|
|
@@ -14966,179 +15152,6 @@ function useFileInfo(source, options2) {
|
|
|
14966
15152
|
} };
|
|
14967
15153
|
}
|
|
14968
15154
|
|
|
14969
|
-
// src/widgets/advanced/search/tag-search/index.tsx
|
|
14970
|
-
import { Fragment as Fragment8 } from "react";
|
|
14971
|
-
import { Fragment as Fragment9, jsx as jsx63, jsxs as jsxs39 } from "react/jsx-runtime";
|
|
14972
|
-
var TagSearch = ({
|
|
14973
|
-
removeSearchItems,
|
|
14974
|
-
selectedTags,
|
|
14975
|
-
filterBy,
|
|
14976
|
-
setFilterBy,
|
|
14977
|
-
setGroupBy
|
|
14978
|
-
}) => {
|
|
14979
|
-
return selectedTags?.length > 0 && selectedTags?.map((tag, index4) => {
|
|
14980
|
-
if (tag?.values?.length > 0) {
|
|
14981
|
-
if (tag?.type !== "group_by") {
|
|
14982
|
-
return /* @__PURE__ */ jsxs39(
|
|
14983
|
-
"div",
|
|
14984
|
-
{
|
|
14985
|
-
className: "flex min-h-full overflow-hidden rounded bg-[#E9ECEF] hover:shadow-xl",
|
|
14986
|
-
children: [
|
|
14987
|
-
/* @__PURE__ */ jsx63("div", { className: "bg-primary flex items-center justify-center px-2 text-sm font-semibold leading-[1.5] text-white", children: tag?.type === SearchType.SEARCH ? tag?.title : /* @__PURE__ */ jsx63(FilterIcon, {}) }),
|
|
14988
|
-
/* @__PURE__ */ jsx63("div", { className: "pl-2 align-middle text-[#495057] text-[14px]", children: tag.values.map((value, idx) => {
|
|
14989
|
-
return /* @__PURE__ */ jsxs39(Fragment8, { children: [
|
|
14990
|
-
/* @__PURE__ */ jsx63("span", { children: value }),
|
|
14991
|
-
idx < tag.values.length - 1 && /* @__PURE__ */ jsxs39("span", { className: "text-sm italic text-[#495057] text-opacity-50", children: [
|
|
14992
|
-
" ",
|
|
14993
|
-
instance.t("or"),
|
|
14994
|
-
" "
|
|
14995
|
-
] })
|
|
14996
|
-
] }, idx);
|
|
14997
|
-
}) }),
|
|
14998
|
-
/* @__PURE__ */ jsx63(
|
|
14999
|
-
"button",
|
|
15000
|
-
{
|
|
15001
|
-
className: "px-2 text-sm font-bold",
|
|
15002
|
-
onClick: () => {
|
|
15003
|
-
typeof removeSearchItems === "function" && removeSearchItems(
|
|
15004
|
-
tag?.type === SearchType.FILTER ? `${SearchType.FILTER}_${tag?.name}` : tag?.name
|
|
15005
|
-
);
|
|
15006
|
-
if (tag?.type === SearchType.FILTER) {
|
|
15007
|
-
setFilterBy(
|
|
15008
|
-
filterBy?.map((item) => ({
|
|
15009
|
-
...item,
|
|
15010
|
-
active: false
|
|
15011
|
-
}))
|
|
15012
|
-
);
|
|
15013
|
-
}
|
|
15014
|
-
},
|
|
15015
|
-
children: /* @__PURE__ */ jsx63(CloseIcon, { className: "size-4 cursor-pointer" })
|
|
15016
|
-
}
|
|
15017
|
-
)
|
|
15018
|
-
]
|
|
15019
|
-
},
|
|
15020
|
-
"selected-tag-" + index4
|
|
15021
|
-
);
|
|
15022
|
-
} else if (tag?.type === "group_by") {
|
|
15023
|
-
return /* @__PURE__ */ jsx63(
|
|
15024
|
-
"div",
|
|
15025
|
-
{
|
|
15026
|
-
className: "flex min-h-full overflow-hidden",
|
|
15027
|
-
children: /* @__PURE__ */ jsx63("div", { className: "flex flex-wrap items-center gap-2 align-middle text-[#495057] text-[14px]", children: tag?.values?.length > 0 && tag?.values.map(
|
|
15028
|
-
(value, indexValue) => value?.strings?.length > 0 && /* @__PURE__ */ jsxs39(
|
|
15029
|
-
"div",
|
|
15030
|
-
{
|
|
15031
|
-
className: "flex gap-2 overflow-hidden rounded bg-[#E9ECEF] hover:shadow-xl",
|
|
15032
|
-
children: [
|
|
15033
|
-
/* @__PURE__ */ jsx63("div", { className: "bg-primary flex items-center justify-center px-2 text-sm font-semibold leading-[1.5] text-white", children: /* @__PURE__ */ jsx63(GroupByIcon, {}) }),
|
|
15034
|
-
value?.strings?.map((string, idx) => /* @__PURE__ */ jsxs39(Fragment9, { children: [
|
|
15035
|
-
/* @__PURE__ */ jsx63("span", { children: string }),
|
|
15036
|
-
idx < value?.strings.length - 1 && /* @__PURE__ */ jsxs39("span", { className: "text-sm italic text-[#495057] text-opacity-50", children: [
|
|
15037
|
-
" ",
|
|
15038
|
-
"> ",
|
|
15039
|
-
" "
|
|
15040
|
-
] })
|
|
15041
|
-
] })),
|
|
15042
|
-
/* @__PURE__ */ jsx63(
|
|
15043
|
-
"button",
|
|
15044
|
-
{
|
|
15045
|
-
className: "pr-2 text-sm font-bold",
|
|
15046
|
-
onClick: () => {
|
|
15047
|
-
if (tag?.type === SearchType.GROUP) {
|
|
15048
|
-
typeof removeSearchItems === "function" && removeSearchItems(`${SearchType.GROUP}`);
|
|
15049
|
-
setGroupBy(
|
|
15050
|
-
(prev2) => prev2?.map((item) => ({
|
|
15051
|
-
...item,
|
|
15052
|
-
active: false
|
|
15053
|
-
}))
|
|
15054
|
-
);
|
|
15055
|
-
}
|
|
15056
|
-
},
|
|
15057
|
-
children: /* @__PURE__ */ jsx63(CloseIcon, { className: "size-4 cursor-pointer" })
|
|
15058
|
-
}
|
|
15059
|
-
)
|
|
15060
|
-
]
|
|
15061
|
-
},
|
|
15062
|
-
`group-by-${index4}-${indexValue}`
|
|
15063
|
-
)
|
|
15064
|
-
) })
|
|
15065
|
-
},
|
|
15066
|
-
"selected-tag-" + index4
|
|
15067
|
-
);
|
|
15068
|
-
}
|
|
15069
|
-
}
|
|
15070
|
-
});
|
|
15071
|
-
};
|
|
15072
|
-
|
|
15073
|
-
// src/widgets/advanced/search/search-list/index.tsx
|
|
15074
|
-
import { jsx as jsx64, jsxs as jsxs40 } from "react/jsx-runtime";
|
|
15075
|
-
var SearchList = ({
|
|
15076
|
-
handleAddTagSearch,
|
|
15077
|
-
handleMouseEnter,
|
|
15078
|
-
handleMouseLeave,
|
|
15079
|
-
searchBy,
|
|
15080
|
-
searchString,
|
|
15081
|
-
hoveredIndexSearchList
|
|
15082
|
-
}) => {
|
|
15083
|
-
const { t: t3 } = useI18n();
|
|
15084
|
-
return /* @__PURE__ */ jsx64(
|
|
15085
|
-
"div",
|
|
15086
|
-
{
|
|
15087
|
-
style: {
|
|
15088
|
-
top: "calc(100% + 3px)"
|
|
15089
|
-
},
|
|
15090
|
-
className: `${searchString === "" ? "hidden" : "block"} absolute left-0 right-0 top-[calc(100%_+_3px)] z-[31] w-full overflow-x-auto rounded-[0.25rem] border-none bg-white shadow-lg`,
|
|
15091
|
-
children: searchBy?.map((searchItem, index4) => {
|
|
15092
|
-
if (searchItem?.type === "date" || searchItem?.type === "datetime") {
|
|
15093
|
-
if (!validateAndParseDate(searchString, searchItem?.type === "datetime"))
|
|
15094
|
-
return;
|
|
15095
|
-
}
|
|
15096
|
-
return /* @__PURE__ */ jsxs40(
|
|
15097
|
-
"button",
|
|
15098
|
-
{
|
|
15099
|
-
onClick: () => {
|
|
15100
|
-
typeof handleAddTagSearch === "function" && handleAddTagSearch({
|
|
15101
|
-
title: searchItem?.title,
|
|
15102
|
-
name: searchItem?.name,
|
|
15103
|
-
value: searchString,
|
|
15104
|
-
domain: searchItem?.filter_domain,
|
|
15105
|
-
operator: searchItem?.operator,
|
|
15106
|
-
type: SearchType.SEARCH,
|
|
15107
|
-
modelType: searchItem?.type,
|
|
15108
|
-
widget: searchItem?.widget,
|
|
15109
|
-
dataIndex: searchItem?.dataIndex
|
|
15110
|
-
});
|
|
15111
|
-
},
|
|
15112
|
-
onMouseEnter: () => typeof handleMouseEnter === "function" && handleMouseEnter(index4),
|
|
15113
|
-
onMouseLeave: () => typeof handleMouseLeave === "function" && handleMouseLeave(),
|
|
15114
|
-
className: `block w-full cursor-pointer whitespace-nowrap p-2 px-3 py-1 text-left !duration-0 hover:!bg-[rgba(0,0,0,0.08)] hover:text-inherit text-sm ${hoveredIndexSearchList === index4 ? "bg-[rgba(0,0,0,0.08)]" : "bg-white"}`,
|
|
15115
|
-
children: [
|
|
15116
|
-
t3("search"),
|
|
15117
|
-
" ",
|
|
15118
|
-
/* @__PURE__ */ jsx64("span", { className: "font-bold", children: searchItem?.title }),
|
|
15119
|
-
" ",
|
|
15120
|
-
t3("for"),
|
|
15121
|
-
":",
|
|
15122
|
-
" ",
|
|
15123
|
-
/* @__PURE__ */ jsx64(
|
|
15124
|
-
"span",
|
|
15125
|
-
{
|
|
15126
|
-
style: {
|
|
15127
|
-
color: "var(--color-primary)"
|
|
15128
|
-
},
|
|
15129
|
-
className: "custom-input-result text-primary font-bold italic",
|
|
15130
|
-
children: searchString
|
|
15131
|
-
}
|
|
15132
|
-
)
|
|
15133
|
-
]
|
|
15134
|
-
},
|
|
15135
|
-
"header-" + index4 + 1
|
|
15136
|
-
);
|
|
15137
|
-
})
|
|
15138
|
-
}
|
|
15139
|
-
);
|
|
15140
|
-
};
|
|
15141
|
-
|
|
15142
15155
|
// src/widgets/advanced/search/search-item/index.tsx
|
|
15143
15156
|
import { Fragment as Fragment10, jsx as jsx65, jsxs as jsxs41 } from "react/jsx-runtime";
|
|
15144
15157
|
var Search = ({
|
|
@@ -15163,7 +15176,11 @@ var Search = ({
|
|
|
15163
15176
|
selectedRowKeys,
|
|
15164
15177
|
domainSearch,
|
|
15165
15178
|
evalJSONContext,
|
|
15166
|
-
clearSearch
|
|
15179
|
+
clearSearch,
|
|
15180
|
+
onKeyDown,
|
|
15181
|
+
handleMouseEnter,
|
|
15182
|
+
handleMouseLeave,
|
|
15183
|
+
hoveredIndexSearchList
|
|
15167
15184
|
}) => {
|
|
15168
15185
|
const { t: t3 } = useI18n();
|
|
15169
15186
|
const [showPopupFilter, setShowPopupFilter] = useState5(false);
|
|
@@ -15200,9 +15217,8 @@ var Search = ({
|
|
|
15200
15217
|
const searchDefaults = Object.entries(context || {}).filter(
|
|
15201
15218
|
([key]) => key.startsWith("search_default_")
|
|
15202
15219
|
);
|
|
15203
|
-
const defaultGroupBy = context ? Object.entries(context).filter(([key]) => key.includes("group_by")) : [];
|
|
15204
15220
|
const hasGroupBy = viewData?.views?.search?.filters_by?.length > 0;
|
|
15205
|
-
if (searchDefaults.length === 0 && !hasGroupBy
|
|
15221
|
+
if (searchDefaults.length === 0 && !hasGroupBy) {
|
|
15206
15222
|
setIsReadyFormatDomain(true);
|
|
15207
15223
|
setDidInit(true);
|
|
15208
15224
|
return;
|
|
@@ -15223,23 +15239,7 @@ var Search = ({
|
|
|
15223
15239
|
}
|
|
15224
15240
|
return item;
|
|
15225
15241
|
});
|
|
15226
|
-
const updatedGroupBy = groupBy?.map((item) => {
|
|
15227
|
-
const defaultGroupByItem = defaultGroupBy.find(
|
|
15228
|
-
([_2, value]) => item?.context?.includes(value)
|
|
15229
|
-
);
|
|
15230
|
-
if (defaultGroupByItem && typeof handleAddTagSearch == "function") {
|
|
15231
|
-
handleAddTagSearch({
|
|
15232
|
-
name: item?.name,
|
|
15233
|
-
value: item?.string,
|
|
15234
|
-
type: SearchType.GROUP,
|
|
15235
|
-
context: JSON.parse(item?.context.replace(/'/g, '"'))
|
|
15236
|
-
});
|
|
15237
|
-
return { ...item, active: true };
|
|
15238
|
-
}
|
|
15239
|
-
return item;
|
|
15240
|
-
});
|
|
15241
15242
|
if (updatedFilter) setFilterBy(updatedFilter);
|
|
15242
|
-
if (updatedGroupBy) setGroupBy(updatedGroupBy);
|
|
15243
15243
|
if (hasGroupBy) {
|
|
15244
15244
|
viewData?.views?.search?.filters_by?.forEach((item, idx) => {
|
|
15245
15245
|
const groupCtx = evalJSONContext(item?.context);
|
|
@@ -15261,60 +15261,68 @@ var Search = ({
|
|
|
15261
15261
|
"div",
|
|
15262
15262
|
{
|
|
15263
15263
|
ref: popupFilterRef,
|
|
15264
|
-
className: `search
|
|
15264
|
+
className: `search ${selectedRowKeys?.length <= 0 ? "flex" : "hidden"} bg-white custom-search-input py-[8px] px-[16px] relative items-center w-full flex-1 xl:flex-1 rounded-[10px] bg-grey-100 shadow-[0px_1px_3px_rgba(16,24,40,0.1),0px_1px_2px_rgba(16,24,40,0.06)] min-h-[40px] border border-[#F2F2F2]`,
|
|
15265
15265
|
children: [
|
|
15266
|
-
/* @__PURE__ */
|
|
15267
|
-
|
|
15268
|
-
|
|
15269
|
-
|
|
15270
|
-
|
|
15271
|
-
|
|
15272
|
-
|
|
15273
|
-
|
|
15274
|
-
|
|
15275
|
-
|
|
15276
|
-
|
|
15277
|
-
|
|
15278
|
-
|
|
15279
|
-
|
|
15280
|
-
|
|
15281
|
-
|
|
15282
|
-
|
|
15283
|
-
|
|
15284
|
-
|
|
15285
|
-
|
|
15286
|
-
|
|
15287
|
-
|
|
15288
|
-
|
|
15289
|
-
|
|
15290
|
-
|
|
15266
|
+
/* @__PURE__ */ jsxs41(
|
|
15267
|
+
"div",
|
|
15268
|
+
{
|
|
15269
|
+
className: `relative flex md:min-w-[400px] max-w-full items-center gap-[8px] w-full ${(showFiltersGroups || filterBy?.length > 0 || groupBy?.length > 0) && "border-r border-[rgba(242,242,242,1)]"}`,
|
|
15270
|
+
children: [
|
|
15271
|
+
/* @__PURE__ */ jsx65("div", { className: "min-h-5 min-w-5", children: /* @__PURE__ */ jsx65(SearchIcon, {}) }),
|
|
15272
|
+
/* @__PURE__ */ jsxs41("div", { className: "flex flex-1 flex-wrap items-center gap-[8px]", children: [
|
|
15273
|
+
/* @__PURE__ */ jsx65(
|
|
15274
|
+
TagSearch,
|
|
15275
|
+
{
|
|
15276
|
+
removeSearchItems,
|
|
15277
|
+
selectedTags,
|
|
15278
|
+
filterBy,
|
|
15279
|
+
setFilterBy
|
|
15280
|
+
}
|
|
15281
|
+
),
|
|
15282
|
+
/* @__PURE__ */ jsx65(
|
|
15283
|
+
"input",
|
|
15284
|
+
{
|
|
15285
|
+
value: searchString,
|
|
15286
|
+
className: "min-h-[25px] w-fit flex-1 border-none bg-transparent outline-none min-w-[50px] text-sm",
|
|
15287
|
+
placeholder: t3("search..."),
|
|
15288
|
+
onChange: (e3) => {
|
|
15289
|
+
onSearchString(e3.target.value);
|
|
15290
|
+
setShowPopupFilter(false);
|
|
15291
|
+
},
|
|
15292
|
+
onKeyDown,
|
|
15293
|
+
onKeyUp: (e3) => e3.preventDefault()
|
|
15294
|
+
}
|
|
15295
|
+
),
|
|
15296
|
+
/* @__PURE__ */ jsx65(
|
|
15297
|
+
SearchList,
|
|
15298
|
+
{
|
|
15299
|
+
handleAddTagSearch,
|
|
15300
|
+
searchBy,
|
|
15301
|
+
searchString,
|
|
15302
|
+
handleMouseEnter,
|
|
15303
|
+
handleMouseLeave,
|
|
15304
|
+
hoveredIndexSearchList
|
|
15305
|
+
}
|
|
15306
|
+
)
|
|
15307
|
+
] })
|
|
15308
|
+
]
|
|
15309
|
+
}
|
|
15310
|
+
),
|
|
15311
|
+
(showFiltersGroups || filterBy?.length > 0 || groupBy?.length > 0) && /* @__PURE__ */ jsxs41(Fragment10, { children: [
|
|
15291
15312
|
/* @__PURE__ */ jsx65(
|
|
15292
|
-
SearchList,
|
|
15293
|
-
{
|
|
15294
|
-
handleAddTagSearch,
|
|
15295
|
-
searchBy,
|
|
15296
|
-
searchString
|
|
15297
|
-
}
|
|
15298
|
-
)
|
|
15299
|
-
] }),
|
|
15300
|
-
showFiltersGroups && /* @__PURE__ */ jsxs41(Fragment10, { children: [
|
|
15301
|
-
/* @__PURE__ */ jsxs41(
|
|
15302
15313
|
"div",
|
|
15303
15314
|
{
|
|
15304
|
-
className: `flex h-full
|
|
15315
|
+
className: `flex h-full cursor-pointer items-center justify-center px-[10px] max-w-fit`,
|
|
15305
15316
|
onClick: (e3) => {
|
|
15306
15317
|
e3.stopPropagation();
|
|
15307
15318
|
setShowPopupFilter((prev2) => !prev2);
|
|
15308
15319
|
},
|
|
15309
|
-
children:
|
|
15310
|
-
|
|
15311
|
-
|
|
15312
|
-
|
|
15313
|
-
|
|
15314
|
-
|
|
15315
|
-
}
|
|
15316
|
-
)
|
|
15317
|
-
]
|
|
15320
|
+
children: /* @__PURE__ */ jsx65("button", { className: "w-max cursor-pointer", children: /* @__PURE__ */ jsx65(
|
|
15321
|
+
ChevronBottomIcon,
|
|
15322
|
+
{
|
|
15323
|
+
className: `h-5 w-5 min-w-fit transition-all ${showPopupFilter ? "rotate-180 " : ""}`
|
|
15324
|
+
}
|
|
15325
|
+
) })
|
|
15318
15326
|
}
|
|
15319
15327
|
),
|
|
15320
15328
|
showPopupFilter && /* @__PURE__ */ jsx65(
|