master-components-react 4.3.33 → 4.3.34
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.
- package/dist/index.js +80 -80
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -278,7 +278,7 @@ const xr = ({ loadingColor: r }) => /* @__PURE__ */ i(
|
|
|
278
278
|
requiredStyle: ce,
|
|
279
279
|
inputContainerStyle: ye,
|
|
280
280
|
leftIconStyle: fe,
|
|
281
|
-
customActionStyle:
|
|
281
|
+
customActionStyle: _e,
|
|
282
282
|
inputDropDownStyle: Y,
|
|
283
283
|
ulStyle: _,
|
|
284
284
|
liStyle: S,
|
|
@@ -291,10 +291,10 @@ const xr = ({ loadingColor: r }) => /* @__PURE__ */ i(
|
|
|
291
291
|
}) => {
|
|
292
292
|
const L = Qe(), [G, ue] = Z(!1), ie = te(null), [xe, re] = Z(!1);
|
|
293
293
|
Z(!1);
|
|
294
|
-
const be = te(null), Ce = te(null), Ae = te(null), [
|
|
294
|
+
const be = te(null), Ce = te(null), Ae = te(null), [he, ve] = Z(!1), [We, Ee] = Z(1), V = (ae) => {
|
|
295
295
|
let me = ae.target.value;
|
|
296
296
|
me.length === 1 && (me = me.trim()), u && typeof u == "function" && u(B ? me.replace(/\d/g, "") : me);
|
|
297
|
-
},
|
|
297
|
+
}, pe = () => {
|
|
298
298
|
re(!0), w && typeof w == "function" && w();
|
|
299
299
|
}, De = () => {
|
|
300
300
|
re(!1), b && typeof b == "function" && b();
|
|
@@ -318,7 +318,7 @@ const xr = ({ loadingColor: r }) => /* @__PURE__ */ i(
|
|
|
318
318
|
};
|
|
319
319
|
oe(() => {
|
|
320
320
|
Ie();
|
|
321
|
-
}, [Ce,
|
|
321
|
+
}, [Ce, he]), oe(() => (document.addEventListener("click", $e), () => {
|
|
322
322
|
document.removeEventListener("click", $e);
|
|
323
323
|
}), []);
|
|
324
324
|
const Ve = te(!1);
|
|
@@ -358,7 +358,7 @@ const xr = ({ loadingColor: r }) => /* @__PURE__ */ i(
|
|
|
358
358
|
),
|
|
359
359
|
!v && Q && /* @__PURE__ */ i("div", { className: Ne.inputDropDown, style: Y ?? {}, onClick: () => (ve(!0), Ie()), ref: be, children: [
|
|
360
360
|
N.find((ae) => ae.id === We).label,
|
|
361
|
-
|
|
361
|
+
he && /* @__PURE__ */ e("ul", { ref: Ce, style: _ ?? {}, children: N && N.length && N.map((ae, me) => /* @__PURE__ */ e("li", { style: S ?? {}, onClick: () => mn(ae), children: ae?.label ?? "-" }, ae.id)) }),
|
|
362
362
|
/* @__PURE__ */ e(vn, {})
|
|
363
363
|
] }),
|
|
364
364
|
v && /* @__PURE__ */ e("div", { className: `${Ne.inputDropDown} ${Ne.http}`, style: H ?? {}, onClick: () => ve(!0), ref: be, children: "http://" }),
|
|
@@ -372,7 +372,7 @@ const xr = ({ loadingColor: r }) => /* @__PURE__ */ i(
|
|
|
372
372
|
type: f ?? "text",
|
|
373
373
|
value: r,
|
|
374
374
|
onChange: (ae) => V(ae),
|
|
375
|
-
onFocus:
|
|
375
|
+
onFocus: pe,
|
|
376
376
|
onBlur: De,
|
|
377
377
|
disabled: m,
|
|
378
378
|
required: c,
|
|
@@ -409,7 +409,7 @@ const xr = ({ loadingColor: r }) => /* @__PURE__ */ i(
|
|
|
409
409
|
/* @__PURE__ */ e(mt, {}),
|
|
410
410
|
/* @__PURE__ */ e("span", { children: "Copy" })
|
|
411
411
|
] }),
|
|
412
|
-
D && /* @__PURE__ */ e("div", { style:
|
|
412
|
+
D && /* @__PURE__ */ e("div", { style: _e ?? {}, className: `${Ne.withCopy} ${xe ? Ne.focused : ""}`, children: D() })
|
|
413
413
|
] }),
|
|
414
414
|
y && y?.visible && /* @__PURE__ */ e("div", { style: q ?? {}, className: `${Ne.inputHelperText} ${y?.error ? Ne.error : ""}`, children: /* @__PURE__ */ e("p", { style: y?.style ?? {}, children: y.text }) })
|
|
415
415
|
] });
|
|
@@ -554,7 +554,7 @@ const xr = ({ loadingColor: r }) => /* @__PURE__ */ i(
|
|
|
554
554
|
}, []);
|
|
555
555
|
const fe = (Y) => {
|
|
556
556
|
ce = !1, b?.(Y.target.value), ye();
|
|
557
|
-
},
|
|
557
|
+
}, _e = () => {
|
|
558
558
|
let Y = p ?? {};
|
|
559
559
|
return g && (Y = { ...Y, ...g ?? {} }), Y;
|
|
560
560
|
};
|
|
@@ -573,7 +573,7 @@ const xr = ({ loadingColor: r }) => /* @__PURE__ */ i(
|
|
|
573
573
|
/* @__PURE__ */ e(
|
|
574
574
|
"textarea",
|
|
575
575
|
{
|
|
576
|
-
style:
|
|
576
|
+
style: _e(),
|
|
577
577
|
className: `${Be.textarea} ${A ? Be.focused : ""} ${C ? Be.disabled : ""} ${t?.error ? Be.error : ""} `,
|
|
578
578
|
value: f,
|
|
579
579
|
placeholder: r ?? "",
|
|
@@ -802,7 +802,7 @@ const xr = ({ loadingColor: r }) => /* @__PURE__ */ i(
|
|
|
802
802
|
iconDown: ce,
|
|
803
803
|
onLabelIconClick: ye,
|
|
804
804
|
onLabelIconMouseEnter: fe,
|
|
805
|
-
onLabelIconMouseLeave:
|
|
805
|
+
onLabelIconMouseLeave: _e,
|
|
806
806
|
onBeforeOpen: Y,
|
|
807
807
|
forceOpen: _,
|
|
808
808
|
dropdownWrapperStyle: S,
|
|
@@ -820,7 +820,7 @@ const xr = ({ loadingColor: r }) => /* @__PURE__ */ i(
|
|
|
820
820
|
treeProps: re,
|
|
821
821
|
theme: be = "light"
|
|
822
822
|
}) => {
|
|
823
|
-
const Ce = Qe(), [Ae,
|
|
823
|
+
const Ce = Qe(), [Ae, he] = Z(!1), [ve, We] = Z(!1), [Ee, V] = Z(!1), [pe, De] = Z([]), [se, ge] = Z(""), [Pe, rn] = Z(""), $e = te([]), [mn, Ie] = Z(/* @__PURE__ */ new Set()), Ve = te(null), ae = te(null), me = te({}), Ue = te([]), yn = (h, I) => {
|
|
824
824
|
const ke = /* @__PURE__ */ new Set();
|
|
825
825
|
return h.filter((je) => ke.has(je[I]) ? !1 : (ke.add(je[I]), !0));
|
|
826
826
|
}, cn = (h) => {
|
|
@@ -831,13 +831,13 @@ const xr = ({ loadingColor: r }) => /* @__PURE__ */ i(
|
|
|
831
831
|
ke.has(h.id) ? ke.delete(h.id) : ke.add(h.id);
|
|
832
832
|
const je = A.filter((an) => ke.has(an.id));
|
|
833
833
|
return $e.current = yn(je, "id"), F && typeof F == "function" && F($e.current), T || ge($e.current.map((an) => an.label).join(", ")), ke;
|
|
834
|
-
}),
|
|
834
|
+
}), he((I) => !I);
|
|
835
835
|
}, Sn = (h) => {
|
|
836
|
-
h.stopPropagation(), n || C ? M && (rn(""), Ue.current = A,
|
|
836
|
+
h.stopPropagation(), n || C ? M && (rn(""), Ue.current = A, he((I) => !I)) : ($e.current = [], K = null, Cn(""), me.current = {}, F({}), ge("")), z && typeof z == "function" && z("");
|
|
837
837
|
}, Cn = (h) => {
|
|
838
838
|
if (z && typeof z == "function" && z(h), n && M) {
|
|
839
839
|
let I = A, ke = I.filter((je) => je?.label?.toLowerCase().includes(h?.toLowerCase() || ""));
|
|
840
|
-
Ue.current = h?.length > 0 ? ke : I, rn(h),
|
|
840
|
+
Ue.current = h?.length > 0 ? ke : I, rn(h), he((je) => !je);
|
|
841
841
|
} else
|
|
842
842
|
rn(h), ge(h);
|
|
843
843
|
}, In = () => {
|
|
@@ -849,10 +849,10 @@ const xr = ({ loadingColor: r }) => /* @__PURE__ */ i(
|
|
|
849
849
|
let I = Ve.current.querySelector("ul"), je = Math.abs(I.scrollTop + I.clientHeight - I.scrollHeight) <= 2;
|
|
850
850
|
P && je && !An && (y && typeof y == "function" && y(!0), xn(!0)), je || xn(!1);
|
|
851
851
|
}, Fn = () => {
|
|
852
|
-
Ie(/* @__PURE__ */ new Set()), $e.current = [], F([], !0), ge(""), w && typeof w == "function" && w(),
|
|
852
|
+
Ie(/* @__PURE__ */ new Set()), $e.current = [], F([], !0), ge(""), w && typeof w == "function" && w(), he((h) => !h);
|
|
853
853
|
}, Bn = () => {
|
|
854
854
|
const h = A.filter((I) => I?.id && I?.id !== null && I?.label && I?.label !== "" && I?.label !== "-" && !I.disabled);
|
|
855
|
-
Ie(new Set(h.map((I) => I.id))), $e.current = yn(h, "id"), ge($e.current.map((I) => I.label).join(", ")), b && typeof b == "function" && b(), F($e.current, !0),
|
|
855
|
+
Ie(new Set(h.map((I) => I.id))), $e.current = yn(h, "id"), ge($e.current.map((I) => I.label).join(", ")), b && typeof b == "function" && b(), F($e.current, !0), he((I) => !I);
|
|
856
856
|
}, Dn = te(!0);
|
|
857
857
|
oe(() => {
|
|
858
858
|
if (Dn.current) {
|
|
@@ -944,7 +944,7 @@ const xr = ({ loadingColor: r }) => /* @__PURE__ */ i(
|
|
|
944
944
|
fe && typeof fe == "function" && fe();
|
|
945
945
|
},
|
|
946
946
|
onMouseLeave: () => {
|
|
947
|
-
|
|
947
|
+
_e && typeof _e == "function" && _e();
|
|
948
948
|
},
|
|
949
949
|
children: [
|
|
950
950
|
" ",
|
|
@@ -1019,7 +1019,7 @@ const xr = ({ loadingColor: r }) => /* @__PURE__ */ i(
|
|
|
1019
1019
|
Li,
|
|
1020
1020
|
{
|
|
1021
1021
|
SearchValue: Pe,
|
|
1022
|
-
expandedNodes:
|
|
1022
|
+
expandedNodes: pe,
|
|
1023
1023
|
setExpandedNodes: De,
|
|
1024
1024
|
checkboxProps: W,
|
|
1025
1025
|
onSelect: en,
|
|
@@ -1504,7 +1504,7 @@ var or = { exports: {} };
|
|
|
1504
1504
|
N && (z = F[2]), w = this.$locale(), !Q && z && (w = g.Ls[z]), this.$d = function(s, x, O, ne) {
|
|
1505
1505
|
try {
|
|
1506
1506
|
if (["x", "X"].indexOf(x) > -1) return new Date((x === "X" ? 1e3 : 1) * s);
|
|
1507
|
-
var ce = D(x)(s), ye = ce.year, fe = ce.month,
|
|
1507
|
+
var ce = D(x)(s), ye = ce.year, fe = ce.month, _e = ce.day, Y = ce.hours, _ = ce.minutes, S = ce.seconds, H = ce.milliseconds, ee = ce.zone, $ = ce.week, U = /* @__PURE__ */ new Date(), q = _e || (ye || fe ? 1 : U.getDate()), le = ye || U.getFullYear(), L = 0;
|
|
1508
1508
|
ye && !fe || (L = fe > 0 ? fe - 1 : U.getMonth());
|
|
1509
1509
|
var G, ue = Y || 0, ie = _ || 0, xe = S || 0, re = H || 0;
|
|
1510
1510
|
return ee ? new Date(Date.UTC(le, L, q, ue, ie, xe, re + 60 * ee.offset * 1e3)) : O ? new Date(Date.UTC(le, L, q, ue, ie, xe, re)) : (G = new Date(le, L, q, ue, ie, xe, re), $ && (G = ne(G).week($).toDate()), G);
|
|
@@ -1588,7 +1588,7 @@ const Oc = ({
|
|
|
1588
1588
|
$.target.scrollIntoView({ behavior: "smooth", block: "start" }), q === "hour" && (n.current = U, P.current || (P.current = "00")), q === "minute" && (P.current = U, n.current || (n.current = "00"));
|
|
1589
1589
|
const G = j().hour(parseInt(n.current ?? "0", 10)).minute(parseInt(P.current ?? "0", 10)).format(c ?? "HH:mm");
|
|
1590
1590
|
z(G), b && typeof b == "function" && b(G);
|
|
1591
|
-
},
|
|
1591
|
+
}, _e = ($) => {
|
|
1592
1592
|
$.stopPropagation(), n.current = null, P.current = null, z(""), b && typeof b == "function" && b("");
|
|
1593
1593
|
}, Y = ($) => {
|
|
1594
1594
|
$.composedPath().includes(v.current) || N(!1);
|
|
@@ -1650,7 +1650,7 @@ const Oc = ({
|
|
|
1650
1650
|
children: [
|
|
1651
1651
|
/* @__PURE__ */ e("div", { style: { display: "grid", placeItems: "center" }, children: /* @__PURE__ */ e(Kc, {}) }),
|
|
1652
1652
|
/* @__PURE__ */ e("input", { type: "text", readOnly: !0, placeholder: t ?? "", value: J }),
|
|
1653
|
-
J ? /* @__PURE__ */ e("div", { onClick: ($) =>
|
|
1653
|
+
J ? /* @__PURE__ */ e("div", { onClick: ($) => _e($), style: { display: "grid", placeItems: "center" }, children: /* @__PURE__ */ e($n, {}) }) : /* @__PURE__ */ e(
|
|
1654
1654
|
"div",
|
|
1655
1655
|
{
|
|
1656
1656
|
style: {
|
|
@@ -1926,7 +1926,7 @@ const Ta = ({
|
|
|
1926
1926
|
m(c.add(1, "month"));
|
|
1927
1927
|
}, fe = () => {
|
|
1928
1928
|
m(c.subtract(1, "month"));
|
|
1929
|
-
},
|
|
1929
|
+
}, _e = () => {
|
|
1930
1930
|
m(c.add(1, "year"));
|
|
1931
1931
|
}, Y = () => {
|
|
1932
1932
|
m(c.subtract(1, "year"));
|
|
@@ -1958,7 +1958,7 @@ const Ta = ({
|
|
|
1958
1958
|
/* @__PURE__ */ e("span", { style: J ?? {}, children: u && u.length === 1 ? c.add(1, "month").format("MMMM") : c.add(1, "month").format("MMMM YYYY") }),
|
|
1959
1959
|
/* @__PURE__ */ i("div", { className: de.right, children: [
|
|
1960
1960
|
!u || u && c.format("MMMM YYYY") !== `December ${Math.max(...u.map(Number))}` ? /* @__PURE__ */ e("div", { className: de.singleIcon, onClick: ye, children: /* @__PURE__ */ e(hn, {}) }) : /* @__PURE__ */ e("div", { style: { width: "20px", height: "20px" } }),
|
|
1961
|
-
(!u || u.length > 1) && (!u || c.year() < Math.max(...u.map(Number))) ? /* @__PURE__ */ i("div", { className: de.doubleIcon, onClick:
|
|
1961
|
+
(!u || u.length > 1) && (!u || c.year() < Math.max(...u.map(Number))) ? /* @__PURE__ */ i("div", { className: de.doubleIcon, onClick: _e, children: [
|
|
1962
1962
|
/* @__PURE__ */ e(hn, {}),
|
|
1963
1963
|
/* @__PURE__ */ e(hn, {})
|
|
1964
1964
|
] }) : /* @__PURE__ */ e("div", { style: { width: "20px", height: "20px" } })
|
|
@@ -1976,7 +1976,7 @@ const Ta = ({
|
|
|
1976
1976
|
/* @__PURE__ */ e("span", { style: J ?? {}, children: u && u.length === 1 ? c.format("MMMM") : c.format("MMMM YYYY") }),
|
|
1977
1977
|
/* @__PURE__ */ i("div", { className: de.right, children: [
|
|
1978
1978
|
!u || u && c.format("MMMM YYYY") !== `December ${Math.max(...u.map(Number))}` ? /* @__PURE__ */ e("div", { className: de.singleIcon, onClick: ye, children: /* @__PURE__ */ e(hn, {}) }) : /* @__PURE__ */ e("div", { style: { width: "20px", height: "20px" } }),
|
|
1979
|
-
(!u || u.length > 1) && (!u || c.year() < Math.max(...u.map(Number))) ? /* @__PURE__ */ i("div", { className: de.doubleIcon, onClick:
|
|
1979
|
+
(!u || u.length > 1) && (!u || c.year() < Math.max(...u.map(Number))) ? /* @__PURE__ */ i("div", { className: de.doubleIcon, onClick: _e, children: [
|
|
1980
1980
|
/* @__PURE__ */ e(hn, {}),
|
|
1981
1981
|
/* @__PURE__ */ e(hn, {})
|
|
1982
1982
|
] }) : /* @__PURE__ */ e("div", { className: de.doubleIcon })
|
|
@@ -2112,7 +2112,7 @@ const Sa = ({
|
|
|
2112
2112
|
}) => {
|
|
2113
2113
|
const x = Qe(), [O, ne] = Z(!1), [ce, ye] = Z(""), fe = te({ state: !1, value: "" });
|
|
2114
2114
|
Z(!1);
|
|
2115
|
-
const
|
|
2115
|
+
const _e = te(null), [Y, _] = Z(() => {
|
|
2116
2116
|
const re = j().year().toString();
|
|
2117
2117
|
return y?.length ? y.includes(re) ? j() : j(`${Math.min(...y.map(Number))}-01-01`) : j();
|
|
2118
2118
|
});
|
|
@@ -2124,8 +2124,8 @@ const Sa = ({
|
|
|
2124
2124
|
start: null,
|
|
2125
2125
|
end: null
|
|
2126
2126
|
}), U = te(null), q = (re, be, Ce) => {
|
|
2127
|
-
let Ae = "",
|
|
2128
|
-
!be && (P === "single" || typeof re == "string") && (Ae = re, ye(Ae)), !be && (P !== "single" || typeof re != "string") && (Ae = `${j(re?.start ?? "").format(f)} / ${re?.end ? j(re.end).format(f) : ""}`,
|
|
2127
|
+
let Ae = "", he = { start: "", end: "" };
|
|
2128
|
+
!be && (P === "single" || typeof re == "string") && (Ae = re, ye(Ae)), !be && (P !== "single" || typeof re != "string") && (Ae = `${j(re?.start ?? "").format(f)} / ${re?.end ? j(re.end).format(f) : ""}`, he.start = j(re?.start ?? "").format(f), he.end = re?.end ? j(re.end).format(f) : "", ye(Ae)), be && (Ae = j(re).format(f), ye(Ae)), re?.end && ne(!1), u && typeof u == "function" && !Ce && (u(he.start !== "" ? he : Ae), fe.current.value = he.start !== "" ? he : Ae);
|
|
2129
2129
|
}, le = (re) => {
|
|
2130
2130
|
re.stopPropagation(), H(""), fe.current.value = "", ye(""), $({
|
|
2131
2131
|
start: null,
|
|
@@ -2140,13 +2140,13 @@ const Sa = ({
|
|
|
2140
2140
|
}, ie = () => {
|
|
2141
2141
|
w && typeof w == "function" && w();
|
|
2142
2142
|
}, xe = () => {
|
|
2143
|
-
if (!U.current || !
|
|
2144
|
-
const re = U.current, be =
|
|
2143
|
+
if (!U.current || !_e.current) return;
|
|
2144
|
+
const re = U.current, be = _e.current;
|
|
2145
2145
|
if (!be || !re) return;
|
|
2146
|
-
const Ce = re.getBoundingClientRect(), Ae = window.innerHeight,
|
|
2146
|
+
const Ce = re.getBoundingClientRect(), Ae = window.innerHeight, he = window.innerWidth;
|
|
2147
2147
|
be.style.position = "fixed";
|
|
2148
2148
|
let ve = -8;
|
|
2149
|
-
Ce.bottom + be.offsetHeight > Ae ? (be.style.top = `${Ce.top - be.offsetHeight + ve}px`, be.style.bottom = "unset") : (be.style.top = `${Ce.bottom + 8}px`, be.style.bottom = "unset"), Ce.right + Ce.width >
|
|
2149
|
+
Ce.bottom + be.offsetHeight > Ae ? (be.style.top = `${Ce.top - be.offsetHeight + ve}px`, be.style.bottom = "unset") : (be.style.top = `${Ce.bottom + 8}px`, be.style.bottom = "unset"), Ce.right + Ce.width > he - 120 ? be.style.left = `${Ce.left + Ce.width - be.offsetWidth}px` : be.style.left = `${Ce.left}px`;
|
|
2150
2150
|
};
|
|
2151
2151
|
return oe(() => {
|
|
2152
2152
|
if (c && fe.current.value === "") {
|
|
@@ -2155,7 +2155,7 @@ const Sa = ({
|
|
|
2155
2155
|
}
|
|
2156
2156
|
}, []), oe(() => {
|
|
2157
2157
|
O && xe();
|
|
2158
|
-
}, [
|
|
2158
|
+
}, [_e, O]), oe(() => (document.addEventListener("click", L), document.addEventListener("wheel", G), () => {
|
|
2159
2159
|
document.removeEventListener("click", L), document.removeEventListener("wheel", G);
|
|
2160
2160
|
}), []), /* @__PURE__ */ i("div", { className: `${v === "dark" ? Ge.dark : ""} ${x === "namespaceHr" ? Ge.namespaceHr : ""} ${Ge.datepickerContainer}`, children: [
|
|
2161
2161
|
r && /* @__PURE__ */ i("label", { className: Ge.datepickerLabel, style: p ?? {}, children: [
|
|
@@ -2214,7 +2214,7 @@ const Sa = ({
|
|
|
2214
2214
|
theme: v,
|
|
2215
2215
|
namespace: x,
|
|
2216
2216
|
defaultValue: fe.current,
|
|
2217
|
-
CalendarRef:
|
|
2217
|
+
CalendarRef: _e,
|
|
2218
2218
|
disabledDatesFrom: C,
|
|
2219
2219
|
disabledDatesTill: B,
|
|
2220
2220
|
disabledDatesRange: W,
|
|
@@ -2668,13 +2668,13 @@ const Sa = ({
|
|
|
2668
2668
|
}, [D]), oe(() => {
|
|
2669
2669
|
K && xe();
|
|
2670
2670
|
}, []);
|
|
2671
|
-
const [fe,
|
|
2671
|
+
const [fe, _e] = Z(!1), [Y, _] = Z(!1), [S, H] = Z(!1), [ee, $] = Z(!1), [U, q] = Z(!1), [le, L] = Z(0), G = te([]), ue = te([]), ie = te([]), xe = () => {
|
|
2672
2672
|
let V = o.map((se) => se.options);
|
|
2673
2673
|
G.current = V;
|
|
2674
|
-
let
|
|
2674
|
+
let pe = [];
|
|
2675
2675
|
for (let se = 0; se < G.current.length; se++)
|
|
2676
|
-
|
|
2677
|
-
ue.current =
|
|
2676
|
+
pe.push(...G.current[se]);
|
|
2677
|
+
ue.current = pe;
|
|
2678
2678
|
let De = [];
|
|
2679
2679
|
for (let se = 0; se < ue.current.length; se++)
|
|
2680
2680
|
De.push(...ue.current[se].value);
|
|
@@ -2683,18 +2683,18 @@ const Sa = ({
|
|
|
2683
2683
|
C && typeof C == "function" && C([]);
|
|
2684
2684
|
}, be = (V) => {
|
|
2685
2685
|
V.selected && (V.selected = !1);
|
|
2686
|
-
let
|
|
2686
|
+
let pe = ie.current.filter((se) => se.label + se.id === V.label + V.id);
|
|
2687
2687
|
o.forEach((se) => {
|
|
2688
2688
|
se.options.map((ge) => {
|
|
2689
|
-
ge.value.includes(
|
|
2689
|
+
ge.value.includes(pe[0]) && (ge.data && (ge.data.filter((Pe) => Pe.itemNodeID === pe[0].itemNodeID)[0].selected = !1, ge.value = ge.value.filter((Pe) => Pe.selected !== !1)), ge.type == "dropdown" && (ge.value = ""), ge.type == "input" && (ge.value = ""), (ge.type == "checkBox" || ge.type == "toggle" || ge.type == "radio") && (ge.value = "", ge.checked = !1), ge.type == "slider" && (ge.value = ""), (ge.type == "datePicker" || ge.type == "timePicker") && (ge.value = ""));
|
|
2690
2690
|
});
|
|
2691
2691
|
}), $((se) => !se), q((se) => !se), _((se) => !se), H((se) => !se);
|
|
2692
2692
|
let De = ue.current.filter((se) => se.value.length > 0);
|
|
2693
|
-
r && typeof r == "function" && r(De, !0), ie.current = ie.current.filter((se) => se.label + se.id !== V.label + V.id), ie.current.length === 0 && re(),
|
|
2694
|
-
}, [Ce, Ae] = Z(y), [
|
|
2693
|
+
r && typeof r == "function" && r(De, !0), ie.current = ie.current.filter((se) => se.label + se.id !== V.label + V.id), ie.current.length === 0 && re(), _e((se) => !se);
|
|
2694
|
+
}, [Ce, Ae] = Z(y), [he, ve] = Z(!0), [We, Ee] = Z(!1);
|
|
2695
2695
|
return oe(() => {
|
|
2696
|
-
const V = (
|
|
2697
|
-
|
|
2696
|
+
const V = (pe) => {
|
|
2697
|
+
pe.key === "Enter" && n && xe();
|
|
2698
2698
|
};
|
|
2699
2699
|
return window.addEventListener("keypress", V), () => {
|
|
2700
2700
|
window.removeEventListener("keypress", V);
|
|
@@ -2769,8 +2769,8 @@ const Sa = ({
|
|
|
2769
2769
|
...z,
|
|
2770
2770
|
children: [
|
|
2771
2771
|
/* @__PURE__ */ e("h2", { className: Se.filterTitle, children: R?.headerName?.label || R?.headerName?.label?.length > 0 ? R?.headerName?.label : "Filter" }),
|
|
2772
|
-
/* @__PURE__ */ e("div", { style: { maxHeight: l == "drawer" ? "calc(100vh - 10.625rem)" : "65vh", overflowY: "auto", paddingBottom: "4px", marginTop: "24px" }, children: o.map((V,
|
|
2773
|
-
let De =
|
|
2772
|
+
/* @__PURE__ */ e("div", { style: { maxHeight: l == "drawer" ? "calc(100vh - 10.625rem)" : "65vh", overflowY: "auto", paddingBottom: "4px", marginTop: "24px" }, children: o.map((V, pe) => {
|
|
2773
|
+
let De = pe === o.length - 1;
|
|
2774
2774
|
return /* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(
|
|
2775
2775
|
Va,
|
|
2776
2776
|
{
|
|
@@ -2798,7 +2798,7 @@ const Sa = ({
|
|
|
2798
2798
|
theme: B,
|
|
2799
2799
|
onSingleChange: p
|
|
2800
2800
|
}
|
|
2801
|
-
) },
|
|
2801
|
+
) }, pe);
|
|
2802
2802
|
}) }),
|
|
2803
2803
|
/* @__PURE__ */ i("div", { className: Se.footer, children: [
|
|
2804
2804
|
/* @__PURE__ */ e(
|
|
@@ -2807,12 +2807,12 @@ const Sa = ({
|
|
|
2807
2807
|
className: Se.clear,
|
|
2808
2808
|
onClick: () => {
|
|
2809
2809
|
p && typeof p == "function" && p([]), o.forEach((V) => {
|
|
2810
|
-
V.options.forEach((
|
|
2811
|
-
|
|
2810
|
+
V.options.forEach((pe) => {
|
|
2811
|
+
pe.value = "", pe.type == "multiselect" && pe.data.forEach((De) => {
|
|
2812
2812
|
De.selected = !1;
|
|
2813
|
-
}), (
|
|
2813
|
+
}), (pe.type == "radio" || pe.type == "checkBox") && (pe.checked = !1);
|
|
2814
2814
|
});
|
|
2815
|
-
}), ie.current = [], _((V) => !V), H((V) => !V), $((V) => !V), q((V) => !V), L(0), re(), r && typeof r == "function" && r(ie.current), Ee((V) => !V), ye((V) => !V),
|
|
2815
|
+
}), ie.current = [], _((V) => !V), H((V) => !V), $((V) => !V), q((V) => !V), L(0), re(), r && typeof r == "function" && r(ie.current), Ee((V) => !V), ye((V) => !V), _e((V) => !V);
|
|
2816
2816
|
},
|
|
2817
2817
|
style: R?.clearAllName?.style ?? {},
|
|
2818
2818
|
children: R?.clearAllName?.label || R?.clearAllName?.label?.length > 0 ? R?.clearAllName?.label : "Clear"
|
|
@@ -2832,11 +2832,11 @@ const Sa = ({
|
|
|
2832
2832
|
}
|
|
2833
2833
|
),
|
|
2834
2834
|
Q && ie.current.length > 0 && /* @__PURE__ */ i("div", { style: m == "side" ? { marginTop: 0 } : {}, className: Se.tag, children: [
|
|
2835
|
-
ie.current.slice(0, Ce).map((V,
|
|
2835
|
+
ie.current.slice(0, Ce).map((V, pe) => {
|
|
2836
2836
|
let De = V?.time && V.time[0] === V.time[1] ? V.time[0] : V.label;
|
|
2837
|
-
return /* @__PURE__ */ e(nr, { id: V.id, label: De, withClose: !0, theme: B, ...P, onClose: (se) => be(V) },
|
|
2837
|
+
return /* @__PURE__ */ e(nr, { id: V.id, label: De, withClose: !0, theme: B, ...P, onClose: (se) => be(V) }, pe);
|
|
2838
2838
|
}),
|
|
2839
|
-
ie.current.length > y && Ce <= y &&
|
|
2839
|
+
ie.current.length > y && Ce <= y && he && /* @__PURE__ */ e(
|
|
2840
2840
|
"button",
|
|
2841
2841
|
{
|
|
2842
2842
|
className: Se.showButton,
|
|
@@ -2846,7 +2846,7 @@ const Sa = ({
|
|
|
2846
2846
|
children: "Show More"
|
|
2847
2847
|
}
|
|
2848
2848
|
),
|
|
2849
|
-
!
|
|
2849
|
+
!he && ie.current.length >= y && /* @__PURE__ */ e(
|
|
2850
2850
|
"button",
|
|
2851
2851
|
{
|
|
2852
2852
|
className: Se.showButton,
|
|
@@ -2862,12 +2862,12 @@ const Sa = ({
|
|
|
2862
2862
|
className: Se.showButton,
|
|
2863
2863
|
onClick: () => {
|
|
2864
2864
|
o.forEach((V) => {
|
|
2865
|
-
V.options.forEach((
|
|
2866
|
-
|
|
2865
|
+
V.options.forEach((pe) => {
|
|
2866
|
+
pe.value = "", pe.type == "multiselect" && pe.data.forEach((De) => {
|
|
2867
2867
|
De.selected = !1;
|
|
2868
|
-
}), (
|
|
2868
|
+
}), (pe.type == "radio" || pe.type == "checkBox") && (pe.checked = !1);
|
|
2869
2869
|
});
|
|
2870
|
-
}), ie.current = [], _((V) => !V), H((V) => !V), $((V) => !V), q((V) => !V), L(0), re(), ye((V) => !V), r && typeof r == "function" && r(ie.current), Ee((V) => !V),
|
|
2870
|
+
}), ie.current = [], _((V) => !V), H((V) => !V), $((V) => !V), q((V) => !V), L(0), re(), ye((V) => !V), r && typeof r == "function" && r(ie.current), Ee((V) => !V), _e((V) => !V);
|
|
2871
2871
|
},
|
|
2872
2872
|
children: "Clear All"
|
|
2873
2873
|
}
|
|
@@ -3197,7 +3197,7 @@ const Sa = ({
|
|
|
3197
3197
|
refresh: ce,
|
|
3198
3198
|
diselectAll: ye,
|
|
3199
3199
|
customActions: fe,
|
|
3200
|
-
onColumnConfigure:
|
|
3200
|
+
onColumnConfigure: _e,
|
|
3201
3201
|
onDeleteAll: Y,
|
|
3202
3202
|
onDelete: _,
|
|
3203
3203
|
onEdit: S,
|
|
@@ -3216,11 +3216,11 @@ const Sa = ({
|
|
|
3216
3216
|
allowColumnResizing: be = !0,
|
|
3217
3217
|
disableOverflow: Ce,
|
|
3218
3218
|
onActionExpand: Ae,
|
|
3219
|
-
disableRowSelection:
|
|
3219
|
+
disableRowSelection: he
|
|
3220
3220
|
}) => {
|
|
3221
3221
|
const [ve, We] = Z(!1), Ee = te(o), V = te(null);
|
|
3222
3222
|
Z("");
|
|
3223
|
-
const
|
|
3223
|
+
const pe = te({
|
|
3224
3224
|
Refresh: () => V.current.instance.getDataSource().reload(),
|
|
3225
3225
|
SelectedRowKeys: () => V.current.instance.getSelectedRowKeys(),
|
|
3226
3226
|
DeselectAll: () => V.current?.instance.deselectAll()
|
|
@@ -3254,18 +3254,18 @@ const Sa = ({
|
|
|
3254
3254
|
if (z && typeof z == "function" && z(X, a), X === "onContentReady") {
|
|
3255
3255
|
const we = document.querySelector(".dx-pager"), Te = document.querySelector("#pagination-container");
|
|
3256
3256
|
let en = !1;
|
|
3257
|
-
we ? en = !we.classList.contains("dx-hidden") : en = !1, Te.style.display = en ? "block" : "none", K?.mode === "multiple" &&
|
|
3257
|
+
we ? en = !we.classList.contains("dx-hidden") : en = !1, Te.style.display = en ? "block" : "none", K?.mode === "multiple" && he && typeof he == "function" && Ve(a.component);
|
|
3258
3258
|
}
|
|
3259
3259
|
}, Ve = (a) => {
|
|
3260
3260
|
try {
|
|
3261
|
-
const we = a.getDataSource()?.items() || [], Te = a.getSelectedRowKeys() || [], Xe = we.filter((h) => !
|
|
3261
|
+
const we = a.getDataSource()?.items() || [], Te = a.getSelectedRowKeys() || [], Xe = we.filter((h) => !he(h)).map((h) => h[c ?? "id"]), tn = Xe.length > 0 && Xe.every((h) => Te.includes(h)), Ze = document.querySelector(".dx-header-row .dx-select-checkbox");
|
|
3262
3262
|
Ze && (tn ? (Ze.classList.add("dx-checkbox-checked"), Ze.classList.remove("dx-checkbox-indeterminate")) : Te.length > 0 ? (Ze.classList.add("dx-checkbox-indeterminate"), Ze.classList.remove("dx-checkbox-checked")) : Ze.classList.remove("dx-checkbox-checked", "dx-checkbox-indeterminate"));
|
|
3263
3263
|
} catch (X) {
|
|
3264
3264
|
console.warn("Error updating select all checkbox state:", X);
|
|
3265
3265
|
}
|
|
3266
3266
|
}, ae = (a) => {
|
|
3267
|
-
if (K?.mode === "multiple" &&
|
|
3268
|
-
const we = (a.selectedRowsData || []).filter((Te) => !
|
|
3267
|
+
if (K?.mode === "multiple" && he && typeof he == "function") {
|
|
3268
|
+
const we = (a.selectedRowsData || []).filter((Te) => !he(Te)).map((Te) => Te[c ?? "id"]);
|
|
3269
3269
|
if (we.length !== a.selectedRowKeys.length) {
|
|
3270
3270
|
a.component.selectRows(we, !1), Ve(a.component);
|
|
3271
3271
|
return;
|
|
@@ -3284,13 +3284,13 @@ const Sa = ({
|
|
|
3284
3284
|
}, Tn = (a, X) => {
|
|
3285
3285
|
a.button === 1 && (O && typeof O == "function" && O(X.data), a.preventDefault());
|
|
3286
3286
|
}, Sn = (a) => {
|
|
3287
|
-
if (a.rowElement && a.data && (a.rowElement.addEventListener("mousedown", (X) => Tn(X, a)), K?.mode === "multiple" &&
|
|
3287
|
+
if (a.rowElement && a.data && (a.rowElement.addEventListener("mousedown", (X) => Tn(X, a)), K?.mode === "multiple" && he && typeof he == "function" && he(a.data))) {
|
|
3288
3288
|
const X = a.rowElement.querySelector(".dx-select-checkbox");
|
|
3289
3289
|
X && (X.classList.add("dx-state-disabled"), X.style.pointerEvents = "none", X.style.opacity = "0.5");
|
|
3290
3290
|
}
|
|
3291
3291
|
L && typeof L == "function" && L(a);
|
|
3292
3292
|
}, Cn = () => {
|
|
3293
|
-
Y && typeof Y == "function" && Y(
|
|
3293
|
+
Y && typeof Y == "function" && Y(pe.current.SelectedRowKeys());
|
|
3294
3294
|
}, In = (a) => {
|
|
3295
3295
|
le && typeof le == "function" && le(a), a.fullName === "paging.pageIndex" && P && typeof P == "function" && P(a.value + 1);
|
|
3296
3296
|
}, An = (a) => {
|
|
@@ -3313,7 +3313,7 @@ const Sa = ({
|
|
|
3313
3313
|
I.style.display = "none", I.style.pointerEvents = "none";
|
|
3314
3314
|
}), Object.assign(en.style, h);
|
|
3315
3315
|
}, xn = (a) => {
|
|
3316
|
-
Ee.current = a, We((X) => !X),
|
|
3316
|
+
Ee.current = a, We((X) => !X), _e && typeof _e == "function" && _e(Ee.current);
|
|
3317
3317
|
}, En = (a) => {
|
|
3318
3318
|
ee || a.component.collapseAll(-1), U && typeof U == "function" && U(a);
|
|
3319
3319
|
}, Fn = (a) => {
|
|
@@ -3340,9 +3340,9 @@ const Sa = ({
|
|
|
3340
3340
|
}), X;
|
|
3341
3341
|
});
|
|
3342
3342
|
}, [fe]), oe(() => {
|
|
3343
|
-
ce && (
|
|
3343
|
+
ce && (pe.current.Refresh(), pe.current.DeselectAll(), console.info("DataSource Refresh....."));
|
|
3344
3344
|
}, [ce]), oe(() => {
|
|
3345
|
-
ye &&
|
|
3345
|
+
ye && pe.current.DeselectAll();
|
|
3346
3346
|
}, [ye]), oe(() => {
|
|
3347
3347
|
if (Array.isArray(Ce) && Ce.length > 0) {
|
|
3348
3348
|
const a = () => {
|
|
@@ -3371,15 +3371,15 @@ const Sa = ({
|
|
|
3371
3371
|
}, [o]), oe(() => {
|
|
3372
3372
|
document.addEventListener("click", Pe), document.addEventListener("wheel", rn);
|
|
3373
3373
|
const a = (X) => {
|
|
3374
|
-
K?.mode === "multiple" &&
|
|
3375
|
-
const Te = V.current.instance, Xe = Te.getDataSource()?.items() || [], tn = Te.getSelectedRowKeys() || [], h = Xe.filter((ke) => !
|
|
3374
|
+
K?.mode === "multiple" && he && typeof he == "function" && X.target.closest(".dx-header-row .dx-select-checkbox") && V.current && setTimeout(() => {
|
|
3375
|
+
const Te = V.current.instance, Xe = Te.getDataSource()?.items() || [], tn = Te.getSelectedRowKeys() || [], h = Xe.filter((ke) => !he(ke)).map((ke) => ke[c ?? "id"]);
|
|
3376
3376
|
h.length > 0 && h.every((ke) => tn.includes(ke)) ? Te.deselectAll() : Te.selectRows(h, !1);
|
|
3377
3377
|
}, 0);
|
|
3378
3378
|
};
|
|
3379
3379
|
return document.addEventListener("click", a, !0), () => {
|
|
3380
3380
|
document.removeEventListener("click", Pe), document.removeEventListener("wheel", rn), document.removeEventListener("click", a, !0);
|
|
3381
3381
|
};
|
|
3382
|
-
}, [K,
|
|
3382
|
+
}, [K, he, c]), oe(() => {
|
|
3383
3383
|
const a = document.querySelector(".dx-pager"), X = document.querySelector("#pagination-container");
|
|
3384
3384
|
let we = !1;
|
|
3385
3385
|
a ? we = !a.classList.contains("dx-hidden") : we = !1, X.style.display = we ? "block" : "none";
|
|
@@ -3702,7 +3702,7 @@ const Sa = ({
|
|
|
3702
3702
|
S.preventDefault(), _(S.dataTransfer.files), x(!1);
|
|
3703
3703
|
}, fe = (S) => {
|
|
3704
3704
|
s.current = s.current.filter((H, ee) => H.fileID !== S.fileID), P((H) => !H), Y();
|
|
3705
|
-
},
|
|
3705
|
+
}, _e = (S) => {
|
|
3706
3706
|
_(S.target.files);
|
|
3707
3707
|
}, Y = () => {
|
|
3708
3708
|
o && typeof o == "function" && o(s.current);
|
|
@@ -3756,13 +3756,13 @@ const Sa = ({
|
|
|
3756
3756
|
k && typeof k == "function" ? k() : /* @__PURE__ */ e("p", { style: E ?? {}, className: Ke.subTitle, children: k ?? "" })
|
|
3757
3757
|
] })
|
|
3758
3758
|
] }),
|
|
3759
|
-
/* @__PURE__ */ e("div", { className: Ke.uploadAction, children: /* @__PURE__ */ e("input", { type: "file", name: "", id: J.current, multiple: !!r, onChange:
|
|
3759
|
+
/* @__PURE__ */ e("div", { className: Ke.uploadAction, children: /* @__PURE__ */ e("input", { type: "file", name: "", id: J.current, multiple: !!r, onChange: _e, accept: "" }) })
|
|
3760
3760
|
]
|
|
3761
3761
|
}
|
|
3762
3762
|
),
|
|
3763
3763
|
M === "row" && C && /* @__PURE__ */ e("div", { className: Ke.uploadSvg, children: B || /* @__PURE__ */ i("div", { children: [
|
|
3764
3764
|
/* @__PURE__ */ e(Jn, {}),
|
|
3765
|
-
/* @__PURE__ */ e("div", { className: Ke.uploadAction, children: /* @__PURE__ */ e("input", { type: "file", name: "", id: J.current, multiple: !!r, onChange:
|
|
3765
|
+
/* @__PURE__ */ e("div", { className: Ke.uploadAction, children: /* @__PURE__ */ e("input", { type: "file", name: "", id: J.current, multiple: !!r, onChange: _e, accept: "" }) })
|
|
3766
3766
|
] }) })
|
|
3767
3767
|
] }),
|
|
3768
3768
|
s && s.current && s.current.length && u ? s.current.map((S, H) => /* @__PURE__ */ e(
|
|
@@ -7003,7 +7003,7 @@ const Sa = ({
|
|
|
7003
7003
|
O((G) => !G);
|
|
7004
7004
|
}
|
|
7005
7005
|
}, [D, z.current]);
|
|
7006
|
-
const [x, O] = Z(!1), ne = te(null), ce = te(null), [ye, fe] = Z(!1), [
|
|
7006
|
+
const [x, O] = Z(!1), ne = te(null), ce = te(null), [ye, fe] = Z(!1), [_e, Y] = Z(!1), _ = te(null), S = (L) => {
|
|
7007
7007
|
let G = L.target.value;
|
|
7008
7008
|
if (C === "country" && (G = G.replace(/[^0-9+ ]/g, "")), A && typeof A == "function" && A(G), !G) {
|
|
7009
7009
|
z.current = u || Vn;
|
|
@@ -7046,7 +7046,7 @@ const Sa = ({
|
|
|
7046
7046
|
ye || K && typeof K == "function" && K();
|
|
7047
7047
|
}, [ye]), oe(() => {
|
|
7048
7048
|
q();
|
|
7049
|
-
}, [ce, ye,
|
|
7049
|
+
}, [ce, ye, _e]), oe(() => (document.addEventListener("click", le), () => {
|
|
7050
7050
|
document.removeEventListener("click", le);
|
|
7051
7051
|
}), []), /* @__PURE__ */ i("div", { className: `${R === "dark" ? He.dark : ""} ${He[J]} ${He.inputWithDropdownWrapper}`, style: l ?? {}, children: [
|
|
7052
7052
|
r && /* @__PURE__ */ i("label", { className: He.inputLabel, style: p ?? {}, children: [
|
|
@@ -7095,7 +7095,7 @@ const Sa = ({
|
|
|
7095
7095
|
style: {
|
|
7096
7096
|
display: "grid",
|
|
7097
7097
|
placeItems: "center",
|
|
7098
|
-
transform:
|
|
7098
|
+
transform: _e ? "rotate(180deg)" : "",
|
|
7099
7099
|
transition: "transform 0.2s ease-in-out",
|
|
7100
7100
|
// Add transition here
|
|
7101
7101
|
cursor: m || f ? "not-allowed" : "pointer"
|
|
@@ -7125,7 +7125,7 @@ const Sa = ({
|
|
|
7125
7125
|
maxLength: k
|
|
7126
7126
|
}
|
|
7127
7127
|
),
|
|
7128
|
-
|
|
7128
|
+
_e && /* @__PURE__ */ e("ul", { ref: ce, className: He.inputDropDown, onClick: (L) => L.stopPropagation(), children: z.current.map((L, G) => /* @__PURE__ */ i("li", { onClick: () => H(L), children: [
|
|
7129
7129
|
C === "country" && /* @__PURE__ */ e("img", { src: n(L.code), style: { width: "1.375rem", height: "1.375rem", objectFit: "contain" }, alt: L.name }),
|
|
7130
7130
|
/* @__PURE__ */ i("span", { title: L.name, className: He.countryName, children: [
|
|
7131
7131
|
L.name,
|