@contentmunch/contentmunch-ui 1.1.1 → 1.1.3
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/LICENSE +21 -0
- package/lib/icon/Drawings.d.ts +2 -0
- package/lib/index.cjs.js +3 -3
- package/lib/index.es.js +149 -138
- package/lib/index.umd.js +4 -4
- package/lib/input/TextInputDropdown.d.ts +3 -0
- package/package.json +1 -1
package/lib/index.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import oe, { useState as
|
|
1
|
+
import oe, { useState as S, Fragment as s, useRef as de, useCallback as G, useEffect as Q, useMemo as te } from "react";
|
|
2
2
|
var K = { exports: {} }, B = {};
|
|
3
3
|
/**
|
|
4
4
|
* @license React
|
|
@@ -47,16 +47,16 @@ function ye() {
|
|
|
47
47
|
function n(l) {
|
|
48
48
|
if (l == null) return null;
|
|
49
49
|
if (typeof l == "function")
|
|
50
|
-
return l.$$typeof ===
|
|
50
|
+
return l.$$typeof === A ? null : l.displayName || l.name || null;
|
|
51
51
|
if (typeof l == "string") return l;
|
|
52
52
|
switch (l) {
|
|
53
|
-
case
|
|
53
|
+
case b:
|
|
54
54
|
return "Fragment";
|
|
55
55
|
case v:
|
|
56
56
|
return "Profiler";
|
|
57
|
-
case
|
|
57
|
+
case E:
|
|
58
58
|
return "StrictMode";
|
|
59
|
-
case
|
|
59
|
+
case C:
|
|
60
60
|
return "Suspense";
|
|
61
61
|
case H:
|
|
62
62
|
return "SuspenseList";
|
|
@@ -67,13 +67,13 @@ function ye() {
|
|
|
67
67
|
switch (typeof l.tag == "number" && console.error(
|
|
68
68
|
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
69
69
|
), l.$$typeof) {
|
|
70
|
-
case
|
|
70
|
+
case g:
|
|
71
71
|
return "Portal";
|
|
72
|
-
case
|
|
72
|
+
case T:
|
|
73
73
|
return (l.displayName || "Context") + ".Provider";
|
|
74
|
-
case
|
|
74
|
+
case k:
|
|
75
75
|
return (l._context.displayName || "Context") + ".Consumer";
|
|
76
|
-
case
|
|
76
|
+
case R:
|
|
77
77
|
var y = l.render;
|
|
78
78
|
return l = l.displayName, l || (l = y.displayName || y.name || "", l = l !== "" ? "ForwardRef(" + l + ")" : "ForwardRef"), l;
|
|
79
79
|
case P:
|
|
@@ -99,16 +99,16 @@ function ye() {
|
|
|
99
99
|
}
|
|
100
100
|
if (y) {
|
|
101
101
|
y = console;
|
|
102
|
-
var w = y.error,
|
|
102
|
+
var w = y.error, _ = typeof Symbol == "function" && Symbol.toStringTag && l[Symbol.toStringTag] || l.constructor.name || "Object";
|
|
103
103
|
return w.call(
|
|
104
104
|
y,
|
|
105
105
|
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
106
|
-
|
|
106
|
+
_
|
|
107
107
|
), t(l);
|
|
108
108
|
}
|
|
109
109
|
}
|
|
110
110
|
function i(l) {
|
|
111
|
-
if (l ===
|
|
111
|
+
if (l === b) return "<>";
|
|
112
112
|
if (typeof l == "object" && l !== null && l.$$typeof === m)
|
|
113
113
|
return "<...>";
|
|
114
114
|
try {
|
|
@@ -150,7 +150,7 @@ function ye() {
|
|
|
150
150
|
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
151
151
|
)), l = this.props.ref, l !== void 0 ? l : null;
|
|
152
152
|
}
|
|
153
|
-
function u(l, y, w,
|
|
153
|
+
function u(l, y, w, _, D, V, ee, se) {
|
|
154
154
|
return w = V.ref, l = {
|
|
155
155
|
$$typeof: f,
|
|
156
156
|
type: l,
|
|
@@ -182,48 +182,48 @@ function ye() {
|
|
|
182
182
|
value: se
|
|
183
183
|
}), Object.freeze && (Object.freeze(l.props), Object.freeze(l)), l;
|
|
184
184
|
}
|
|
185
|
-
function d(l, y, w,
|
|
186
|
-
var
|
|
187
|
-
if (
|
|
188
|
-
if (
|
|
189
|
-
if (Z(
|
|
190
|
-
for (
|
|
191
|
-
h(
|
|
192
|
-
Object.freeze && Object.freeze(
|
|
185
|
+
function d(l, y, w, _, D, V, ee, se) {
|
|
186
|
+
var z = y.children;
|
|
187
|
+
if (z !== void 0)
|
|
188
|
+
if (_)
|
|
189
|
+
if (Z(z)) {
|
|
190
|
+
for (_ = 0; _ < z.length; _++)
|
|
191
|
+
h(z[_]);
|
|
192
|
+
Object.freeze && Object.freeze(z);
|
|
193
193
|
} else
|
|
194
194
|
console.error(
|
|
195
195
|
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
196
196
|
);
|
|
197
|
-
else h(
|
|
197
|
+
else h(z);
|
|
198
198
|
if (X.call(y, "key")) {
|
|
199
|
-
|
|
199
|
+
z = n(l);
|
|
200
200
|
var F = Object.keys(y).filter(function(je) {
|
|
201
201
|
return je !== "key";
|
|
202
202
|
});
|
|
203
|
-
|
|
203
|
+
_ = 0 < F.length ? "{key: someKey, " + F.join(": ..., ") + ": ...}" : "{key: someKey}", re[z + _] || (F = 0 < F.length ? "{" + F.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
204
204
|
`A props object containing a "key" prop is being spread into JSX:
|
|
205
205
|
let props = %s;
|
|
206
206
|
<%s {...props} />
|
|
207
207
|
React keys must be passed directly to JSX without using spread:
|
|
208
208
|
let props = %s;
|
|
209
209
|
<%s key={someKey} {...props} />`,
|
|
210
|
-
|
|
211
|
-
|
|
210
|
+
_,
|
|
211
|
+
z,
|
|
212
212
|
F,
|
|
213
|
-
|
|
214
|
-
), re[
|
|
213
|
+
z
|
|
214
|
+
), re[z + _] = !0);
|
|
215
215
|
}
|
|
216
|
-
if (
|
|
216
|
+
if (z = null, w !== void 0 && (r(w), z = "" + w), o(y) && (r(y.key), z = "" + y.key), "key" in y) {
|
|
217
217
|
w = {};
|
|
218
218
|
for (var ne in y)
|
|
219
219
|
ne !== "key" && (w[ne] = y[ne]);
|
|
220
220
|
} else w = y;
|
|
221
|
-
return
|
|
221
|
+
return z && x(
|
|
222
222
|
w,
|
|
223
223
|
typeof l == "function" ? l.displayName || l.name || "Unknown" : l
|
|
224
224
|
), u(
|
|
225
225
|
l,
|
|
226
|
-
|
|
226
|
+
z,
|
|
227
227
|
V,
|
|
228
228
|
D,
|
|
229
229
|
c(),
|
|
@@ -235,7 +235,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
235
235
|
function h(l) {
|
|
236
236
|
typeof l == "object" && l !== null && l.$$typeof === f && l._store && (l._store.validated = 1);
|
|
237
237
|
}
|
|
238
|
-
var p = oe, f = Symbol.for("react.transitional.element"),
|
|
238
|
+
var p = oe, f = Symbol.for("react.transitional.element"), g = Symbol.for("react.portal"), b = Symbol.for("react.fragment"), E = Symbol.for("react.strict_mode"), v = Symbol.for("react.profiler"), k = Symbol.for("react.consumer"), T = Symbol.for("react.context"), R = Symbol.for("react.forward_ref"), C = Symbol.for("react.suspense"), H = Symbol.for("react.suspense_list"), P = Symbol.for("react.memo"), m = Symbol.for("react.lazy"), M = Symbol.for("react.activity"), A = Symbol.for("react.client.reference"), L = p.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, X = Object.prototype.hasOwnProperty, Z = Array.isArray, I = console.createTask ? console.createTask : function() {
|
|
239
239
|
return null;
|
|
240
240
|
};
|
|
241
241
|
p = {
|
|
@@ -247,26 +247,26 @@ React keys must be passed directly to JSX without using spread:
|
|
|
247
247
|
p,
|
|
248
248
|
a
|
|
249
249
|
)(), W = I(i(a)), re = {};
|
|
250
|
-
J.Fragment =
|
|
250
|
+
J.Fragment = b, J.jsx = function(l, y, w, _, D) {
|
|
251
251
|
var V = 1e4 > L.recentlyCreatedOwnerStacks++;
|
|
252
252
|
return d(
|
|
253
253
|
l,
|
|
254
254
|
y,
|
|
255
255
|
w,
|
|
256
256
|
!1,
|
|
257
|
-
|
|
257
|
+
_,
|
|
258
258
|
D,
|
|
259
259
|
V ? Error("react-stack-top-frame") : U,
|
|
260
260
|
V ? I(i(l)) : W
|
|
261
261
|
);
|
|
262
|
-
}, J.jsxs = function(l, y, w,
|
|
262
|
+
}, J.jsxs = function(l, y, w, _, D) {
|
|
263
263
|
var V = 1e4 > L.recentlyCreatedOwnerStacks++;
|
|
264
264
|
return d(
|
|
265
265
|
l,
|
|
266
266
|
y,
|
|
267
267
|
w,
|
|
268
268
|
!0,
|
|
269
|
-
|
|
269
|
+
_,
|
|
270
270
|
D,
|
|
271
271
|
V ? Error("react-stack-top-frame") : U,
|
|
272
272
|
V ? I(i(l)) : W
|
|
@@ -280,11 +280,11 @@ function pe() {
|
|
|
280
280
|
}
|
|
281
281
|
var e = pe();
|
|
282
282
|
const Re = ({ variant: n, collapsed: t, children: r }) => {
|
|
283
|
-
const { folds: i } = r, [c, a] =
|
|
283
|
+
const { folds: i } = r, [c, a] = S(t ? -1 : 0), o = (d) => d === c ? "fold active" : "fold", x = (d) => "fold-button" + (n ? " fold-button--" + n : "") + (i[d].foldColor ? " fold-button--primary fold-button--" + i[d].foldColor : ""), j = (d) => {
|
|
284
284
|
const h = d.which.toString(), p = d.ctrlKey && h.match(/33|34/);
|
|
285
285
|
if (h.match(/38|40/) || p) {
|
|
286
|
-
const f = h.match(/34|40/) ? 1 : -1,
|
|
287
|
-
a(
|
|
286
|
+
const f = h.match(/34|40/) ? 1 : -1, g = i.length, b = (c + g + f) % g;
|
|
287
|
+
a(b);
|
|
288
288
|
} else
|
|
289
289
|
h === "36" && a(0), h === "35" && a(i.length - 1);
|
|
290
290
|
d.preventDefault();
|
|
@@ -470,6 +470,11 @@ const Re = ({ variant: n, collapsed: t, children: r }) => {
|
|
|
470
470
|
/* @__PURE__ */ e.jsx("circle", { cx: "12", cy: "12", r: "10" }),
|
|
471
471
|
/* @__PURE__ */ e.jsx("polyline", { points: "12 6 12 12 16 14" })
|
|
472
472
|
] }),
|
|
473
|
+
cloud: /* @__PURE__ */ e.jsx(s, { children: /* @__PURE__ */ e.jsx("path", { d: "M18 10h-1.26A8 8 0 1 0 9 20h9a5 5 0 0 0 0-10z" }) }),
|
|
474
|
+
"cloud-lightning": /* @__PURE__ */ e.jsxs(s, { children: [
|
|
475
|
+
/* @__PURE__ */ e.jsx("path", { d: "M19 16.9A5 5 0 0 0 18 7h-1.26a8 8 0 1 0-11.62 9" }),
|
|
476
|
+
/* @__PURE__ */ e.jsx("polyline", { points: "13 11 9 17 15 17 11 23" })
|
|
477
|
+
] }),
|
|
473
478
|
camera: /* @__PURE__ */ e.jsxs(s, { children: [
|
|
474
479
|
/* @__PURE__ */ e.jsx("path", { d: "M23 19a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h4l2-3h6l2 3h4a2 2 0 0 1 2 2z" }),
|
|
475
480
|
/* @__PURE__ */ e.jsx("circle", { cx: "12", cy: "13", r: "4" })
|
|
@@ -1159,32 +1164,32 @@ const Re = ({ variant: n, collapsed: t, children: r }) => {
|
|
|
1159
1164
|
showContent: h,
|
|
1160
1165
|
setShowContent: p,
|
|
1161
1166
|
withDropIcon: f,
|
|
1162
|
-
children:
|
|
1163
|
-
...
|
|
1167
|
+
children: g,
|
|
1168
|
+
...b
|
|
1164
1169
|
}) => {
|
|
1165
|
-
const
|
|
1166
|
-
|
|
1167
|
-
},
|
|
1170
|
+
const E = de(null), v = (C) => {
|
|
1171
|
+
C.preventDefault(), u && u(C), p && p(!0);
|
|
1172
|
+
}, k = G(() => {
|
|
1168
1173
|
p(!1), d && d();
|
|
1169
|
-
}, [d, p]),
|
|
1170
|
-
|
|
1171
|
-
}, [
|
|
1174
|
+
}, [d, p]), T = G((C) => {
|
|
1175
|
+
C.keyCode === 27 && k();
|
|
1176
|
+
}, [k]);
|
|
1172
1177
|
Q(() => {
|
|
1173
|
-
const
|
|
1174
|
-
|
|
1178
|
+
const C = (H) => {
|
|
1179
|
+
E && E.current && H.target instanceof HTMLElement && !E.current.contains(H.target) && k();
|
|
1175
1180
|
};
|
|
1176
|
-
return document.addEventListener("keydown",
|
|
1177
|
-
document.removeEventListener("keydown",
|
|
1181
|
+
return document.addEventListener("keydown", T, !1), document.addEventListener("mousedown", C), () => {
|
|
1182
|
+
document.removeEventListener("keydown", T, !1);
|
|
1178
1183
|
};
|
|
1179
|
-
}, [
|
|
1180
|
-
const
|
|
1184
|
+
}, [T, k]);
|
|
1185
|
+
const R = () => {
|
|
1181
1186
|
var P;
|
|
1182
|
-
const
|
|
1183
|
-
if (
|
|
1184
|
-
if (
|
|
1185
|
-
if (H -
|
|
1186
|
-
if (H -
|
|
1187
|
-
const m = Math.round((H -
|
|
1187
|
+
const C = (P = E.current) == null ? void 0 : P.offsetLeft, H = window.innerWidth;
|
|
1188
|
+
if (C) {
|
|
1189
|
+
if (C < 100) return "muncher-dropdown--content";
|
|
1190
|
+
if (H - C < 150) return "muncher-dropdown--content drop-left";
|
|
1191
|
+
if (H - C < 250) {
|
|
1192
|
+
const m = Math.round((H - C) / H * 100);
|
|
1188
1193
|
if (m > 40 || m < 60) return "muncher-dropdown--content drop-middle";
|
|
1189
1194
|
}
|
|
1190
1195
|
}
|
|
@@ -1197,7 +1202,7 @@ const Re = ({ variant: n, collapsed: t, children: r }) => {
|
|
|
1197
1202
|
return "muncher-dropdown--content";
|
|
1198
1203
|
}
|
|
1199
1204
|
};
|
|
1200
|
-
return /* @__PURE__ */ e.jsxs("div", { className: "muncher-dropdown", ref:
|
|
1205
|
+
return /* @__PURE__ */ e.jsxs("div", { className: "muncher-dropdown", ref: E, children: [
|
|
1201
1206
|
/* @__PURE__ */ e.jsxs(
|
|
1202
1207
|
O,
|
|
1203
1208
|
{
|
|
@@ -1208,7 +1213,7 @@ const Re = ({ variant: n, collapsed: t, children: r }) => {
|
|
|
1208
1213
|
active: i,
|
|
1209
1214
|
variant: n,
|
|
1210
1215
|
size: t,
|
|
1211
|
-
...
|
|
1216
|
+
...b,
|
|
1212
1217
|
children: [
|
|
1213
1218
|
a,
|
|
1214
1219
|
f ? /* @__PURE__ */ e.jsx(
|
|
@@ -1221,7 +1226,7 @@ const Re = ({ variant: n, collapsed: t, children: r }) => {
|
|
|
1221
1226
|
]
|
|
1222
1227
|
}
|
|
1223
1228
|
),
|
|
1224
|
-
h ? /* @__PURE__ */ e.jsx("div", { className:
|
|
1229
|
+
h ? /* @__PURE__ */ e.jsx("div", { className: R(), children: g }) : ""
|
|
1225
1230
|
] });
|
|
1226
1231
|
}, Ae = ({
|
|
1227
1232
|
title: n,
|
|
@@ -1253,7 +1258,7 @@ const Re = ({ variant: n, collapsed: t, children: r }) => {
|
|
|
1253
1258
|
variant: t = "secondary",
|
|
1254
1259
|
size: r = "small"
|
|
1255
1260
|
}) => {
|
|
1256
|
-
const [i, c] =
|
|
1261
|
+
const [i, c] = S(), [a, o] = S("copy"), [x, j] = S("copy link"), u = () => {
|
|
1257
1262
|
ge(n), c("green"), o("check"), j("copied!"), setTimeout(function() {
|
|
1258
1263
|
c(""), o("copy");
|
|
1259
1264
|
}, 2e3);
|
|
@@ -1273,7 +1278,7 @@ const Re = ({ variant: n, collapsed: t, children: r }) => {
|
|
|
1273
1278
|
size: t = "medium",
|
|
1274
1279
|
title: r
|
|
1275
1280
|
}) => {
|
|
1276
|
-
const [i, c] =
|
|
1281
|
+
const [i, c] = S(!1);
|
|
1277
1282
|
return /* @__PURE__ */ e.jsx("div", { className: "muncher-share", children: /* @__PURE__ */ e.jsxs(
|
|
1278
1283
|
ve,
|
|
1279
1284
|
{
|
|
@@ -1340,7 +1345,7 @@ const Re = ({ variant: n, collapsed: t, children: r }) => {
|
|
|
1340
1345
|
onClick: o,
|
|
1341
1346
|
children: x
|
|
1342
1347
|
}) => {
|
|
1343
|
-
const [j, u] =
|
|
1348
|
+
const [j, u] = S(!1), d = () => !c || c && !j ? i ? /* @__PURE__ */ e.jsx(N, { name: "sort-asc" }) : /* @__PURE__ */ e.jsx(N, { name: "sort-desc" }) : i ? /* @__PURE__ */ e.jsx(N, { name: "sort-desc" }) : /* @__PURE__ */ e.jsx(N, { name: "sort-asc" });
|
|
1344
1349
|
return /* @__PURE__ */ e.jsxs(
|
|
1345
1350
|
O,
|
|
1346
1351
|
{
|
|
@@ -1402,7 +1407,7 @@ const Re = ({ variant: n, collapsed: t, children: r }) => {
|
|
|
1402
1407
|
}, q = ({ label: n, onClick: t, id: r, required: i = !1 }) => /* @__PURE__ */ e.jsxs("label", { htmlFor: r, onClick: t, children: [
|
|
1403
1408
|
n,
|
|
1404
1409
|
i ? /* @__PURE__ */ e.jsx("span", { className: "required", children: "*" }) : ""
|
|
1405
|
-
] }),
|
|
1410
|
+
] }), ze = ({
|
|
1406
1411
|
name: n,
|
|
1407
1412
|
required: t = !1,
|
|
1408
1413
|
onChange: r,
|
|
@@ -1410,7 +1415,7 @@ const Re = ({ variant: n, collapsed: t, children: r }) => {
|
|
|
1410
1415
|
label: c,
|
|
1411
1416
|
...a
|
|
1412
1417
|
}) => {
|
|
1413
|
-
const [o, x] =
|
|
1418
|
+
const [o, x] = S(i || !1);
|
|
1414
1419
|
return /* @__PURE__ */ e.jsx("div", { className: "muncher-input--div", children: /* @__PURE__ */ e.jsxs("div", { className: "muncher-checkbox", children: [
|
|
1415
1420
|
/* @__PURE__ */ e.jsx(
|
|
1416
1421
|
"input",
|
|
@@ -1483,7 +1488,7 @@ const Re = ({ variant: n, collapsed: t, children: r }) => {
|
|
|
1483
1488
|
j && j !== "" ? /* @__PURE__ */ e.jsx("p", { className: "text-danger", children: j }) : "",
|
|
1484
1489
|
u && u !== "" ? /* @__PURE__ */ e.jsx("p", { className: "text-success", children: u }) : ""
|
|
1485
1490
|
] }) });
|
|
1486
|
-
},
|
|
1491
|
+
}, Se = ({
|
|
1487
1492
|
name: n,
|
|
1488
1493
|
label: t,
|
|
1489
1494
|
variant: r = "secondary",
|
|
@@ -1496,16 +1501,16 @@ const Re = ({ variant: n, collapsed: t, children: r }) => {
|
|
|
1496
1501
|
maxFiles: u,
|
|
1497
1502
|
...d
|
|
1498
1503
|
}) => {
|
|
1499
|
-
const [h, p] =
|
|
1504
|
+
const [h, p] = S(""), [f, g] = S(""), b = u || 3, E = "muncher-button" + (r ? " muncher-button--" + r : "") + (i ? " muncher-button--" + i : "") + (a ? " muncher-button--active" : ""), v = (T) => {
|
|
1500
1505
|
if (j) {
|
|
1501
|
-
let
|
|
1502
|
-
|
|
1506
|
+
let R = Array.from(T.currentTarget.files);
|
|
1507
|
+
R.length > b && (R = R.slice(0, b), g("Only first " + b + " files included")), o(R), p(R.map((C) => C.name).join(", "));
|
|
1503
1508
|
} else
|
|
1504
|
-
o(Array.from(
|
|
1505
|
-
},
|
|
1509
|
+
o(Array.from(T.currentTarget.files[0])), p(T.currentTarget.files[0].name);
|
|
1510
|
+
}, k = () => x && x !== "";
|
|
1506
1511
|
return /* @__PURE__ */ e.jsxs("div", { className: "muncher-file-input--div", children: [
|
|
1507
1512
|
/* @__PURE__ */ e.jsxs("div", { className: "file-input-element", children: [
|
|
1508
|
-
/* @__PURE__ */ e.jsxs("label", { htmlFor: n, className:
|
|
1513
|
+
/* @__PURE__ */ e.jsxs("label", { htmlFor: n, className: E, children: [
|
|
1509
1514
|
/* @__PURE__ */ e.jsx(N, { name: "image" }),
|
|
1510
1515
|
" ",
|
|
1511
1516
|
t,
|
|
@@ -1527,7 +1532,7 @@ const Re = ({ variant: n, collapsed: t, children: r }) => {
|
|
|
1527
1532
|
)
|
|
1528
1533
|
] }),
|
|
1529
1534
|
f !== "" ? /* @__PURE__ */ e.jsx("p", { className: "text-danger", children: f }) : "",
|
|
1530
|
-
|
|
1535
|
+
k() ? /* @__PURE__ */ e.jsx("div", { className: "muncher-input-error-message", children: /* @__PURE__ */ e.jsx(N, { name: "alert", children: x }) }) : ""
|
|
1531
1536
|
] });
|
|
1532
1537
|
}, ke = ({
|
|
1533
1538
|
name: n,
|
|
@@ -1544,20 +1549,20 @@ const Re = ({ variant: n, collapsed: t, children: r }) => {
|
|
|
1544
1549
|
onKeyDown: h,
|
|
1545
1550
|
error: p,
|
|
1546
1551
|
focus: f = !1,
|
|
1547
|
-
placeholder:
|
|
1548
|
-
onChange:
|
|
1549
|
-
step:
|
|
1552
|
+
placeholder: g,
|
|
1553
|
+
onChange: b,
|
|
1554
|
+
step: E,
|
|
1550
1555
|
value: v,
|
|
1551
|
-
maxLength:
|
|
1552
|
-
onEnterPress:
|
|
1553
|
-
displayLoader:
|
|
1554
|
-
...
|
|
1556
|
+
maxLength: k,
|
|
1557
|
+
onEnterPress: T,
|
|
1558
|
+
displayLoader: R,
|
|
1559
|
+
...C
|
|
1555
1560
|
}) => {
|
|
1556
1561
|
const H = () => p && p !== "", P = () => {
|
|
1557
|
-
let
|
|
1558
|
-
return (c || a) && (
|
|
1559
|
-
}, m = () => t ? /* @__PURE__ */ e.jsx(q, { label: t, required: r, id: n }) : "", M = (
|
|
1560
|
-
|
|
1562
|
+
let A = "muncher-input";
|
|
1563
|
+
return (c || a) && (A += " muncher-input-icon"), H() && (A += " muncher-input-error"), d === "side" && (A += " muncher-label-side"), A;
|
|
1564
|
+
}, m = () => t ? /* @__PURE__ */ e.jsx(q, { label: t, required: r, id: n }) : "", M = (A) => {
|
|
1565
|
+
A.key === "Enter" && T && T(), h && h(A);
|
|
1561
1566
|
};
|
|
1562
1567
|
return /* @__PURE__ */ e.jsxs("div", { className: "muncher-input--div", children: [
|
|
1563
1568
|
d !== "side" ? m() : "",
|
|
@@ -1579,19 +1584,19 @@ const Re = ({ variant: n, collapsed: t, children: r }) => {
|
|
|
1579
1584
|
value: v,
|
|
1580
1585
|
type: x || "text",
|
|
1581
1586
|
autoComplete: "off",
|
|
1582
|
-
placeholder:
|
|
1583
|
-
onChange:
|
|
1587
|
+
placeholder: g,
|
|
1588
|
+
onChange: b,
|
|
1584
1589
|
required: r,
|
|
1585
1590
|
readOnly: i,
|
|
1586
1591
|
list: j,
|
|
1587
1592
|
onKeyDown: M,
|
|
1588
1593
|
onBlur: u,
|
|
1589
|
-
step:
|
|
1590
|
-
maxLength:
|
|
1591
|
-
...
|
|
1594
|
+
step: E,
|
|
1595
|
+
maxLength: k,
|
|
1596
|
+
...C
|
|
1592
1597
|
}
|
|
1593
1598
|
),
|
|
1594
|
-
|
|
1599
|
+
R ? /* @__PURE__ */ e.jsx(he, { size: "tiny" }) : ""
|
|
1595
1600
|
] })
|
|
1596
1601
|
] }),
|
|
1597
1602
|
H() ? /* @__PURE__ */ e.jsx("div", { className: "muncher-input-error-message", children: /* @__PURE__ */ e.jsx(N, { name: "alert", children: p }) }) : ""
|
|
@@ -1668,8 +1673,8 @@ const Re = ({ variant: n, collapsed: t, children: r }) => {
|
|
|
1668
1673
|
value: u,
|
|
1669
1674
|
...d
|
|
1670
1675
|
}) => {
|
|
1671
|
-
const [h, p] =
|
|
1672
|
-
p(
|
|
1676
|
+
const [h, p] = S(u), f = (g) => {
|
|
1677
|
+
p(g.target.value), j && j(g);
|
|
1673
1678
|
};
|
|
1674
1679
|
return /* @__PURE__ */ e.jsxs("div", { className: "muncher-input--div", children: [
|
|
1675
1680
|
t ? /* @__PURE__ */ e.jsx(q, { label: t, required: r, id: n }) : "",
|
|
@@ -1706,33 +1711,39 @@ const Re = ({ variant: n, collapsed: t, children: r }) => {
|
|
|
1706
1711
|
label: x,
|
|
1707
1712
|
error: j,
|
|
1708
1713
|
required: u,
|
|
1709
|
-
|
|
1714
|
+
onEnterPress: d,
|
|
1715
|
+
list: h,
|
|
1716
|
+
displayLoader: p,
|
|
1717
|
+
children: f
|
|
1710
1718
|
}) => {
|
|
1711
|
-
const
|
|
1712
|
-
c(!0), r(
|
|
1713
|
-
},
|
|
1719
|
+
const g = de(null), b = (k) => {
|
|
1720
|
+
c(!0), r(k.target.value);
|
|
1721
|
+
}, E = G(() => {
|
|
1714
1722
|
c(!1);
|
|
1715
|
-
}, [c]),
|
|
1716
|
-
|
|
1717
|
-
}, [
|
|
1723
|
+
}, [c]), v = G((k) => {
|
|
1724
|
+
k.keyCode === 27 && E();
|
|
1725
|
+
}, [E]);
|
|
1718
1726
|
return Q(() => {
|
|
1719
|
-
const
|
|
1720
|
-
if (
|
|
1721
|
-
const
|
|
1722
|
-
|
|
1727
|
+
const k = (T) => {
|
|
1728
|
+
if (g && g !== null) {
|
|
1729
|
+
const R = g.current;
|
|
1730
|
+
R && !R.contains(T.target) && E();
|
|
1723
1731
|
}
|
|
1724
1732
|
};
|
|
1725
|
-
return document.addEventListener("keydown",
|
|
1726
|
-
document.removeEventListener("keydown",
|
|
1733
|
+
return document.addEventListener("keydown", v, !1), document.addEventListener("mousedown", k), () => {
|
|
1734
|
+
document.removeEventListener("keydown", v, !1);
|
|
1727
1735
|
};
|
|
1728
|
-
}, [
|
|
1736
|
+
}, [v, E]), /* @__PURE__ */ e.jsxs("div", { className: "muncher-input-drop-down", ref: g, children: [
|
|
1729
1737
|
/* @__PURE__ */ e.jsx(
|
|
1730
1738
|
ke,
|
|
1731
1739
|
{
|
|
1732
1740
|
focus: n,
|
|
1733
1741
|
placeholder: t,
|
|
1734
1742
|
name: "query",
|
|
1735
|
-
onChange:
|
|
1743
|
+
onChange: b,
|
|
1744
|
+
onEnterPress: d,
|
|
1745
|
+
list: h,
|
|
1746
|
+
displayLoader: p,
|
|
1736
1747
|
readOnly: a,
|
|
1737
1748
|
value: o,
|
|
1738
1749
|
label: x,
|
|
@@ -1740,7 +1751,7 @@ const Re = ({ variant: n, collapsed: t, children: r }) => {
|
|
|
1740
1751
|
error: j
|
|
1741
1752
|
}
|
|
1742
1753
|
),
|
|
1743
|
-
i ? /* @__PURE__ */ e.jsx("div", { className: "muncher-input-drop-down--content", children:
|
|
1754
|
+
i ? /* @__PURE__ */ e.jsx("div", { className: "muncher-input-drop-down--content", children: f }) : ""
|
|
1744
1755
|
] });
|
|
1745
1756
|
}, Le = ({ children: n }) => /* @__PURE__ */ e.jsx("ul", { className: "muncher-ul", children: n }), Pe = ({ isFeatured: n, bulletIcon: t = "arrow-right", bulletWeight: r = 2, bulletSize: i = "small", bulletColor: c, children: a }) => /* @__PURE__ */ e.jsx("li", { className: n ? "muncher-li featured" : "muncher-li", children: /* @__PURE__ */ e.jsx(
|
|
1746
1757
|
N,
|
|
@@ -1796,7 +1807,7 @@ const Re = ({ variant: n, collapsed: t, children: r }) => {
|
|
|
1796
1807
|
const i = "muncher-hr" + (n ? " muncher-hr--" + n : "") + (t ? " muncher-hr--" + t : "") + (r ? " muncher-hr--" + r : "");
|
|
1797
1808
|
return /* @__PURE__ */ e.jsx("hr", { className: i });
|
|
1798
1809
|
}, Ue = ({ sliderItems: n, navButtonSize: t = "large", navButtonWeight: r = 2, variant: i, navIcon: c, navButtonPlacement: a = "inside" }) => {
|
|
1799
|
-
const [o, x] =
|
|
1810
|
+
const [o, x] = S(0), [j, u] = S(0), d = () => n.length > 1 && o > 0 ? /* @__PURE__ */ e.jsx(
|
|
1800
1811
|
xe,
|
|
1801
1812
|
{
|
|
1802
1813
|
direction: "left",
|
|
@@ -1929,7 +1940,7 @@ const Re = ({ variant: n, collapsed: t, children: r }) => {
|
|
|
1929
1940
|
};
|
|
1930
1941
|
return /* @__PURE__ */ e.jsx("span", { className: a(), style: c, ...i });
|
|
1931
1942
|
}, qe = ({ handleTabSelected: n, children: t }) => {
|
|
1932
|
-
const [r, i] =
|
|
1943
|
+
const [r, i] = S(0), { tabs: c } = t, a = (o) => {
|
|
1933
1944
|
i(o), n && n(o);
|
|
1934
1945
|
};
|
|
1935
1946
|
return /* @__PURE__ */ e.jsxs("section", { className: "muncher-tabs", children: [
|
|
@@ -1977,23 +1988,23 @@ const Re = ({ variant: n, collapsed: t, children: r }) => {
|
|
|
1977
1988
|
footer: h,
|
|
1978
1989
|
children: p
|
|
1979
1990
|
}) => {
|
|
1980
|
-
const { header: f, rows:
|
|
1981
|
-
|
|
1991
|
+
const { header: f, rows: g } = p, [b, E] = S(c ?? { index: 0 }), [v, k] = S({ num: 0, size: t }), T = (m) => {
|
|
1992
|
+
E(
|
|
1982
1993
|
(M) => M.index === m ? { ...M, desc: !M.desc } : { index: m }
|
|
1983
1994
|
);
|
|
1984
|
-
},
|
|
1985
|
-
var
|
|
1986
|
-
const m = [...
|
|
1995
|
+
}, R = te(() => {
|
|
1996
|
+
var A;
|
|
1997
|
+
const m = [...g], M = (A = f[b.index]) == null ? void 0 : A.sort;
|
|
1987
1998
|
return M ? m.sort(M) : m.sort((L, X) => {
|
|
1988
1999
|
var $, Y, U, W;
|
|
1989
|
-
const Z = ((Y = ($ = L[
|
|
2000
|
+
const Z = ((Y = ($ = L[b.index]) == null ? void 0 : $.value) == null ? void 0 : Y.toString().toLowerCase()) ?? "", I = ((W = (U = X[b.index]) == null ? void 0 : U.value) == null ? void 0 : W.toString().toLowerCase()) ?? "";
|
|
1990
2001
|
return Z.localeCompare(I);
|
|
1991
|
-
}),
|
|
1992
|
-
}, [
|
|
1993
|
-
() =>
|
|
1994
|
-
[
|
|
1995
|
-
), H = f.filter((m) => !m.csvExclude).map((m) => typeof m.name == "string" ? m.name : ""), P =
|
|
1996
|
-
(m) => m.filter((M,
|
|
2002
|
+
}), b.desc ? m.reverse() : m;
|
|
2003
|
+
}, [g, b, f]), C = te(
|
|
2004
|
+
() => R.slice(v.num * v.size, (v.num + 1) * v.size),
|
|
2005
|
+
[R, v]
|
|
2006
|
+
), H = f.filter((m) => !m.csvExclude).map((m) => typeof m.name == "string" ? m.name : ""), P = g.map(
|
|
2007
|
+
(m) => m.filter((M, A) => !f[A].csvExclude).map((M) => M.csv ?? M.value ?? "")
|
|
1997
2008
|
);
|
|
1998
2009
|
return /* @__PURE__ */ e.jsxs("section", { className: "muncher-table", children: [
|
|
1999
2010
|
/* @__PURE__ */ e.jsx("div", { className: "row head", children: f.map(
|
|
@@ -2005,9 +2016,9 @@ const Re = ({ variant: n, collapsed: t, children: r }) => {
|
|
|
2005
2016
|
children: typeof m.name == "string" ? /* @__PURE__ */ e.jsx("div", { className: "sort-button", children: /* @__PURE__ */ e.jsx(
|
|
2006
2017
|
Ne,
|
|
2007
2018
|
{
|
|
2008
|
-
onClick: () =>
|
|
2009
|
-
active:
|
|
2010
|
-
sortAsc: !
|
|
2019
|
+
onClick: () => T(M),
|
|
2020
|
+
active: b.index === M,
|
|
2021
|
+
sortAsc: !b.desc,
|
|
2011
2022
|
children: m.name
|
|
2012
2023
|
}
|
|
2013
2024
|
) }) : m.name
|
|
@@ -2015,12 +2026,12 @@ const Re = ({ variant: n, collapsed: t, children: r }) => {
|
|
|
2015
2026
|
`row-head-${M}`
|
|
2016
2027
|
)
|
|
2017
2028
|
) }),
|
|
2018
|
-
r ||
|
|
2019
|
-
(
|
|
2029
|
+
r || C.map((m, M) => /* @__PURE__ */ e.jsx("div", { className: "row", children: m.map(
|
|
2030
|
+
(A, L) => f[L].visibility === "hidden" ? null : /* @__PURE__ */ e.jsx(
|
|
2020
2031
|
"div",
|
|
2021
2032
|
{
|
|
2022
2033
|
className: f[L].visibility ? "col main" : "col",
|
|
2023
|
-
children:
|
|
2034
|
+
children: A.content
|
|
2024
2035
|
},
|
|
2025
2036
|
`row-col-${M}-${L}`
|
|
2026
2037
|
)
|
|
@@ -2062,16 +2073,16 @@ const Re = ({ variant: n, collapsed: t, children: r }) => {
|
|
|
2062
2073
|
{ label: "500", value: "500" }
|
|
2063
2074
|
],
|
|
2064
2075
|
value: String(v.size),
|
|
2065
|
-
onChange: (m) =>
|
|
2076
|
+
onChange: (m) => k({ num: 0, size: parseInt(m.target.value, 10) })
|
|
2066
2077
|
}
|
|
2067
2078
|
)
|
|
2068
2079
|
] }),
|
|
2069
2080
|
/* @__PURE__ */ e.jsxs("div", { className: "center", children: [
|
|
2070
2081
|
v.num * v.size + 1,
|
|
2071
2082
|
" -",
|
|
2072
|
-
Math.min((v.num + 1) * v.size,
|
|
2083
|
+
Math.min((v.num + 1) * v.size, g.length),
|
|
2073
2084
|
" of ",
|
|
2074
|
-
|
|
2085
|
+
g.length
|
|
2075
2086
|
] }),
|
|
2076
2087
|
/* @__PURE__ */ e.jsxs("div", { className: "right", children: [
|
|
2077
2088
|
/* @__PURE__ */ e.jsx(
|
|
@@ -2080,7 +2091,7 @@ const Re = ({ variant: n, collapsed: t, children: r }) => {
|
|
|
2080
2091
|
variant: "transparent",
|
|
2081
2092
|
disabled: v.num === 0,
|
|
2082
2093
|
size: "small",
|
|
2083
|
-
onClick: () =>
|
|
2094
|
+
onClick: () => k({ ...v, num: v.num - 1 }),
|
|
2084
2095
|
children: /* @__PURE__ */ e.jsx(N, { name: "chevron-left" })
|
|
2085
2096
|
}
|
|
2086
2097
|
),
|
|
@@ -2088,9 +2099,9 @@ const Re = ({ variant: n, collapsed: t, children: r }) => {
|
|
|
2088
2099
|
O,
|
|
2089
2100
|
{
|
|
2090
2101
|
variant: "transparent",
|
|
2091
|
-
disabled: (v.num + 1) * v.size >=
|
|
2102
|
+
disabled: (v.num + 1) * v.size >= g.length,
|
|
2092
2103
|
size: "small",
|
|
2093
|
-
onClick: () =>
|
|
2104
|
+
onClick: () => k({ ...v, num: v.num + 1 }),
|
|
2094
2105
|
children: /* @__PURE__ */ e.jsx(N, { name: "chevron-right" })
|
|
2095
2106
|
}
|
|
2096
2107
|
)
|
|
@@ -2104,7 +2115,7 @@ export {
|
|
|
2104
2115
|
me as Backdrop,
|
|
2105
2116
|
fe as Badge,
|
|
2106
2117
|
O as Button,
|
|
2107
|
-
|
|
2118
|
+
ze as Checkbox,
|
|
2108
2119
|
be as CopyButton,
|
|
2109
2120
|
we as CsvButton,
|
|
2110
2121
|
Me as CsvInput,
|
|
@@ -2114,7 +2125,7 @@ export {
|
|
|
2114
2125
|
Ye as Hr,
|
|
2115
2126
|
N as Icon,
|
|
2116
2127
|
Te as IconBadge,
|
|
2117
|
-
|
|
2128
|
+
Se as ImageInput,
|
|
2118
2129
|
ke as Input,
|
|
2119
2130
|
Ue as ItemSlider,
|
|
2120
2131
|
q as Label,
|