cecomponent 1.0.135 → 1.0.136

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.
@@ -43859,22 +43859,24 @@ const CEAdvancedMultiSelectDropdown = ({
43859
43859
  id: o
43860
43860
  }) => {
43861
43861
  const [l, c] = useState(!1), [f, u] = useState(!1), [x, d] = useState(""), y = useRef(null), m = useRef(null), p = t.filter(
43862
- (_) => _.label.toLowerCase().includes(x.toLowerCase())
43863
- ), E = (_) => {
43862
+ (T) => T.label.toLowerCase().includes(x.toLowerCase())
43863
+ ), E = (T) => {
43864
43864
  if (s) {
43865
- const T = i.includes(_.value);
43865
+ const b = i.includes(T.value);
43866
43866
  n(
43867
- T ? i.filter((b) => b !== _.value) : [...i, _.value]
43867
+ b ? i.filter((C) => C !== T.value) : [...i, T.value]
43868
43868
  ), d("");
43869
43869
  } else
43870
- n([_.value]), d(_.label), c(!1);
43871
- }, g = (_) => {
43872
- m.current && !m.current.contains(_.target) && (c(!1), u(!1));
43870
+ n([T.value]), d(T.label), c(!1);
43871
+ }, g = (T) => {
43872
+ m.current && !m.current.contains(T.target) && (c(!1), u(!1));
43873
43873
  };
43874
43874
  useEffect(() => (document.addEventListener("mousedown", g), () => document.removeEventListener("mousedown", g)), []);
43875
- const S = (_) => {
43876
- var T;
43877
- return ((T = t.find((b) => b.value === _)) == null ? void 0 : T.label) || _;
43875
+ const S = (T) => {
43876
+ var b;
43877
+ return ((b = t.find((C) => C.value === T)) == null ? void 0 : b.label) || T;
43878
+ }, _ = (T) => {
43879
+ T.stopPropagation(), d(""), n([]);
43878
43880
  };
43879
43881
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(
43880
43882
  "div",
@@ -43892,18 +43894,18 @@ const CEAdvancedMultiSelectDropdown = ({
43892
43894
  children: [
43893
43895
  /* @__PURE__ */ jsxRuntimeExports.jsx("label", { className: "autocomplete-label", children: e }),
43894
43896
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "input-area", children: [
43895
- s && i.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "selected-values", children: i.map((_) => /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "selected-tag", children: [
43896
- S(_),
43897
+ s && i.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "selected-values", children: i.map((T) => /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "selected-tag", children: [
43898
+ S(T),
43897
43899
  /* @__PURE__ */ jsxRuntimeExports.jsx(
43898
43900
  "button",
43899
43901
  {
43900
- onClick: (T) => {
43901
- T.stopPropagation(), n(i.filter((b) => b !== _));
43902
+ onClick: (b) => {
43903
+ b.stopPropagation(), n(i.filter((C) => C !== T));
43902
43904
  },
43903
43905
  children: "×"
43904
43906
  }
43905
43907
  )
43906
- ] }, _)) }),
43908
+ ] }, T)) }),
43907
43909
  /* @__PURE__ */ jsxRuntimeExports.jsx(
43908
43910
  "input",
43909
43911
  {
@@ -43911,17 +43913,20 @@ const CEAdvancedMultiSelectDropdown = ({
43911
43913
  type: "text",
43912
43914
  className: "autocomplete-input",
43913
43915
  value: x,
43914
- onChange: (_) => d(_.target.value),
43916
+ onChange: (T) => d(T.target.value),
43915
43917
  onFocus: () => {
43916
43918
  u(!0), c(!0);
43917
43919
  }
43918
43920
  }
43919
43921
  ),
43922
+ i.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "clear-icon", onClick: _, title: "Clear", children: "×" }),
43920
43923
  /* @__PURE__ */ jsxRuntimeExports.jsx(
43921
43924
  "span",
43922
43925
  {
43923
43926
  className: "dropdown-toggle-icon",
43924
- onClick: () => c((_) => !_),
43927
+ onClick: (T) => {
43928
+ T.stopPropagation(), c((b) => !b);
43929
+ },
43925
43930
  children: /* @__PURE__ */ jsxRuntimeExports.jsx("svg", { width: "16", height: "16", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsxRuntimeExports.jsx("path", { d: "M7 10l5 5 5-5H7z", fill: "gray" }) })
43926
43931
  }
43927
43932
  )
@@ -43937,25 +43942,25 @@ const CEAdvancedMultiSelectDropdown = ({
43937
43942
  type: "checkbox",
43938
43943
  checked: i.length === t.length,
43939
43944
  onChange: () => {
43940
- const _ = i.length === t.length;
43941
- n(_ ? [] : t.map((T) => T.value));
43945
+ const T = i.length === t.length;
43946
+ n(T ? [] : t.map((b) => b.value));
43942
43947
  }
43943
43948
  }
43944
43949
  ),
43945
43950
  "Select All"
43946
43951
  ] }) }),
43947
- p.map((_) => /* @__PURE__ */ jsxRuntimeExports.jsx("li", { onClick: () => E(_), children: s && a ? /* @__PURE__ */ jsxRuntimeExports.jsxs("label", { children: [
43952
+ p.map((T) => /* @__PURE__ */ jsxRuntimeExports.jsx("li", { onClick: () => E(T), children: s && a ? /* @__PURE__ */ jsxRuntimeExports.jsxs("label", { children: [
43948
43953
  /* @__PURE__ */ jsxRuntimeExports.jsx(
43949
43954
  "input",
43950
43955
  {
43951
43956
  type: "checkbox",
43952
- checked: i.includes(_.value),
43953
- onChange: () => E(_),
43954
- onClick: (T) => T.stopPropagation()
43957
+ checked: i.includes(T.value),
43958
+ onChange: () => E(T),
43959
+ onClick: (b) => b.stopPropagation()
43955
43960
  }
43956
43961
  ),
43957
- _.label
43958
- ] }) : _.label }, _.value))
43962
+ T.label
43963
+ ] }) : T.label }, T.value))
43959
43964
  ] })
43960
43965
  ]
43961
43966
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "cecomponent",
3
3
  "description": "A React component library for building modern UIs for Cleanearth",
4
- "version": "1.0.135",
4
+ "version": "1.0.136",
5
5
  "main": "dist/ce-component-lib.js",
6
6
  "module": "dist/ce-component-lib.mjs",
7
7
  "types": "dist/index.d.ts",