@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 CHANGED
@@ -1,10 +1,10 @@
1
1
  @charset "UTF-8";
2
+ @import "https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap";
2
3
 
3
4
  /* src/index.css */
4
5
  @tailwind base;
5
6
  @tailwind components;
6
7
  @tailwind utilities;
7
- @import url(https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap);
8
8
  * {
9
9
  font-family: "Inter", sans-serif;
10
10
  }
package/dist/index.js CHANGED
@@ -15783,36 +15783,121 @@ var PopupFilter = ({
15783
15783
  // src/widgets/advanced/search/search-item/index.tsx
15784
15784
  var import_react21 = require("react");
15785
15785
 
15786
+ // src/widgets/advanced/search/search-list/index.tsx
15787
+ var import_jsx_runtime63 = require("react/jsx-runtime");
15788
+ var SearchList = ({
15789
+ handleAddTagSearch,
15790
+ handleMouseEnter,
15791
+ handleMouseLeave,
15792
+ searchBy,
15793
+ searchString,
15794
+ hoveredIndexSearchList
15795
+ }) => {
15796
+ const { t: t3 } = useI18n();
15797
+ return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
15798
+ "div",
15799
+ {
15800
+ style: {
15801
+ position: "absolute",
15802
+ top: "calc(100% + 5px)",
15803
+ left: 0,
15804
+ right: 0,
15805
+ zIndex: 31
15806
+ },
15807
+ className: `${searchString === "" ? "hidden" : "block"} w-full overflow-x-auto rounded-[0.25rem] border-none bg-white shadow-lg`,
15808
+ children: searchBy?.map((searchItem, index4) => {
15809
+ if (searchItem?.type === "date" || searchItem?.type === "datetime") {
15810
+ if (!validateAndParseDate(searchString, searchItem?.type === "datetime"))
15811
+ return;
15812
+ }
15813
+ return /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(
15814
+ "button",
15815
+ {
15816
+ onClick: () => {
15817
+ typeof handleAddTagSearch === "function" && handleAddTagSearch({
15818
+ title: searchItem?.title,
15819
+ name: searchItem?.name,
15820
+ value: searchString,
15821
+ domain: searchItem?.filter_domain,
15822
+ operator: searchItem?.operator,
15823
+ type: SearchType.SEARCH,
15824
+ modelType: searchItem?.type,
15825
+ widget: searchItem?.widget,
15826
+ dataIndex: searchItem?.dataIndex
15827
+ });
15828
+ },
15829
+ onMouseEnter: () => typeof handleMouseEnter === "function" && handleMouseEnter(index4),
15830
+ onMouseLeave: () => typeof handleMouseLeave === "function" && handleMouseLeave(),
15831
+ style: {
15832
+ display: "block",
15833
+ width: "100%",
15834
+ cursor: "pointer",
15835
+ whiteSpace: "nowrap",
15836
+ padding: "2px 12px",
15837
+ paddingTop: "4px",
15838
+ paddingBottom: "4px",
15839
+ textAlign: "left",
15840
+ transitionDuration: "0ms",
15841
+ backgroundColor: hoveredIndexSearchList === index4 ? "rgba(0,0,0,0.08)" : "white",
15842
+ fontSize: "14px"
15843
+ },
15844
+ children: [
15845
+ t3("search"),
15846
+ " ",
15847
+ /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("span", { className: "font-bold", children: searchItem?.title }),
15848
+ " ",
15849
+ t3("for"),
15850
+ ":",
15851
+ " ",
15852
+ /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("span", { className: "custom-input-result text-primary font-bold italic", children: searchString })
15853
+ ]
15854
+ },
15855
+ "header-" + index4 + 1
15856
+ );
15857
+ })
15858
+ }
15859
+ );
15860
+ };
15861
+
15786
15862
  // src/widgets/advanced/search/tag-search/index.tsx
15787
15863
  var import_react20 = require("react");
15788
- var import_jsx_runtime63 = require("react/jsx-runtime");
15864
+ var import_jsx_runtime64 = require("react/jsx-runtime");
15789
15865
  var TagSearch = ({
15790
15866
  removeSearchItems,
15791
15867
  selectedTags,
15792
15868
  filterBy,
15793
- setFilterBy,
15794
- setGroupBy
15869
+ setFilterBy
15795
15870
  }) => {
15871
+ const { t: t3 } = useI18n();
15796
15872
  return selectedTags?.length > 0 && selectedTags?.map((tag, index4) => {
15797
15873
  if (tag?.values?.length > 0) {
15798
15874
  if (tag?.type !== "group_by") {
15799
- return /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(
15875
+ return /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(
15800
15876
  "div",
15801
15877
  {
15802
15878
  className: "flex min-h-full overflow-hidden rounded bg-[#E9ECEF] hover:shadow-xl",
15803
15879
  children: [
15804
- /* @__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, {}) }),
15805
- /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "pl-2 align-middle text-[#495057] text-[14px]", children: tag.values.map((value, idx) => {
15806
- return /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(import_react20.Fragment, { children: [
15807
- /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("span", { children: value }),
15808
- idx < tag.values.length - 1 && /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("span", { className: "text-sm italic text-[#495057] text-opacity-50", children: [
15809
- " ",
15810
- instance.t("or"),
15811
- " "
15812
- ] })
15813
- ] }, idx);
15814
- }) }),
15815
- /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
15880
+ /* @__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, {}) }),
15881
+ /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
15882
+ "div",
15883
+ {
15884
+ style: {
15885
+ paddingLeft: "8px"
15886
+ },
15887
+ className: "align-middle text-[#495057] text-[14px]",
15888
+ children: tag.values.map((value, idx) => {
15889
+ return /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(import_react20.Fragment, { children: [
15890
+ /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("span", { children: value }),
15891
+ idx < tag.values.length - 1 && /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)("span", { className: "text-sm italic text-[#495057] text-opacity-50", children: [
15892
+ " ",
15893
+ t3("or"),
15894
+ " "
15895
+ ] })
15896
+ ] }, idx);
15897
+ })
15898
+ }
15899
+ ),
15900
+ /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
15816
15901
  "button",
15817
15902
  {
15818
15903
  className: "px-2 text-sm font-bold",
@@ -15829,7 +15914,7 @@ var TagSearch = ({
15829
15914
  );
15830
15915
  }
15831
15916
  },
15832
- children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(CloseIcon, { className: "size-4 cursor-pointer" })
15917
+ children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(CloseIcon, { className: "size-4 cursor-pointer" })
15833
15918
  }
15834
15919
  )
15835
15920
  ]
@@ -15837,41 +15922,35 @@ var TagSearch = ({
15837
15922
  "selected-tag-" + index4
15838
15923
  );
15839
15924
  } else if (tag?.type === "group_by") {
15840
- return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
15925
+ return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
15841
15926
  "div",
15842
15927
  {
15843
15928
  className: "flex min-h-full overflow-hidden",
15844
- 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(
15845
- (value, indexValue) => value?.strings?.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(
15929
+ 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(
15930
+ (value, indexValue) => value?.strings?.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(
15846
15931
  "div",
15847
15932
  {
15848
15933
  className: "flex gap-2 overflow-hidden rounded bg-[#E9ECEF] hover:shadow-xl",
15849
15934
  children: [
15850
- /* @__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, {}) }),
15851
- value?.strings?.map((string, idx) => /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(import_jsx_runtime63.Fragment, { children: [
15852
- /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("span", { children: string }),
15853
- idx < value?.strings.length - 1 && /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("span", { className: "text-sm italic text-[#495057] text-opacity-50", children: [
15935
+ /* @__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, {}) }),
15936
+ value?.strings?.map((string, idx) => /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(import_jsx_runtime64.Fragment, { children: [
15937
+ /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("span", { children: string }),
15938
+ idx < value?.strings.length - 1 && /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)("span", { className: "text-sm italic text-[#495057] text-opacity-50", children: [
15854
15939
  " ",
15855
15940
  "> ",
15856
15941
  " "
15857
15942
  ] })
15858
15943
  ] })),
15859
- /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
15944
+ /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
15860
15945
  "button",
15861
15946
  {
15862
15947
  className: "pr-2 text-sm font-bold",
15863
15948
  onClick: () => {
15864
15949
  if (tag?.type === SearchType.GROUP) {
15865
15950
  typeof removeSearchItems === "function" && removeSearchItems(`${SearchType.GROUP}`);
15866
- setGroupBy(
15867
- (prev2) => prev2?.map((item) => ({
15868
- ...item,
15869
- active: false
15870
- }))
15871
- );
15872
15951
  }
15873
15952
  },
15874
- children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(CloseIcon, { className: "size-4 cursor-pointer" })
15953
+ children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(CloseIcon, { className: "size-4 cursor-pointer" })
15875
15954
  }
15876
15955
  )
15877
15956
  ]
@@ -15887,75 +15966,6 @@ var TagSearch = ({
15887
15966
  });
15888
15967
  };
15889
15968
 
15890
- // src/widgets/advanced/search/search-list/index.tsx
15891
- var import_jsx_runtime64 = require("react/jsx-runtime");
15892
- var SearchList = ({
15893
- handleAddTagSearch,
15894
- handleMouseEnter,
15895
- handleMouseLeave,
15896
- searchBy,
15897
- searchString,
15898
- hoveredIndexSearchList
15899
- }) => {
15900
- const { t: t3 } = useI18n();
15901
- return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
15902
- "div",
15903
- {
15904
- style: {
15905
- top: "calc(100% + 3px)"
15906
- },
15907
- 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`,
15908
- children: searchBy?.map((searchItem, index4) => {
15909
- if (searchItem?.type === "date" || searchItem?.type === "datetime") {
15910
- if (!validateAndParseDate(searchString, searchItem?.type === "datetime"))
15911
- return;
15912
- }
15913
- return /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(
15914
- "button",
15915
- {
15916
- onClick: () => {
15917
- typeof handleAddTagSearch === "function" && handleAddTagSearch({
15918
- title: searchItem?.title,
15919
- name: searchItem?.name,
15920
- value: searchString,
15921
- domain: searchItem?.filter_domain,
15922
- operator: searchItem?.operator,
15923
- type: SearchType.SEARCH,
15924
- modelType: searchItem?.type,
15925
- widget: searchItem?.widget,
15926
- dataIndex: searchItem?.dataIndex
15927
- });
15928
- },
15929
- onMouseEnter: () => typeof handleMouseEnter === "function" && handleMouseEnter(index4),
15930
- onMouseLeave: () => typeof handleMouseLeave === "function" && handleMouseLeave(),
15931
- 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"}`,
15932
- children: [
15933
- t3("search"),
15934
- " ",
15935
- /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("span", { className: "font-bold", children: searchItem?.title }),
15936
- " ",
15937
- t3("for"),
15938
- ":",
15939
- " ",
15940
- /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
15941
- "span",
15942
- {
15943
- style: {
15944
- color: "var(--color-primary)"
15945
- },
15946
- className: "custom-input-result text-primary font-bold italic",
15947
- children: searchString
15948
- }
15949
- )
15950
- ]
15951
- },
15952
- "header-" + index4 + 1
15953
- );
15954
- })
15955
- }
15956
- );
15957
- };
15958
-
15959
15969
  // src/widgets/advanced/search/search-item/index.tsx
15960
15970
  var import_jsx_runtime65 = require("react/jsx-runtime");
15961
15971
  var Search = ({
@@ -15980,7 +15990,11 @@ var Search = ({
15980
15990
  selectedRowKeys,
15981
15991
  domainSearch,
15982
15992
  evalJSONContext,
15983
- clearSearch
15993
+ clearSearch,
15994
+ onKeyDown,
15995
+ handleMouseEnter,
15996
+ handleMouseLeave,
15997
+ hoveredIndexSearchList
15984
15998
  }) => {
15985
15999
  const { t: t3 } = useI18n();
15986
16000
  const [showPopupFilter, setShowPopupFilter] = (0, import_react21.useState)(false);
@@ -16078,60 +16092,68 @@ var Search = ({
16078
16092
  "div",
16079
16093
  {
16080
16094
  ref: popupFilterRef,
16081
- className: `search gap-[8px] p-2 items-center flex !order-3 xl:!order-2 bg-white custom-search-input relative flex-1 xl:min-w-[480px] xl:flex-1 rounded-[10px] shadow-[0px_1px_3px_rgba(16,24,40,0.1),0px_1px_2px_rgba(16,24,40,0.06)] min-h-[40px] border border-[var(--stroke-default)]`,
16095
+ 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]`,
16082
16096
  children: [
16083
- /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("div", { className: "size-5", children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(SearchIcon, {}) }),
16084
- /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("div", { className: "flex flex-1 flex-wrap items-center gap-[8px]", children: [
16085
- /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
16086
- TagSearch,
16087
- {
16088
- removeSearchItems,
16089
- selectedTags,
16090
- filterBy,
16091
- setFilterBy,
16092
- setGroupBy
16093
- }
16094
- ),
16095
- /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
16096
- "input",
16097
- {
16098
- value: searchString,
16099
- className: "h-5 w-fit flex-1 border-none bg-transparent outline-none min-w-[50px] text-sm",
16100
- placeholder: t3("search..."),
16101
- onChange: (e3) => {
16102
- onSearchString(e3.target.value);
16103
- setShowPopupFilter(false);
16104
- },
16105
- onKeyUp: (e3) => e3.preventDefault()
16106
- }
16107
- ),
16097
+ /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(
16098
+ "div",
16099
+ {
16100
+ 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)]"}`,
16101
+ children: [
16102
+ /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("div", { className: "min-h-5 min-w-5", children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(SearchIcon, {}) }),
16103
+ /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("div", { className: "flex flex-1 flex-wrap items-center gap-[8px]", children: [
16104
+ /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
16105
+ TagSearch,
16106
+ {
16107
+ removeSearchItems,
16108
+ selectedTags,
16109
+ filterBy,
16110
+ setFilterBy
16111
+ }
16112
+ ),
16113
+ /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
16114
+ "input",
16115
+ {
16116
+ value: searchString,
16117
+ className: "min-h-[25px] w-fit flex-1 border-none bg-transparent outline-none min-w-[50px] text-sm",
16118
+ placeholder: t3("search..."),
16119
+ onChange: (e3) => {
16120
+ onSearchString(e3.target.value);
16121
+ setShowPopupFilter(false);
16122
+ },
16123
+ onKeyDown,
16124
+ onKeyUp: (e3) => e3.preventDefault()
16125
+ }
16126
+ ),
16127
+ /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
16128
+ SearchList,
16129
+ {
16130
+ handleAddTagSearch,
16131
+ searchBy,
16132
+ searchString,
16133
+ handleMouseEnter,
16134
+ handleMouseLeave,
16135
+ hoveredIndexSearchList
16136
+ }
16137
+ )
16138
+ ] })
16139
+ ]
16140
+ }
16141
+ ),
16142
+ (showFiltersGroups || filterBy?.length > 0 || groupBy?.length > 0) && /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(import_jsx_runtime65.Fragment, { children: [
16108
16143
  /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
16109
- SearchList,
16110
- {
16111
- handleAddTagSearch,
16112
- searchBy,
16113
- searchString
16114
- }
16115
- )
16116
- ] }),
16117
- showFiltersGroups && /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(import_jsx_runtime65.Fragment, { children: [
16118
- /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(
16119
16144
  "div",
16120
16145
  {
16121
- className: `flex h-full gap-2 cursor-pointer items-center justify-center max-w-fit`,
16146
+ className: `flex h-full cursor-pointer items-center justify-center px-[10px] max-w-fit`,
16122
16147
  onClick: (e3) => {
16123
16148
  e3.stopPropagation();
16124
16149
  setShowPopupFilter((prev2) => !prev2);
16125
16150
  },
16126
- children: [
16127
- /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("div", { className: "w-[1px] h-[28px] bg-[var(--stroke-default)]" }),
16128
- /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
16129
- ChevronBottomIcon,
16130
- {
16131
- className: `h-5 w-5 min-w-fit transition-all ${showPopupFilter ? "rotate-180 " : ""}`
16132
- }
16133
- )
16134
- ]
16151
+ children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("button", { className: "w-max cursor-pointer", children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
16152
+ ChevronBottomIcon,
16153
+ {
16154
+ className: `h-5 w-5 min-w-fit transition-all ${showPopupFilter ? "rotate-180 " : ""}`
16155
+ }
16156
+ ) })
16135
16157
  }
16136
16158
  ),
16137
16159
  showPopupFilter && /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(