cecomponent 1.0.177 → 1.0.179

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.
@@ -1903,7 +1903,10 @@ const Breadcrumbs = ({ items: e, maxVisible: t = 4, onItemClick: n }) => {
1903
1903
  "aria-describedby": L ? `${e}-error` : void 0
1904
1904
  }
1905
1905
  ),
1906
- /* @__PURE__ */ jsxRuntimeExports.jsx("label", { className: "floating-label", children: e }),
1906
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("label", { className: "floating-label", children: [
1907
+ e,
1908
+ p && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "required-asterisk", children: "*" })
1909
+ ] }),
1907
1910
  S && g.length > 0 && createPortal(
1908
1911
  /* @__PURE__ */ jsxRuntimeExports.jsx(
1909
1912
  "ul",
@@ -42648,66 +42651,71 @@ const CESkeletonTable = ({ columns: e, rows: t }) => /* @__PURE__ */ jsxRuntimeE
42648
42651
  allowClear: f = !0,
42649
42652
  showInputPills: p = !0,
42650
42653
  id: d,
42651
- name: m
42654
+ name: m,
42655
+ required: g = !1
42652
42656
  }) => {
42653
- const [g, _] = useState(!1), [S, E] = useState(!1), b = useRef(null), A = { ...getSizeStyle$1(l), ...u }, R = (j) => {
42657
+ const [_, S] = useState(!1), [E, b] = useState(!1), T = useRef(null), R = { ...getSizeStyle$1(l), ...u }, C = (M) => {
42654
42658
  if (i) {
42655
- const M = t.includes(j) ? t.filter((N) => N !== j) : [...t, j];
42656
- n(M);
42659
+ const N = t.includes(M) ? t.filter((D) => D !== M) : [...t, M];
42660
+ n(N);
42657
42661
  } else
42658
- n([j]), _(!1);
42659
- }, C = () => n([]), I = e.filter((j) => t.includes(j.value)).map((j) => j.label);
42662
+ n([M]), S(!1);
42663
+ }, I = () => n([]), O = e.filter((M) => t.includes(M.value)).map((M) => M.label);
42660
42664
  useEffect(() => {
42661
- const j = (M) => {
42662
- var N;
42663
- (N = b.current) != null && N.contains(M.target) || _(!1);
42665
+ const M = (N) => {
42666
+ var D;
42667
+ (D = T.current) != null && D.contains(N.target) || S(!1);
42664
42668
  };
42665
- return document.addEventListener("mousedown", j), () => document.removeEventListener("mousedown", j);
42669
+ return document.addEventListener("mousedown", M), () => document.removeEventListener("mousedown", M);
42666
42670
  }, []);
42667
- const O = (j) => {
42668
- const M = t.filter((N) => N !== j);
42669
- n(M);
42671
+ const j = (M) => {
42672
+ const N = t.filter((D) => D !== M);
42673
+ n(N);
42670
42674
  };
42671
42675
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
42672
42676
  "div",
42673
42677
  {
42674
- className: `dropdown-container ${g || t.length > 0 ? "float" : ""}`,
42675
- ref: b,
42676
- style: A,
42678
+ className: `dropdown-container ${_ || t.length > 0 ? "float" : ""}`,
42679
+ ref: T,
42680
+ style: R,
42677
42681
  id: d,
42678
42682
  "data-name": m,
42683
+ "aria-required": g,
42679
42684
  children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
42680
42685
  "div",
42681
42686
  {
42682
- className: `dropdown-input ${g ? "open" : ""}`,
42683
- onClick: () => _((j) => !j),
42684
- onFocus: () => E(!0),
42685
- onBlur: () => E(!1),
42687
+ className: `dropdown-input ${_ ? "open" : ""}`,
42688
+ onClick: () => S((M) => !M),
42689
+ onFocus: () => b(!0),
42690
+ onBlur: () => b(!1),
42686
42691
  tabIndex: 0,
42687
42692
  children: [
42688
- /* @__PURE__ */ jsxRuntimeExports.jsx("label", { className: "floating-placeholder", children: o }),
42689
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "selected-display", children: t.length === 0 ? "" : i ? p ? I.map((j, M) => /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "chip", children: [
42690
- j,
42693
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("label", { className: "floating-placeholder", children: [
42694
+ o,
42695
+ g && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "required-asterisk", "aria-hidden": "true", children: "*" })
42696
+ ] }),
42697
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "selected-display", children: t.length === 0 ? "" : i ? p ? O.map((M, N) => /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "chip", children: [
42698
+ M,
42691
42699
  /* @__PURE__ */ jsxRuntimeExports.jsx(
42692
42700
  "span",
42693
42701
  {
42694
42702
  className: "close-icon",
42695
- onClick: (N) => {
42696
- var D;
42697
- N.stopPropagation(), O(
42698
- ((D = e.find((F) => F.label === j)) == null ? void 0 : D.value) || ""
42703
+ onClick: (D) => {
42704
+ var F;
42705
+ D.stopPropagation(), j(
42706
+ ((F = e.find((q) => q.label === M)) == null ? void 0 : F.value) || ""
42699
42707
  );
42700
42708
  },
42701
42709
  children: "×"
42702
42710
  }
42703
42711
  )
42704
- ] }, M)) : /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "selected-display-label", children: I.join(",") }) : /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: I[0] }) }),
42712
+ ] }, N)) : /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "selected-display-label", children: O.join(",") }) : /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: O[0] }) }),
42705
42713
  f && t.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx(
42706
42714
  "button",
42707
42715
  {
42708
42716
  className: "clear-button",
42709
- onClick: (j) => {
42710
- j.stopPropagation(), C();
42717
+ onClick: (M) => {
42718
+ M.stopPropagation(), I();
42711
42719
  },
42712
42720
  children: "×"
42713
42721
  }
@@ -42720,7 +42728,7 @@ const CESkeletonTable = ({ columns: e, rows: t }) => /* @__PURE__ */ jsxRuntimeE
42720
42728
  viewBox: "0 0 24 25",
42721
42729
  fill: "none",
42722
42730
  xmlns: "http://www.w3.org/2000/svg",
42723
- className: `dropdown-icon-img ${g ? "rotate-icon" : ""}`,
42731
+ className: `dropdown-icon-img ${_ ? "rotate-icon" : ""}`,
42724
42732
  children: /* @__PURE__ */ jsxRuntimeExports.jsx(
42725
42733
  "path",
42726
42734
  {
@@ -42731,12 +42739,12 @@ const CESkeletonTable = ({ columns: e, rows: t }) => /* @__PURE__ */ jsxRuntimeE
42731
42739
  )
42732
42740
  }
42733
42741
  ) }),
