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.
|
|
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 [
|
|
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
|
|
42656
|
-
n(
|
|
42659
|
+
const N = t.includes(M) ? t.filter((D) => D !== M) : [...t, M];
|
|
42660
|
+
n(N);
|
|
42657
42661
|
} else
|
|
42658
|
-
n([
|
|
42659
|
-
},
|
|
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
|
|
42662
|
-
var
|
|
42663
|
-
(
|
|
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",
|
|
42669
|
+
return document.addEventListener("mousedown", M), () => document.removeEventListener("mousedown", M);
|
|
42666
42670
|
}, []);
|
|
42667
|
-
const
|
|
42668
|
-
const
|
|
42669
|
-
n(
|
|
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 ${
|
|
42675
|
-
ref:
|
|
42676
|
-
style:
|
|
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 ${
|
|
42683
|
-
onClick: () =>
|
|
42684
|
-
onFocus: () =>
|
|
42685
|
-
onBlur: () =>
|
|
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.
|
|
42689
|
-
|
|
42690
|
-
|
|
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: (
|
|
42696
|
-
var
|
|
42697
|
-
|
|
42698
|
-
((
|
|
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
|
-
] },
|
|
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: (
|
|
42710
|
-
|
|
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 ${
|
|
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
|
-
|
|
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(
|
|
42738
|
-
onClick: (
|
|
42739
|
-
|
|
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(
|
|
42755
|
+
checked: t.includes(M.value)
|
|
42748
42756
|
}
|
|
42749
42757
|
),
|
|
42750
|
-
|
|
42758
|
+
M.label
|
|
42751
42759
|
]
|
|
42752
42760
|
},
|
|
42753
|
-
|
|
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
|
-
)
|
|
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.
|
|
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
|
-
|
|
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.
|
|
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",
|
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.
|
|
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",
|