@hudoro/dropdown
Advanced tools
Comparing version 0.0.3-beta.29 to 0.0.3-beta.30
@@ -1,3 +0,3 @@ | ||
import K, { useState as dr, useRef as fn, useEffect as $r } from "react"; | ||
var sr = { exports: {} }, Y = {}; | ||
import J, { useState as er, useRef as zr, useEffect as H } from "react"; | ||
var pr = { exports: {} }, B = {}; | ||
/** | ||
@@ -12,21 +12,21 @@ * @license React | ||
*/ | ||
var Ir; | ||
var Wr; | ||
function pn() { | ||
if (Ir) | ||
return Y; | ||
Ir = 1; | ||
var v = K, w = Symbol.for("react.element"), E = Symbol.for("react.fragment"), m = Object.prototype.hasOwnProperty, R = v.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, S = { key: !0, ref: !0, __self: !0, __source: !0 }; | ||
function P(j, h, F) { | ||
var c, _ = {}, l = null, C = null; | ||
F !== void 0 && (l = "" + F), h.key !== void 0 && (l = "" + h.key), h.ref !== void 0 && (C = h.ref); | ||
for (c in h) | ||
m.call(h, c) && !S.hasOwnProperty(c) && (_[c] = h[c]); | ||
if (j && j.defaultProps) | ||
for (c in h = j.defaultProps, h) | ||
_[c] === void 0 && (_[c] = h[c]); | ||
return { $$typeof: w, type: j, key: l, ref: C, props: _, _owner: R.current }; | ||
if (Wr) | ||
return B; | ||
Wr = 1; | ||
var v = J, m = Symbol.for("react.element"), R = Symbol.for("react.fragment"), x = Object.prototype.hasOwnProperty, _ = v.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, S = { key: !0, ref: !0, __self: !0, __source: !0 }; | ||
function F(T, g, D) { | ||
var p, w = {}, O = null, l = null; | ||
D !== void 0 && (O = "" + D), g.key !== void 0 && (O = "" + g.key), g.ref !== void 0 && (l = g.ref); | ||
for (p in g) | ||
x.call(g, p) && !S.hasOwnProperty(p) && (w[p] = g[p]); | ||
if (T && T.defaultProps) | ||
for (p in g = T.defaultProps, g) | ||
w[p] === void 0 && (w[p] = g[p]); | ||
return { $$typeof: m, type: T, key: O, ref: l, props: w, _owner: _.current }; | ||
} | ||
return Y.Fragment = E, Y.jsx = P, Y.jsxs = P, Y; | ||
return B.Fragment = R, B.jsx = F, B.jsxs = F, B; | ||
} | ||
var z = {}; | ||
var q = {}; | ||
/** | ||
@@ -41,53 +41,53 @@ * @license React | ||
*/ | ||
var Dr; | ||
var $r; | ||
function hn() { | ||
return Dr || (Dr = 1, process.env.NODE_ENV !== "production" && function() { | ||
var v = K, w = Symbol.for("react.element"), E = Symbol.for("react.portal"), m = Symbol.for("react.fragment"), R = Symbol.for("react.strict_mode"), S = Symbol.for("react.profiler"), P = Symbol.for("react.provider"), j = Symbol.for("react.context"), h = Symbol.for("react.forward_ref"), F = Symbol.for("react.suspense"), c = Symbol.for("react.suspense_list"), _ = Symbol.for("react.memo"), l = Symbol.for("react.lazy"), C = Symbol.for("react.offscreen"), $ = Symbol.iterator, H = "@@iterator"; | ||
function V(r) { | ||
return $r || ($r = 1, process.env.NODE_ENV !== "production" && function() { | ||
var v = J, m = Symbol.for("react.element"), R = Symbol.for("react.portal"), x = Symbol.for("react.fragment"), _ = Symbol.for("react.strict_mode"), S = Symbol.for("react.profiler"), F = Symbol.for("react.provider"), T = Symbol.for("react.context"), g = Symbol.for("react.forward_ref"), D = Symbol.for("react.suspense"), p = Symbol.for("react.suspense_list"), w = Symbol.for("react.memo"), O = Symbol.for("react.lazy"), l = Symbol.for("react.offscreen"), A = Symbol.iterator, L = "@@iterator"; | ||
function N(r) { | ||
if (r === null || typeof r != "object") | ||
return null; | ||
var n = $ && r[$] || r[H]; | ||
var n = A && r[A] || r[L]; | ||
return typeof n == "function" ? n : null; | ||
} | ||
var I = v.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; | ||
function g(r) { | ||
var k = v.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; | ||
function h(r) { | ||
{ | ||
for (var n = arguments.length, e = new Array(n > 1 ? n - 1 : 0), o = 1; o < n; o++) | ||
e[o - 1] = arguments[o]; | ||
X("error", r, e); | ||
V("error", r, e); | ||
} | ||
} | ||
function X(r, n, e) { | ||
function V(r, n, e) { | ||
{ | ||
var o = I.ReactDebugCurrentFrame, a = o.getStackAddendum(); | ||
a !== "" && (n += "%s", e = e.concat([a])); | ||
var s = e.map(function(t) { | ||
return String(t); | ||
var o = k.ReactDebugCurrentFrame, d = o.getStackAddendum(); | ||
d !== "" && (n += "%s", e = e.concat([d])); | ||
var u = e.map(function(a) { | ||
return String(a); | ||
}); | ||
s.unshift("Warning: " + n), Function.prototype.apply.call(console[r], console, s); | ||
u.unshift("Warning: " + n), Function.prototype.apply.call(console[r], console, u); | ||
} | ||
} | ||
var d = !1, y = !1, M = !1, k = !1, Z = !1, ur; | ||
ur = Symbol.for("react.module.reference"); | ||
function Lr(r) { | ||
return !!(typeof r == "string" || typeof r == "function" || r === m || r === S || Z || r === R || r === F || r === c || k || r === C || d || y || M || typeof r == "object" && r !== null && (r.$$typeof === l || r.$$typeof === _ || r.$$typeof === P || r.$$typeof === j || r.$$typeof === h || // This needs to include all possible module reference object | ||
var G = !1, or = !1, K = !1, ir = !1, W = !1, i; | ||
i = Symbol.for("react.module.reference"); | ||
function b(r) { | ||
return !!(typeof r == "string" || typeof r == "function" || r === x || r === S || W || r === _ || r === D || r === p || ir || r === l || G || or || K || typeof r == "object" && r !== null && (r.$$typeof === O || r.$$typeof === w || r.$$typeof === F || r.$$typeof === T || r.$$typeof === g || // This needs to include all possible module reference object | ||
// types supported by any Flight configuration anywhere since | ||
// we don't know which Flight build this will end up being used | ||
// with. | ||
r.$$typeof === ur || r.getModuleId !== void 0)); | ||
r.$$typeof === i || r.getModuleId !== void 0)); | ||
} | ||
function Nr(r, n, e) { | ||
function I(r, n, e) { | ||
var o = r.displayName; | ||
if (o) | ||
return o; | ||
var a = n.displayName || n.name || ""; | ||
return a !== "" ? e + "(" + a + ")" : e; | ||
var d = n.displayName || n.name || ""; | ||
return d !== "" ? e + "(" + d + ")" : e; | ||
} | ||
function lr(r) { | ||
function j(r) { | ||
return r.displayName || "Context"; | ||
} | ||
function T(r) { | ||
function C(r) { | ||
if (r == null) | ||
return null; | ||
if (typeof r.tag == "number" && g("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" && h("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; | ||
@@ -97,13 +97,13 @@ if (typeof r == "string") | ||
switch (r) { | ||
case m: | ||
case x: | ||
return "Fragment"; | ||
case E: | ||
case R: | ||
return "Portal"; | ||
case S: | ||
return "Profiler"; | ||
case R: | ||
case _: | ||
return "StrictMode"; | ||
case F: | ||
case D: | ||
return "Suspense"; | ||
case c: | ||
case p: | ||
return "SuspenseList"; | ||
@@ -113,17 +113,17 @@ } | ||
switch (r.$$typeof) { | ||
case j: | ||
case T: | ||
var n = r; | ||
return lr(n) + ".Consumer"; | ||
case P: | ||
return j(n) + ".Consumer"; | ||
case F: | ||
var e = r; | ||
return lr(e._context) + ".Provider"; | ||
case h: | ||
return Nr(r, r.render, "ForwardRef"); | ||
case _: | ||
return j(e._context) + ".Provider"; | ||
case g: | ||
return I(r, r.render, "ForwardRef"); | ||
case w: | ||
var o = r.displayName || null; | ||
return o !== null ? o : T(r.type) || "Memo"; | ||
case l: { | ||
var a = r, s = a._payload, t = a._init; | ||
return o !== null ? o : C(r.type) || "Memo"; | ||
case O: { | ||
var d = r, u = d._payload, a = d._init; | ||
try { | ||
return T(t(s)); | ||
return C(a(u)); | ||
} catch { | ||
@@ -136,14 +136,14 @@ return null; | ||
} | ||
var D = Object.assign, L = 0, cr, fr, pr, hr, vr, gr, wr; | ||
function br() { | ||
var $ = Object.assign, M = 0, hr, vr, gr, wr, br, mr, yr; | ||
function xr() { | ||
} | ||
br.__reactDisabledLog = !0; | ||
xr.__reactDisabledLog = !0; | ||
function Yr() { | ||
{ | ||
if (L === 0) { | ||
cr = console.log, fr = console.info, pr = console.warn, hr = console.error, vr = console.group, gr = console.groupCollapsed, wr = console.groupEnd; | ||
if (M === 0) { | ||
hr = console.log, vr = console.info, gr = console.warn, wr = console.error, br = console.group, mr = console.groupCollapsed, yr = console.groupEnd; | ||
var r = { | ||
configurable: !0, | ||
enumerable: !0, | ||
value: br, | ||
value: xr, | ||
writable: !0 | ||
@@ -161,8 +161,8 @@ }; | ||
} | ||
L++; | ||
M++; | ||
} | ||
} | ||
function zr() { | ||
function Vr() { | ||
{ | ||
if (L--, L === 0) { | ||
if (M--, M === 0) { | ||
var r = { | ||
@@ -174,52 +174,52 @@ configurable: !0, | ||
Object.defineProperties(console, { | ||
log: D({}, r, { | ||
value: cr | ||
}), | ||
info: D({}, r, { | ||
value: fr | ||
}), | ||
warn: D({}, r, { | ||
value: pr | ||
}), | ||
error: D({}, r, { | ||
log: $({}, r, { | ||
value: hr | ||
}), | ||
group: D({}, r, { | ||
info: $({}, r, { | ||
value: vr | ||
}), | ||
groupCollapsed: D({}, r, { | ||
warn: $({}, r, { | ||
value: gr | ||
}), | ||
groupEnd: D({}, r, { | ||
error: $({}, r, { | ||
value: wr | ||
}), | ||
group: $({}, r, { | ||
value: br | ||
}), | ||
groupCollapsed: $({}, r, { | ||
value: mr | ||
}), | ||
groupEnd: $({}, r, { | ||
value: yr | ||
}) | ||
}); | ||
} | ||
L < 0 && g("disabledDepth fell below zero. This is a bug in React. Please file an issue."); | ||
M < 0 && h("disabledDepth fell below zero. This is a bug in React. Please file an issue."); | ||
} | ||
} | ||
var Q = I.ReactCurrentDispatcher, rr; | ||
function U(r, n, e) { | ||
var tr = k.ReactCurrentDispatcher, ar; | ||
function X(r, n, e) { | ||
{ | ||
if (rr === void 0) | ||
if (ar === void 0) | ||
try { | ||
throw Error(); | ||
} catch (a) { | ||
var o = a.stack.trim().match(/\n( *(at )?)/); | ||
rr = o && o[1] || ""; | ||
} catch (d) { | ||
var o = d.stack.trim().match(/\n( *(at )?)/); | ||
ar = o && o[1] || ""; | ||
} | ||
return ` | ||
` + rr + r; | ||
` + ar + r; | ||
} | ||
} | ||
var nr = !1, q; | ||
var dr = !1, Z; | ||
{ | ||
var Vr = typeof WeakMap == "function" ? WeakMap : Map; | ||
q = new Vr(); | ||
var Mr = typeof WeakMap == "function" ? WeakMap : Map; | ||
Z = new Mr(); | ||
} | ||
function mr(r, n) { | ||
if (!r || nr) | ||
function Er(r, n) { | ||
if (!r || dr) | ||
return ""; | ||
{ | ||
var e = q.get(r); | ||
var e = Z.get(r); | ||
if (e !== void 0) | ||
@@ -229,13 +229,13 @@ return e; | ||
var o; | ||
nr = !0; | ||
var a = Error.prepareStackTrace; | ||
dr = !0; | ||
var d = Error.prepareStackTrace; | ||
Error.prepareStackTrace = void 0; | ||
var s; | ||
s = Q.current, Q.current = null, Yr(); | ||
var u; | ||
u = tr.current, tr.current = null, Yr(); | ||
try { | ||
if (n) { | ||
var t = function() { | ||
var a = function() { | ||
throw Error(); | ||
}; | ||
if (Object.defineProperty(t.prototype, "props", { | ||
if (Object.defineProperty(a.prototype, "props", { | ||
set: function() { | ||
@@ -246,14 +246,14 @@ throw Error(); | ||
try { | ||
Reflect.construct(t, []); | ||
} catch (O) { | ||
o = O; | ||
Reflect.construct(a, []); | ||
} catch (P) { | ||
o = P; | ||
} | ||
Reflect.construct(r, [], t); | ||
Reflect.construct(r, [], a); | ||
} else { | ||
try { | ||
t.call(); | ||
} catch (O) { | ||
o = O; | ||
a.call(); | ||
} catch (P) { | ||
o = P; | ||
} | ||
r.call(t.prototype); | ||
r.call(a.prototype); | ||
} | ||
@@ -263,23 +263,23 @@ } else { | ||
throw Error(); | ||
} catch (O) { | ||
o = O; | ||
} catch (P) { | ||
o = P; | ||
} | ||
r(); | ||
} | ||
} catch (O) { | ||
if (O && o && typeof O.stack == "string") { | ||
for (var i = O.stack.split(` | ||
`), b = o.stack.split(` | ||
`), f = i.length - 1, p = b.length - 1; f >= 1 && p >= 0 && i[f] !== b[p]; ) | ||
p--; | ||
for (; f >= 1 && p >= 0; f--, p--) | ||
if (i[f] !== b[p]) { | ||
if (f !== 1 || p !== 1) | ||
} catch (P) { | ||
if (P && o && typeof P.stack == "string") { | ||
for (var t = P.stack.split(` | ||
`), y = o.stack.split(` | ||
`), c = t.length - 1, f = y.length - 1; c >= 1 && f >= 0 && t[c] !== y[f]; ) | ||
f--; | ||
for (; c >= 1 && f >= 0; c--, f--) | ||
if (t[c] !== y[f]) { | ||
if (c !== 1 || f !== 1) | ||
do | ||
if (f--, p--, p < 0 || i[f] !== b[p]) { | ||
var x = ` | ||
` + i[f].replace(" at new ", " at "); | ||
return r.displayName && x.includes("<anonymous>") && (x = x.replace("<anonymous>", r.displayName)), typeof r == "function" && q.set(r, x), x; | ||
if (c--, f--, f < 0 || t[c] !== y[f]) { | ||
var E = ` | ||
` + t[c].replace(" at new ", " at "); | ||
return r.displayName && E.includes("<anonymous>") && (E = E.replace("<anonymous>", r.displayName)), typeof r == "function" && Z.set(r, E), E; | ||
} | ||
while (f >= 1 && p >= 0); | ||
while (c >= 1 && f >= 0); | ||
break; | ||
@@ -289,37 +289,37 @@ } | ||
} finally { | ||
nr = !1, Q.current = s, zr(), Error.prepareStackTrace = a; | ||
dr = !1, tr.current = u, Vr(), Error.prepareStackTrace = d; | ||
} | ||
var W = r ? r.displayName || r.name : "", Fr = W ? U(W) : ""; | ||
return typeof r == "function" && q.set(r, Fr), Fr; | ||
var Y = r ? r.displayName || r.name : "", Ar = Y ? X(Y) : ""; | ||
return typeof r == "function" && Z.set(r, Ar), Ar; | ||
} | ||
function Mr(r, n, e) { | ||
return mr(r, !1); | ||
function Ur(r, n, e) { | ||
return Er(r, !1); | ||
} | ||
function Ur(r) { | ||
function Br(r) { | ||
var n = r.prototype; | ||
return !!(n && n.isReactComponent); | ||
} | ||
function B(r, n, e) { | ||
function Q(r, n, e) { | ||
if (r == null) | ||
return ""; | ||
if (typeof r == "function") | ||
return mr(r, Ur(r)); | ||
return Er(r, Br(r)); | ||
if (typeof r == "string") | ||
return U(r); | ||
return X(r); | ||
switch (r) { | ||
case F: | ||
return U("Suspense"); | ||
case c: | ||
return U("SuspenseList"); | ||
case D: | ||
return X("Suspense"); | ||
case p: | ||
return X("SuspenseList"); | ||
} | ||
if (typeof r == "object") | ||
switch (r.$$typeof) { | ||
case h: | ||
return Mr(r.render); | ||
case _: | ||
return B(r.type, n, e); | ||
case l: { | ||
var o = r, a = o._payload, s = o._init; | ||
case g: | ||
return Ur(r.render); | ||
case w: | ||
return Q(r.type, n, e); | ||
case O: { | ||
var o = r, d = o._payload, u = o._init; | ||
try { | ||
return B(s(a), n, e); | ||
return Q(u(d), n, e); | ||
} catch { | ||
@@ -331,32 +331,32 @@ } | ||
} | ||
var J = Object.prototype.hasOwnProperty, yr = {}, xr = I.ReactDebugCurrentFrame; | ||
function G(r) { | ||
var rr = Object.prototype.hasOwnProperty, Rr = {}, _r = k.ReactDebugCurrentFrame; | ||
function nr(r) { | ||
if (r) { | ||
var n = r._owner, e = B(r.type, r._source, n ? n.type : null); | ||
xr.setExtraStackFrame(e); | ||
var n = r._owner, e = Q(r.type, r._source, n ? n.type : null); | ||
_r.setExtraStackFrame(e); | ||
} else | ||
xr.setExtraStackFrame(null); | ||
_r.setExtraStackFrame(null); | ||
} | ||
function qr(r, n, e, o, a) { | ||
function qr(r, n, e, o, d) { | ||
{ | ||
var s = Function.call.bind(J); | ||
for (var t in r) | ||
if (s(r, t)) { | ||
var i = void 0; | ||
var u = Function.call.bind(rr); | ||
for (var a in r) | ||
if (u(r, a)) { | ||
var t = 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; | ||
if (typeof r[a] != "function") { | ||
var y = Error((o || "React class") + ": " + e + " type `" + a + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof r[a] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`."); | ||
throw y.name = "Invariant Violation", y; | ||
} | ||
i = r[t](n, t, o, e, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"); | ||
} catch (f) { | ||
i = f; | ||
t = r[a](n, a, o, e, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"); | ||
} catch (c) { | ||
t = c; | ||
} | ||
i && !(i instanceof Error) && (G(a), g("%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), G(null)), i instanceof Error && !(i.message in yr) && (yr[i.message] = !0, G(a), g("Failed %s type: %s", e, i.message), G(null)); | ||
t && !(t instanceof Error) && (nr(d), h("%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, a, typeof t), nr(null)), t instanceof Error && !(t.message in Rr) && (Rr[t.message] = !0, nr(d), h("Failed %s type: %s", e, t.message), nr(null)); | ||
} | ||
} | ||
} | ||
var Br = Array.isArray; | ||
function er(r) { | ||
return Br(r); | ||
var Hr = Array.isArray; | ||
function sr(r) { | ||
return Hr(r); | ||
} | ||
@@ -371,3 +371,3 @@ function Jr(r) { | ||
try { | ||
return Er(r), !1; | ||
return jr(r), !1; | ||
} catch { | ||
@@ -377,10 +377,10 @@ return !0; | ||
} | ||
function Er(r) { | ||
function jr(r) { | ||
return "" + r; | ||
} | ||
function Rr(r) { | ||
function Cr(r) { | ||
if (Gr(r)) | ||
return g("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Jr(r)), Er(r); | ||
return h("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Jr(r)), jr(r); | ||
} | ||
var N = I.ReactCurrentOwner, Kr = { | ||
var U = k.ReactCurrentOwner, Kr = { | ||
key: !0, | ||
@@ -390,6 +390,6 @@ ref: !0, | ||
__source: !0 | ||
}, _r, jr, or; | ||
or = {}; | ||
function Hr(r) { | ||
if (J.call(r, "ref")) { | ||
}, kr, Tr, ur; | ||
ur = {}; | ||
function Xr(r) { | ||
if (rr.call(r, "ref")) { | ||
var n = Object.getOwnPropertyDescriptor(r, "ref").get; | ||
@@ -401,4 +401,4 @@ if (n && n.isReactWarning) | ||
} | ||
function Xr(r) { | ||
if (J.call(r, "key")) { | ||
function Zr(r) { | ||
if (rr.call(r, "key")) { | ||
var n = Object.getOwnPropertyDescriptor(r, "key").get; | ||
@@ -410,12 +410,12 @@ if (n && n.isReactWarning) | ||
} | ||
function Zr(r, n) { | ||
if (typeof r.ref == "string" && N.current && n && N.current.stateNode !== n) { | ||
var e = T(N.current.type); | ||
or[e] || (g('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(N.current.type), r.ref), or[e] = !0); | ||
function Qr(r, n) { | ||
if (typeof r.ref == "string" && U.current && n && U.current.stateNode !== n) { | ||
var e = C(U.current.type); | ||
ur[e] || (h('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', C(U.current.type), r.ref), ur[e] = !0); | ||
} | ||
} | ||
function Qr(r, n) { | ||
function rn(r, n) { | ||
{ | ||
var e = function() { | ||
_r || (_r = !0, g("%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)); | ||
kr || (kr = !0, h("%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)); | ||
}; | ||
@@ -428,6 +428,6 @@ e.isReactWarning = !0, Object.defineProperty(r, "key", { | ||
} | ||
function rn(r, n) { | ||
function nn(r, n) { | ||
{ | ||
var e = function() { | ||
jr || (jr = !0, g("%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)); | ||
Tr || (Tr = !0, h("%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)); | ||
}; | ||
@@ -440,6 +440,6 @@ e.isReactWarning = !0, Object.defineProperty(r, "ref", { | ||
} | ||
var nn = function(r, n, e, o, a, s, t) { | ||
var i = { | ||
var en = function(r, n, e, o, d, u, a) { | ||
var t = { | ||
// This tag allows us to uniquely identify this as a React Element | ||
$$typeof: w, | ||
$$typeof: m, | ||
// Built-in properties that belong on the element | ||
@@ -449,7 +449,7 @@ type: r, | ||
ref: e, | ||
props: t, | ||
props: a, | ||
// Record the component responsible for creating this element. | ||
_owner: s | ||
_owner: u | ||
}; | ||
return i._store = {}, Object.defineProperty(i._store, "validated", { | ||
return t._store = {}, Object.defineProperty(t._store, "validated", { | ||
configurable: !1, | ||
@@ -459,3 +459,3 @@ enumerable: !1, | ||
value: !1 | ||
}), Object.defineProperty(i, "_self", { | ||
}), Object.defineProperty(t, "_self", { | ||
configurable: !1, | ||
@@ -465,44 +465,44 @@ enumerable: !1, | ||
value: o | ||
}), Object.defineProperty(i, "_source", { | ||
}), Object.defineProperty(t, "_source", { | ||
configurable: !1, | ||
enumerable: !1, | ||
writable: !1, | ||
value: a | ||
}), Object.freeze && (Object.freeze(i.props), Object.freeze(i)), i; | ||
value: d | ||
}), Object.freeze && (Object.freeze(t.props), Object.freeze(t)), t; | ||
}; | ||
function en(r, n, e, o, a) { | ||
function on(r, n, e, o, d) { | ||
{ | ||
var s, t = {}, i = null, b = null; | ||
e !== void 0 && (Rr(e), i = "" + e), Xr(n) && (Rr(n.key), i = "" + n.key), Hr(n) && (b = n.ref, Zr(n, a)); | ||
for (s in n) | ||
J.call(n, s) && !Kr.hasOwnProperty(s) && (t[s] = n[s]); | ||
var u, a = {}, t = null, y = null; | ||
e !== void 0 && (Cr(e), t = "" + e), Zr(n) && (Cr(n.key), t = "" + n.key), Xr(n) && (y = n.ref, Qr(n, d)); | ||
for (u in n) | ||
rr.call(n, u) && !Kr.hasOwnProperty(u) && (a[u] = n[u]); | ||
if (r && r.defaultProps) { | ||
var f = r.defaultProps; | ||
for (s in f) | ||
t[s] === void 0 && (t[s] = f[s]); | ||
var c = r.defaultProps; | ||
for (u in c) | ||
a[u] === void 0 && (a[u] = c[u]); | ||
} | ||
if (i || b) { | ||
var p = typeof r == "function" ? r.displayName || r.name || "Unknown" : r; | ||
i && Qr(t, p), b && rn(t, p); | ||
if (t || y) { | ||
var f = typeof r == "function" ? r.displayName || r.name || "Unknown" : r; | ||
t && rn(a, f), y && nn(a, f); | ||
} | ||
return nn(r, i, b, a, o, N.current, t); | ||
return en(r, t, y, d, o, U.current, a); | ||
} | ||
} | ||
var ir = I.ReactCurrentOwner, Cr = I.ReactDebugCurrentFrame; | ||
function A(r) { | ||
var lr = k.ReactCurrentOwner, Or = k.ReactDebugCurrentFrame; | ||
function z(r) { | ||
if (r) { | ||
var n = r._owner, e = B(r.type, r._source, n ? n.type : null); | ||
Cr.setExtraStackFrame(e); | ||
var n = r._owner, e = Q(r.type, r._source, n ? n.type : null); | ||
Or.setExtraStackFrame(e); | ||
} else | ||
Cr.setExtraStackFrame(null); | ||
Or.setExtraStackFrame(null); | ||
} | ||
var tr; | ||
tr = !1; | ||
function ar(r) { | ||
return typeof r == "object" && r !== null && r.$$typeof === w; | ||
var cr; | ||
cr = !1; | ||
function fr(r) { | ||
return typeof r == "object" && r !== null && r.$$typeof === m; | ||
} | ||
function kr() { | ||
function Pr() { | ||
{ | ||
if (ir.current) { | ||
var r = T(ir.current.type); | ||
if (lr.current) { | ||
var r = C(lr.current.type); | ||
if (r) | ||
@@ -516,3 +516,3 @@ return ` | ||
} | ||
function on(r) { | ||
function tn(r) { | ||
{ | ||
@@ -528,6 +528,6 @@ if (r !== void 0) { | ||
} | ||
var Tr = {}; | ||
function tn(r) { | ||
var Sr = {}; | ||
function an(r) { | ||
{ | ||
var n = kr(); | ||
var n = Pr(); | ||
if (!n) { | ||
@@ -542,3 +542,3 @@ var e = typeof r == "string" ? r : r.displayName || r.name; | ||
} | ||
function Or(r, n) { | ||
function Fr(r, n) { | ||
{ | ||
@@ -548,30 +548,30 @@ if (!r._store || r._store.validated || r.key != null) | ||
r._store.validated = !0; | ||
var e = tn(n); | ||
if (Tr[e]) | ||
var e = an(n); | ||
if (Sr[e]) | ||
return; | ||
Tr[e] = !0; | ||
Sr[e] = !0; | ||
var o = ""; | ||
r && r._owner && r._owner !== ir.current && (o = " It was passed a child from " + T(r._owner.type) + "."), A(r), g('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), A(null); | ||
r && r._owner && r._owner !== lr.current && (o = " It was passed a child from " + C(r._owner.type) + "."), z(r), h('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), z(null); | ||
} | ||
} | ||
function Sr(r, n) { | ||
function Dr(r, n) { | ||
{ | ||
if (typeof r != "object") | ||
return; | ||
if (er(r)) | ||
if (sr(r)) | ||
for (var e = 0; e < r.length; e++) { | ||
var o = r[e]; | ||
ar(o) && Or(o, n); | ||
fr(o) && Fr(o, n); | ||
} | ||
else if (ar(r)) | ||
else if (fr(r)) | ||
r._store && (r._store.validated = !0); | ||
else if (r) { | ||
var a = V(r); | ||
if (typeof a == "function" && a !== r.entries) | ||
for (var s = a.call(r), t; !(t = s.next()).done; ) | ||
ar(t.value) && Or(t.value, n); | ||
var d = N(r); | ||
if (typeof d == "function" && d !== r.entries) | ||
for (var u = d.call(r), a; !(a = u.next()).done; ) | ||
fr(a.value) && Fr(a.value, n); | ||
} | ||
} | ||
} | ||
function an(r) { | ||
function dn(r) { | ||
{ | ||
@@ -584,5 +584,5 @@ var n = r.type; | ||
e = n.propTypes; | ||
else if (typeof n == "object" && (n.$$typeof === h || // Note: Memo only checks outer props here. | ||
else if (typeof n == "object" && (n.$$typeof === g || // Note: Memo only checks outer props here. | ||
// Inner props are checked in the reconciler. | ||
n.$$typeof === _)) | ||
n.$$typeof === w)) | ||
e = n.propTypes; | ||
@@ -592,13 +592,13 @@ else | ||
if (e) { | ||
var o = T(n); | ||
var o = C(n); | ||
qr(e, r.props, "prop", o, r); | ||
} else if (n.PropTypes !== void 0 && !tr) { | ||
tr = !0; | ||
var a = T(n); | ||
g("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", a || "Unknown"); | ||
} else if (n.PropTypes !== void 0 && !cr) { | ||
cr = !0; | ||
var d = C(n); | ||
h("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", d || "Unknown"); | ||
} | ||
typeof n.getDefaultProps == "function" && !n.getDefaultProps.isReactClassApproved && g("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead."); | ||
typeof n.getDefaultProps == "function" && !n.getDefaultProps.isReactClassApproved && h("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead."); | ||
} | ||
} | ||
function dn(r) { | ||
function sn(r) { | ||
{ | ||
@@ -608,51 +608,51 @@ for (var n = Object.keys(r.props), e = 0; e < n.length; e++) { | ||
if (o !== "children" && o !== "key") { | ||
A(r), g("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", o), A(null); | ||
z(r), h("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", o), z(null); | ||
break; | ||
} | ||
} | ||
r.ref !== null && (A(r), g("Invalid attribute `ref` supplied to `React.Fragment`."), A(null)); | ||
r.ref !== null && (z(r), h("Invalid attribute `ref` supplied to `React.Fragment`."), z(null)); | ||
} | ||
} | ||
function Pr(r, n, e, o, a, s) { | ||
function Ir(r, n, e, o, d, u) { | ||
{ | ||
var t = Lr(r); | ||
if (!t) { | ||
var i = ""; | ||
(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 += kr(); | ||
var f; | ||
r === null ? f = "null" : er(r) ? f = "array" : r !== void 0 && r.$$typeof === w ? (f = "<" + (T(r.type) || "Unknown") + " />", i = " Did you accidentally export a JSX literal instead of a component?") : f = typeof r, g("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", f, i); | ||
var a = b(r); | ||
if (!a) { | ||
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 = tn(d); | ||
y ? t += y : t += Pr(); | ||
var c; | ||
r === null ? c = "null" : sr(r) ? c = "array" : r !== void 0 && r.$$typeof === m ? (c = "<" + (C(r.type) || "Unknown") + " />", t = " Did you accidentally export a JSX literal instead of a component?") : c = typeof r, h("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 = en(r, n, e, a, s); | ||
if (p == null) | ||
return p; | ||
if (t) { | ||
var x = n.children; | ||
if (x !== void 0) | ||
var f = on(r, n, e, d, u); | ||
if (f == null) | ||
return f; | ||
if (a) { | ||
var E = n.children; | ||
if (E !== void 0) | ||
if (o) | ||
if (er(x)) { | ||
for (var W = 0; W < x.length; W++) | ||
Sr(x[W], r); | ||
Object.freeze && Object.freeze(x); | ||
if (sr(E)) { | ||
for (var Y = 0; Y < E.length; Y++) | ||
Dr(E[Y], r); | ||
Object.freeze && Object.freeze(E); | ||
} else | ||
g("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."); | ||
h("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 | ||
Sr(x, r); | ||
Dr(E, r); | ||
} | ||
return r === m ? dn(p) : an(p), p; | ||
return r === x ? sn(f) : dn(f), f; | ||
} | ||
} | ||
function sn(r, n, e) { | ||
return Pr(r, n, e, !0); | ||
} | ||
function un(r, n, e) { | ||
return Pr(r, n, e, !1); | ||
return Ir(r, n, e, !0); | ||
} | ||
var ln = un, cn = sn; | ||
z.Fragment = m, z.jsx = ln, z.jsxs = cn; | ||
}()), z; | ||
function ln(r, n, e) { | ||
return Ir(r, n, e, !1); | ||
} | ||
var cn = ln, fn = un; | ||
q.Fragment = x, q.jsx = cn, q.jsxs = fn; | ||
}()), q; | ||
} | ||
process.env.NODE_ENV === "production" ? sr.exports = pn() : sr.exports = hn(); | ||
var u = sr.exports; | ||
process.env.NODE_ENV === "production" ? pr.exports = pn() : pr.exports = hn(); | ||
var s = pr.exports; | ||
const vn = `@import url("https://fonts.googleapis.com/css2?family=Poppins&display=swap"); | ||
@@ -800,5 +800,3 @@ * { | ||
position: absolute; | ||
top: 100%; | ||
left: 0; | ||
margin-top: var(--hsd-ui-dropdown-spacing-xs); | ||
padding: var(--hsd-ui-dropdown-spacing-sm); | ||
@@ -820,2 +818,11 @@ border: var(--hsd-ui-dropdown-border-width) solid | ||
.hsd-input-dropdown-lists-container-bottom { | ||
top: 100%; | ||
margin-top: var(--hsd-ui-dropdown-spacing-xs); | ||
} | ||
.hsd-input-dropdown-lists-container-top { | ||
bottom: 100%; | ||
margin-bottom: var(--hsd-ui-dropdown-spacing-xs); | ||
} | ||
.hsd-input-dropdown-container-dropdown-search { | ||
@@ -895,13 +902,13 @@ display: flex; | ||
function gn(v) { | ||
const [w, E] = dr(v), m = fn(null), R = (S) => { | ||
m.current && !m.current.contains(S.target) && E(!1); | ||
const [m, R] = er(v), x = zr(null), _ = (S) => { | ||
x.current && !x.current.contains(S.target) && R(!1); | ||
}; | ||
return $r(() => (document.addEventListener("click", R, !0), () => { | ||
document.removeEventListener("click", R, !0); | ||
}), []), { ref: m, isComponentVisible: w, setIsComponentVisible: E }; | ||
return H(() => (document.addEventListener("click", _, !0), () => { | ||
document.removeEventListener("click", _, !0); | ||
}), []), { ref: x, isComponentVisible: m, setIsComponentVisible: R }; | ||
} | ||
const Ar = "hudoro-input-dropdown-styles", wn = (v) => { | ||
if (!document.getElementById(Ar)) { | ||
const w = document.createElement("style"); | ||
w.id = Ar, w.textContent = v, document.head.appendChild(w); | ||
const Lr = "hudoro-input-dropdown-styles", wn = (v) => { | ||
if (!document.getElementById(Lr)) { | ||
const m = document.createElement("style"); | ||
m.id = Lr, m.textContent = v, document.head.appendChild(m); | ||
} | ||
@@ -912,31 +919,32 @@ }; | ||
dropdownLists: v, | ||
onChange: w, | ||
defaultValue: E, | ||
size: m = "md", | ||
multiSelect: R, | ||
onChange: m, | ||
defaultValue: R, | ||
size: x = "md", | ||
multiSelect: _, | ||
searchAble: S, | ||
iconLeft: P, | ||
placeholder: j, | ||
onSearch: h, | ||
error: F | ||
iconLeft: F, | ||
placeholder: T, | ||
onSearch: g, | ||
error: D, | ||
position: p | ||
}) => { | ||
const [c, _] = dr([]), [l, C] = dr([]), { isComponentVisible: $, ref: H, setIsComponentVisible: V } = gn(!1), I = () => { | ||
V((d) => !d); | ||
}, g = (d, y) => { | ||
if (!R) | ||
C([{ label: d, value: y }]), w([{ label: d, value: y }]), V(!1); | ||
else if (l == null ? void 0 : l.find((k) => k.value === y)) { | ||
const k = [ | ||
...l ? l.filter((Z) => Z.value !== y) : [] | ||
const [w, O] = er([]), [l, A] = er([]), [L, N] = er(""), k = zr(null), { isComponentVisible: h, ref: V, setIsComponentVisible: G } = gn(!1), or = () => { | ||
G((i) => !i); | ||
}, K = (i, b) => { | ||
if (!_) | ||
A([{ label: i, value: b }]), m([{ label: i, value: b }]), G(!1); | ||
else if (l == null ? void 0 : l.find((j) => j.value === b)) { | ||
const j = [ | ||
...l ? l.filter((C) => C.value !== b) : [] | ||
]; | ||
C(k), w(k); | ||
A(j), m(j); | ||
} else { | ||
const k = [...l || [], { label: d, value: y }]; | ||
C(k), w(k); | ||
const j = [...l || [], { label: i, value: b }]; | ||
A(j), m(j); | ||
} | ||
}; | ||
$r(() => { | ||
E && (C(E), _(E)); | ||
}, [E]); | ||
const X = () => l.length ? R ? l == null ? void 0 : l.map((d, y) => /* @__PURE__ */ u.jsx( | ||
H(() => { | ||
R && (A(R), O(R)); | ||
}, [R]); | ||
const ir = () => l.length ? _ ? l == null ? void 0 : l.map((i, b) => /* @__PURE__ */ s.jsx( | ||
"p", | ||
@@ -946,6 +954,6 @@ { | ||
className: "hsd-input-dropdown-preview-item", | ||
children: d == null ? void 0 : d.label | ||
children: i == null ? void 0 : i.label | ||
}, | ||
y | ||
)) : /* @__PURE__ */ u.jsx("p", { style: { minWidth: "max-content" }, children: l == null ? void 0 : l[0].label }) : c.length ? R ? c == null ? void 0 : c.map((d, y) => /* @__PURE__ */ u.jsx( | ||
b | ||
)) : /* @__PURE__ */ s.jsx("p", { style: { minWidth: "max-content" }, children: l == null ? void 0 : l[0].label }) : w.length ? _ ? w == null ? void 0 : w.map((i, b) => /* @__PURE__ */ s.jsx( | ||
"p", | ||
@@ -955,55 +963,100 @@ { | ||
className: "hsd-input-dropdown-preview-item", | ||
children: d == null ? void 0 : d.label | ||
children: i == null ? void 0 : i.label | ||
}, | ||
y | ||
)) : /* @__PURE__ */ u.jsx("p", { style: { minWidth: "max-content" }, children: c == null ? void 0 : c[0].label }) : /* @__PURE__ */ u.jsx("p", { className: "hsd-input-dropdown-placeholder", children: j || "Search" }); | ||
return /* @__PURE__ */ u.jsxs( | ||
b | ||
)) : /* @__PURE__ */ s.jsx("p", { style: { minWidth: "max-content" }, children: w == null ? void 0 : w[0].label }) : /* @__PURE__ */ s.jsx("p", { className: "hsd-input-dropdown-placeholder", children: T || "Search" }); | ||
H(() => { | ||
N(p || "bottom"); | ||
}, [p]); | ||
const W = () => { | ||
if (!p && V.current && k.current) { | ||
const i = window.innerHeight, b = V.current.getBoundingClientRect(), I = k.current.getBoundingClientRect(); | ||
b.bottom + I.height >= i - 10 ? N("top") : N(p || "bottom"); | ||
} | ||
}; | ||
return H(() => (window.addEventListener("scroll", W), window.addEventListener("resize", W), () => { | ||
window.removeEventListener("scroll", W), window.removeEventListener("resize", W); | ||
}), []), H(() => { | ||
W(); | ||
}, [h]), /* @__PURE__ */ s.jsxs( | ||
"div", | ||
{ | ||
className: `hsd-input-dropdown-container hsd-input-dropdown-size-${m} ${$ ? "active" : ""} ${F ? "error" : ""}`, | ||
ref: H, | ||
onClick: I, | ||
className: `hsd-input-dropdown-container hsd-input-dropdown-size-${x} ${h ? "active" : ""} ${D ? "error" : ""}`, | ||
ref: V, | ||
onClick: or, | ||
children: [ | ||
/* @__PURE__ */ u.jsxs("div", { className: "hsd-input-dropdown-preview-container", children: [ | ||
P ? /* @__PURE__ */ u.jsx(u.Fragment, { children: K.cloneElement(P, { | ||
width: Wr(m), | ||
/* @__PURE__ */ s.jsxs("div", { className: "hsd-input-dropdown-preview-container", children: [ | ||
F ? /* @__PURE__ */ s.jsx(s.Fragment, { children: J.cloneElement(F, { | ||
width: Nr(x), | ||
color: "#939E99" | ||
}) }) : null, | ||
/* @__PURE__ */ u.jsx("div", { className: "hsd-input-dropdown-container-preview-item", children: X() }), | ||
/* @__PURE__ */ u.jsx(mn, { strokeWidth: 2, width: Wr(m) }) | ||
/* @__PURE__ */ s.jsx("div", { className: "hsd-input-dropdown-container-preview-item", children: ir() }), | ||
/* @__PURE__ */ s.jsx(mn, { strokeWidth: 2, width: Nr(x) }) | ||
] }), | ||
$ ? /* @__PURE__ */ u.jsxs( | ||
h ? /* @__PURE__ */ s.jsxs( | ||
"div", | ||
{ | ||
className: "hsd-input-dropdown-lists-container", | ||
onClick: (d) => d.stopPropagation(), | ||
className: `hsd-input-dropdown-lists-container | ||
hsd-input-dropdown-lists-container-${L}`, | ||
onClick: (i) => i.stopPropagation(), | ||
ref: k, | ||
children: [ | ||
S ? /* @__PURE__ */ u.jsxs("div", { className: "hsd-input-dropdown-container-dropdown-search", children: [ | ||
/* @__PURE__ */ u.jsx("div", { style: { display: "flex" }, children: /* @__PURE__ */ u.jsx(bn, { strokeWidth: 2, width: 20 }) }), | ||
/* @__PURE__ */ u.jsx( | ||
"input", | ||
{ | ||
onChange: (d) => { | ||
h && h(d.target.value); | ||
} | ||
} | ||
) | ||
] }) : null, | ||
/* @__PURE__ */ u.jsx("div", { className: "hsd-input-dropdwon-item-container", children: v.map((d, y) => /* @__PURE__ */ u.jsxs( | ||
S ? /* @__PURE__ */ s.jsxs( | ||
"div", | ||
{ | ||
className: `hsd-input-dropdwon-item ${l != null && l.find((M) => M.value === d.value) ? "active" : ""} ${d.disable ? "hsd-input-dropdwon-item-disable" : null}`, | ||
onClick: () => g(d.label, d.value), | ||
className: "hsd-input-dropdown-container-dropdown-search", | ||
style: { order: L == "bottom" ? 1 : 2 }, | ||
children: [ | ||
d.icon ? /* @__PURE__ */ u.jsx("div", { children: K.cloneElement(d.icon, { | ||
width: 16 | ||
}) }) : null, | ||
/* @__PURE__ */ u.jsxs("div", { children: [ | ||
" ", | ||
/* @__PURE__ */ u.jsx("p", { children: d.label }) | ||
] }) | ||
/* @__PURE__ */ s.jsx("div", { style: { display: "flex" }, children: /* @__PURE__ */ s.jsx(bn, { strokeWidth: 2, width: 20 }) }), | ||
/* @__PURE__ */ s.jsx( | ||
"input", | ||
{ | ||
onChange: (i) => { | ||
g && g(i.target.value); | ||
} | ||
} | ||
) | ||
] | ||
}, | ||
y | ||
)) }) | ||
} | ||
) : null, | ||
/* @__PURE__ */ s.jsx( | ||
"div", | ||
{ | ||
className: "hsd-input-dropdwon-item-container", | ||
style: { order: L == "bottom" ? 2 : 1 }, | ||
children: L === "bottom" ? v.map((i, b) => /* @__PURE__ */ s.jsxs( | ||
"div", | ||
{ | ||
className: `hsd-input-dropdwon-item ${l != null && l.find((I) => I.value === i.value) ? "active" : ""} ${i.disable ? "hsd-input-dropdwon-item-disable" : null}`, | ||
onClick: () => K(i.label, i.value), | ||
children: [ | ||
i.icon ? /* @__PURE__ */ s.jsx("div", { children: J.cloneElement(i.icon, { | ||
width: 16 | ||
}) }) : null, | ||
/* @__PURE__ */ s.jsxs("div", { children: [ | ||
" ", | ||
/* @__PURE__ */ s.jsx("p", { children: i.label }) | ||
] }) | ||
] | ||
}, | ||
b | ||
)) : v.reverse().map((i, b) => /* @__PURE__ */ s.jsxs( | ||
"div", | ||
{ | ||
className: `hsd-input-dropdwon-item ${l != null && l.find((I) => I.value === i.value) ? "active" : ""} ${i.disable ? "hsd-input-dropdwon-item-disable" : null}`, | ||
onClick: () => K(i.label, i.value), | ||
children: [ | ||
i.icon ? /* @__PURE__ */ s.jsx("div", { children: J.cloneElement(i.icon, { | ||
width: 16 | ||
}) }) : null, | ||
/* @__PURE__ */ s.jsxs("div", { children: [ | ||
" ", | ||
/* @__PURE__ */ s.jsx("p", { children: i.label }) | ||
] }) | ||
] | ||
}, | ||
b | ||
)) | ||
} | ||
) | ||
] | ||
@@ -1015,3 +1068,3 @@ } | ||
); | ||
}, bn = ({ ...v }) => /* @__PURE__ */ u.jsxs( | ||
}, bn = ({ ...v }) => /* @__PURE__ */ s.jsxs( | ||
"svg", | ||
@@ -1024,3 +1077,3 @@ { | ||
children: [ | ||
/* @__PURE__ */ u.jsx( | ||
/* @__PURE__ */ s.jsx( | ||
"circle", | ||
@@ -1037,3 +1090,3 @@ { | ||
), | ||
/* @__PURE__ */ u.jsx( | ||
/* @__PURE__ */ s.jsx( | ||
"path", | ||
@@ -1050,3 +1103,3 @@ { | ||
} | ||
), mn = ({ ...v }) => /* @__PURE__ */ u.jsx( | ||
), mn = ({ ...v }) => /* @__PURE__ */ s.jsx( | ||
"svg", | ||
@@ -1059,3 +1112,3 @@ { | ||
color: "#1976D2", | ||
children: /* @__PURE__ */ u.jsx( | ||
children: /* @__PURE__ */ s.jsx( | ||
"path", | ||
@@ -1070,3 +1123,3 @@ { | ||
} | ||
), Wr = (v) => { | ||
), Nr = (v) => { | ||
if (v === "sm") | ||
@@ -1073,0 +1126,0 @@ return 16; |
@@ -1,2 +0,2 @@ | ||
(function(A,m){typeof exports=="object"&&typeof module<"u"?m(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],m):(A=typeof globalThis<"u"?globalThis:A||self,m(A.Dropdown={},A.React))})(this,function(A,m){"use strict";var X={exports:{}},Y={};/** | ||
(function(W,f){typeof exports=="object"&&typeof module<"u"?f(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],f):(W=typeof globalThis<"u"?globalThis:W||self,f(W.Dropdown={},W.React))})(this,function(W,f){"use strict";var er={exports:{}},U={};/** | ||
* @license React | ||
@@ -9,3 +9,3 @@ * react-jsx-runtime.production.min.js | ||
* LICENSE file in the root directory of this source tree. | ||
*/var ur;function Lr(){if(ur)return Y;ur=1;var v=m,w=Symbol.for("react.element"),R=Symbol.for("react.fragment"),y=Object.prototype.hasOwnProperty,_=v.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,P={key:!0,ref:!0,__self:!0,__source:!0};function F(C,h,I){var c,j={},l=null,T=null;I!==void 0&&(l=""+I),h.key!==void 0&&(l=""+h.key),h.ref!==void 0&&(T=h.ref);for(c in h)y.call(h,c)&&!P.hasOwnProperty(c)&&(j[c]=h[c]);if(C&&C.defaultProps)for(c in h=C.defaultProps,h)j[c]===void 0&&(j[c]=h[c]);return{$$typeof:w,type:C,key:l,ref:T,props:j,_owner:_.current}}return Y.Fragment=R,Y.jsx=F,Y.jsxs=F,Y}var z={};/** | ||
*/var pr;function Nr(){if(pr)return U;pr=1;var g=f,y=Symbol.for("react.element"),_=Symbol.for("react.fragment"),E=Object.prototype.hasOwnProperty,j=g.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,D={key:!0,ref:!0,__self:!0,__source:!0};function F(S,w,I){var h,b={},O=null,l=null;I!==void 0&&(O=""+I),w.key!==void 0&&(O=""+w.key),w.ref!==void 0&&(l=w.ref);for(h in w)E.call(w,h)&&!D.hasOwnProperty(h)&&(b[h]=w[h]);if(S&&S.defaultProps)for(h in w=S.defaultProps,w)b[h]===void 0&&(b[h]=w[h]);return{$$typeof:y,type:S,key:O,ref:l,props:b,_owner:j.current}}return U.Fragment=_,U.jsx=F,U.jsxs=F,U}var B={};/** | ||
* @license React | ||
@@ -18,13 +18,13 @@ * react-jsx-runtime.development.js | ||
* LICENSE file in the root directory of this source tree. | ||
*/var lr;function Nr(){return lr||(lr=1,process.env.NODE_ENV!=="production"&&function(){var v=m,w=Symbol.for("react.element"),R=Symbol.for("react.portal"),y=Symbol.for("react.fragment"),_=Symbol.for("react.strict_mode"),P=Symbol.for("react.profiler"),F=Symbol.for("react.provider"),C=Symbol.for("react.context"),h=Symbol.for("react.forward_ref"),I=Symbol.for("react.suspense"),c=Symbol.for("react.suspense_list"),j=Symbol.for("react.memo"),l=Symbol.for("react.lazy"),T=Symbol.for("react.offscreen"),V=Symbol.iterator,Z="@@iterator";function B(r){if(r===null||typeof r!="object")return null;var n=V&&r[V]||r[Z];return typeof n=="function"?n:null}var D=v.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function g(r){{for(var n=arguments.length,e=new Array(n>1?n-1:0),o=1;o<n;o++)e[o-1]=arguments[o];Q("error",r,e)}}function Q(r,n,e){{var o=D.ReactDebugCurrentFrame,a=o.getStackAddendum();a!==""&&(n+="%s",e=e.concat([a]));var s=e.map(function(t){return String(t)});s.unshift("Warning: "+n),Function.prototype.apply.call(console[r],console,s)}}var d=!1,x=!1,$=!1,k=!1,rr=!1,pr;pr=Symbol.for("react.module.reference");function Br(r){return!!(typeof r=="string"||typeof r=="function"||r===y||r===P||rr||r===_||r===I||r===c||k||r===T||d||x||$||typeof r=="object"&&r!==null&&(r.$$typeof===l||r.$$typeof===j||r.$$typeof===F||r.$$typeof===C||r.$$typeof===h||r.$$typeof===pr||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 hr(r){return r.displayName||"Context"}function S(r){if(r==null)return null;if(typeof r.tag=="number"&&g("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 y:return"Fragment";case R:return"Portal";case P:return"Profiler";case _:return"StrictMode";case I:return"Suspense";case c:return"SuspenseList"}if(typeof r=="object")switch(r.$$typeof){case C:var n=r;return hr(n)+".Consumer";case F:var e=r;return hr(e._context)+".Provider";case h:return $r(r,r.render,"ForwardRef");case j:var o=r.displayName||null;return o!==null?o:S(r.type)||"Memo";case l:{var a=r,s=a._payload,t=a._init;try{return S(t(s))}catch{return null}}}return null}var W=Object.assign,M=0,vr,gr,wr,br,mr,yr,xr;function Er(){}Er.__reactDisabledLog=!0;function Jr(){{if(M===0){vr=console.log,gr=console.info,wr=console.warn,br=console.error,mr=console.group,yr=console.groupCollapsed,xr=console.groupEnd;var r={configurable:!0,enumerable:!0,value:Er,writable:!0};Object.defineProperties(console,{info:r,log:r,warn:r,error:r,group:r,groupCollapsed:r,groupEnd:r})}M++}}function Gr(){{if(M--,M===0){var r={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:W({},r,{value:vr}),info:W({},r,{value:gr}),warn:W({},r,{value:wr}),error:W({},r,{value:br}),group:W({},r,{value:mr}),groupCollapsed:W({},r,{value:yr}),groupEnd:W({},r,{value:xr})})}M<0&&g("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var nr=D.ReactCurrentDispatcher,er;function J(r,n,e){{if(er===void 0)try{throw Error()}catch(a){var o=a.stack.trim().match(/\n( *(at )?)/);er=o&&o[1]||""}return` | ||
`+er+r}}var or=!1,G;{var qr=typeof WeakMap=="function"?WeakMap:Map;G=new qr}function Rr(r,n){if(!r||or)return"";{var e=G.get(r);if(e!==void 0)return e}var o;or=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var s;s=nr.current,nr.current=null,Jr();try{if(n){var t=function(){throw Error()};if(Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(O){o=O}Reflect.construct(r,[],t)}else{try{t.call()}catch(O){o=O}r.call(t.prototype)}}else{try{throw Error()}catch(O){o=O}r()}}catch(O){if(O&&o&&typeof O.stack=="string"){for(var i=O.stack.split(` | ||
`),b=o.stack.split(` | ||
`),f=i.length-1,p=b.length-1;f>=1&&p>=0&&i[f]!==b[p];)p--;for(;f>=1&&p>=0;f--,p--)if(i[f]!==b[p]){if(f!==1||p!==1)do if(f--,p--,p<0||i[f]!==b[p]){var E=` | ||
`+i[f].replace(" at new "," at ");return r.displayName&&E.includes("<anonymous>")&&(E=E.replace("<anonymous>",r.displayName)),typeof r=="function"&&G.set(r,E),E}while(f>=1&&p>=0);break}}}finally{or=!1,nr.current=s,Gr(),Error.prepareStackTrace=a}var N=r?r.displayName||r.name:"",Wr=N?J(N):"";return typeof r=="function"&&G.set(r,Wr),Wr}function Kr(r,n,e){return Rr(r,!1)}function Hr(r){var n=r.prototype;return!!(n&&n.isReactComponent)}function q(r,n,e){if(r==null)return"";if(typeof r=="function")return Rr(r,Hr(r));if(typeof r=="string")return J(r);switch(r){case I:return J("Suspense");case c:return J("SuspenseList")}if(typeof r=="object")switch(r.$$typeof){case h:return Kr(r.render);case j:return q(r.type,n,e);case l:{var o=r,a=o._payload,s=o._init;try{return q(s(a),n,e)}catch{}}}return""}var K=Object.prototype.hasOwnProperty,_r={},jr=D.ReactDebugCurrentFrame;function H(r){if(r){var n=r._owner,e=q(r.type,r._source,n?n.type:null);jr.setExtraStackFrame(e)}else jr.setExtraStackFrame(null)}function Xr(r,n,e,o,a){{var s=Function.call.bind(K);for(var t in r)if(s(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}i=r[t](n,t,o,e,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(f){i=f}i&&!(i instanceof Error)&&(H(a),g("%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),H(null)),i instanceof Error&&!(i.message in _r)&&(_r[i.message]=!0,H(a),g("Failed %s type: %s",e,i.message),H(null))}}}var Zr=Array.isArray;function ir(r){return Zr(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 Cr(r),!1}catch{return!0}}function Cr(r){return""+r}function Tr(r){if(rn(r))return g("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Qr(r)),Cr(r)}var U=D.ReactCurrentOwner,nn={key:!0,ref:!0,__self:!0,__source:!0},kr,Sr,tr;tr={};function en(r){if(K.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(K.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"&&U.current&&n&&U.current.stateNode!==n){var e=S(U.current.type);tr[e]||(g('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(U.current.type),r.ref),tr[e]=!0)}}function an(r,n){{var e=function(){kr||(kr=!0,g("%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 dn(r,n){{var e=function(){Sr||(Sr=!0,g("%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 sn=function(r,n,e,o,a,s,t){var i={$$typeof:w,type:r,key:n,ref:e,props:t,_owner:s};return i._store={},Object.defineProperty(i._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(i,"_self",{configurable:!1,enumerable:!1,writable:!1,value:o}),Object.defineProperty(i,"_source",{configurable:!1,enumerable:!1,writable:!1,value:a}),Object.freeze&&(Object.freeze(i.props),Object.freeze(i)),i};function un(r,n,e,o,a){{var s,t={},i=null,b=null;e!==void 0&&(Tr(e),i=""+e),on(n)&&(Tr(n.key),i=""+n.key),en(n)&&(b=n.ref,tn(n,a));for(s in n)K.call(n,s)&&!nn.hasOwnProperty(s)&&(t[s]=n[s]);if(r&&r.defaultProps){var f=r.defaultProps;for(s in f)t[s]===void 0&&(t[s]=f[s])}if(i||b){var p=typeof r=="function"?r.displayName||r.name||"Unknown":r;i&&an(t,p),b&&dn(t,p)}return sn(r,i,b,a,o,U.current,t)}}var ar=D.ReactCurrentOwner,Or=D.ReactDebugCurrentFrame;function L(r){if(r){var n=r._owner,e=q(r.type,r._source,n?n.type:null);Or.setExtraStackFrame(e)}else Or.setExtraStackFrame(null)}var dr;dr=!1;function sr(r){return typeof r=="object"&&r!==null&&r.$$typeof===w}function Pr(){{if(ar.current){var r=S(ar.current.type);if(r)return` | ||
*/var hr;function zr(){return hr||(hr=1,process.env.NODE_ENV!=="production"&&function(){var g=f,y=Symbol.for("react.element"),_=Symbol.for("react.portal"),E=Symbol.for("react.fragment"),j=Symbol.for("react.strict_mode"),D=Symbol.for("react.profiler"),F=Symbol.for("react.provider"),S=Symbol.for("react.context"),w=Symbol.for("react.forward_ref"),I=Symbol.for("react.suspense"),h=Symbol.for("react.suspense_list"),b=Symbol.for("react.memo"),O=Symbol.for("react.lazy"),l=Symbol.for("react.offscreen"),$=Symbol.iterator,z="@@iterator";function Y(r){if(r===null||typeof r!="object")return null;var n=$&&r[$]||r[z];return typeof n=="function"?n:null}var T=g.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function v(r){{for(var n=arguments.length,e=new Array(n>1?n-1:0),o=1;o<n;o++)e[o-1]=arguments[o];q("error",r,e)}}function q(r,n,e){{var o=T.ReactDebugCurrentFrame,d=o.getStackAddendum();d!==""&&(n+="%s",e=e.concat([d]));var u=e.map(function(a){return String(a)});u.unshift("Warning: "+n),Function.prototype.apply.call(console[r],console,u)}}var G=!1,or=!1,K=!1,ir=!1,L=!1,i;i=Symbol.for("react.module.reference");function m(r){return!!(typeof r=="string"||typeof r=="function"||r===E||r===D||L||r===j||r===I||r===h||ir||r===l||G||or||K||typeof r=="object"&&r!==null&&(r.$$typeof===O||r.$$typeof===b||r.$$typeof===F||r.$$typeof===S||r.$$typeof===w||r.$$typeof===i||r.getModuleId!==void 0))}function A(r,n,e){var o=r.displayName;if(o)return o;var d=n.displayName||n.name||"";return d!==""?e+"("+d+")":e}function C(r){return r.displayName||"Context"}function k(r){if(r==null)return null;if(typeof r.tag=="number"&&v("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 E:return"Fragment";case _:return"Portal";case D:return"Profiler";case j:return"StrictMode";case I:return"Suspense";case h:return"SuspenseList"}if(typeof r=="object")switch(r.$$typeof){case S:var n=r;return C(n)+".Consumer";case F:var e=r;return C(e._context)+".Provider";case w:return A(r,r.render,"ForwardRef");case b:var o=r.displayName||null;return o!==null?o:k(r.type)||"Memo";case O:{var d=r,u=d._payload,a=d._init;try{return k(a(u))}catch{return null}}}return null}var N=Object.assign,H=0,wr,br,mr,yr,xr,Er,Rr;function _r(){}_r.__reactDisabledLog=!0;function qr(){{if(H===0){wr=console.log,br=console.info,mr=console.warn,yr=console.error,xr=console.group,Er=console.groupCollapsed,Rr=console.groupEnd;var r={configurable:!0,enumerable:!0,value:_r,writable:!0};Object.defineProperties(console,{info:r,log:r,warn:r,error:r,group:r,groupCollapsed:r,groupEnd:r})}H++}}function Hr(){{if(H--,H===0){var r={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:N({},r,{value:wr}),info:N({},r,{value:br}),warn:N({},r,{value:mr}),error:N({},r,{value:yr}),group:N({},r,{value:xr}),groupCollapsed:N({},r,{value:Er}),groupEnd:N({},r,{value:Rr})})}H<0&&v("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var tr=T.ReactCurrentDispatcher,ar;function X(r,n,e){{if(ar===void 0)try{throw Error()}catch(d){var o=d.stack.trim().match(/\n( *(at )?)/);ar=o&&o[1]||""}return` | ||
`+ar+r}}var dr=!1,Z;{var Jr=typeof WeakMap=="function"?WeakMap:Map;Z=new Jr}function jr(r,n){if(!r||dr)return"";{var e=Z.get(r);if(e!==void 0)return e}var o;dr=!0;var d=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var u;u=tr.current,tr.current=null,qr();try{if(n){var a=function(){throw Error()};if(Object.defineProperty(a.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(a,[])}catch(P){o=P}Reflect.construct(r,[],a)}else{try{a.call()}catch(P){o=P}r.call(a.prototype)}}else{try{throw Error()}catch(P){o=P}r()}}catch(P){if(P&&o&&typeof P.stack=="string"){for(var t=P.stack.split(` | ||
`),x=o.stack.split(` | ||
`),c=t.length-1,p=x.length-1;c>=1&&p>=0&&t[c]!==x[p];)p--;for(;c>=1&&p>=0;c--,p--)if(t[c]!==x[p]){if(c!==1||p!==1)do if(c--,p--,p<0||t[c]!==x[p]){var R=` | ||
`+t[c].replace(" at new "," at ");return r.displayName&&R.includes("<anonymous>")&&(R=R.replace("<anonymous>",r.displayName)),typeof r=="function"&&Z.set(r,R),R}while(c>=1&&p>=0);break}}}finally{dr=!1,tr.current=u,Hr(),Error.prepareStackTrace=d}var M=r?r.displayName||r.name:"",Lr=M?X(M):"";return typeof r=="function"&&Z.set(r,Lr),Lr}function Gr(r,n,e){return jr(r,!1)}function Kr(r){var n=r.prototype;return!!(n&&n.isReactComponent)}function Q(r,n,e){if(r==null)return"";if(typeof r=="function")return jr(r,Kr(r));if(typeof r=="string")return X(r);switch(r){case I:return X("Suspense");case h:return X("SuspenseList")}if(typeof r=="object")switch(r.$$typeof){case w:return Gr(r.render);case b:return Q(r.type,n,e);case O:{var o=r,d=o._payload,u=o._init;try{return Q(u(d),n,e)}catch{}}}return""}var rr=Object.prototype.hasOwnProperty,Cr={},kr=T.ReactDebugCurrentFrame;function nr(r){if(r){var n=r._owner,e=Q(r.type,r._source,n?n.type:null);kr.setExtraStackFrame(e)}else kr.setExtraStackFrame(null)}function Xr(r,n,e,o,d){{var u=Function.call.bind(rr);for(var a in r)if(u(r,a)){var t=void 0;try{if(typeof r[a]!="function"){var x=Error((o||"React class")+": "+e+" type `"+a+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof r[a]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw x.name="Invariant Violation",x}t=r[a](n,a,o,e,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(c){t=c}t&&!(t instanceof Error)&&(nr(d),v("%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,a,typeof t),nr(null)),t instanceof Error&&!(t.message in Cr)&&(Cr[t.message]=!0,nr(d),v("Failed %s type: %s",e,t.message),nr(null))}}}var Zr=Array.isArray;function sr(r){return Zr(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 Tr(r),!1}catch{return!0}}function Tr(r){return""+r}function Sr(r){if(rn(r))return v("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Qr(r)),Tr(r)}var J=T.ReactCurrentOwner,nn={key:!0,ref:!0,__self:!0,__source:!0},Or,Pr,ur;ur={};function en(r){if(rr.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(rr.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"&&J.current&&n&&J.current.stateNode!==n){var e=k(J.current.type);ur[e]||(v('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',k(J.current.type),r.ref),ur[e]=!0)}}function an(r,n){{var e=function(){Or||(Or=!0,v("%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 dn(r,n){{var e=function(){Pr||(Pr=!0,v("%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 sn=function(r,n,e,o,d,u,a){var t={$$typeof:y,type:r,key:n,ref:e,props:a,_owner:u};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:d}),Object.freeze&&(Object.freeze(t.props),Object.freeze(t)),t};function un(r,n,e,o,d){{var u,a={},t=null,x=null;e!==void 0&&(Sr(e),t=""+e),on(n)&&(Sr(n.key),t=""+n.key),en(n)&&(x=n.ref,tn(n,d));for(u in n)rr.call(n,u)&&!nn.hasOwnProperty(u)&&(a[u]=n[u]);if(r&&r.defaultProps){var c=r.defaultProps;for(u in c)a[u]===void 0&&(a[u]=c[u])}if(t||x){var p=typeof r=="function"?r.displayName||r.name||"Unknown":r;t&&an(a,p),x&&dn(a,p)}return sn(r,t,x,d,o,J.current,a)}}var lr=T.ReactCurrentOwner,Dr=T.ReactDebugCurrentFrame;function V(r){if(r){var n=r._owner,e=Q(r.type,r._source,n?n.type:null);Dr.setExtraStackFrame(e)}else Dr.setExtraStackFrame(null)}var cr;cr=!1;function fr(r){return typeof r=="object"&&r!==null&&r.$$typeof===y}function Fr(){{if(lr.current){var r=k(lr.current.type);if(r)return` | ||
Check the render method of \``+r+"`."}return""}}function ln(r){{if(r!==void 0){var n=r.fileName.replace(/^.*[\\\/]/,""),e=r.lineNumber;return` | ||
Check your code at `+n+":"+e+"."}return""}}var Fr={};function cn(r){{var n=Pr();if(!n){var e=typeof r=="string"?r:r.displayName||r.name;e&&(n=` | ||
Check your code at `+n+":"+e+"."}return""}}var Ir={};function cn(r){{var n=Fr();if(!n){var e=typeof r=="string"?r:r.displayName||r.name;e&&(n=` | ||
Check the top-level render call using <`+e+">.")}return n}}function Ir(r,n){{if(!r._store||r._store.validated||r.key!=null)return;r._store.validated=!0;var e=cn(n);if(Fr[e])return;Fr[e]=!0;var o="";r&&r._owner&&r._owner!==ar.current&&(o=" It was passed a child from "+S(r._owner.type)+"."),L(r),g('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),L(null)}}function Dr(r,n){{if(typeof r!="object")return;if(ir(r))for(var e=0;e<r.length;e++){var o=r[e];sr(o)&&Ir(o,n)}else if(sr(r))r._store&&(r._store.validated=!0);else if(r){var a=B(r);if(typeof a=="function"&&a!==r.entries)for(var s=a.call(r),t;!(t=s.next()).done;)sr(t.value)&&Ir(t.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===h||n.$$typeof===j))e=n.propTypes;else return;if(e){var o=S(n);Xr(e,r.props,"prop",o,r)}else if(n.PropTypes!==void 0&&!dr){dr=!0;var a=S(n);g("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",a||"Unknown")}typeof n.getDefaultProps=="function"&&!n.getDefaultProps.isReactClassApproved&&g("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"){L(r),g("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",o),L(null);break}}r.ref!==null&&(L(r),g("Invalid attribute `ref` supplied to `React.Fragment`."),L(null))}}function Ar(r,n,e,o,a,s){{var t=Br(r);if(!t){var i="";(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=ln(a);b?i+=b:i+=Pr();var f;r===null?f="null":ir(r)?f="array":r!==void 0&&r.$$typeof===w?(f="<"+(S(r.type)||"Unknown")+" />",i=" Did you accidentally export a JSX literal instead of a component?"):f=typeof r,g("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",f,i)}var p=un(r,n,e,a,s);if(p==null)return p;if(t){var E=n.children;if(E!==void 0)if(o)if(ir(E)){for(var N=0;N<E.length;N++)Dr(E[N],r);Object.freeze&&Object.freeze(E)}else g("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 Dr(E,r)}return r===y?pn(p):fn(p),p}}function hn(r,n,e){return Ar(r,n,e,!0)}function vn(r,n,e){return Ar(r,n,e,!1)}var gn=vn,wn=hn;z.Fragment=y,z.jsx=gn,z.jsxs=wn}()),z}process.env.NODE_ENV==="production"?X.exports=Lr():X.exports=Nr();var u=X.exports;const Yr=`@import url("https://fonts.googleapis.com/css2?family=Poppins&display=swap"); | ||
Check the top-level render call using <`+e+">.")}return n}}function Ar(r,n){{if(!r._store||r._store.validated||r.key!=null)return;r._store.validated=!0;var e=cn(n);if(Ir[e])return;Ir[e]=!0;var o="";r&&r._owner&&r._owner!==lr.current&&(o=" It was passed a child from "+k(r._owner.type)+"."),V(r),v('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),V(null)}}function Wr(r,n){{if(typeof r!="object")return;if(sr(r))for(var e=0;e<r.length;e++){var o=r[e];fr(o)&&Ar(o,n)}else if(fr(r))r._store&&(r._store.validated=!0);else if(r){var d=Y(r);if(typeof d=="function"&&d!==r.entries)for(var u=d.call(r),a;!(a=u.next()).done;)fr(a.value)&&Ar(a.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===b))e=n.propTypes;else return;if(e){var o=k(n);Xr(e,r.props,"prop",o,r)}else if(n.PropTypes!==void 0&&!cr){cr=!0;var d=k(n);v("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",d||"Unknown")}typeof n.getDefaultProps=="function"&&!n.getDefaultProps.isReactClassApproved&&v("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"){V(r),v("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",o),V(null);break}}r.ref!==null&&(V(r),v("Invalid attribute `ref` supplied to `React.Fragment`."),V(null))}}function $r(r,n,e,o,d,u){{var a=m(r);if(!a){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 x=ln(d);x?t+=x:t+=Fr();var c;r===null?c="null":sr(r)?c="array":r!==void 0&&r.$$typeof===y?(c="<"+(k(r.type)||"Unknown")+" />",t=" Did you accidentally export a JSX literal instead of a component?"):c=typeof r,v("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,d,u);if(p==null)return p;if(a){var R=n.children;if(R!==void 0)if(o)if(sr(R)){for(var M=0;M<R.length;M++)Wr(R[M],r);Object.freeze&&Object.freeze(R)}else v("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 Wr(R,r)}return r===E?pn(p):fn(p),p}}function hn(r,n,e){return $r(r,n,e,!0)}function vn(r,n,e){return $r(r,n,e,!1)}var gn=vn,wn=hn;B.Fragment=E,B.jsx=gn,B.jsxs=wn}()),B}process.env.NODE_ENV==="production"?er.exports=Nr():er.exports=zr();var s=er.exports;const Yr=`@import url("https://fonts.googleapis.com/css2?family=Poppins&display=swap"); | ||
* { | ||
@@ -171,5 +171,3 @@ margin: 0; | ||
position: absolute; | ||
top: 100%; | ||
left: 0; | ||
margin-top: var(--hsd-ui-dropdown-spacing-xs); | ||
padding: var(--hsd-ui-dropdown-spacing-sm); | ||
@@ -191,2 +189,11 @@ border: var(--hsd-ui-dropdown-border-width) solid | ||
.hsd-input-dropdown-lists-container-bottom { | ||
top: 100%; | ||
margin-top: var(--hsd-ui-dropdown-spacing-xs); | ||
} | ||
.hsd-input-dropdown-lists-container-top { | ||
bottom: 100%; | ||
margin-bottom: var(--hsd-ui-dropdown-spacing-xs); | ||
} | ||
.hsd-input-dropdown-container-dropdown-search { | ||
@@ -264,2 +271,3 @@ display: flex; | ||
} | ||
`;function zr(v){const[w,R]=m.useState(v),y=m.useRef(null),_=P=>{y.current&&!y.current.contains(P.target)&&R(!1)};return m.useEffect(()=>(document.addEventListener("click",_,!0),()=>{document.removeEventListener("click",_,!0)}),[]),{ref:y,isComponentVisible:w,setIsComponentVisible:R}}const cr="hudoro-input-dropdown-styles";(v=>{if(!document.getElementById(cr)){const w=document.createElement("style");w.id=cr,w.textContent=v,document.head.appendChild(w)}})(Yr);const Vr=({dropdownLists:v,onChange:w,defaultValue:R,size:y="md",multiSelect:_,searchAble:P,iconLeft:F,placeholder:C,onSearch:h,error:I})=>{const[c,j]=m.useState([]),[l,T]=m.useState([]),{isComponentVisible:V,ref:Z,setIsComponentVisible:B}=zr(!1),D=()=>{B(d=>!d)},g=(d,x)=>{if(!_)T([{label:d,value:x}]),w([{label:d,value:x}]),B(!1);else if(l==null?void 0:l.find(k=>k.value===x)){const k=[...l?l.filter(rr=>rr.value!==x):[]];T(k),w(k)}else{const k=[...l||[],{label:d,value:x}];T(k),w(k)}};m.useEffect(()=>{R&&(T(R),j(R))},[R]);const Q=()=>l.length?_?l==null?void 0:l.map((d,x)=>u.jsx("p",{style:{minWidth:"max-content"},className:"hsd-input-dropdown-preview-item",children:d==null?void 0:d.label},x)):u.jsx("p",{style:{minWidth:"max-content"},children:l==null?void 0:l[0].label}):c.length?_?c==null?void 0:c.map((d,x)=>u.jsx("p",{style:{minWidth:"max-content"},className:"hsd-input-dropdown-preview-item",children:d==null?void 0:d.label},x)):u.jsx("p",{style:{minWidth:"max-content"},children:c==null?void 0:c[0].label}):u.jsx("p",{className:"hsd-input-dropdown-placeholder",children:C||"Search"});return u.jsxs("div",{className:`hsd-input-dropdown-container hsd-input-dropdown-size-${y} ${V?"active":""} ${I?"error":""}`,ref:Z,onClick:D,children:[u.jsxs("div",{className:"hsd-input-dropdown-preview-container",children:[F?u.jsx(u.Fragment,{children:m.cloneElement(F,{width:fr(y),color:"#939E99"})}):null,u.jsx("div",{className:"hsd-input-dropdown-container-preview-item",children:Q()}),u.jsx(Ur,{strokeWidth:2,width:fr(y)})]}),V?u.jsxs("div",{className:"hsd-input-dropdown-lists-container",onClick:d=>d.stopPropagation(),children:[P?u.jsxs("div",{className:"hsd-input-dropdown-container-dropdown-search",children:[u.jsx("div",{style:{display:"flex"},children:u.jsx(Mr,{strokeWidth:2,width:20})}),u.jsx("input",{onChange:d=>{h&&h(d.target.value)}})]}):null,u.jsx("div",{className:"hsd-input-dropdwon-item-container",children:v.map((d,x)=>u.jsxs("div",{className:`hsd-input-dropdwon-item ${l!=null&&l.find($=>$.value===d.value)?"active":""} ${d.disable?"hsd-input-dropdwon-item-disable":null}`,onClick:()=>g(d.label,d.value),children:[d.icon?u.jsx("div",{children:m.cloneElement(d.icon,{width:16})}):null,u.jsxs("div",{children:[" ",u.jsx("p",{children:d.label})]})]},x))})]}):null]})},Mr=({...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"})]}),Ur=({...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"})}),fr=v=>{if(v==="sm")return 16;if(v==="md")return 20;if(v==="lg")return 20};A.Dropdown=Vr,Object.defineProperty(A,Symbol.toStringTag,{value:"Module"})}); | ||
`;function Vr(g){const[y,_]=f.useState(g),E=f.useRef(null),j=D=>{E.current&&!E.current.contains(D.target)&&_(!1)};return f.useEffect(()=>(document.addEventListener("click",j,!0),()=>{document.removeEventListener("click",j,!0)}),[]),{ref:E,isComponentVisible:y,setIsComponentVisible:_}}const vr="hudoro-input-dropdown-styles";(g=>{if(!document.getElementById(vr)){const y=document.createElement("style");y.id=vr,y.textContent=g,document.head.appendChild(y)}})(Yr);const Mr=({dropdownLists:g,onChange:y,defaultValue:_,size:E="md",multiSelect:j,searchAble:D,iconLeft:F,placeholder:S,onSearch:w,error:I,position:h})=>{const[b,O]=f.useState([]),[l,$]=f.useState([]),[z,Y]=f.useState(""),T=f.useRef(null),{isComponentVisible:v,ref:q,setIsComponentVisible:G}=Vr(!1),or=()=>{G(i=>!i)},K=(i,m)=>{if(!j)$([{label:i,value:m}]),y([{label:i,value:m}]),G(!1);else if(l==null?void 0:l.find(C=>C.value===m)){const C=[...l?l.filter(k=>k.value!==m):[]];$(C),y(C)}else{const C=[...l||[],{label:i,value:m}];$(C),y(C)}};f.useEffect(()=>{_&&($(_),O(_))},[_]);const ir=()=>l.length?j?l==null?void 0:l.map((i,m)=>s.jsx("p",{style:{minWidth:"max-content"},className:"hsd-input-dropdown-preview-item",children:i==null?void 0:i.label},m)):s.jsx("p",{style:{minWidth:"max-content"},children:l==null?void 0:l[0].label}):b.length?j?b==null?void 0:b.map((i,m)=>s.jsx("p",{style:{minWidth:"max-content"},className:"hsd-input-dropdown-preview-item",children:i==null?void 0:i.label},m)):s.jsx("p",{style:{minWidth:"max-content"},children:b==null?void 0:b[0].label}):s.jsx("p",{className:"hsd-input-dropdown-placeholder",children:S||"Search"});f.useEffect(()=>{Y(h||"bottom")},[h]);const L=()=>{if(!h&&q.current&&T.current){const i=window.innerHeight,m=q.current.getBoundingClientRect(),A=T.current.getBoundingClientRect();m.bottom+A.height>=i-10?Y("top"):Y(h||"bottom")}};return f.useEffect(()=>(window.addEventListener("scroll",L),window.addEventListener("resize",L),()=>{window.removeEventListener("scroll",L),window.removeEventListener("resize",L)}),[]),f.useEffect(()=>{L()},[v]),s.jsxs("div",{className:`hsd-input-dropdown-container hsd-input-dropdown-size-${E} ${v?"active":""} ${I?"error":""}`,ref:q,onClick:or,children:[s.jsxs("div",{className:"hsd-input-dropdown-preview-container",children:[F?s.jsx(s.Fragment,{children:f.cloneElement(F,{width:gr(E),color:"#939E99"})}):null,s.jsx("div",{className:"hsd-input-dropdown-container-preview-item",children:ir()}),s.jsx(Br,{strokeWidth:2,width:gr(E)})]}),v?s.jsxs("div",{className:`hsd-input-dropdown-lists-container | ||
hsd-input-dropdown-lists-container-${z}`,onClick:i=>i.stopPropagation(),ref:T,children:[D?s.jsxs("div",{className:"hsd-input-dropdown-container-dropdown-search",style:{order:z=="bottom"?1:2},children:[s.jsx("div",{style:{display:"flex"},children:s.jsx(Ur,{strokeWidth:2,width:20})}),s.jsx("input",{onChange:i=>{w&&w(i.target.value)}})]}):null,s.jsx("div",{className:"hsd-input-dropdwon-item-container",style:{order:z=="bottom"?2:1},children:z==="bottom"?g.map((i,m)=>s.jsxs("div",{className:`hsd-input-dropdwon-item ${l!=null&&l.find(A=>A.value===i.value)?"active":""} ${i.disable?"hsd-input-dropdwon-item-disable":null}`,onClick:()=>K(i.label,i.value),children:[i.icon?s.jsx("div",{children:f.cloneElement(i.icon,{width:16})}):null,s.jsxs("div",{children:[" ",s.jsx("p",{children:i.label})]})]},m)):g.reverse().map((i,m)=>s.jsxs("div",{className:`hsd-input-dropdwon-item ${l!=null&&l.find(A=>A.value===i.value)?"active":""} ${i.disable?"hsd-input-dropdwon-item-disable":null}`,onClick:()=>K(i.label,i.value),children:[i.icon?s.jsx("div",{children:f.cloneElement(i.icon,{width:16})}):null,s.jsxs("div",{children:[" ",s.jsx("p",{children:i.label})]})]},m))})]}):null]})},Ur=({...g})=>s.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",...g,viewBox:"0 0 20 20",fill:"none",children:[s.jsx("circle",{cx:"9.80547",cy:"9.8055",r:"7.49047",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round"}),s.jsx("path",{d:"M15.0153 15.4043L17.9519 18.3333",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round"})]}),Br=({...g})=>s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",...g,viewBox:"0 0 24 24",fill:"none",color:"#1976D2",children:s.jsx("path",{d:"M4 9L12 17L20 9",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})}),gr=g=>{if(g==="sm")return 16;if(g==="md")return 20;if(g==="lg")return 20};W.Dropdown=Mr,Object.defineProperty(W,Symbol.toStringTag,{value:"Module"})}); |
@@ -25,2 +25,3 @@ export interface IconPropsDropdown extends React.SVGProps<SVGSVGElement> { | ||
onSearch?: (e: string) => void; | ||
position?: "top" | "bottom"; | ||
} |
{ | ||
"name": "@hudoro/dropdown", | ||
"version": "0.0.3-beta.29", | ||
"version": "0.0.3-beta.30", | ||
"description": "dropdown component for Hudoro UI", | ||
@@ -5,0 +5,0 @@ "author": "Prawito Hudoro", |
68131
1407