cecomponent 2.0.81 → 2.0.82
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.
|
@@ -44647,23 +44647,24 @@ const CESkeletonTable = ({ columns: e, rows: t }) => /* @__PURE__ */ jsxRuntimeE
|
|
|
44647
44647
|
placeholder: i = "Select status...",
|
|
44648
44648
|
size: o = "medium",
|
|
44649
44649
|
disabled: l = !1,
|
|
44650
|
-
ariaLabel: u = "Status selection dropdown"
|
|
44650
|
+
ariaLabel: u = "Status selection dropdown",
|
|
44651
|
+
fullButtonAsDropdown: f = !1
|
|
44651
44652
|
}) => {
|
|
44652
|
-
const [
|
|
44653
|
-
n(
|
|
44653
|
+
const [p, m] = useState(!1), d = useRef(null), g = e.find((T) => T.value === t), b = (T) => {
|
|
44654
|
+
n(T), m(!1);
|
|
44654
44655
|
};
|
|
44655
44656
|
useEffect(() => {
|
|
44656
|
-
const
|
|
44657
|
-
var
|
|
44658
|
-
(
|
|
44657
|
+
const T = (C) => {
|
|
44658
|
+
var R;
|
|
44659
|
+
(R = d.current) != null && R.contains(C.target) || m(!1);
|
|
44659
44660
|
};
|
|
44660
|
-
return document.addEventListener("mousedown",
|
|
44661
|
+
return document.addEventListener("mousedown", T), () => document.removeEventListener("mousedown", T);
|
|
44661
44662
|
}, []);
|
|
44662
|
-
const
|
|
44663
|
-
l || (
|
|
44664
|
-
},
|
|
44665
|
-
if (
|
|
44666
|
-
switch (
|
|
44663
|
+
const E = (T) => {
|
|
44664
|
+
l || (T.key === "Enter" || T.key === " " ? (T.preventDefault(), m(!p)) : T.key === "Escape" && m(!1));
|
|
44665
|
+
}, S = (T) => {
|
|
44666
|
+
if (T != null && T.statusType)
|
|
44667
|
+
switch (T.statusType) {
|
|
44667
44668
|
case "in-progress":
|
|
44668
44669
|
return "in-progress";
|
|
44669
44670
|
case "declined":
|
|
@@ -44674,10 +44675,10 @@ const CESkeletonTable = ({ columns: e, rows: t }) => /* @__PURE__ */ jsxRuntimeE
|
|
|
44674
44675
|
return "";
|
|
44675
44676
|
}
|
|
44676
44677
|
return "";
|
|
44677
|
-
},
|
|
44678
|
-
if (
|
|
44679
|
-
const
|
|
44680
|
-
return
|
|
44678
|
+
}, _ = () => {
|
|
44679
|
+
if (g) {
|
|
44680
|
+
const T = {};
|
|
44681
|
+
return g.backgroundColor && (T.backgroundColor = g.backgroundColor), g.textColor && (T.color = g.textColor), T;
|
|
44681
44682
|
}
|
|
44682
44683
|
return {};
|
|
44683
44684
|
};
|
|
@@ -44685,28 +44686,30 @@ const CESkeletonTable = ({ columns: e, rows: t }) => /* @__PURE__ */ jsxRuntimeE
|
|
|
44685
44686
|
"div",
|
|
44686
44687
|
{
|
|
44687
44688
|
className: `status-dropdown-container ${l ? "disabled" : ""} size-${o}`,
|
|
44688
|
-
ref:
|
|
44689
|
+
ref: d,
|
|
44689
44690
|
children: [
|
|
44690
44691
|
/* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
44691
44692
|
"div",
|
|
44692
44693
|
{
|
|
44693
|
-
className: `status-dropdown-trigger ${
|
|
44694
|
-
onClick: () =>
|
|
44695
|
-
|
|
44694
|
+
className: `status-dropdown-trigger ${p ? "open" : ""} ${g ? `has-selection ${S(g)}` : ""}`,
|
|
44695
|
+
onClick: () => {
|
|
44696
|
+
l || (f ? m(!p) : b((g == null ? void 0 : g.value) || ""));
|
|
44697
|
+
},
|
|
44698
|
+
onKeyDown: E,
|
|
44696
44699
|
tabIndex: l ? -1 : 0,
|
|
44697
44700
|
role: "button",
|
|
44698
44701
|
"aria-haspopup": "listbox",
|
|
44699
|
-
"aria-expanded":
|
|
44702
|
+
"aria-expanded": p ? "true" : "false",
|
|
44700
44703
|
"aria-label": u,
|
|
44701
|
-
style:
|
|
44704
|
+
style: _(),
|
|
44702
44705
|
children: [
|
|
44703
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "status-text", children:
|
|
44706
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "status-text", children: g ? g.label : i }),
|
|
44704
44707
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
44705
44708
|
"span",
|
|
44706
44709
|
{
|
|
44707
44710
|
className: "status-dropdown-icon",
|
|
44708
|
-
onClick: (
|
|
44709
|
-
|
|
44711
|
+
onClick: (T) => {
|
|
44712
|
+
T.stopPropagation(), !l && m(!p);
|
|
44710
44713
|
},
|
|
44711
44714
|
children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
44712
44715
|
"svg",
|
|
@@ -44716,7 +44719,7 @@ const CESkeletonTable = ({ columns: e, rows: t }) => /* @__PURE__ */ jsxRuntimeE
|
|
|
44716
44719
|
viewBox: "0 0 24 24",
|
|
44717
44720
|
fill: "none",
|
|
44718
44721
|
xmlns: "http://www.w3.org/2000/svg",
|
|
44719
|
-
className: `dropdown-arrow ${
|
|
44722
|
+
className: `dropdown-arrow ${p ? "rotate" : ""}`,
|
|
44720
44723
|
children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
44721
44724
|
"path",
|
|
44722
44725
|
{
|
|
@@ -44732,25 +44735,25 @@ const CESkeletonTable = ({ columns: e, rows: t }) => /* @__PURE__ */ jsxRuntimeE
|
|
|
44732
44735
|
]
|
|
44733
44736
|
}
|
|
44734
44737
|
),
|
|
44735
|
-
|
|
44738
|
+
p && !l && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
44736
44739
|
"ul",
|
|
44737
44740
|
{
|
|
44738
44741
|
className: "status-dropdown-options",
|
|
44739
44742
|
role: "listbox",
|
|
44740
44743
|
"aria-label": "Status options",
|
|
44741
|
-
children: e.map((
|
|
44742
|
-
const
|
|
44743
|
-
return
|
|
44744
|
+
children: e.map((T) => {
|
|
44745
|
+
const C = {};
|
|
44746
|
+
return T.backgroundColor && (C.backgroundColor = T.backgroundColor), T.textColor && (C.color = T.textColor), /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
44744
44747
|
"li",
|
|
44745
44748
|
{
|
|
44746
|
-
className: `status-dropdown-option ${t ===
|
|
44747
|
-
onClick: () =>
|
|
44749
|
+
className: `status-dropdown-option ${t === T.value ? "selected" : ""} ${S(T)}`,
|
|
44750
|
+
onClick: () => b(T.value),
|
|
44748
44751
|
role: "option",
|
|
44749
|
-
"aria-selected": t ===
|
|
44750
|
-
style:
|
|
44752
|
+
"aria-selected": t === T.value ? "true" : "false",
|
|
44753
|
+
style: C,
|
|
44751
44754
|
children: [
|
|
44752
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "option-indicator", children:
|
|
44753
|
-
|
|
44755
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "option-indicator", children: T.icon ? T.icon : /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
44756
|
+
T.statusType === "declined" && /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
44754
44757
|
"svg",
|
|
44755
44758
|
{
|
|
44756
44759
|
width: "16",
|
|
@@ -44771,7 +44774,7 @@ const CESkeletonTable = ({ columns: e, rows: t }) => /* @__PURE__ */ jsxRuntimeE
|
|
|
44771
44774
|
]
|
|
44772
44775
|
}
|
|
44773
44776
|
),
|
|
44774
|
-
|
|
44777
|
+
T.statusType === "withdrawn" && /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
44775
44778
|
"svg",
|
|
44776
44779
|
{
|
|
44777
44780
|
width: "16",
|
|
@@ -44792,7 +44795,7 @@ const CESkeletonTable = ({ columns: e, rows: t }) => /* @__PURE__ */ jsxRuntimeE
|
|
|
44792
44795
|
]
|
|
44793
44796
|
}
|
|
44794
44797
|
),
|
|
44795
|
-
|
|
44798
|
+
T.statusType === "in-progress" && /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
44796
44799
|
"svg",
|
|
44797
44800
|
{
|
|
44798
44801
|
width: "16",
|
|
@@ -44815,10 +44818,10 @@ const CESkeletonTable = ({ columns: e, rows: t }) => /* @__PURE__ */ jsxRuntimeE
|
|
|
44815
44818
|
}
|
|
44816
44819
|
)
|
|
44817
44820
|
] }) }),
|
|
44818
|
-
|
|
44821
|
+
T.label
|
|
44819
44822
|
]
|
|
44820
44823
|
},
|
|
44821
|
-
|
|
44824
|
+
T.value
|
|
44822
44825
|
);
|
|
44823
44826
|
})
|
|
44824
44827
|
}
|
package/package.json
CHANGED