cecomponent 2.0.81 → 2.0.83
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.
|
@@ -40239,20 +40239,42 @@ const CESkeletonTable = ({ columns: e, rows: t }) => /* @__PURE__ */ jsxRuntimeE
|
|
|
40239
40239
|
}
|
|
40240
40240
|
);
|
|
40241
40241
|
}, DatePickerCell = ({ row: e, colId: t }) => {
|
|
40242
|
-
var
|
|
40243
|
-
const n = (
|
|
40244
|
-
|
|
40245
|
-
|
|
40246
|
-
(
|
|
40247
|
-
|
|
40248
|
-
|
|
40249
|
-
|
|
40250
|
-
|
|
40251
|
-
|
|
40252
|
-
|
|
40253
|
-
|
|
40242
|
+
var u;
|
|
40243
|
+
const n = (f) => {
|
|
40244
|
+
if (!f) return "";
|
|
40245
|
+
if (/^\d{4}-\d{2}-\d{2}$/.test(f)) return f;
|
|
40246
|
+
if (f.includes("/")) {
|
|
40247
|
+
const d = f.split("/").map((g) => g.trim());
|
|
40248
|
+
if (d.length >= 3) {
|
|
40249
|
+
const g = d[0].padStart(2, "0").slice(0, 2), b = d[1].padStart(2, "0").slice(0, 2), S = d[2].replace(/\D/g, "").slice(0, 4);
|
|
40250
|
+
return S.length !== 4 ? "" : `${S}-${g}-${b}`;
|
|
40251
|
+
}
|
|
40252
|
+
}
|
|
40253
|
+
const p = f.replace(/\D/g, "");
|
|
40254
|
+
if (p.length === 8) {
|
|
40255
|
+
const d = p.slice(0, 4), g = p.slice(4, 6), b = p.slice(6, 8);
|
|
40256
|
+
if (+g >= 1 && +g <= 12)
|
|
40257
|
+
return `${d}-${g}-${b}`;
|
|
40258
|
+
const E = p.slice(0, 2), S = p.slice(2, 4);
|
|
40259
|
+
return `${p.slice(4, 8)}-${E}-${S}`;
|
|
40260
|
+
}
|
|
40261
|
+
const m = new Date(f);
|
|
40262
|
+
if (!isNaN(m.getTime())) {
|
|
40263
|
+
const d = m.getFullYear().toString().slice(0, 4).padStart(4, "0"), g = (m.getMonth() + 1).toString().padStart(2, "0"), b = m.getDate().toString().padStart(2, "0");
|
|
40264
|
+
return `${d}-${g}-${b}`;
|
|
40254
40265
|
}
|
|
40255
|
-
|
|
40266
|
+
return "";
|
|
40267
|
+
}, [i, o] = useState(((u = e[t]) == null ? void 0 : u.value) || "");
|
|
40268
|
+
useEffect(() => {
|
|
40269
|
+
var f;
|
|
40270
|
+
o(n(((f = e[t]) == null ? void 0 : f.value) || ""));
|
|
40271
|
+
}, [e, t]);
|
|
40272
|
+
const l = (f) => {
|
|
40273
|
+
var m;
|
|
40274
|
+
const p = n(f.target.value);
|
|
40275
|
+
o(p), (m = e[t]) == null || m.onchange(p);
|
|
40276
|
+
};
|
|
40277
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: { minWidth: "120px" }, children: /* @__PURE__ */ jsxRuntimeExports.jsx("input", { type: "date", value: i, onChange: (f) => l(f) }) });
|
|
40256
40278
|
}, AddNewRowCell = ({
|
|
40257
40279
|
row: e,
|
|
40258
40280
|
column: t,
|
|
@@ -44647,23 +44669,24 @@ const CESkeletonTable = ({ columns: e, rows: t }) => /* @__PURE__ */ jsxRuntimeE
|
|
|
44647
44669
|
placeholder: i = "Select status...",
|
|
44648
44670
|
size: o = "medium",
|
|
44649
44671
|
disabled: l = !1,
|
|
44650
|
-
ariaLabel: u = "Status selection dropdown"
|
|
44672
|
+
ariaLabel: u = "Status selection dropdown",
|
|
44673
|
+
fullButtonAsDropdown: f = !1
|
|
44651
44674
|
}) => {
|
|
44652
|
-
const [
|
|
44653
|
-
n(
|
|
44675
|
+
const [p, m] = useState(!1), d = useRef(null), g = e.find((T) => T.value === t), b = (T) => {
|
|
44676
|
+
n(T), m(!1);
|
|
44654
44677
|
};
|
|
44655
44678
|
useEffect(() => {
|
|
44656
|
-
const
|
|
44657
|
-
var
|
|
44658
|
-
(
|
|
44679
|
+
const T = (C) => {
|
|
44680
|
+
var R;
|
|
44681
|
+
(R = d.current) != null && R.contains(C.target) || m(!1);
|
|
44659
44682
|
};
|
|
44660
|
-
return document.addEventListener("mousedown",
|
|
44683
|
+
return document.addEventListener("mousedown", T), () => document.removeEventListener("mousedown", T);
|
|
44661
44684
|
}, []);
|
|
44662
|
-
const
|
|
44663
|
-
l || (
|
|
44664
|
-
},
|
|
44665
|
-
if (
|
|
44666
|
-
switch (
|
|
44685
|
+
const E = (T) => {
|
|
44686
|
+
l || (T.key === "Enter" || T.key === " " ? (T.preventDefault(), m(!p)) : T.key === "Escape" && m(!1));
|
|
44687
|
+
}, S = (T) => {
|
|
44688
|
+
if (T != null && T.statusType)
|
|
44689
|
+
switch (T.statusType) {
|
|
44667
44690
|
case "in-progress":
|
|
44668
44691
|
return "in-progress";
|
|
44669
44692
|
case "declined":
|
|
@@ -44674,10 +44697,10 @@ const CESkeletonTable = ({ columns: e, rows: t }) => /* @__PURE__ */ jsxRuntimeE
|
|
|
44674
44697
|
return "";
|
|
44675
44698
|
}
|
|
44676
44699
|
return "";
|
|
44677
|
-
},
|
|
44678
|
-
if (
|
|
44679
|
-
const
|
|
44680
|
-
return
|
|
44700
|
+
}, _ = () => {
|
|
44701
|
+
if (g) {
|
|
44702
|
+
const T = {};
|
|
44703
|
+
return g.backgroundColor && (T.backgroundColor = g.backgroundColor), g.textColor && (T.color = g.textColor), T;
|
|
44681
44704
|
}
|
|
44682
44705
|
return {};
|
|
44683
44706
|
};
|
|
@@ -44685,28 +44708,30 @@ const CESkeletonTable = ({ columns: e, rows: t }) => /* @__PURE__ */ jsxRuntimeE
|
|
|
44685
44708
|
"div",
|
|
44686
44709
|
{
|
|
44687
44710
|
className: `status-dropdown-container ${l ? "disabled" : ""} size-${o}`,
|
|
44688
|
-
ref:
|
|
44711
|
+
ref: d,
|
|
44689
44712
|
children: [
|
|
44690
44713
|
/* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
44691
44714
|
"div",
|
|
44692
44715
|
{
|
|
44693
|
-
className: `status-dropdown-trigger ${
|
|
44694
|
-
onClick: () =>
|
|
44695
|
-
|
|
44716
|
+
className: `status-dropdown-trigger ${p ? "open" : ""} ${g ? `has-selection ${S(g)}` : ""}`,
|
|
44717
|
+
onClick: () => {
|
|
44718
|
+
l || (f ? m(!p) : b((g == null ? void 0 : g.value) || ""));
|
|
44719
|
+
},
|
|
44720
|
+
onKeyDown: E,
|
|
44696
44721
|
tabIndex: l ? -1 : 0,
|
|
44697
44722
|
role: "button",
|
|
44698
44723
|
"aria-haspopup": "listbox",
|
|
44699
|
-
"aria-expanded":
|
|
44724
|
+
"aria-expanded": p ? "true" : "false",
|
|
44700
44725
|
"aria-label": u,
|
|
44701
|
-
style:
|
|
44726
|
+
style: _(),
|
|
44702
44727
|
children: [
|
|
44703
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "status-text", children:
|
|
44728
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "status-text", children: g ? g.label : i }),
|
|
44704
44729
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
44705
44730
|
"span",
|
|
44706
44731
|
{
|
|
44707
44732
|
className: "status-dropdown-icon",
|
|
44708
|
-
onClick: (
|
|
44709
|
-
|
|
44733
|
+
onClick: (T) => {
|
|
44734
|
+
T.stopPropagation(), !l && m(!p);
|
|
44710
44735
|
},
|
|
44711
44736
|
children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
44712
44737
|
"svg",
|
|
@@ -44716,7 +44741,7 @@ const CESkeletonTable = ({ columns: e, rows: t }) => /* @__PURE__ */ jsxRuntimeE
|
|
|
44716
44741
|
viewBox: "0 0 24 24",
|
|
44717
44742
|
fill: "none",
|
|
44718
44743
|
xmlns: "http://www.w3.org/2000/svg",
|
|
44719
|
-
className: `dropdown-arrow ${
|
|
44744
|
+
className: `dropdown-arrow ${p ? "rotate" : ""}`,
|
|
44720
44745
|
children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
44721
44746
|
"path",
|
|
44722
44747
|
{
|
|
@@ -44732,25 +44757,25 @@ const CESkeletonTable = ({ columns: e, rows: t }) => /* @__PURE__ */ jsxRuntimeE
|
|
|
44732
44757
|
]
|
|
44733
44758
|
}
|
|
44734
44759
|
),
|
|
44735
|
-
|
|
44760
|
+
p && !l && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
44736
44761
|
"ul",
|
|
44737
44762
|
{
|
|
44738
44763
|
className: "status-dropdown-options",
|
|
44739
44764
|
role: "listbox",
|
|
44740
44765
|
"aria-label": "Status options",
|
|
44741
|
-
children: e.map((
|
|
44742
|
-
const
|
|
44743
|
-
return
|
|
44766
|
+
children: e.map((T) => {
|
|
44767
|
+
const C = {};
|
|
44768
|
+
return T.backgroundColor && (C.backgroundColor = T.backgroundColor), T.textColor && (C.color = T.textColor), /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
44744
44769
|
"li",
|
|
44745
44770
|
{
|
|
44746
|
-
className: `status-dropdown-option ${t ===
|
|
44747
|
-
onClick: () =>
|
|
44771
|
+
className: `status-dropdown-option ${t === T.value ? "selected" : ""} ${S(T)}`,
|
|
44772
|
+
onClick: () => b(T.value),
|
|
44748
44773
|
role: "option",
|
|
44749
|
-
"aria-selected": t ===
|
|
44750
|
-
style:
|
|
44774
|
+
"aria-selected": t === T.value ? "true" : "false",
|
|
44775
|
+
style: C,
|
|
44751
44776
|
children: [
|
|
44752
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "option-indicator", children:
|
|
44753
|
-
|
|
44777
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "option-indicator", children: T.icon ? T.icon : /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
44778
|
+
T.statusType === "declined" && /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
44754
44779
|
"svg",
|
|
44755
44780
|
{
|
|
44756
44781
|
width: "16",
|
|
@@ -44771,7 +44796,7 @@ const CESkeletonTable = ({ columns: e, rows: t }) => /* @__PURE__ */ jsxRuntimeE
|
|
|
44771
44796
|
]
|
|
44772
44797
|
}
|
|
44773
44798
|
),
|
|
44774
|
-
|
|
44799
|
+
T.statusType === "withdrawn" && /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
44775
44800
|
"svg",
|
|
44776
44801
|
{
|
|
44777
44802
|
width: "16",
|
|
@@ -44792,7 +44817,7 @@ const CESkeletonTable = ({ columns: e, rows: t }) => /* @__PURE__ */ jsxRuntimeE
|
|
|
44792
44817
|
]
|
|
44793
44818
|
}
|
|
44794
44819
|
),
|
|
44795
|
-
|
|
44820
|
+
T.statusType === "in-progress" && /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
44796
44821
|
"svg",
|
|
44797
44822
|
{
|
|
44798
44823
|
width: "16",
|
|
@@ -44815,10 +44840,10 @@ const CESkeletonTable = ({ columns: e, rows: t }) => /* @__PURE__ */ jsxRuntimeE
|
|
|
44815
44840
|
}
|
|
44816
44841
|
)
|
|
44817
44842
|
] }) }),
|
|
44818
|
-
|
|
44843
|
+
T.label
|
|
44819
44844
|
]
|
|
44820
44845
|
},
|
|
44821
|
-
|
|
44846
|
+
T.value
|
|
44822
44847
|
);
|
|
44823
44848
|
})
|
|
44824
44849
|
}
|
package/package.json
CHANGED