@fctc/sme-widget-ui 2.7.4 → 2.7.6
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 +170 -148
- package/dist/index.mjs +171 -149
- package/dist/widgets.css +1 -1
- package/dist/widgets.d.mts +1 -1
- package/dist/widgets.d.ts +1 -1
- package/dist/widgets.js +251 -229
- package/dist/widgets.mjs +243 -221
- package/package.json +1 -1
package/dist/widgets.js
CHANGED
|
@@ -14786,8 +14786,191 @@ var PopupFilter = ({
|
|
|
14786
14786
|
// src/widgets/advanced/search/search-item/index.tsx
|
|
14787
14787
|
var import_react21 = require("react");
|
|
14788
14788
|
|
|
14789
|
-
// src/
|
|
14789
|
+
// src/widgets/advanced/search/search-list/index.tsx
|
|
14790
|
+
var import_jsx_runtime63 = require("react/jsx-runtime");
|
|
14791
|
+
var SearchList = ({
|
|
14792
|
+
handleAddTagSearch,
|
|
14793
|
+
handleMouseEnter,
|
|
14794
|
+
handleMouseLeave,
|
|
14795
|
+
searchBy,
|
|
14796
|
+
searchString,
|
|
14797
|
+
hoveredIndexSearchList
|
|
14798
|
+
}) => {
|
|
14799
|
+
const { t: t3 } = useI18n();
|
|
14800
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
14801
|
+
"div",
|
|
14802
|
+
{
|
|
14803
|
+
style: {
|
|
14804
|
+
position: "absolute",
|
|
14805
|
+
top: "calc(100% + 5px)",
|
|
14806
|
+
left: 0,
|
|
14807
|
+
right: 0,
|
|
14808
|
+
zIndex: 31
|
|
14809
|
+
},
|
|
14810
|
+
className: `${searchString === "" ? "hidden" : "block"} w-full overflow-x-auto rounded-[0.25rem] border-none bg-white shadow-lg`,
|
|
14811
|
+
children: searchBy?.map((searchItem, index4) => {
|
|
14812
|
+
if (searchItem?.type === "date" || searchItem?.type === "datetime") {
|
|
14813
|
+
if (!validateAndParseDate(searchString, searchItem?.type === "datetime"))
|
|
14814
|
+
return;
|
|
14815
|
+
}
|
|
14816
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(
|
|
14817
|
+
"button",
|
|
14818
|
+
{
|
|
14819
|
+
onClick: () => {
|
|
14820
|
+
typeof handleAddTagSearch === "function" && handleAddTagSearch({
|
|
14821
|
+
title: searchItem?.title,
|
|
14822
|
+
name: searchItem?.name,
|
|
14823
|
+
value: searchString,
|
|
14824
|
+
domain: searchItem?.filter_domain,
|
|
14825
|
+
operator: searchItem?.operator,
|
|
14826
|
+
type: SearchType.SEARCH,
|
|
14827
|
+
modelType: searchItem?.type,
|
|
14828
|
+
widget: searchItem?.widget,
|
|
14829
|
+
dataIndex: searchItem?.dataIndex
|
|
14830
|
+
});
|
|
14831
|
+
},
|
|
14832
|
+
onMouseEnter: () => typeof handleMouseEnter === "function" && handleMouseEnter(index4),
|
|
14833
|
+
onMouseLeave: () => typeof handleMouseLeave === "function" && handleMouseLeave(),
|
|
14834
|
+
style: {
|
|
14835
|
+
display: "block",
|
|
14836
|
+
width: "100%",
|
|
14837
|
+
cursor: "pointer",
|
|
14838
|
+
whiteSpace: "nowrap",
|
|
14839
|
+
padding: "2px 12px",
|
|
14840
|
+
paddingTop: "4px",
|
|
14841
|
+
paddingBottom: "4px",
|
|
14842
|
+
textAlign: "left",
|
|
14843
|
+
transitionDuration: "0ms",
|
|
14844
|
+
backgroundColor: hoveredIndexSearchList === index4 ? "rgba(0,0,0,0.08)" : "white",
|
|
14845
|
+
fontSize: "14px"
|
|
14846
|
+
},
|
|
14847
|
+
children: [
|
|
14848
|
+
t3("search"),
|
|
14849
|
+
" ",
|
|
14850
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("span", { className: "font-bold", children: searchItem?.title }),
|
|
14851
|
+
" ",
|
|
14852
|
+
t3("for"),
|
|
14853
|
+
":",
|
|
14854
|
+
" ",
|
|
14855
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("span", { className: "custom-input-result text-primary font-bold italic", children: searchString })
|
|
14856
|
+
]
|
|
14857
|
+
},
|
|
14858
|
+
"header-" + index4 + 1
|
|
14859
|
+
);
|
|
14860
|
+
})
|
|
14861
|
+
}
|
|
14862
|
+
);
|
|
14863
|
+
};
|
|
14864
|
+
|
|
14865
|
+
// src/widgets/advanced/search/tag-search/index.tsx
|
|
14790
14866
|
var import_react18 = require("react");
|
|
14867
|
+
var import_jsx_runtime64 = require("react/jsx-runtime");
|
|
14868
|
+
var TagSearch = ({
|
|
14869
|
+
removeSearchItems,
|
|
14870
|
+
selectedTags,
|
|
14871
|
+
filterBy,
|
|
14872
|
+
setFilterBy
|
|
14873
|
+
}) => {
|
|
14874
|
+
const { t: t3 } = useI18n();
|
|
14875
|
+
return selectedTags?.length > 0 && selectedTags?.map((tag, index4) => {
|
|
14876
|
+
if (tag?.values?.length > 0) {
|
|
14877
|
+
if (tag?.type !== "group_by") {
|
|
14878
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(
|
|
14879
|
+
"div",
|
|
14880
|
+
{
|
|
14881
|
+
className: "flex min-h-full overflow-hidden rounded bg-[#E9ECEF] hover:shadow-xl",
|
|
14882
|
+
children: [
|
|
14883
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)("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__ */ (0, import_jsx_runtime64.jsx)(FilterIcon, {}) }),
|
|
14884
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
14885
|
+
"div",
|
|
14886
|
+
{
|
|
14887
|
+
style: {
|
|
14888
|
+
paddingLeft: "8px"
|
|
14889
|
+
},
|
|
14890
|
+
className: "align-middle text-[#495057] text-[14px]",
|
|
14891
|
+
children: tag.values.map((value, idx) => {
|
|
14892
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(import_react18.Fragment, { children: [
|
|
14893
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)("span", { children: value }),
|
|
14894
|
+
idx < tag.values.length - 1 && /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)("span", { className: "text-sm italic text-[#495057] text-opacity-50", children: [
|
|
14895
|
+
" ",
|
|
14896
|
+
t3("or"),
|
|
14897
|
+
" "
|
|
14898
|
+
] })
|
|
14899
|
+
] }, idx);
|
|
14900
|
+
})
|
|
14901
|
+
}
|
|
14902
|
+
),
|
|
14903
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
14904
|
+
"button",
|
|
14905
|
+
{
|
|
14906
|
+
className: "px-2 text-sm font-bold",
|
|
14907
|
+
onClick: () => {
|
|
14908
|
+
typeof removeSearchItems === "function" && removeSearchItems(
|
|
14909
|
+
tag?.type === SearchType.FILTER ? `${SearchType.FILTER}_${tag?.name}` : tag?.name
|
|
14910
|
+
);
|
|
14911
|
+
if (tag?.type === SearchType.FILTER) {
|
|
14912
|
+
setFilterBy(
|
|
14913
|
+
filterBy?.map((item) => ({
|
|
14914
|
+
...item,
|
|
14915
|
+
active: false
|
|
14916
|
+
}))
|
|
14917
|
+
);
|
|
14918
|
+
}
|
|
14919
|
+
},
|
|
14920
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(CloseIcon, { className: "size-4 cursor-pointer" })
|
|
14921
|
+
}
|
|
14922
|
+
)
|
|
14923
|
+
]
|
|
14924
|
+
},
|
|
14925
|
+
"selected-tag-" + index4
|
|
14926
|
+
);
|
|
14927
|
+
} else if (tag?.type === "group_by") {
|
|
14928
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
14929
|
+
"div",
|
|
14930
|
+
{
|
|
14931
|
+
className: "flex min-h-full overflow-hidden",
|
|
14932
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("div", { className: "flex flex-wrap items-center gap-2 align-middle text-[#495057] text-[14px]", children: tag?.values?.length > 0 && tag?.values.map(
|
|
14933
|
+
(value, indexValue) => value?.strings?.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(
|
|
14934
|
+
"div",
|
|
14935
|
+
{
|
|
14936
|
+
className: "flex gap-2 overflow-hidden rounded bg-[#E9ECEF] hover:shadow-xl",
|
|
14937
|
+
children: [
|
|
14938
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)("div", { className: "bg-primary flex items-center justify-center px-2 text-sm font-semibold leading-[1.5] text-white", children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(GroupByIcon, {}) }),
|
|
14939
|
+
value?.strings?.map((string, idx) => /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(import_jsx_runtime64.Fragment, { children: [
|
|
14940
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)("span", { children: string }),
|
|
14941
|
+
idx < value?.strings.length - 1 && /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)("span", { className: "text-sm italic text-[#495057] text-opacity-50", children: [
|
|
14942
|
+
" ",
|
|
14943
|
+
"> ",
|
|
14944
|
+
" "
|
|
14945
|
+
] })
|
|
14946
|
+
] })),
|
|
14947
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
14948
|
+
"button",
|
|
14949
|
+
{
|
|
14950
|
+
className: "pr-2 text-sm font-bold",
|
|
14951
|
+
onClick: () => {
|
|
14952
|
+
if (tag?.type === SearchType.GROUP) {
|
|
14953
|
+
typeof removeSearchItems === "function" && removeSearchItems(`${SearchType.GROUP}`);
|
|
14954
|
+
}
|
|
14955
|
+
},
|
|
14956
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(CloseIcon, { className: "size-4 cursor-pointer" })
|
|
14957
|
+
}
|
|
14958
|
+
)
|
|
14959
|
+
]
|
|
14960
|
+
},
|
|
14961
|
+
`group-by-${index4}-${indexValue}`
|
|
14962
|
+
)
|
|
14963
|
+
) })
|
|
14964
|
+
},
|
|
14965
|
+
"selected-tag-" + index4
|
|
14966
|
+
);
|
|
14967
|
+
}
|
|
14968
|
+
}
|
|
14969
|
+
});
|
|
14970
|
+
};
|
|
14971
|
+
|
|
14972
|
+
// src/hooks/use-click-outside.ts
|
|
14973
|
+
var import_react19 = require("react");
|
|
14791
14974
|
var DEFAULT_EVENTS = ["mousedown", "touchstart"];
|
|
14792
14975
|
var useClickOutside = ({
|
|
14793
14976
|
handler,
|
|
@@ -14796,8 +14979,8 @@ var useClickOutside = ({
|
|
|
14796
14979
|
// Default to empty array to avoid undefined errors
|
|
14797
14980
|
refs
|
|
14798
14981
|
}) => {
|
|
14799
|
-
const ref = (0,
|
|
14800
|
-
(0,
|
|
14982
|
+
const ref = (0, import_react19.useRef)(null);
|
|
14983
|
+
(0, import_react19.useEffect)(() => {
|
|
14801
14984
|
const listener = (event) => {
|
|
14802
14985
|
const { target } = event;
|
|
14803
14986
|
if (refs && refs?.length > 0 && refs?.some((r4) => r4.current?.contains(target))) {
|
|
@@ -14819,7 +15002,7 @@ var useClickOutside = ({
|
|
|
14819
15002
|
};
|
|
14820
15003
|
|
|
14821
15004
|
// src/hooks/use-get-file-infor.ts
|
|
14822
|
-
var
|
|
15005
|
+
var import_react20 = require("react");
|
|
14823
15006
|
function getFileName(source, mime) {
|
|
14824
15007
|
if (source instanceof File) return source.name;
|
|
14825
15008
|
if (typeof source === "string") {
|
|
@@ -14840,11 +15023,11 @@ function getFileName(source, mime) {
|
|
|
14840
15023
|
}
|
|
14841
15024
|
function useFileInfo(source, options2) {
|
|
14842
15025
|
const { readAs = "all" } = options2 ?? {};
|
|
14843
|
-
const [info, setInfo] = (0,
|
|
14844
|
-
const [loading, setLoading] = (0,
|
|
14845
|
-
const [error2, setError] = (0,
|
|
14846
|
-
const abortRef = (0,
|
|
14847
|
-
(0,
|
|
15026
|
+
const [info, setInfo] = (0, import_react20.useState)(null);
|
|
15027
|
+
const [loading, setLoading] = (0, import_react20.useState)(false);
|
|
15028
|
+
const [error2, setError] = (0, import_react20.useState)(null);
|
|
15029
|
+
const abortRef = (0, import_react20.useRef)({ aborted: false });
|
|
15030
|
+
(0, import_react20.useEffect)(() => {
|
|
14848
15031
|
abortRef.current.aborted = false;
|
|
14849
15032
|
if (!source) {
|
|
14850
15033
|
setInfo(null);
|
|
@@ -15032,179 +15215,6 @@ function useFileInfo(source, options2) {
|
|
|
15032
15215
|
} };
|
|
15033
15216
|
}
|
|
15034
15217
|
|
|
15035
|
-
// src/widgets/advanced/search/tag-search/index.tsx
|
|
15036
|
-
var import_react20 = require("react");
|
|
15037
|
-
var import_jsx_runtime63 = require("react/jsx-runtime");
|
|
15038
|
-
var TagSearch = ({
|
|
15039
|
-
removeSearchItems,
|
|
15040
|
-
selectedTags,
|
|
15041
|
-
filterBy,
|
|
15042
|
-
setFilterBy,
|
|
15043
|
-
setGroupBy
|
|
15044
|
-
}) => {
|
|
15045
|
-
return selectedTags?.length > 0 && selectedTags?.map((tag, index4) => {
|
|
15046
|
-
if (tag?.values?.length > 0) {
|
|
15047
|
-
if (tag?.type !== "group_by") {
|
|
15048
|
-
return /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(
|
|
15049
|
-
"div",
|
|
15050
|
-
{
|
|
15051
|
-
className: "flex min-h-full overflow-hidden rounded bg-[#E9ECEF] hover:shadow-xl",
|
|
15052
|
-
children: [
|
|
15053
|
-
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("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__ */ (0, import_jsx_runtime63.jsx)(FilterIcon, {}) }),
|
|
15054
|
-
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "pl-2 align-middle text-[#495057] text-[14px]", children: tag.values.map((value, idx) => {
|
|
15055
|
-
return /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(import_react20.Fragment, { children: [
|
|
15056
|
-
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("span", { children: value }),
|
|
15057
|
-
idx < tag.values.length - 1 && /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("span", { className: "text-sm italic text-[#495057] text-opacity-50", children: [
|
|
15058
|
-
" ",
|
|
15059
|
-
instance.t("or"),
|
|
15060
|
-
" "
|
|
15061
|
-
] })
|
|
15062
|
-
] }, idx);
|
|
15063
|
-
}) }),
|
|
15064
|
-
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
15065
|
-
"button",
|
|
15066
|
-
{
|
|
15067
|
-
className: "px-2 text-sm font-bold",
|
|
15068
|
-
onClick: () => {
|
|
15069
|
-
typeof removeSearchItems === "function" && removeSearchItems(
|
|
15070
|
-
tag?.type === SearchType.FILTER ? `${SearchType.FILTER}_${tag?.name}` : tag?.name
|
|
15071
|
-
);
|
|
15072
|
-
if (tag?.type === SearchType.FILTER) {
|
|
15073
|
-
setFilterBy(
|
|
15074
|
-
filterBy?.map((item) => ({
|
|
15075
|
-
...item,
|
|
15076
|
-
active: false
|
|
15077
|
-
}))
|
|
15078
|
-
);
|
|
15079
|
-
}
|
|
15080
|
-
},
|
|
15081
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(CloseIcon, { className: "size-4 cursor-pointer" })
|
|
15082
|
-
}
|
|
15083
|
-
)
|
|
15084
|
-
]
|
|
15085
|
-
},
|
|
15086
|
-
"selected-tag-" + index4
|
|
15087
|
-
);
|
|
15088
|
-
} else if (tag?.type === "group_by") {
|
|
15089
|
-
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
15090
|
-
"div",
|
|
15091
|
-
{
|
|
15092
|
-
className: "flex min-h-full overflow-hidden",
|
|
15093
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "flex flex-wrap items-center gap-2 align-middle text-[#495057] text-[14px]", children: tag?.values?.length > 0 && tag?.values.map(
|
|
15094
|
-
(value, indexValue) => value?.strings?.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(
|
|
15095
|
-
"div",
|
|
15096
|
-
{
|
|
15097
|
-
className: "flex gap-2 overflow-hidden rounded bg-[#E9ECEF] hover:shadow-xl",
|
|
15098
|
-
children: [
|
|
15099
|
-
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "bg-primary flex items-center justify-center px-2 text-sm font-semibold leading-[1.5] text-white", children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(GroupByIcon, {}) }),
|
|
15100
|
-
value?.strings?.map((string, idx) => /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(import_jsx_runtime63.Fragment, { children: [
|
|
15101
|
-
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("span", { children: string }),
|
|
15102
|
-
idx < value?.strings.length - 1 && /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("span", { className: "text-sm italic text-[#495057] text-opacity-50", children: [
|
|
15103
|
-
" ",
|
|
15104
|
-
"> ",
|
|
15105
|
-
" "
|
|
15106
|
-
] })
|
|
15107
|
-
] })),
|
|
15108
|
-
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
15109
|
-
"button",
|
|
15110
|
-
{
|
|
15111
|
-
className: "pr-2 text-sm font-bold",
|
|
15112
|
-
onClick: () => {
|
|
15113
|
-
if (tag?.type === SearchType.GROUP) {
|
|
15114
|
-
typeof removeSearchItems === "function" && removeSearchItems(`${SearchType.GROUP}`);
|
|
15115
|
-
setGroupBy(
|
|
15116
|
-
(prev2) => prev2?.map((item) => ({
|
|
15117
|
-
...item,
|
|
15118
|
-
active: false
|
|
15119
|
-
}))
|
|
15120
|
-
);
|
|
15121
|
-
}
|
|
15122
|
-
},
|
|
15123
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(CloseIcon, { className: "size-4 cursor-pointer" })
|
|
15124
|
-
}
|
|
15125
|
-
)
|
|
15126
|
-
]
|
|
15127
|
-
},
|
|
15128
|
-
`group-by-${index4}-${indexValue}`
|
|
15129
|
-
)
|
|
15130
|
-
) })
|
|
15131
|
-
},
|
|
15132
|
-
"selected-tag-" + index4
|
|
15133
|
-
);
|
|
15134
|
-
}
|
|
15135
|
-
}
|
|
15136
|
-
});
|
|
15137
|
-
};
|
|
15138
|
-
|
|
15139
|
-
// src/widgets/advanced/search/search-list/index.tsx
|
|
15140
|
-
var import_jsx_runtime64 = require("react/jsx-runtime");
|
|
15141
|
-
var SearchList = ({
|
|
15142
|
-
handleAddTagSearch,
|
|
15143
|
-
handleMouseEnter,
|
|
15144
|
-
handleMouseLeave,
|
|
15145
|
-
searchBy,
|
|
15146
|
-
searchString,
|
|
15147
|
-
hoveredIndexSearchList
|
|
15148
|
-
}) => {
|
|
15149
|
-
const { t: t3 } = useI18n();
|
|
15150
|
-
return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
15151
|
-
"div",
|
|
15152
|
-
{
|
|
15153
|
-
style: {
|
|
15154
|
-
top: "calc(100% + 3px)"
|
|
15155
|
-
},
|
|
15156
|
-
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`,
|
|
15157
|
-
children: searchBy?.map((searchItem, index4) => {
|
|
15158
|
-
if (searchItem?.type === "date" || searchItem?.type === "datetime") {
|
|
15159
|
-
if (!validateAndParseDate(searchString, searchItem?.type === "datetime"))
|
|
15160
|
-
return;
|
|
15161
|
-
}
|
|
15162
|
-
return /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(
|
|
15163
|
-
"button",
|
|
15164
|
-
{
|
|
15165
|
-
onClick: () => {
|
|
15166
|
-
typeof handleAddTagSearch === "function" && handleAddTagSearch({
|
|
15167
|
-
title: searchItem?.title,
|
|
15168
|
-
name: searchItem?.name,
|
|
15169
|
-
value: searchString,
|
|
15170
|
-
domain: searchItem?.filter_domain,
|
|
15171
|
-
operator: searchItem?.operator,
|
|
15172
|
-
type: SearchType.SEARCH,
|
|
15173
|
-
modelType: searchItem?.type,
|
|
15174
|
-
widget: searchItem?.widget,
|
|
15175
|
-
dataIndex: searchItem?.dataIndex
|
|
15176
|
-
});
|
|
15177
|
-
},
|
|
15178
|
-
onMouseEnter: () => typeof handleMouseEnter === "function" && handleMouseEnter(index4),
|
|
15179
|
-
onMouseLeave: () => typeof handleMouseLeave === "function" && handleMouseLeave(),
|
|
15180
|
-
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"}`,
|
|
15181
|
-
children: [
|
|
15182
|
-
t3("search"),
|
|
15183
|
-
" ",
|
|
15184
|
-
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)("span", { className: "font-bold", children: searchItem?.title }),
|
|
15185
|
-
" ",
|
|
15186
|
-
t3("for"),
|
|
15187
|
-
":",
|
|
15188
|
-
" ",
|
|
15189
|
-
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
15190
|
-
"span",
|
|
15191
|
-
{
|
|
15192
|
-
style: {
|
|
15193
|
-
color: "var(--color-primary)"
|
|
15194
|
-
},
|
|
15195
|
-
className: "custom-input-result text-primary font-bold italic",
|
|
15196
|
-
children: searchString
|
|
15197
|
-
}
|
|
15198
|
-
)
|
|
15199
|
-
]
|
|
15200
|
-
},
|
|
15201
|
-
"header-" + index4 + 1
|
|
15202
|
-
);
|
|
15203
|
-
})
|
|
15204
|
-
}
|
|
15205
|
-
);
|
|
15206
|
-
};
|
|
15207
|
-
|
|
15208
15218
|
// src/widgets/advanced/search/search-item/index.tsx
|
|
15209
15219
|
var import_jsx_runtime65 = require("react/jsx-runtime");
|
|
15210
15220
|
var Search = ({
|
|
@@ -15229,7 +15239,11 @@ var Search = ({
|
|
|
15229
15239
|
selectedRowKeys,
|
|
15230
15240
|
domainSearch,
|
|
15231
15241
|
evalJSONContext,
|
|
15232
|
-
clearSearch
|
|
15242
|
+
clearSearch,
|
|
15243
|
+
onKeyDown,
|
|
15244
|
+
handleMouseEnter,
|
|
15245
|
+
handleMouseLeave,
|
|
15246
|
+
hoveredIndexSearchList
|
|
15233
15247
|
}) => {
|
|
15234
15248
|
const { t: t3 } = useI18n();
|
|
15235
15249
|
const [showPopupFilter, setShowPopupFilter] = (0, import_react21.useState)(false);
|
|
@@ -15327,60 +15341,68 @@ var Search = ({
|
|
|
15327
15341
|
"div",
|
|
15328
15342
|
{
|
|
15329
15343
|
ref: popupFilterRef,
|
|
15330
|
-
className: `search
|
|
15344
|
+
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]`,
|
|
15331
15345
|
children: [
|
|
15332
|
-
/* @__PURE__ */ (0, import_jsx_runtime65.
|
|
15333
|
-
|
|
15334
|
-
|
|
15335
|
-
|
|
15336
|
-
|
|
15337
|
-
|
|
15338
|
-
|
|
15339
|
-
|
|
15340
|
-
|
|
15341
|
-
|
|
15342
|
-
|
|
15343
|
-
|
|
15344
|
-
|
|
15345
|
-
|
|
15346
|
-
|
|
15347
|
-
|
|
15348
|
-
|
|
15349
|
-
|
|
15350
|
-
|
|
15351
|
-
|
|
15352
|
-
|
|
15353
|
-
|
|
15354
|
-
|
|
15355
|
-
|
|
15356
|
-
|
|
15346
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(
|
|
15347
|
+
"div",
|
|
15348
|
+
{
|
|
15349
|
+
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)]"}`,
|
|
15350
|
+
children: [
|
|
15351
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)("div", { className: "min-h-5 min-w-5", children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(SearchIcon, {}) }),
|
|
15352
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("div", { className: "flex flex-1 flex-wrap items-center gap-[8px]", children: [
|
|
15353
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
15354
|
+
TagSearch,
|
|
15355
|
+
{
|
|
15356
|
+
removeSearchItems,
|
|
15357
|
+
selectedTags,
|
|
15358
|
+
filterBy,
|
|
15359
|
+
setFilterBy
|
|
15360
|
+
}
|
|
15361
|
+
),
|
|
15362
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
15363
|
+
"input",
|
|
15364
|
+
{
|
|
15365
|
+
value: searchString,
|
|
15366
|
+
className: "min-h-[25px] w-fit flex-1 border-none bg-transparent outline-none min-w-[50px] text-sm",
|
|
15367
|
+
placeholder: t3("search..."),
|
|
15368
|
+
onChange: (e3) => {
|
|
15369
|
+
onSearchString(e3.target.value);
|
|
15370
|
+
setShowPopupFilter(false);
|
|
15371
|
+
},
|
|
15372
|
+
onKeyDown,
|
|
15373
|
+
onKeyUp: (e3) => e3.preventDefault()
|
|
15374
|
+
}
|
|
15375
|
+
),
|
|
15376
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
15377
|
+
SearchList,
|
|
15378
|
+
{
|
|
15379
|
+
handleAddTagSearch,
|
|
15380
|
+
searchBy,
|
|
15381
|
+
searchString,
|
|
15382
|
+
handleMouseEnter,
|
|
15383
|
+
handleMouseLeave,
|
|
15384
|
+
hoveredIndexSearchList
|
|
15385
|
+
}
|
|
15386
|
+
)
|
|
15387
|
+
] })
|
|
15388
|
+
]
|
|
15389
|
+
}
|
|
15390
|
+
),
|
|
15391
|
+
(showFiltersGroups || filterBy?.length > 0 || groupBy?.length > 0) && /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(import_jsx_runtime65.Fragment, { children: [
|
|
15357
15392
|
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
15358
|
-
SearchList,
|
|
15359
|
-
{
|
|
15360
|
-
handleAddTagSearch,
|
|
15361
|
-
searchBy,
|
|
15362
|
-
searchString
|
|
15363
|
-
}
|
|
15364
|
-
)
|
|
15365
|
-
] }),
|
|
15366
|
-
showFiltersGroups && /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(import_jsx_runtime65.Fragment, { children: [
|
|
15367
|
-
/* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(
|
|
15368
15393
|
"div",
|
|
15369
15394
|
{
|
|
15370
|
-
className: `flex h-full
|
|
15395
|
+
className: `flex h-full cursor-pointer items-center justify-center px-[10px] max-w-fit`,
|
|
15371
15396
|
onClick: (e3) => {
|
|
15372
15397
|
e3.stopPropagation();
|
|
15373
15398
|
setShowPopupFilter((prev2) => !prev2);
|
|
15374
15399
|
},
|
|
15375
|
-
children:
|
|
15376
|
-
|
|
15377
|
-
|
|
15378
|
-
|
|
15379
|
-
|
|
15380
|
-
|
|
15381
|
-
}
|
|
15382
|
-
)
|
|
15383
|
-
]
|
|
15400
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("button", { className: "w-max cursor-pointer", children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
15401
|
+
ChevronBottomIcon,
|
|
15402
|
+
{
|
|
15403
|
+
className: `h-5 w-5 min-w-fit transition-all ${showPopupFilter ? "rotate-180 " : ""}`
|
|
15404
|
+
}
|
|
15405
|
+
) })
|
|
15384
15406
|
}
|
|
15385
15407
|
),
|
|
15386
15408
|
showPopupFilter && /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|