42734
- g && /* @__PURE__ */ jsxRuntimeExports.jsx("ul", { className: "dropdown-options", children: e.map((j) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
42742
+ _ && /* @__PURE__ */ jsxRuntimeExports.jsx("ul", { className: "dropdown-options", children: e.map((M) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
42735
42743
  "li",
42736
42744
  {
42737
- className: `dropdown-option ${t.includes(j.value) ? "selected" : ""}`,
42738
- onClick: (M) => {
42739
- M.stopPropagation(), R(j.value);
42745
+ className: `dropdown-option ${t.includes(M.value) ? "selected" : ""}`,
42746
+ onClick: (N) => {
42747
+ N.stopPropagation(), C(M.value);
42740
42748
  },
42741
42749
  children: [
42742
42750
  i && /* @__PURE__ */ jsxRuntimeExports.jsx(
@@ -42744,13 +42752,13 @@ const CESkeletonTable = ({ columns: e, rows: t }) => /* @__PURE__ */ jsxRuntimeE
42744
42752
  {
42745
42753
  type: "checkbox",
42746
42754
  readOnly: !0,
42747
- checked: t.includes(j.value)
42755
+ checked: t.includes(M.value)
42748
42756
  }
42749
42757
  ),
42750
- j.label
42758
+ M.label
42751
42759
  ]
42752
42760
  },
42753
- j.value
42761
+ M.value
42754
42762
  )) })
42755
42763
  ]
42756
42764
  }
@@ -64080,7 +64088,11 @@ const CEBarChart = ({
64080
64088
  }) => {
64081
64089
  const [g, _] = useState(
64082
64090
  t || []
64083
- ), S = g.length > 0 ? e.filter(
64091
+ );
64092
+ useEffect(() => {
64093
+ _(t);
64094
+ }, [t]);
64095
+ const S = g.length > 0 ? e.filter(
64084
64096
  (C) => g.includes(C.facility)
64085
64097
  ) : e, E = (C) => {
64086
64098
  const { x: I, y: O, width: j, height: M, value: N } = C;
@@ -64096,6 +64108,7 @@ const CEBarChart = ({
64096
64108
  fill: "white",
64097
64109
  fontSize: 10,
64098
64110
  fontWeight: "500",
64111
+ className: "custom-bar-chart-label",
64099
64112
  children: [
64100
64113
  D,
64101
64114
  d == null ? void 0 : d.unit
@@ -64104,7 +64117,7 @@ const CEBarChart = ({
64104
64117
  );
64105
64118
  }, b = ({ active: C, payload: I, label: O }) => {
64106
64119
  if (C && I && I.length) {
64107
- const j = I.find((F) => F.dataKey === (d == null ? void 0 : d.key)), M = I.filter((F) => F.dataKey !== (d == null ? void 0 : d.key)), N = M.reduce(
64120
+ const j = I.find((F) => F.dataKey === (d == null ? void 0 : d.linekey)), M = I.filter((F) => F.dataKey !== (d == null ? void 0 : d.linekey)), N = M.reduce(
64108
64121
  (F, q) => F + q.value,
64109
64122
  0
64110
64123
  ), D = parseFloat(N.toFixed(1));
@@ -64134,11 +64147,10 @@ const CEBarChart = ({
64134
64147
  d == null ? void 0 : d.unit
64135
64148
  ] }),
64136
64149
  j && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "chart-tooltip-revenue", children: [
64137
- "Total ",
64138
- d == null ? void 0 : d.type,
64150
+ d == null ? void 0 : d.lineName,
64139
64151
  ": ",
64140
64152
  j.value,
64141
- d == null ? void 0 : d.unit
64153
+ d == null ? void 0 : d.lineUnit
64142
64154
  ] })
64143
64155
  ] });
64144
64156
  }
@@ -64232,7 +64244,7 @@ const CEBarChart = ({
64232
64244
  yAxisId: "right",
64233
64245
  type: "monotone",
64234
64246
  dataKey: (d == null ? void 0 : d.linekey) || "totalRevenue",
64235
- stroke: "#dc2626",
64247
+ stroke: (d == null ? void 0 : d.lineStrokeColor) ?? "#dc2626",
64236
64248
  strokeWidth: 3,
64237
64249
  dot: {
64238
64250
  fill: d.lineColor ?? "#dc2626",
@@ -16,6 +16,7 @@ interface InputDropDownProps {
16
16
  showInputPills?: boolean;
17
17
  id?: string;
18
18
  name?: string;
19
+ required?: boolean;
19
20
  }
20
21
  declare const InputDropDown: React.FC<InputDropDownProps>;
21
22
  export default InputDropDown;
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.177",
4
+ "version": "1.0.179",
5
5
  "main": "dist/ce-component-lib.js",
6
6
  "module": "dist/ce-component-lib.mjs",
7
7
  "types": "dist/idex.d.ts",