@hudoro/dropdown
Advanced tools
Comparing version 0.0.3-beta.18 to 0.0.3-beta.19
@@ -17,14 +17,14 @@ import q, { useState as Fr, useRef as fn, useEffect as Ir } from "react"; | ||
Tr = 1; | ||
var v = q, m = Symbol.for("react.element"), x = Symbol.for("react.fragment"), y = Object.prototype.hasOwnProperty, _ = v.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, O = { key: !0, ref: !0, __self: !0, __source: !0 }; | ||
function P(j, g, d) { | ||
var h, E = {}, C = null, F = null; | ||
d !== void 0 && (C = "" + d), g.key !== void 0 && (C = "" + g.key), g.ref !== void 0 && (F = g.ref); | ||
for (h in g) | ||
y.call(g, h) && !O.hasOwnProperty(h) && (E[h] = g[h]); | ||
var g = q, m = Symbol.for("react.element"), b = Symbol.for("react.fragment"), y = Object.prototype.hasOwnProperty, _ = g.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, O = { key: !0, ref: !0, __self: !0, __source: !0 }; | ||
function P(j, w, s) { | ||
var f, E = {}, C = null, F = null; | ||
s !== void 0 && (C = "" + s), w.key !== void 0 && (C = "" + w.key), w.ref !== void 0 && (F = w.ref); | ||
for (f in w) | ||
y.call(w, f) && !O.hasOwnProperty(f) && (E[f] = w[f]); | ||
if (j && j.defaultProps) | ||
for (h in g = j.defaultProps, g) | ||
E[h] === void 0 && (E[h] = g[h]); | ||
for (f in w = j.defaultProps, w) | ||
E[f] === void 0 && (E[f] = w[f]); | ||
return { $$typeof: m, type: j, key: C, ref: F, props: E, _owner: _.current }; | ||
} | ||
return L.Fragment = x, L.jsx = P, L.jsxs = P, L; | ||
return L.Fragment = b, L.jsx = P, L.jsxs = P, L; | ||
} | ||
@@ -44,3 +44,3 @@ var N = {}; | ||
return Sr || (Sr = 1, process.env.NODE_ENV !== "production" && function() { | ||
var v = q, m = Symbol.for("react.element"), x = Symbol.for("react.portal"), y = Symbol.for("react.fragment"), _ = Symbol.for("react.strict_mode"), O = Symbol.for("react.profiler"), P = Symbol.for("react.provider"), j = Symbol.for("react.context"), g = Symbol.for("react.forward_ref"), d = Symbol.for("react.suspense"), h = Symbol.for("react.suspense_list"), E = Symbol.for("react.memo"), C = Symbol.for("react.lazy"), F = Symbol.for("react.offscreen"), z = Symbol.iterator, J = "@@iterator"; | ||
var g = q, m = Symbol.for("react.element"), b = Symbol.for("react.portal"), y = Symbol.for("react.fragment"), _ = Symbol.for("react.strict_mode"), O = Symbol.for("react.profiler"), P = Symbol.for("react.provider"), j = Symbol.for("react.context"), w = Symbol.for("react.forward_ref"), s = Symbol.for("react.suspense"), f = Symbol.for("react.suspense_list"), E = Symbol.for("react.memo"), C = Symbol.for("react.lazy"), F = Symbol.for("react.offscreen"), z = Symbol.iterator, J = "@@iterator"; | ||
function u(r) { | ||
@@ -52,4 +52,4 @@ if (r === null || typeof r != "object") | ||
} | ||
var w = v.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; | ||
function f(r) { | ||
var v = g.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; | ||
function p(r) { | ||
{ | ||
@@ -63,8 +63,8 @@ for (var n = arguments.length, e = new Array(n > 1 ? n - 1 : 0), o = 1; o < n; o++) | ||
{ | ||
var o = w.ReactDebugCurrentFrame, a = o.getStackAddendum(); | ||
var o = v.ReactDebugCurrentFrame, a = o.getStackAddendum(); | ||
a !== "" && (n += "%s", e = e.concat([a])); | ||
var s = e.map(function(t) { | ||
var d = e.map(function(t) { | ||
return String(t); | ||
}); | ||
s.unshift("Warning: " + n), Function.prototype.apply.call(console[r], console, s); | ||
d.unshift("Warning: " + n), Function.prototype.apply.call(console[r], console, d); | ||
} | ||
@@ -75,3 +75,3 @@ } | ||
function Lr(r) { | ||
return !!(typeof r == "string" || typeof r == "function" || r === y || r === O || $r || r === _ || r === d || r === h || Wr || r === F || G || Dr || Ar || typeof r == "object" && r !== null && (r.$$typeof === C || r.$$typeof === E || r.$$typeof === P || r.$$typeof === j || r.$$typeof === g || // This needs to include all possible module reference object | ||
return !!(typeof r == "string" || typeof r == "function" || r === y || r === O || $r || r === _ || r === s || r === f || Wr || r === F || G || Dr || Ar || typeof r == "object" && r !== null && (r.$$typeof === C || r.$$typeof === E || r.$$typeof === P || r.$$typeof === j || r.$$typeof === w || // This needs to include all possible module reference object | ||
// types supported by any Flight configuration anywhere since | ||
@@ -95,3 +95,3 @@ // we don't know which Flight build this will end up being used | ||
return null; | ||
if (typeof r.tag == "number" && f("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof r == "function") | ||
if (typeof r.tag == "number" && p("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof r == "function") | ||
return r.displayName || r.name || null; | ||
@@ -103,3 +103,3 @@ if (typeof r == "string") | ||
return "Fragment"; | ||
case x: | ||
case b: | ||
return "Portal"; | ||
@@ -110,5 +110,5 @@ case O: | ||
return "StrictMode"; | ||
case d: | ||
case s: | ||
return "Suspense"; | ||
case h: | ||
case f: | ||
return "SuspenseList"; | ||
@@ -124,3 +124,3 @@ } | ||
return tr(e._context) + ".Provider"; | ||
case g: | ||
case w: | ||
return Nr(r, r.render, "ForwardRef"); | ||
@@ -131,5 +131,5 @@ case E: | ||
case C: { | ||
var a = r, s = a._payload, t = a._init; | ||
var a = r, d = a._payload, t = a._init; | ||
try { | ||
return T(t(s)); | ||
return T(t(d)); | ||
} catch { | ||
@@ -201,6 +201,6 @@ return null; | ||
} | ||
W < 0 && f("disabledDepth fell below zero. This is a bug in React. Please file an issue."); | ||
W < 0 && p("disabledDepth fell below zero. This is a bug in React. Please file an issue."); | ||
} | ||
} | ||
var K = w.ReactCurrentDispatcher, H; | ||
var K = v.ReactCurrentDispatcher, H; | ||
function Y(r, n, e) { | ||
@@ -236,4 +236,4 @@ { | ||
Error.prepareStackTrace = void 0; | ||
var s; | ||
s = K.current, K.current = null, zr(); | ||
var d; | ||
d = K.current, K.current = null, zr(); | ||
try { | ||
@@ -274,10 +274,10 @@ if (n) { | ||
for (var i = S.stack.split(` | ||
`), b = o.stack.split(` | ||
`), c = i.length - 1, p = b.length - 1; c >= 1 && p >= 0 && i[c] !== b[p]; ) | ||
p--; | ||
for (; c >= 1 && p >= 0; c--, p--) | ||
if (i[c] !== b[p]) { | ||
if (c !== 1 || p !== 1) | ||
`), x = o.stack.split(` | ||
`), c = i.length - 1, h = x.length - 1; c >= 1 && h >= 0 && i[c] !== x[h]; ) | ||
h--; | ||
for (; c >= 1 && h >= 0; c--, h--) | ||
if (i[c] !== x[h]) { | ||
if (c !== 1 || h !== 1) | ||
do | ||
if (c--, p--, p < 0 || i[c] !== b[p]) { | ||
if (c--, h--, h < 0 || i[c] !== x[h]) { | ||
var R = ` | ||
@@ -287,3 +287,3 @@ ` + i[c].replace(" at new ", " at "); | ||
} | ||
while (c >= 1 && p >= 0); | ||
while (c >= 1 && h >= 0); | ||
break; | ||
@@ -293,3 +293,3 @@ } | ||
} finally { | ||
X = !1, K.current = s, Yr(), Error.prepareStackTrace = a; | ||
X = !1, K.current = d, Yr(), Error.prepareStackTrace = a; | ||
} | ||
@@ -314,5 +314,5 @@ var A = r ? r.displayName || r.name : "", kr = A ? Y(A) : ""; | ||
switch (r) { | ||
case d: | ||
case s: | ||
return Y("Suspense"); | ||
case h: | ||
case f: | ||
return Y("SuspenseList"); | ||
@@ -322,3 +322,3 @@ } | ||
switch (r.$$typeof) { | ||
case g: | ||
case w: | ||
return Vr(r.render); | ||
@@ -328,5 +328,5 @@ case E: | ||
case C: { | ||
var o = r, a = o._payload, s = o._init; | ||
var o = r, a = o._payload, d = o._init; | ||
try { | ||
return V(s(a), n, e); | ||
return V(d(a), n, e); | ||
} catch { | ||
@@ -338,3 +338,3 @@ } | ||
} | ||
var U = Object.prototype.hasOwnProperty, vr = {}, gr = w.ReactDebugCurrentFrame; | ||
var U = Object.prototype.hasOwnProperty, vr = {}, gr = v.ReactDebugCurrentFrame; | ||
function B(r) { | ||
@@ -349,10 +349,10 @@ if (r) { | ||
{ | ||
var s = Function.call.bind(U); | ||
var d = Function.call.bind(U); | ||
for (var t in r) | ||
if (s(r, t)) { | ||
if (d(r, t)) { | ||
var i = void 0; | ||
try { | ||
if (typeof r[t] != "function") { | ||
var b = Error((o || "React class") + ": " + e + " type `" + t + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof r[t] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`."); | ||
throw b.name = "Invariant Violation", b; | ||
var x = Error((o || "React class") + ": " + e + " type `" + t + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof r[t] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`."); | ||
throw x.name = "Invariant Violation", x; | ||
} | ||
@@ -363,3 +363,3 @@ i = r[t](n, t, o, e, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"); | ||
} | ||
i && !(i instanceof Error) && (B(a), f("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", o || "React class", e, t, typeof i), B(null)), i instanceof Error && !(i.message in vr) && (vr[i.message] = !0, B(a), f("Failed %s type: %s", e, i.message), B(null)); | ||
i && !(i instanceof Error) && (B(a), p("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", o || "React class", e, t, typeof i), B(null)), i instanceof Error && !(i.message in vr) && (vr[i.message] = !0, B(a), p("Failed %s type: %s", e, i.message), B(null)); | ||
} | ||
@@ -390,5 +390,5 @@ } | ||
if (Gr(r)) | ||
return f("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Jr(r)), wr(r); | ||
return p("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Jr(r)), wr(r); | ||
} | ||
var $ = w.ReactCurrentOwner, Kr = { | ||
var $ = v.ReactCurrentOwner, Kr = { | ||
key: !0, | ||
@@ -419,3 +419,3 @@ ref: !0, | ||
var e = T($.current.type); | ||
Q[e] || (f('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', T($.current.type), r.ref), Q[e] = !0); | ||
Q[e] || (p('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', T($.current.type), r.ref), Q[e] = !0); | ||
} | ||
@@ -426,3 +426,3 @@ } | ||
var e = function() { | ||
br || (br = !0, f("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", n)); | ||
br || (br = !0, p("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", n)); | ||
}; | ||
@@ -438,3 +438,3 @@ e.isReactWarning = !0, Object.defineProperty(r, "key", { | ||
var e = function() { | ||
xr || (xr = !0, f("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", n)); | ||
xr || (xr = !0, p("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", n)); | ||
}; | ||
@@ -447,3 +447,3 @@ e.isReactWarning = !0, Object.defineProperty(r, "ref", { | ||
} | ||
var nn = function(r, n, e, o, a, s, t) { | ||
var nn = function(r, n, e, o, a, d, t) { | ||
var i = { | ||
@@ -458,3 +458,3 @@ // This tag allows us to uniquely identify this as a React Element | ||
// Record the component responsible for creating this element. | ||
_owner: s | ||
_owner: d | ||
}; | ||
@@ -480,19 +480,19 @@ return i._store = {}, Object.defineProperty(i._store, "validated", { | ||
{ | ||
var s, t = {}, i = null, b = null; | ||
e !== void 0 && (mr(e), i = "" + e), Xr(n) && (mr(n.key), i = "" + n.key), Hr(n) && (b = n.ref, Zr(n, a)); | ||
for (s in n) | ||
U.call(n, s) && !Kr.hasOwnProperty(s) && (t[s] = n[s]); | ||
var d, t = {}, i = null, x = null; | ||
e !== void 0 && (mr(e), i = "" + e), Xr(n) && (mr(n.key), i = "" + n.key), Hr(n) && (x = n.ref, Zr(n, a)); | ||
for (d in n) | ||
U.call(n, d) && !Kr.hasOwnProperty(d) && (t[d] = n[d]); | ||
if (r && r.defaultProps) { | ||
var c = r.defaultProps; | ||
for (s in c) | ||
t[s] === void 0 && (t[s] = c[s]); | ||
for (d in c) | ||
t[d] === void 0 && (t[d] = c[d]); | ||
} | ||
if (i || b) { | ||
var p = typeof r == "function" ? r.displayName || r.name || "Unknown" : r; | ||
i && Qr(t, p), b && rn(t, p); | ||
if (i || x) { | ||
var h = typeof r == "function" ? r.displayName || r.name || "Unknown" : r; | ||
i && Qr(t, h), x && rn(t, h); | ||
} | ||
return nn(r, i, b, a, o, $.current, t); | ||
return nn(r, i, x, a, o, $.current, t); | ||
} | ||
} | ||
var rr = w.ReactCurrentOwner, yr = w.ReactDebugCurrentFrame; | ||
var rr = v.ReactCurrentOwner, yr = v.ReactDebugCurrentFrame; | ||
function D(r) { | ||
@@ -556,3 +556,3 @@ if (r) { | ||
var o = ""; | ||
r && r._owner && r._owner !== rr.current && (o = " It was passed a child from " + T(r._owner.type) + "."), D(r), f('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', e, o), D(null); | ||
r && r._owner && r._owner !== rr.current && (o = " It was passed a child from " + T(r._owner.type) + "."), D(r), p('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', e, o), D(null); | ||
} | ||
@@ -574,3 +574,3 @@ } | ||
if (typeof a == "function" && a !== r.entries) | ||
for (var s = a.call(r), t; !(t = s.next()).done; ) | ||
for (var d = a.call(r), t; !(t = d.next()).done; ) | ||
er(t.value) && _r(t.value, n); | ||
@@ -588,3 +588,3 @@ } | ||
e = n.propTypes; | ||
else if (typeof n == "object" && (n.$$typeof === g || // Note: Memo only checks outer props here. | ||
else if (typeof n == "object" && (n.$$typeof === w || // Note: Memo only checks outer props here. | ||
// Inner props are checked in the reconciler. | ||
@@ -601,5 +601,5 @@ n.$$typeof === E)) | ||
var a = T(n); | ||
f("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", a || "Unknown"); | ||
p("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", a || "Unknown"); | ||
} | ||
typeof n.getDefaultProps == "function" && !n.getDefaultProps.isReactClassApproved && f("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead."); | ||
typeof n.getDefaultProps == "function" && !n.getDefaultProps.isReactClassApproved && p("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead."); | ||
} | ||
@@ -612,10 +612,10 @@ } | ||
if (o !== "children" && o !== "key") { | ||
D(r), f("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", o), D(null); | ||
D(r), p("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", o), D(null); | ||
break; | ||
} | ||
} | ||
r.ref !== null && (D(r), f("Invalid attribute `ref` supplied to `React.Fragment`."), D(null)); | ||
r.ref !== null && (D(r), p("Invalid attribute `ref` supplied to `React.Fragment`."), D(null)); | ||
} | ||
} | ||
function Cr(r, n, e, o, a, s) { | ||
function Cr(r, n, e, o, a, d) { | ||
{ | ||
@@ -626,10 +626,10 @@ var t = Lr(r); | ||
(r === void 0 || typeof r == "object" && r !== null && Object.keys(r).length === 0) && (i += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports."); | ||
var b = on(a); | ||
b ? i += b : i += Er(); | ||
var x = on(a); | ||
x ? i += x : i += Er(); | ||
var c; | ||
r === null ? c = "null" : Z(r) ? c = "array" : r !== void 0 && r.$$typeof === m ? (c = "<" + (T(r.type) || "Unknown") + " />", i = " Did you accidentally export a JSX literal instead of a component?") : c = typeof r, f("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", c, i); | ||
r === null ? c = "null" : Z(r) ? c = "array" : r !== void 0 && r.$$typeof === m ? (c = "<" + (T(r.type) || "Unknown") + " />", i = " Did you accidentally export a JSX literal instead of a component?") : c = typeof r, p("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", c, i); | ||
} | ||
var p = en(r, n, e, a, s); | ||
if (p == null) | ||
return p; | ||
var h = en(r, n, e, a, d); | ||
if (h == null) | ||
return h; | ||
if (t) { | ||
@@ -644,7 +644,7 @@ var R = n.children; | ||
} else | ||
f("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."); | ||
p("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."); | ||
else | ||
jr(R, r); | ||
} | ||
return r === y ? sn(p) : an(p), p; | ||
return r === y ? sn(h) : an(h), h; | ||
} | ||
@@ -857,14 +857,14 @@ } | ||
`; | ||
function gn(v) { | ||
const [m, x] = Fr(v), y = fn(null), _ = (O) => { | ||
y.current && !y.current.contains(O.target) && x(!1); | ||
function gn(g) { | ||
const [m, b] = Fr(g), y = fn(null), _ = (O) => { | ||
y.current && !y.current.contains(O.target) && b(!1); | ||
}; | ||
return Ir(() => (document.addEventListener("click", _, !0), () => { | ||
document.removeEventListener("click", _, !0); | ||
}), []), { ref: y, isComponentVisible: m, setIsComponentVisible: x }; | ||
}), []), { ref: y, isComponentVisible: m, setIsComponentVisible: b }; | ||
} | ||
const Or = "hudoro-input-dropdown-styles", wn = (v) => { | ||
const Or = "hudoro-input-dropdown-styles", wn = (g) => { | ||
if (!document.getElementById(Or)) { | ||
const m = document.createElement("style"); | ||
m.id = Or, m.textContent = v, document.head.appendChild(m); | ||
m.id = Or, m.textContent = g, document.head.appendChild(m); | ||
} | ||
@@ -874,5 +874,5 @@ }; | ||
const yn = ({ | ||
dropdownLists: v, | ||
dropdownLists: g, | ||
onChange: m, | ||
defaultValue: x, | ||
defaultValue: b, | ||
size: y = "md", | ||
@@ -883,29 +883,33 @@ multiSelect: _, | ||
placeholder: j, | ||
onSearch: g | ||
onSearch: w | ||
}) => { | ||
const [d, h] = Fr([]), { isComponentVisible: E, ref: C, setIsComponentVisible: F } = gn(!1), z = () => { | ||
const [s, f] = Fr([]), { isComponentVisible: E, ref: C, setIsComponentVisible: F } = gn(!1), z = () => { | ||
F((u) => !u); | ||
}, J = (u, w) => { | ||
}, J = (u, v) => { | ||
if (!_) | ||
h([{ label: u, value: w }]), m([{ label: u, value: w }]), F(!1); | ||
else if (d == null ? void 0 : d.find((k) => k.value === w)) { | ||
f([{ label: u, value: v }]), m([{ label: u, value: v }]), F(!1); | ||
else if (s == null ? void 0 : s.find((k) => k.value === v)) { | ||
const k = [ | ||
...d ? d.filter((G) => G.value !== w) : [] | ||
...s ? s.filter((G) => G.value !== v) : [] | ||
]; | ||
h(k), m(k); | ||
f(k), m(k); | ||
} else { | ||
const k = [...d || [], { label: u, value: w }]; | ||
h(k), m(k); | ||
const k = [...s || [], { label: u, value: v }]; | ||
f(k), m(k); | ||
} | ||
}; | ||
return Ir(() => { | ||
if (x) { | ||
for (let u of x) | ||
if (d.findIndex((f) => f.value === u.value) < 0) { | ||
h(x); | ||
return; | ||
if (b) | ||
if (!s.length) | ||
f(b); | ||
else | ||
for (let u of b) { | ||
const v = s.findIndex((p) => p.value === u.value); | ||
if (v < 0) { | ||
console.log("position", v), console.log("value", s), console.log("defaultValue", b), f(s); | ||
return; | ||
} | ||
} | ||
} | ||
x != null && x.length || h([]); | ||
}, [x, v, d]), /* @__PURE__ */ l.jsxs( | ||
b != null && b.length || f([]); | ||
}, [b, g, s]), /* @__PURE__ */ l.jsxs( | ||
"div", | ||
@@ -922,3 +926,3 @@ { | ||
}) }) : null, | ||
/* @__PURE__ */ l.jsx("div", { className: "hsd-input-dropdown-container-preview-item", children: d.length ? _ ? d == null ? void 0 : d.map((u, w) => /* @__PURE__ */ l.jsx( | ||
/* @__PURE__ */ l.jsx("div", { className: "hsd-input-dropdown-container-preview-item", children: s.length ? _ ? s == null ? void 0 : s.map((u, v) => /* @__PURE__ */ l.jsx( | ||
"p", | ||
@@ -930,4 +934,4 @@ { | ||
}, | ||
w | ||
)) : /* @__PURE__ */ l.jsx("p", { style: { minWidth: "max-content" }, children: d == null ? void 0 : d[0].label }) : /* @__PURE__ */ l.jsx("p", { className: "hsd-input-dropdown-placeholder", children: j || "Search" }) }), | ||
v | ||
)) : /* @__PURE__ */ l.jsx("p", { style: { minWidth: "max-content" }, children: s == null ? void 0 : s[0].label }) : /* @__PURE__ */ l.jsx("p", { className: "hsd-input-dropdown-placeholder", children: j || "Search" }) }), | ||
/* @__PURE__ */ l.jsx(bn, { strokeWidth: 2, width: Pr(y) }) | ||
@@ -947,3 +951,3 @@ ] }), | ||
onChange: (u) => { | ||
g && g(u.target.value); | ||
w && w(u.target.value); | ||
} | ||
@@ -953,6 +957,6 @@ } | ||
] }) : null, | ||
/* @__PURE__ */ l.jsx("div", { className: "hsd-input-dropdwon-item-container", children: v.map((u, w) => /* @__PURE__ */ l.jsxs( | ||
/* @__PURE__ */ l.jsx("div", { className: "hsd-input-dropdwon-item-container", children: g.map((u, v) => /* @__PURE__ */ l.jsxs( | ||
"div", | ||
{ | ||
className: `hsd-input-dropdwon-item ${d != null && d.find((f) => f.value === u.value) ? "active" : ""}`, | ||
className: `hsd-input-dropdwon-item ${s != null && s.find((p) => p.value === u.value) ? "active" : ""}`, | ||
onClick: () => J(u.label, u.value), | ||
@@ -969,3 +973,3 @@ children: [ | ||
}, | ||
w | ||
v | ||
)) }) | ||
@@ -978,7 +982,7 @@ ] | ||
); | ||
}, mn = ({ ...v }) => /* @__PURE__ */ l.jsxs( | ||
}, mn = ({ ...g }) => /* @__PURE__ */ l.jsxs( | ||
"svg", | ||
{ | ||
xmlns: "http://www.w3.org/2000/svg", | ||
...v, | ||
...g, | ||
viewBox: "0 0 20 20", | ||
@@ -1011,7 +1015,7 @@ fill: "none", | ||
} | ||
), bn = ({ ...v }) => /* @__PURE__ */ l.jsx( | ||
), bn = ({ ...g }) => /* @__PURE__ */ l.jsx( | ||
"svg", | ||
{ | ||
xmlns: "http://www.w3.org/2000/svg", | ||
...v, | ||
...g, | ||
viewBox: "0 0 24 24", | ||
@@ -1030,8 +1034,8 @@ fill: "none", | ||
} | ||
), Pr = (v) => { | ||
if (v === "sm") | ||
), Pr = (g) => { | ||
if (g === "sm") | ||
return 16; | ||
if (v === "md") | ||
if (g === "md") | ||
return 20; | ||
if (v === "lg") | ||
if (g === "lg") | ||
return 20; | ||
@@ -1038,0 +1042,0 @@ }; |
@@ -9,3 +9,3 @@ (function(F,E){typeof exports=="object"&&typeof module<"u"?E(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],E):(F=typeof globalThis<"u"?globalThis:F||self,E(F.Dropdown={},F.React))})(this,function(F,E){"use strict";var K={exports:{}},N={};/** | ||
* LICENSE file in the root directory of this source tree. | ||
*/var ir;function Fr(){if(ir)return N;ir=1;var v=E,m=Symbol.for("react.element"),y=Symbol.for("react.fragment"),x=Object.prototype.hasOwnProperty,j=v.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,P={key:!0,ref:!0,__self:!0,__source:!0};function D(C,g,d){var h,R={},T=null,I=null;d!==void 0&&(T=""+d),g.key!==void 0&&(T=""+g.key),g.ref!==void 0&&(I=g.ref);for(h in g)x.call(g,h)&&!P.hasOwnProperty(h)&&(R[h]=g[h]);if(C&&C.defaultProps)for(h in g=C.defaultProps,g)R[h]===void 0&&(R[h]=g[h]);return{$$typeof:m,type:C,key:T,ref:I,props:R,_owner:j.current}}return N.Fragment=y,N.jsx=D,N.jsxs=D,N}var z={};/** | ||
*/var ir;function Fr(){if(ir)return N;ir=1;var g=E,m=Symbol.for("react.element"),b=Symbol.for("react.fragment"),x=Object.prototype.hasOwnProperty,j=g.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,P={key:!0,ref:!0,__self:!0,__source:!0};function D(C,w,s){var f,R={},T=null,I=null;s!==void 0&&(T=""+s),w.key!==void 0&&(T=""+w.key),w.ref!==void 0&&(I=w.ref);for(f in w)x.call(w,f)&&!P.hasOwnProperty(f)&&(R[f]=w[f]);if(C&&C.defaultProps)for(f in w=C.defaultProps,w)R[f]===void 0&&(R[f]=w[f]);return{$$typeof:m,type:C,key:T,ref:I,props:R,_owner:j.current}}return N.Fragment=b,N.jsx=D,N.jsxs=D,N}var z={};/** | ||
* @license React | ||
@@ -18,7 +18,7 @@ * react-jsx-runtime.development.js | ||
* LICENSE file in the root directory of this source tree. | ||
*/var ar;function Ir(){return ar||(ar=1,process.env.NODE_ENV!=="production"&&function(){var v=E,m=Symbol.for("react.element"),y=Symbol.for("react.portal"),x=Symbol.for("react.fragment"),j=Symbol.for("react.strict_mode"),P=Symbol.for("react.profiler"),D=Symbol.for("react.provider"),C=Symbol.for("react.context"),g=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),h=Symbol.for("react.suspense_list"),R=Symbol.for("react.memo"),T=Symbol.for("react.lazy"),I=Symbol.for("react.offscreen"),V=Symbol.iterator,H="@@iterator";function l(r){if(r===null||typeof r!="object")return null;var n=V&&r[V]||r[H];return typeof n=="function"?n:null}var w=v.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function f(r){{for(var n=arguments.length,e=new Array(n>1?n-1:0),o=1;o<n;o++)e[o-1]=arguments[o];k("error",r,e)}}function k(r,n,e){{var o=w.ReactDebugCurrentFrame,a=o.getStackAddendum();a!==""&&(n+="%s",e=e.concat([a]));var s=e.map(function(i){return String(i)});s.unshift("Warning: "+n),Function.prototype.apply.call(console[r],console,s)}}var X=!1,Yr=!1,Mr=!1,Vr=!1,Ur=!1,ur;ur=Symbol.for("react.module.reference");function Br(r){return!!(typeof r=="string"||typeof r=="function"||r===x||r===P||Ur||r===j||r===d||r===h||Vr||r===I||X||Yr||Mr||typeof r=="object"&&r!==null&&(r.$$typeof===T||r.$$typeof===R||r.$$typeof===D||r.$$typeof===C||r.$$typeof===g||r.$$typeof===ur||r.getModuleId!==void 0))}function $r(r,n,e){var o=r.displayName;if(o)return o;var a=n.displayName||n.name||"";return a!==""?e+"("+a+")":e}function lr(r){return r.displayName||"Context"}function S(r){if(r==null)return null;if(typeof r.tag=="number"&&f("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof r=="function")return r.displayName||r.name||null;if(typeof r=="string")return r;switch(r){case x:return"Fragment";case y:return"Portal";case P:return"Profiler";case j:return"StrictMode";case d:return"Suspense";case h:return"SuspenseList"}if(typeof r=="object")switch(r.$$typeof){case C:var n=r;return lr(n)+".Consumer";case D:var e=r;return lr(e._context)+".Provider";case g:return $r(r,r.render,"ForwardRef");case R:var o=r.displayName||null;return o!==null?o:S(r.type)||"Memo";case T:{var a=r,s=a._payload,i=a._init;try{return S(i(s))}catch{return null}}}return null}var A=Object.assign,Y=0,cr,fr,pr,hr,vr,gr,wr;function mr(){}mr.__reactDisabledLog=!0;function Jr(){{if(Y===0){cr=console.log,fr=console.info,pr=console.warn,hr=console.error,vr=console.group,gr=console.groupCollapsed,wr=console.groupEnd;var r={configurable:!0,enumerable:!0,value:mr,writable:!0};Object.defineProperties(console,{info:r,log:r,warn:r,error:r,group:r,groupCollapsed:r,groupEnd:r})}Y++}}function Gr(){{if(Y--,Y===0){var r={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:A({},r,{value:cr}),info:A({},r,{value:fr}),warn:A({},r,{value:pr}),error:A({},r,{value:hr}),group:A({},r,{value:vr}),groupCollapsed:A({},r,{value:gr}),groupEnd:A({},r,{value:wr})})}Y<0&&f("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var Z=w.ReactCurrentDispatcher,q;function U(r,n,e){{if(q===void 0)try{throw Error()}catch(a){var o=a.stack.trim().match(/\n( *(at )?)/);q=o&&o[1]||""}return` | ||
`+q+r}}var Q=!1,B;{var Kr=typeof WeakMap=="function"?WeakMap:Map;B=new Kr}function br(r,n){if(!r||Q)return"";{var e=B.get(r);if(e!==void 0)return e}var o;Q=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var s;s=Z.current,Z.current=null,Jr();try{if(n){var i=function(){throw Error()};if(Object.defineProperty(i.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(i,[])}catch(O){o=O}Reflect.construct(r,[],i)}else{try{i.call()}catch(O){o=O}r.call(i.prototype)}}else{try{throw Error()}catch(O){o=O}r()}}catch(O){if(O&&o&&typeof O.stack=="string"){for(var t=O.stack.split(` | ||
`),b=o.stack.split(` | ||
`),c=t.length-1,p=b.length-1;c>=1&&p>=0&&t[c]!==b[p];)p--;for(;c>=1&&p>=0;c--,p--)if(t[c]!==b[p]){if(c!==1||p!==1)do if(c--,p--,p<0||t[c]!==b[p]){var _=` | ||
`+t[c].replace(" at new "," at ");return r.displayName&&_.includes("<anonymous>")&&(_=_.replace("<anonymous>",r.displayName)),typeof r=="function"&&B.set(r,_),_}while(c>=1&&p>=0);break}}}finally{Q=!1,Z.current=s,Gr(),Error.prepareStackTrace=a}var L=r?r.displayName||r.name:"",Dr=L?U(L):"";return typeof r=="function"&&B.set(r,Dr),Dr}function Hr(r,n,e){return br(r,!1)}function Xr(r){var n=r.prototype;return!!(n&&n.isReactComponent)}function $(r,n,e){if(r==null)return"";if(typeof r=="function")return br(r,Xr(r));if(typeof r=="string")return U(r);switch(r){case d:return U("Suspense");case h:return U("SuspenseList")}if(typeof r=="object")switch(r.$$typeof){case g:return Hr(r.render);case R:return $(r.type,n,e);case T:{var o=r,a=o._payload,s=o._init;try{return $(s(a),n,e)}catch{}}}return""}var J=Object.prototype.hasOwnProperty,yr={},xr=w.ReactDebugCurrentFrame;function G(r){if(r){var n=r._owner,e=$(r.type,r._source,n?n.type:null);xr.setExtraStackFrame(e)}else xr.setExtraStackFrame(null)}function Zr(r,n,e,o,a){{var s=Function.call.bind(J);for(var i in r)if(s(r,i)){var t=void 0;try{if(typeof r[i]!="function"){var b=Error((o||"React class")+": "+e+" type `"+i+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof r[i]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw b.name="Invariant Violation",b}t=r[i](n,i,o,e,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(c){t=c}t&&!(t instanceof Error)&&(G(a),f("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",o||"React class",e,i,typeof t),G(null)),t instanceof Error&&!(t.message in yr)&&(yr[t.message]=!0,G(a),f("Failed %s type: %s",e,t.message),G(null))}}}var qr=Array.isArray;function rr(r){return qr(r)}function Qr(r){{var n=typeof Symbol=="function"&&Symbol.toStringTag,e=n&&r[Symbol.toStringTag]||r.constructor.name||"Object";return e}}function rn(r){try{return Er(r),!1}catch{return!0}}function Er(r){return""+r}function Rr(r){if(rn(r))return f("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Qr(r)),Er(r)}var M=w.ReactCurrentOwner,nn={key:!0,ref:!0,__self:!0,__source:!0},_r,jr,nr;nr={};function en(r){if(J.call(r,"ref")){var n=Object.getOwnPropertyDescriptor(r,"ref").get;if(n&&n.isReactWarning)return!1}return r.ref!==void 0}function on(r){if(J.call(r,"key")){var n=Object.getOwnPropertyDescriptor(r,"key").get;if(n&&n.isReactWarning)return!1}return r.key!==void 0}function tn(r,n){if(typeof r.ref=="string"&&M.current&&n&&M.current.stateNode!==n){var e=S(M.current.type);nr[e]||(f('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',S(M.current.type),r.ref),nr[e]=!0)}}function an(r,n){{var e=function(){_r||(_r=!0,f("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",n))};e.isReactWarning=!0,Object.defineProperty(r,"key",{get:e,configurable:!0})}}function sn(r,n){{var e=function(){jr||(jr=!0,f("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",n))};e.isReactWarning=!0,Object.defineProperty(r,"ref",{get:e,configurable:!0})}}var dn=function(r,n,e,o,a,s,i){var t={$$typeof:m,type:r,key:n,ref:e,props:i,_owner:s};return t._store={},Object.defineProperty(t._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(t,"_self",{configurable:!1,enumerable:!1,writable:!1,value:o}),Object.defineProperty(t,"_source",{configurable:!1,enumerable:!1,writable:!1,value:a}),Object.freeze&&(Object.freeze(t.props),Object.freeze(t)),t};function un(r,n,e,o,a){{var s,i={},t=null,b=null;e!==void 0&&(Rr(e),t=""+e),on(n)&&(Rr(n.key),t=""+n.key),en(n)&&(b=n.ref,tn(n,a));for(s in n)J.call(n,s)&&!nn.hasOwnProperty(s)&&(i[s]=n[s]);if(r&&r.defaultProps){var c=r.defaultProps;for(s in c)i[s]===void 0&&(i[s]=c[s])}if(t||b){var p=typeof r=="function"?r.displayName||r.name||"Unknown":r;t&&an(i,p),b&&sn(i,p)}return dn(r,t,b,a,o,M.current,i)}}var er=w.ReactCurrentOwner,Cr=w.ReactDebugCurrentFrame;function W(r){if(r){var n=r._owner,e=$(r.type,r._source,n?n.type:null);Cr.setExtraStackFrame(e)}else Cr.setExtraStackFrame(null)}var or;or=!1;function tr(r){return typeof r=="object"&&r!==null&&r.$$typeof===m}function Tr(){{if(er.current){var r=S(er.current.type);if(r)return` | ||
*/var ar;function Ir(){return ar||(ar=1,process.env.NODE_ENV!=="production"&&function(){var g=E,m=Symbol.for("react.element"),b=Symbol.for("react.portal"),x=Symbol.for("react.fragment"),j=Symbol.for("react.strict_mode"),P=Symbol.for("react.profiler"),D=Symbol.for("react.provider"),C=Symbol.for("react.context"),w=Symbol.for("react.forward_ref"),s=Symbol.for("react.suspense"),f=Symbol.for("react.suspense_list"),R=Symbol.for("react.memo"),T=Symbol.for("react.lazy"),I=Symbol.for("react.offscreen"),V=Symbol.iterator,H="@@iterator";function l(r){if(r===null||typeof r!="object")return null;var n=V&&r[V]||r[H];return typeof n=="function"?n:null}var v=g.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function p(r){{for(var n=arguments.length,e=new Array(n>1?n-1:0),o=1;o<n;o++)e[o-1]=arguments[o];k("error",r,e)}}function k(r,n,e){{var o=v.ReactDebugCurrentFrame,a=o.getStackAddendum();a!==""&&(n+="%s",e=e.concat([a]));var d=e.map(function(i){return String(i)});d.unshift("Warning: "+n),Function.prototype.apply.call(console[r],console,d)}}var X=!1,Yr=!1,Mr=!1,Vr=!1,Ur=!1,ur;ur=Symbol.for("react.module.reference");function Br(r){return!!(typeof r=="string"||typeof r=="function"||r===x||r===P||Ur||r===j||r===s||r===f||Vr||r===I||X||Yr||Mr||typeof r=="object"&&r!==null&&(r.$$typeof===T||r.$$typeof===R||r.$$typeof===D||r.$$typeof===C||r.$$typeof===w||r.$$typeof===ur||r.getModuleId!==void 0))}function $r(r,n,e){var o=r.displayName;if(o)return o;var a=n.displayName||n.name||"";return a!==""?e+"("+a+")":e}function lr(r){return r.displayName||"Context"}function S(r){if(r==null)return null;if(typeof r.tag=="number"&&p("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof r=="function")return r.displayName||r.name||null;if(typeof r=="string")return r;switch(r){case x:return"Fragment";case b:return"Portal";case P:return"Profiler";case j:return"StrictMode";case s:return"Suspense";case f:return"SuspenseList"}if(typeof r=="object")switch(r.$$typeof){case C:var n=r;return lr(n)+".Consumer";case D:var e=r;return lr(e._context)+".Provider";case w:return $r(r,r.render,"ForwardRef");case R:var o=r.displayName||null;return o!==null?o:S(r.type)||"Memo";case T:{var a=r,d=a._payload,i=a._init;try{return S(i(d))}catch{return null}}}return null}var A=Object.assign,Y=0,cr,fr,pr,hr,vr,gr,wr;function mr(){}mr.__reactDisabledLog=!0;function Jr(){{if(Y===0){cr=console.log,fr=console.info,pr=console.warn,hr=console.error,vr=console.group,gr=console.groupCollapsed,wr=console.groupEnd;var r={configurable:!0,enumerable:!0,value:mr,writable:!0};Object.defineProperties(console,{info:r,log:r,warn:r,error:r,group:r,groupCollapsed:r,groupEnd:r})}Y++}}function Gr(){{if(Y--,Y===0){var r={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:A({},r,{value:cr}),info:A({},r,{value:fr}),warn:A({},r,{value:pr}),error:A({},r,{value:hr}),group:A({},r,{value:vr}),groupCollapsed:A({},r,{value:gr}),groupEnd:A({},r,{value:wr})})}Y<0&&p("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var Z=v.ReactCurrentDispatcher,q;function U(r,n,e){{if(q===void 0)try{throw Error()}catch(a){var o=a.stack.trim().match(/\n( *(at )?)/);q=o&&o[1]||""}return` | ||
`+q+r}}var Q=!1,B;{var Kr=typeof WeakMap=="function"?WeakMap:Map;B=new Kr}function br(r,n){if(!r||Q)return"";{var e=B.get(r);if(e!==void 0)return e}var o;Q=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var d;d=Z.current,Z.current=null,Jr();try{if(n){var i=function(){throw Error()};if(Object.defineProperty(i.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(i,[])}catch(O){o=O}Reflect.construct(r,[],i)}else{try{i.call()}catch(O){o=O}r.call(i.prototype)}}else{try{throw Error()}catch(O){o=O}r()}}catch(O){if(O&&o&&typeof O.stack=="string"){for(var t=O.stack.split(` | ||
`),y=o.stack.split(` | ||
`),c=t.length-1,h=y.length-1;c>=1&&h>=0&&t[c]!==y[h];)h--;for(;c>=1&&h>=0;c--,h--)if(t[c]!==y[h]){if(c!==1||h!==1)do if(c--,h--,h<0||t[c]!==y[h]){var _=` | ||
`+t[c].replace(" at new "," at ");return r.displayName&&_.includes("<anonymous>")&&(_=_.replace("<anonymous>",r.displayName)),typeof r=="function"&&B.set(r,_),_}while(c>=1&&h>=0);break}}}finally{Q=!1,Z.current=d,Gr(),Error.prepareStackTrace=a}var L=r?r.displayName||r.name:"",Dr=L?U(L):"";return typeof r=="function"&&B.set(r,Dr),Dr}function Hr(r,n,e){return br(r,!1)}function Xr(r){var n=r.prototype;return!!(n&&n.isReactComponent)}function $(r,n,e){if(r==null)return"";if(typeof r=="function")return br(r,Xr(r));if(typeof r=="string")return U(r);switch(r){case s:return U("Suspense");case f:return U("SuspenseList")}if(typeof r=="object")switch(r.$$typeof){case w:return Hr(r.render);case R:return $(r.type,n,e);case T:{var o=r,a=o._payload,d=o._init;try{return $(d(a),n,e)}catch{}}}return""}var J=Object.prototype.hasOwnProperty,yr={},xr=v.ReactDebugCurrentFrame;function G(r){if(r){var n=r._owner,e=$(r.type,r._source,n?n.type:null);xr.setExtraStackFrame(e)}else xr.setExtraStackFrame(null)}function Zr(r,n,e,o,a){{var d=Function.call.bind(J);for(var i in r)if(d(r,i)){var t=void 0;try{if(typeof r[i]!="function"){var y=Error((o||"React class")+": "+e+" type `"+i+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof r[i]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw y.name="Invariant Violation",y}t=r[i](n,i,o,e,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(c){t=c}t&&!(t instanceof Error)&&(G(a),p("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",o||"React class",e,i,typeof t),G(null)),t instanceof Error&&!(t.message in yr)&&(yr[t.message]=!0,G(a),p("Failed %s type: %s",e,t.message),G(null))}}}var qr=Array.isArray;function rr(r){return qr(r)}function Qr(r){{var n=typeof Symbol=="function"&&Symbol.toStringTag,e=n&&r[Symbol.toStringTag]||r.constructor.name||"Object";return e}}function rn(r){try{return Er(r),!1}catch{return!0}}function Er(r){return""+r}function Rr(r){if(rn(r))return p("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Qr(r)),Er(r)}var M=v.ReactCurrentOwner,nn={key:!0,ref:!0,__self:!0,__source:!0},_r,jr,nr;nr={};function en(r){if(J.call(r,"ref")){var n=Object.getOwnPropertyDescriptor(r,"ref").get;if(n&&n.isReactWarning)return!1}return r.ref!==void 0}function on(r){if(J.call(r,"key")){var n=Object.getOwnPropertyDescriptor(r,"key").get;if(n&&n.isReactWarning)return!1}return r.key!==void 0}function tn(r,n){if(typeof r.ref=="string"&&M.current&&n&&M.current.stateNode!==n){var e=S(M.current.type);nr[e]||(p('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',S(M.current.type),r.ref),nr[e]=!0)}}function an(r,n){{var e=function(){_r||(_r=!0,p("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",n))};e.isReactWarning=!0,Object.defineProperty(r,"key",{get:e,configurable:!0})}}function sn(r,n){{var e=function(){jr||(jr=!0,p("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",n))};e.isReactWarning=!0,Object.defineProperty(r,"ref",{get:e,configurable:!0})}}var dn=function(r,n,e,o,a,d,i){var t={$$typeof:m,type:r,key:n,ref:e,props:i,_owner:d};return t._store={},Object.defineProperty(t._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(t,"_self",{configurable:!1,enumerable:!1,writable:!1,value:o}),Object.defineProperty(t,"_source",{configurable:!1,enumerable:!1,writable:!1,value:a}),Object.freeze&&(Object.freeze(t.props),Object.freeze(t)),t};function un(r,n,e,o,a){{var d,i={},t=null,y=null;e!==void 0&&(Rr(e),t=""+e),on(n)&&(Rr(n.key),t=""+n.key),en(n)&&(y=n.ref,tn(n,a));for(d in n)J.call(n,d)&&!nn.hasOwnProperty(d)&&(i[d]=n[d]);if(r&&r.defaultProps){var c=r.defaultProps;for(d in c)i[d]===void 0&&(i[d]=c[d])}if(t||y){var h=typeof r=="function"?r.displayName||r.name||"Unknown":r;t&&an(i,h),y&&sn(i,h)}return dn(r,t,y,a,o,M.current,i)}}var er=v.ReactCurrentOwner,Cr=v.ReactDebugCurrentFrame;function W(r){if(r){var n=r._owner,e=$(r.type,r._source,n?n.type:null);Cr.setExtraStackFrame(e)}else Cr.setExtraStackFrame(null)}var or;or=!1;function tr(r){return typeof r=="object"&&r!==null&&r.$$typeof===m}function Tr(){{if(er.current){var r=S(er.current.type);if(r)return` | ||
@@ -29,3 +29,3 @@ Check the render method of \``+r+"`."}return""}}function ln(r){{if(r!==void 0){var n=r.fileName.replace(/^.*[\\\/]/,""),e=r.lineNumber;return` | ||
Check the top-level render call using <`+e+">.")}return n}}function Sr(r,n){{if(!r._store||r._store.validated||r.key!=null)return;r._store.validated=!0;var e=cn(n);if(kr[e])return;kr[e]=!0;var o="";r&&r._owner&&r._owner!==er.current&&(o=" It was passed a child from "+S(r._owner.type)+"."),W(r),f('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',e,o),W(null)}}function Or(r,n){{if(typeof r!="object")return;if(rr(r))for(var e=0;e<r.length;e++){var o=r[e];tr(o)&&Sr(o,n)}else if(tr(r))r._store&&(r._store.validated=!0);else if(r){var a=l(r);if(typeof a=="function"&&a!==r.entries)for(var s=a.call(r),i;!(i=s.next()).done;)tr(i.value)&&Sr(i.value,n)}}}function fn(r){{var n=r.type;if(n==null||typeof n=="string")return;var e;if(typeof n=="function")e=n.propTypes;else if(typeof n=="object"&&(n.$$typeof===g||n.$$typeof===R))e=n.propTypes;else return;if(e){var o=S(n);Zr(e,r.props,"prop",o,r)}else if(n.PropTypes!==void 0&&!or){or=!0;var a=S(n);f("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",a||"Unknown")}typeof n.getDefaultProps=="function"&&!n.getDefaultProps.isReactClassApproved&&f("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function pn(r){{for(var n=Object.keys(r.props),e=0;e<n.length;e++){var o=n[e];if(o!=="children"&&o!=="key"){W(r),f("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",o),W(null);break}}r.ref!==null&&(W(r),f("Invalid attribute `ref` supplied to `React.Fragment`."),W(null))}}function Pr(r,n,e,o,a,s){{var i=Br(r);if(!i){var t="";(r===void 0||typeof r=="object"&&r!==null&&Object.keys(r).length===0)&&(t+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var b=ln(a);b?t+=b:t+=Tr();var c;r===null?c="null":rr(r)?c="array":r!==void 0&&r.$$typeof===m?(c="<"+(S(r.type)||"Unknown")+" />",t=" Did you accidentally export a JSX literal instead of a component?"):c=typeof r,f("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",c,t)}var p=un(r,n,e,a,s);if(p==null)return p;if(i){var _=n.children;if(_!==void 0)if(o)if(rr(_)){for(var L=0;L<_.length;L++)Or(_[L],r);Object.freeze&&Object.freeze(_)}else f("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else Or(_,r)}return r===x?pn(p):fn(p),p}}function hn(r,n,e){return Pr(r,n,e,!0)}function vn(r,n,e){return Pr(r,n,e,!1)}var gn=vn,wn=hn;z.Fragment=x,z.jsx=gn,z.jsxs=wn}()),z}process.env.NODE_ENV==="production"?K.exports=Fr():K.exports=Ir();var u=K.exports;const Ar=`@import url("https://fonts.googleapis.com/css2?family=Poppins&display=swap"); | ||
Check the top-level render call using <`+e+">.")}return n}}function Sr(r,n){{if(!r._store||r._store.validated||r.key!=null)return;r._store.validated=!0;var e=cn(n);if(kr[e])return;kr[e]=!0;var o="";r&&r._owner&&r._owner!==er.current&&(o=" It was passed a child from "+S(r._owner.type)+"."),W(r),p('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',e,o),W(null)}}function Or(r,n){{if(typeof r!="object")return;if(rr(r))for(var e=0;e<r.length;e++){var o=r[e];tr(o)&&Sr(o,n)}else if(tr(r))r._store&&(r._store.validated=!0);else if(r){var a=l(r);if(typeof a=="function"&&a!==r.entries)for(var d=a.call(r),i;!(i=d.next()).done;)tr(i.value)&&Sr(i.value,n)}}}function fn(r){{var n=r.type;if(n==null||typeof n=="string")return;var e;if(typeof n=="function")e=n.propTypes;else if(typeof n=="object"&&(n.$$typeof===w||n.$$typeof===R))e=n.propTypes;else return;if(e){var o=S(n);Zr(e,r.props,"prop",o,r)}else if(n.PropTypes!==void 0&&!or){or=!0;var a=S(n);p("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",a||"Unknown")}typeof n.getDefaultProps=="function"&&!n.getDefaultProps.isReactClassApproved&&p("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function pn(r){{for(var n=Object.keys(r.props),e=0;e<n.length;e++){var o=n[e];if(o!=="children"&&o!=="key"){W(r),p("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",o),W(null);break}}r.ref!==null&&(W(r),p("Invalid attribute `ref` supplied to `React.Fragment`."),W(null))}}function Pr(r,n,e,o,a,d){{var i=Br(r);if(!i){var t="";(r===void 0||typeof r=="object"&&r!==null&&Object.keys(r).length===0)&&(t+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var y=ln(a);y?t+=y:t+=Tr();var c;r===null?c="null":rr(r)?c="array":r!==void 0&&r.$$typeof===m?(c="<"+(S(r.type)||"Unknown")+" />",t=" Did you accidentally export a JSX literal instead of a component?"):c=typeof r,p("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",c,t)}var h=un(r,n,e,a,d);if(h==null)return h;if(i){var _=n.children;if(_!==void 0)if(o)if(rr(_)){for(var L=0;L<_.length;L++)Or(_[L],r);Object.freeze&&Object.freeze(_)}else p("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else Or(_,r)}return r===x?pn(h):fn(h),h}}function hn(r,n,e){return Pr(r,n,e,!0)}function vn(r,n,e){return Pr(r,n,e,!1)}var gn=vn,wn=hn;z.Fragment=x,z.jsx=gn,z.jsxs=wn}()),z}process.env.NODE_ENV==="production"?K.exports=Fr():K.exports=Ir();var u=K.exports;const Ar=`@import url("https://fonts.googleapis.com/css2?family=Poppins&display=swap"); | ||
* { | ||
@@ -222,2 +222,2 @@ margin: 0; | ||
} | ||
`;function Wr(v){const[m,y]=E.useState(v),x=E.useRef(null),j=P=>{x.current&&!x.current.contains(P.target)&&y(!1)};return E.useEffect(()=>(document.addEventListener("click",j,!0),()=>{document.removeEventListener("click",j,!0)}),[]),{ref:x,isComponentVisible:m,setIsComponentVisible:y}}const sr="hudoro-input-dropdown-styles";(v=>{if(!document.getElementById(sr)){const m=document.createElement("style");m.id=sr,m.textContent=v,document.head.appendChild(m)}})(Ar);const Lr=({dropdownLists:v,onChange:m,defaultValue:y,size:x="md",multiSelect:j,searchAble:P,iconLeft:D,placeholder:C,onSearch:g})=>{const[d,h]=E.useState([]),{isComponentVisible:R,ref:T,setIsComponentVisible:I}=Wr(!1),V=()=>{I(l=>!l)},H=(l,w)=>{if(!j)h([{label:l,value:w}]),m([{label:l,value:w}]),I(!1);else if(d==null?void 0:d.find(k=>k.value===w)){const k=[...d?d.filter(X=>X.value!==w):[]];h(k),m(k)}else{const k=[...d||[],{label:l,value:w}];h(k),m(k)}};return E.useEffect(()=>{if(y){for(let l of y)if(d.findIndex(f=>f.value===l.value)<0){h(y);return}}y!=null&&y.length||h([])},[y,v,d]),u.jsxs("div",{className:`hsd-input-dropdown-container hsd-input-dropdown-size-${x} ${R?"active":""}`,ref:T,onClick:V,children:[u.jsxs("div",{className:"hsd-input-dropdown-preview-container",children:[D?u.jsx(u.Fragment,{children:E.cloneElement(D,{width:dr(x),color:"#939E99"})}):null,u.jsx("div",{className:"hsd-input-dropdown-container-preview-item",children:d.length?j?d==null?void 0:d.map((l,w)=>u.jsx("p",{style:{minWidth:"max-content"},className:"hsd-input-dropdown-preview-item",children:l==null?void 0:l.label},w)):u.jsx("p",{style:{minWidth:"max-content"},children:d==null?void 0:d[0].label}):u.jsx("p",{className:"hsd-input-dropdown-placeholder",children:C||"Search"})}),u.jsx(zr,{strokeWidth:2,width:dr(x)})]}),R?u.jsxs("div",{className:"hsd-input-dropdown-lists-container",onClick:l=>l.stopPropagation(),children:[P?u.jsxs("div",{className:"hsd-input-dropdown-container-dropdown-search",children:[u.jsx("div",{style:{display:"flex"},children:u.jsx(Nr,{strokeWidth:2,width:20})}),u.jsx("input",{onChange:l=>{g&&g(l.target.value)}})]}):null,u.jsx("div",{className:"hsd-input-dropdwon-item-container",children:v.map((l,w)=>u.jsxs("div",{className:`hsd-input-dropdwon-item ${d!=null&&d.find(f=>f.value===l.value)?"active":""}`,onClick:()=>H(l.label,l.value),children:[l.icon?u.jsx("div",{children:E.cloneElement(l.icon,{width:16})}):null,u.jsxs("div",{children:[" ",u.jsx("p",{children:l.label})]})]},w))})]}):null]})},Nr=({...v})=>u.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",...v,viewBox:"0 0 20 20",fill:"none",children:[u.jsx("circle",{cx:"9.80547",cy:"9.8055",r:"7.49047",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round"}),u.jsx("path",{d:"M15.0153 15.4043L17.9519 18.3333",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round"})]}),zr=({...v})=>u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",...v,viewBox:"0 0 24 24",fill:"none",color:"#1976D2",children:u.jsx("path",{d:"M4 9L12 17L20 9",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})}),dr=v=>{if(v==="sm")return 16;if(v==="md")return 20;if(v==="lg")return 20};F.Dropdown=Lr,Object.defineProperty(F,Symbol.toStringTag,{value:"Module"})}); | ||
`;function Wr(g){const[m,b]=E.useState(g),x=E.useRef(null),j=P=>{x.current&&!x.current.contains(P.target)&&b(!1)};return E.useEffect(()=>(document.addEventListener("click",j,!0),()=>{document.removeEventListener("click",j,!0)}),[]),{ref:x,isComponentVisible:m,setIsComponentVisible:b}}const sr="hudoro-input-dropdown-styles";(g=>{if(!document.getElementById(sr)){const m=document.createElement("style");m.id=sr,m.textContent=g,document.head.appendChild(m)}})(Ar);const Lr=({dropdownLists:g,onChange:m,defaultValue:b,size:x="md",multiSelect:j,searchAble:P,iconLeft:D,placeholder:C,onSearch:w})=>{const[s,f]=E.useState([]),{isComponentVisible:R,ref:T,setIsComponentVisible:I}=Wr(!1),V=()=>{I(l=>!l)},H=(l,v)=>{if(!j)f([{label:l,value:v}]),m([{label:l,value:v}]),I(!1);else if(s==null?void 0:s.find(k=>k.value===v)){const k=[...s?s.filter(X=>X.value!==v):[]];f(k),m(k)}else{const k=[...s||[],{label:l,value:v}];f(k),m(k)}};return E.useEffect(()=>{if(b)if(!s.length)f(b);else for(let l of b){const v=s.findIndex(p=>p.value===l.value);if(v<0){console.log("position",v),console.log("value",s),console.log("defaultValue",b),f(s);return}}b!=null&&b.length||f([])},[b,g,s]),u.jsxs("div",{className:`hsd-input-dropdown-container hsd-input-dropdown-size-${x} ${R?"active":""}`,ref:T,onClick:V,children:[u.jsxs("div",{className:"hsd-input-dropdown-preview-container",children:[D?u.jsx(u.Fragment,{children:E.cloneElement(D,{width:dr(x),color:"#939E99"})}):null,u.jsx("div",{className:"hsd-input-dropdown-container-preview-item",children:s.length?j?s==null?void 0:s.map((l,v)=>u.jsx("p",{style:{minWidth:"max-content"},className:"hsd-input-dropdown-preview-item",children:l==null?void 0:l.label},v)):u.jsx("p",{style:{minWidth:"max-content"},children:s==null?void 0:s[0].label}):u.jsx("p",{className:"hsd-input-dropdown-placeholder",children:C||"Search"})}),u.jsx(zr,{strokeWidth:2,width:dr(x)})]}),R?u.jsxs("div",{className:"hsd-input-dropdown-lists-container",onClick:l=>l.stopPropagation(),children:[P?u.jsxs("div",{className:"hsd-input-dropdown-container-dropdown-search",children:[u.jsx("div",{style:{display:"flex"},children:u.jsx(Nr,{strokeWidth:2,width:20})}),u.jsx("input",{onChange:l=>{w&&w(l.target.value)}})]}):null,u.jsx("div",{className:"hsd-input-dropdwon-item-container",children:g.map((l,v)=>u.jsxs("div",{className:`hsd-input-dropdwon-item ${s!=null&&s.find(p=>p.value===l.value)?"active":""}`,onClick:()=>H(l.label,l.value),children:[l.icon?u.jsx("div",{children:E.cloneElement(l.icon,{width:16})}):null,u.jsxs("div",{children:[" ",u.jsx("p",{children:l.label})]})]},v))})]}):null]})},Nr=({...g})=>u.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",...g,viewBox:"0 0 20 20",fill:"none",children:[u.jsx("circle",{cx:"9.80547",cy:"9.8055",r:"7.49047",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round"}),u.jsx("path",{d:"M15.0153 15.4043L17.9519 18.3333",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round"})]}),zr=({...g})=>u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",...g,viewBox:"0 0 24 24",fill:"none",color:"#1976D2",children:u.jsx("path",{d:"M4 9L12 17L20 9",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})}),dr=g=>{if(g==="sm")return 16;if(g==="md")return 20;if(g==="lg")return 20};F.Dropdown=Lr,Object.defineProperty(F,Symbol.toStringTag,{value:"Module"})}); |
{ | ||
"name": "@hudoro/dropdown", | ||
"version": "0.0.3-beta.18", | ||
"version": "0.0.3-beta.19", | ||
"description": "dropdown component for Hudoro UI", | ||
@@ -5,0 +5,0 @@ "author": "Prawito Hudoro", |
61906
1270