@hudoro/dropdown
Advanced tools
Comparing version 0.0.3-beta.40 to 0.0.3-beta.41
@@ -17,14 +17,14 @@ import H, { useState as fr, useRef as pr, useEffect as J } from "react"; | ||
Lr = 1; | ||
var v = H, b = Symbol.for("react.element"), j = Symbol.for("react.fragment"), x = Object.prototype.hasOwnProperty, C = v.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, D = { key: !0, ref: !0, __self: !0, __source: !0 }; | ||
function F(k, g, I) { | ||
var p, R = {}, T = null, A = null; | ||
I !== void 0 && (T = "" + I), g.key !== void 0 && (T = "" + g.key), g.ref !== void 0 && (A = g.ref); | ||
for (p in g) | ||
x.call(g, p) && !D.hasOwnProperty(p) && (R[p] = g[p]); | ||
if (k && k.defaultProps) | ||
for (p in g = k.defaultProps, g) | ||
R[p] === void 0 && (R[p] = g[p]); | ||
return { $$typeof: b, type: k, key: T, ref: A, props: R, _owner: C.current }; | ||
var v = H, y = Symbol.for("react.element"), C = Symbol.for("react.fragment"), E = Object.prototype.hasOwnProperty, k = v.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, P = { key: !0, ref: !0, __self: !0, __source: !0 }; | ||
function D(T, g, F) { | ||
var h, _ = {}, O = null, $ = null; | ||
F !== void 0 && (O = "" + F), g.key !== void 0 && (O = "" + g.key), g.ref !== void 0 && ($ = g.ref); | ||
for (h in g) | ||
E.call(g, h) && !P.hasOwnProperty(h) && (_[h] = g[h]); | ||
if (T && T.defaultProps) | ||
for (h in g = T.defaultProps, g) | ||
_[h] === void 0 && (_[h] = g[h]); | ||
return { $$typeof: y, type: T, key: O, ref: $, props: _, _owner: k.current }; | ||
} | ||
return q.Fragment = j, q.jsx = F, q.jsxs = F, q; | ||
return q.Fragment = C, q.jsx = D, q.jsxs = D, q; | ||
} | ||
@@ -44,11 +44,11 @@ var B = {}; | ||
return Wr || (Wr = 1, process.env.NODE_ENV !== "production" && function() { | ||
var v = H, b = Symbol.for("react.element"), j = Symbol.for("react.portal"), x = Symbol.for("react.fragment"), C = Symbol.for("react.strict_mode"), D = Symbol.for("react.profiler"), F = Symbol.for("react.provider"), k = Symbol.for("react.context"), g = Symbol.for("react.forward_ref"), I = Symbol.for("react.suspense"), p = Symbol.for("react.suspense_list"), R = Symbol.for("react.memo"), T = Symbol.for("react.lazy"), A = Symbol.for("react.offscreen"), l = Symbol.iterator, L = "@@iterator"; | ||
var v = H, y = Symbol.for("react.element"), C = Symbol.for("react.portal"), E = Symbol.for("react.fragment"), k = Symbol.for("react.strict_mode"), P = Symbol.for("react.profiler"), D = Symbol.for("react.provider"), T = Symbol.for("react.context"), g = Symbol.for("react.forward_ref"), F = Symbol.for("react.suspense"), h = Symbol.for("react.suspense_list"), _ = Symbol.for("react.memo"), O = Symbol.for("react.lazy"), $ = Symbol.for("react.offscreen"), L = Symbol.iterator, l = "@@iterator"; | ||
function W(r) { | ||
if (r === null || typeof r != "object") | ||
return null; | ||
var n = l && r[l] || r[L]; | ||
var n = L && r[L] || r[l]; | ||
return typeof n == "function" ? n : null; | ||
} | ||
var _ = v.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; | ||
function h(r) { | ||
var j = v.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; | ||
function f(r) { | ||
{ | ||
@@ -62,3 +62,3 @@ for (var n = arguments.length, e = new Array(n > 1 ? n - 1 : 0), o = 1; o < n; o++) | ||
{ | ||
var o = _.ReactDebugCurrentFrame, d = o.getStackAddendum(); | ||
var o = j.ReactDebugCurrentFrame, d = o.getStackAddendum(); | ||
d !== "" && (n += "%s", e = e.concat([d])); | ||
@@ -71,12 +71,12 @@ var u = e.map(function(a) { | ||
} | ||
var Y = !1, G = !1, er = !1, K = !1, or = !1, $; | ||
$ = Symbol.for("react.module.reference"); | ||
function i(r) { | ||
return !!(typeof r == "string" || typeof r == "function" || r === x || r === D || or || r === C || r === I || r === p || K || r === A || Y || G || er || typeof r == "object" && r !== null && (r.$$typeof === T || r.$$typeof === R || r.$$typeof === F || r.$$typeof === k || r.$$typeof === g || // This needs to include all possible module reference object | ||
var Y = !1, M = !1, G = !1, or = !1, K = !1, X; | ||
X = Symbol.for("react.module.reference"); | ||
function I(r) { | ||
return !!(typeof r == "string" || typeof r == "function" || r === E || r === P || K || r === k || r === F || r === h || or || r === $ || Y || M || G || typeof r == "object" && r !== null && (r.$$typeof === O || r.$$typeof === _ || r.$$typeof === D || 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 === $ || r.getModuleId !== void 0)); | ||
r.$$typeof === X || r.getModuleId !== void 0)); | ||
} | ||
function m(r, n, e) { | ||
function i(r, n, e) { | ||
var o = r.displayName; | ||
@@ -88,9 +88,9 @@ if (o) | ||
} | ||
function O(r) { | ||
function w(r) { | ||
return r.displayName || "Context"; | ||
} | ||
function w(r) { | ||
function b(r) { | ||
if (r == null) | ||
return null; | ||
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") | ||
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; | ||
@@ -100,13 +100,13 @@ if (typeof r == "string") | ||
switch (r) { | ||
case x: | ||
case E: | ||
return "Fragment"; | ||
case j: | ||
case C: | ||
return "Portal"; | ||
case D: | ||
case P: | ||
return "Profiler"; | ||
case C: | ||
case k: | ||
return "StrictMode"; | ||
case I: | ||
case F: | ||
return "Suspense"; | ||
case p: | ||
case h: | ||
return "SuspenseList"; | ||
@@ -116,17 +116,17 @@ } | ||
switch (r.$$typeof) { | ||
case k: | ||
case T: | ||
var n = r; | ||
return O(n) + ".Consumer"; | ||
case F: | ||
return w(n) + ".Consumer"; | ||
case D: | ||
var e = r; | ||
return O(e._context) + ".Provider"; | ||
return w(e._context) + ".Provider"; | ||
case g: | ||
return m(r, r.render, "ForwardRef"); | ||
case R: | ||
return i(r, r.render, "ForwardRef"); | ||
case _: | ||
var o = r.displayName || null; | ||
return o !== null ? o : w(r.type) || "Memo"; | ||
case T: { | ||
return o !== null ? o : b(r.type) || "Memo"; | ||
case O: { | ||
var d = r, u = d._payload, a = d._init; | ||
try { | ||
return w(a(u)); | ||
return b(a(u)); | ||
} catch { | ||
@@ -139,3 +139,3 @@ return null; | ||
} | ||
var S = Object.assign, M = 0, vr, gr, wr, br, mr, yr, xr; | ||
var m = Object.assign, A = 0, vr, gr, wr, br, mr, yr, xr; | ||
function Er() { | ||
@@ -146,3 +146,3 @@ } | ||
{ | ||
if (M === 0) { | ||
if (A === 0) { | ||
vr = console.log, gr = console.info, wr = console.warn, br = console.error, mr = console.group, yr = console.groupCollapsed, xr = console.groupEnd; | ||
@@ -165,3 +165,3 @@ var r = { | ||
} | ||
M++; | ||
A++; | ||
} | ||
@@ -171,3 +171,3 @@ } | ||
{ | ||
if (M--, M === 0) { | ||
if (A--, A === 0) { | ||
var r = { | ||
@@ -179,21 +179,21 @@ configurable: !0, | ||
Object.defineProperties(console, { | ||
log: S({}, r, { | ||
log: m({}, r, { | ||
value: vr | ||
}), | ||
info: S({}, r, { | ||
info: m({}, r, { | ||
value: gr | ||
}), | ||
warn: S({}, r, { | ||
warn: m({}, r, { | ||
value: wr | ||
}), | ||
error: S({}, r, { | ||
error: m({}, r, { | ||
value: br | ||
}), | ||
group: S({}, r, { | ||
group: m({}, r, { | ||
value: mr | ||
}), | ||
groupCollapsed: S({}, r, { | ||
groupCollapsed: m({}, r, { | ||
value: yr | ||
}), | ||
groupEnd: S({}, r, { | ||
groupEnd: m({}, r, { | ||
value: xr | ||
@@ -203,7 +203,7 @@ }) | ||
} | ||
M < 0 && h("disabledDepth fell below zero. This is a bug in React. Please file an issue."); | ||
A < 0 && f("disabledDepth fell below zero. This is a bug in React. Please file an issue."); | ||
} | ||
} | ||
var tr = _.ReactCurrentDispatcher, ir; | ||
function X(r, n, e) { | ||
var tr = j.ReactCurrentDispatcher, ir; | ||
function Z(r, n, e) { | ||
{ | ||
@@ -221,6 +221,6 @@ if (ir === void 0) | ||
} | ||
var ar = !1, Z; | ||
var ar = !1, Q; | ||
{ | ||
var Mr = typeof WeakMap == "function" ? WeakMap : Map; | ||
Z = new Mr(); | ||
Q = new Mr(); | ||
} | ||
@@ -231,3 +231,3 @@ function Rr(r, n) { | ||
{ | ||
var e = Z.get(r); | ||
var e = Q.get(r); | ||
if (e !== void 0) | ||
@@ -254,4 +254,4 @@ return e; | ||
Reflect.construct(a, []); | ||
} catch (P) { | ||
o = P; | ||
} catch (S) { | ||
o = S; | ||
} | ||
@@ -262,4 +262,4 @@ Reflect.construct(r, [], a); | ||
a.call(); | ||
} catch (P) { | ||
o = P; | ||
} catch (S) { | ||
o = S; | ||
} | ||
@@ -271,23 +271,23 @@ r.call(a.prototype); | ||
throw Error(); | ||
} catch (P) { | ||
o = P; | ||
} catch (S) { | ||
o = S; | ||
} | ||
r(); | ||
} | ||
} 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) | ||
} catch (S) { | ||
if (S && o && typeof S.stack == "string") { | ||
for (var t = S.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--, f--, f < 0 || t[c] !== y[f]) { | ||
var E = ` | ||
if (c--, p--, p < 0 || t[c] !== x[p]) { | ||
var R = ` | ||
` + 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; | ||
return r.displayName && R.includes("<anonymous>") && (R = R.replace("<anonymous>", r.displayName)), typeof r == "function" && Q.set(r, R), R; | ||
} | ||
while (c >= 1 && f >= 0); | ||
while (c >= 1 && p >= 0); | ||
break; | ||
@@ -299,4 +299,4 @@ } | ||
} | ||
var z = r ? r.displayName || r.name : "", $r = z ? X(z) : ""; | ||
return typeof r == "function" && Z.set(r, $r), $r; | ||
var z = r ? r.displayName || r.name : "", $r = z ? Z(z) : ""; | ||
return typeof r == "function" && Q.set(r, $r), $r; | ||
} | ||
@@ -310,3 +310,3 @@ function Ur(r, n, e) { | ||
} | ||
function Q(r, n, e) { | ||
function rr(r, n, e) { | ||
if (r == null) | ||
@@ -317,8 +317,8 @@ return ""; | ||
if (typeof r == "string") | ||
return X(r); | ||
return Z(r); | ||
switch (r) { | ||
case I: | ||
return X("Suspense"); | ||
case p: | ||
return X("SuspenseList"); | ||
case F: | ||
return Z("Suspense"); | ||
case h: | ||
return Z("SuspenseList"); | ||
} | ||
@@ -329,8 +329,8 @@ if (typeof r == "object") | ||
return Ur(r.render); | ||
case R: | ||
return Q(r.type, n, e); | ||
case T: { | ||
case _: | ||
return rr(r.type, n, e); | ||
case O: { | ||
var o = r, d = o._payload, u = o._init; | ||
try { | ||
return Q(u(d), n, e); | ||
return rr(u(d), n, e); | ||
} catch { | ||
@@ -342,6 +342,6 @@ } | ||
} | ||
var rr = Object.prototype.hasOwnProperty, _r = {}, jr = _.ReactDebugCurrentFrame; | ||
function nr(r) { | ||
var nr = Object.prototype.hasOwnProperty, _r = {}, jr = j.ReactDebugCurrentFrame; | ||
function er(r) { | ||
if (r) { | ||
var n = r._owner, e = Q(r.type, r._source, n ? n.type : null); | ||
var n = r._owner, e = rr(r.type, r._source, n ? n.type : null); | ||
jr.setExtraStackFrame(e); | ||
@@ -353,3 +353,3 @@ } else | ||
{ | ||
var u = Function.call.bind(rr); | ||
var u = Function.call.bind(nr); | ||
for (var a in r) | ||
@@ -360,4 +360,4 @@ if (u(r, a)) { | ||
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; | ||
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; | ||
} | ||
@@ -368,3 +368,3 @@ t = r[a](n, a, o, e, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"); | ||
} | ||
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 _r) && (_r[t.message] = !0, nr(d), h("Failed %s type: %s", e, t.message), nr(null)); | ||
t && !(t instanceof Error) && (er(d), 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, a, typeof t), er(null)), t instanceof Error && !(t.message in _r) && (_r[t.message] = !0, er(d), f("Failed %s type: %s", e, t.message), er(null)); | ||
} | ||
@@ -395,5 +395,5 @@ } | ||
if (Gr(r)) | ||
return h("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Hr(r)), Cr(r); | ||
return f("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Hr(r)), Cr(r); | ||
} | ||
var U = _.ReactCurrentOwner, Kr = { | ||
var U = j.ReactCurrentOwner, Kr = { | ||
key: !0, | ||
@@ -406,3 +406,3 @@ ref: !0, | ||
function Xr(r) { | ||
if (rr.call(r, "ref")) { | ||
if (nr.call(r, "ref")) { | ||
var n = Object.getOwnPropertyDescriptor(r, "ref").get; | ||
@@ -415,3 +415,3 @@ if (n && n.isReactWarning) | ||
function Zr(r) { | ||
if (rr.call(r, "key")) { | ||
if (nr.call(r, "key")) { | ||
var n = Object.getOwnPropertyDescriptor(r, "key").get; | ||
@@ -425,4 +425,4 @@ if (n && n.isReactWarning) | ||
if (typeof r.ref == "string" && U.current && n && U.current.stateNode !== n) { | ||
var e = w(U.current.type); | ||
sr[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', w(U.current.type), r.ref), sr[e] = !0); | ||
var e = b(U.current.type); | ||
sr[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', b(U.current.type), r.ref), sr[e] = !0); | ||
} | ||
@@ -433,3 +433,3 @@ } | ||
var e = function() { | ||
Tr || (Tr = !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)); | ||
Tr || (Tr = !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)); | ||
}; | ||
@@ -445,3 +445,3 @@ e.isReactWarning = !0, Object.defineProperty(r, "key", { | ||
var e = function() { | ||
Or || (Or = !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)); | ||
Or || (Or = !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)); | ||
}; | ||
@@ -457,3 +457,3 @@ e.isReactWarning = !0, Object.defineProperty(r, "ref", { | ||
// This tag allows us to uniquely identify this as a React Element | ||
$$typeof: b, | ||
$$typeof: y, | ||
// Built-in properties that belong on the element | ||
@@ -486,6 +486,6 @@ type: r, | ||
{ | ||
var u, a = {}, t = null, y = null; | ||
e !== void 0 && (kr(e), t = "" + e), Zr(n) && (kr(n.key), t = "" + n.key), Xr(n) && (y = n.ref, Qr(n, d)); | ||
var u, a = {}, t = null, x = null; | ||
e !== void 0 && (kr(e), t = "" + e), Zr(n) && (kr(n.key), t = "" + n.key), Xr(n) && (x = n.ref, Qr(n, d)); | ||
for (u in n) | ||
rr.call(n, u) && !Kr.hasOwnProperty(u) && (a[u] = n[u]); | ||
nr.call(n, u) && !Kr.hasOwnProperty(u) && (a[u] = n[u]); | ||
if (r && r.defaultProps) { | ||
@@ -496,13 +496,13 @@ var c = r.defaultProps; | ||
} | ||
if (t || y) { | ||
var f = typeof r == "function" ? r.displayName || r.name || "Unknown" : r; | ||
t && rn(a, f), y && nn(a, f); | ||
if (t || x) { | ||
var p = typeof r == "function" ? r.displayName || r.name || "Unknown" : r; | ||
t && rn(a, p), x && nn(a, p); | ||
} | ||
return en(r, t, y, d, o, U.current, a); | ||
return en(r, t, x, d, o, U.current, a); | ||
} | ||
} | ||
var ur = _.ReactCurrentOwner, Sr = _.ReactDebugCurrentFrame; | ||
var ur = j.ReactCurrentOwner, Sr = j.ReactDebugCurrentFrame; | ||
function N(r) { | ||
if (r) { | ||
var n = r._owner, e = Q(r.type, r._source, n ? n.type : null); | ||
var n = r._owner, e = rr(r.type, r._source, n ? n.type : null); | ||
Sr.setExtraStackFrame(e); | ||
@@ -515,3 +515,3 @@ } else | ||
function cr(r) { | ||
return typeof r == "object" && r !== null && r.$$typeof === b; | ||
return typeof r == "object" && r !== null && r.$$typeof === y; | ||
} | ||
@@ -521,3 +521,3 @@ function Pr() { | ||
if (ur.current) { | ||
var r = w(ur.current.type); | ||
var r = b(ur.current.type); | ||
if (r) | ||
@@ -565,3 +565,3 @@ return ` | ||
var o = ""; | ||
r && r._owner && r._owner !== ur.current && (o = " It was passed a child from " + w(r._owner.type) + "."), N(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), N(null); | ||
r && r._owner && r._owner !== ur.current && (o = " It was passed a child from " + b(r._owner.type) + "."), N(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), N(null); | ||
} | ||
@@ -598,3 +598,3 @@ } | ||
// Inner props are checked in the reconciler. | ||
n.$$typeof === R)) | ||
n.$$typeof === _)) | ||
e = n.propTypes; | ||
@@ -604,10 +604,10 @@ else | ||
if (e) { | ||
var o = w(n); | ||
var o = b(n); | ||
Br(e, r.props, "prop", o, r); | ||
} else if (n.PropTypes !== void 0 && !lr) { | ||
lr = !0; | ||
var d = w(n); | ||
h("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", d || "Unknown"); | ||
var d = b(n); | ||
f("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", d || "Unknown"); | ||
} | ||
typeof n.getDefaultProps == "function" && !n.getDefaultProps.isReactClassApproved && h("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead."); | ||
typeof n.getDefaultProps == "function" && !n.getDefaultProps.isReactClassApproved && f("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead."); | ||
} | ||
@@ -620,7 +620,7 @@ } | ||
if (o !== "children" && o !== "key") { | ||
N(r), h("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", o), N(null); | ||
N(r), f("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", o), N(null); | ||
break; | ||
} | ||
} | ||
r.ref !== null && (N(r), h("Invalid attribute `ref` supplied to `React.Fragment`."), N(null)); | ||
r.ref !== null && (N(r), f("Invalid attribute `ref` supplied to `React.Fragment`."), N(null)); | ||
} | ||
@@ -630,28 +630,28 @@ } | ||
{ | ||
var a = i(r); | ||
var a = I(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 x = tn(d); | ||
x ? t += x : t += Pr(); | ||
var c; | ||
r === null ? c = "null" : dr(r) ? c = "array" : r !== void 0 && r.$$typeof === b ? (c = "<" + (w(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); | ||
r === null ? c = "null" : dr(r) ? c = "array" : r !== void 0 && r.$$typeof === y ? (c = "<" + (b(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 f = on(r, n, e, d, u); | ||
if (f == null) | ||
return f; | ||
var p = on(r, n, e, d, u); | ||
if (p == null) | ||
return p; | ||
if (a) { | ||
var E = n.children; | ||
if (E !== void 0) | ||
var R = n.children; | ||
if (R !== void 0) | ||
if (o) | ||
if (dr(E)) { | ||
for (var z = 0; z < E.length; z++) | ||
Ir(E[z], r); | ||
Object.freeze && Object.freeze(E); | ||
if (dr(R)) { | ||
for (var z = 0; z < R.length; z++) | ||
Ir(R[z], r); | ||
Object.freeze && Object.freeze(R); | ||
} else | ||
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."); | ||
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 | ||
Ir(E, r); | ||
Ir(R, r); | ||
} | ||
return r === x ? sn(f) : dn(f), f; | ||
return r === E ? sn(p) : dn(p), p; | ||
} | ||
@@ -666,3 +666,3 @@ } | ||
var cn = ln, fn = un; | ||
B.Fragment = x, B.jsx = cn, B.jsxs = fn; | ||
B.Fragment = E, B.jsx = cn, B.jsxs = fn; | ||
}()), B; | ||
@@ -792,2 +792,7 @@ } | ||
} | ||
.hsd-input-dropdown-container.disable { | ||
background-color: #f2f3f2; | ||
cursor: not-allowed; | ||
pointer-events: none; | ||
} | ||
@@ -917,13 +922,13 @@ .hsd-input-dropdown-container.error { | ||
function gn(v) { | ||
const [b, j] = fr(v), x = pr(null), C = (D) => { | ||
x.current && !x.current.contains(D.target) && j(!1); | ||
const [y, C] = fr(v), E = pr(null), k = (P) => { | ||
E.current && !E.current.contains(P.target) && C(!1); | ||
}; | ||
return J(() => (document.addEventListener("click", C, !0), () => { | ||
document.removeEventListener("click", C, !0); | ||
}), []), { ref: x, isComponentVisible: b, setIsComponentVisible: j }; | ||
return J(() => (document.addEventListener("click", k, !0), () => { | ||
document.removeEventListener("click", k, !0); | ||
}), []), { ref: E, isComponentVisible: y, setIsComponentVisible: C }; | ||
} | ||
const Nr = "hudoro-input-dropdown-styles", wn = (v) => { | ||
if (!document.getElementById(Nr)) { | ||
const b = document.createElement("style"); | ||
b.id = Nr, b.textContent = v, document.head.appendChild(b); | ||
const y = document.createElement("style"); | ||
y.id = Nr, y.textContent = v, document.head.appendChild(y); | ||
} | ||
@@ -934,34 +939,35 @@ }; | ||
dropdownLists: v, | ||
onChange: b, | ||
defaultValue: j, | ||
size: x = "md", | ||
multiSelect: C, | ||
searchAble: D, | ||
iconLeft: F, | ||
placeholder: k, | ||
onChange: y, | ||
defaultValue: C, | ||
size: E = "md", | ||
multiSelect: k, | ||
searchAble: P, | ||
iconLeft: D, | ||
placeholder: T, | ||
onSearch: g, | ||
error: I, | ||
position: p, | ||
onBlur: R, | ||
onFocus: T | ||
error: F, | ||
position: h, | ||
onBlur: _, | ||
onFocus: O, | ||
disable: $ | ||
}) => { | ||
const A = pr(), [l, L] = fr([]), [W, _] = fr(""), h = pr(null), { isComponentVisible: V, ref: Y, setIsComponentVisible: G } = gn(!1), er = () => { | ||
const L = pr(), [l, W] = fr([]), [j, f] = fr(""), V = pr(null), { isComponentVisible: Y, ref: M, setIsComponentVisible: G } = gn(!1), or = () => { | ||
G((i) => !i); | ||
}, K = (i, m) => { | ||
if (!C) | ||
L([{ label: i, value: m }]), b([{ label: i, value: m }]), G(!1); | ||
else if (l == null ? void 0 : l.find((w) => w.value === m)) { | ||
const w = [ | ||
...l ? l.filter((S) => S.value !== m) : [] | ||
}, K = (i, w) => { | ||
if (!k) | ||
W([{ label: i, value: w }]), y([{ label: i, value: w }]), G(!1); | ||
else if (l == null ? void 0 : l.find((m) => m.value === w)) { | ||
const m = [ | ||
...l ? l.filter((A) => A.value !== w) : [] | ||
]; | ||
L(w), b(w); | ||
W(m), y(m); | ||
} else { | ||
const w = [...l || [], { label: i, value: m }]; | ||
L(w), b(w); | ||
const m = [...l || [], { label: i, value: w }]; | ||
W(m), y(m); | ||
} | ||
}; | ||
J(() => { | ||
JSON.stringify(A.current) === JSON.stringify(j) || (A.current = j, L(A.current || [])); | ||
}, [j]); | ||
const or = () => l.length ? C ? l == null ? void 0 : l.map((i, m) => /* @__PURE__ */ s.jsx( | ||
JSON.stringify(L.current) === JSON.stringify(C) || (L.current = C, W(L.current || [])); | ||
}, [C]); | ||
const X = () => l.length ? k ? l == null ? void 0 : l.map((i, w) => /* @__PURE__ */ s.jsx( | ||
"p", | ||
@@ -973,27 +979,27 @@ { | ||
}, | ||
m | ||
)) : /* @__PURE__ */ s.jsx("p", { style: { minWidth: "max-content" }, children: l == null ? void 0 : l[0].label }) : /* @__PURE__ */ s.jsx("p", { className: "hsd-input-dropdown-placeholder", children: k }); | ||
w | ||
)) : /* @__PURE__ */ s.jsx("p", { style: { minWidth: "max-content" }, children: l == null ? void 0 : l[0].label }) : /* @__PURE__ */ s.jsx("p", { className: "hsd-input-dropdown-placeholder", children: T }); | ||
J(() => { | ||
_(p || "bottom"); | ||
}, [p]); | ||
const $ = () => { | ||
if (!p && Y.current && h.current) { | ||
const i = window.innerHeight, m = Y.current.getBoundingClientRect(), O = h.current.getBoundingClientRect(); | ||
m.bottom + O.height >= i - 10 ? _("top") : _(p || "bottom"); | ||
f(h || "bottom"); | ||
}, [h]); | ||
const I = () => { | ||
if (!h && M.current && V.current) { | ||
const i = window.innerHeight, w = M.current.getBoundingClientRect(), b = V.current.getBoundingClientRect(); | ||
w.bottom + b.height >= i - 10 ? f("top") : f(h || "bottom"); | ||
} | ||
}; | ||
return J(() => (window.addEventListener("scroll", $), window.addEventListener("resize", $), () => { | ||
window.removeEventListener("scroll", $), window.removeEventListener("resize", $); | ||
return J(() => (window.addEventListener("scroll", I), window.addEventListener("resize", I), () => { | ||
window.removeEventListener("scroll", I), window.removeEventListener("resize", I); | ||
}), []), J(() => { | ||
$(); | ||
}, [V]), /* @__PURE__ */ s.jsxs( | ||
I(); | ||
}, [Y]), /* @__PURE__ */ s.jsxs( | ||
"div", | ||
{ | ||
className: `hsd-input-dropdown-container hsd-input-dropdown-size-${x} ${V ? "active" : ""} ${I ? "error" : ""}`, | ||
ref: Y, | ||
onClick: er, | ||
className: `hsd-input-dropdown-container ${$ ? "disable" : ""} hsd-input-dropdown-size-${E} ${Y ? "active" : ""} ${F ? "error" : ""}`, | ||
ref: M, | ||
onClick: or, | ||
children: [ | ||
/* @__PURE__ */ s.jsxs("div", { className: "hsd-input-dropdown-preview-container", children: [ | ||
F ? /* @__PURE__ */ s.jsx(s.Fragment, { children: H.cloneElement(F, { | ||
width: zr(x), | ||
D ? /* @__PURE__ */ s.jsx(s.Fragment, { children: H.cloneElement(D, { | ||
width: zr(E), | ||
color: "#939E99" | ||
@@ -1006,18 +1012,18 @@ }) }) : null, | ||
tabIndex: 100, | ||
onBlur: R, | ||
onFocus: T, | ||
children: or() | ||
onBlur: _, | ||
onFocus: O, | ||
children: X() | ||
} | ||
), | ||
/* @__PURE__ */ s.jsx(mn, { strokeWidth: 2, width: zr(x) }) | ||
/* @__PURE__ */ s.jsx(mn, { strokeWidth: 2, width: zr(E) }) | ||
] }), | ||
V ? /* @__PURE__ */ s.jsxs( | ||
Y ? /* @__PURE__ */ s.jsxs( | ||
"div", | ||
{ | ||
className: `hsd-input-dropdown-lists-container | ||
hsd-input-dropdown-lists-container-${W}`, | ||
hsd-input-dropdown-lists-container-${j}`, | ||
onClick: (i) => i.stopPropagation(), | ||
ref: h, | ||
ref: V, | ||
children: [ | ||
D ? /* @__PURE__ */ s.jsxs( | ||
P ? /* @__PURE__ */ s.jsxs( | ||
"div", | ||
@@ -1027,3 +1033,3 @@ { | ||
style: { | ||
order: W == "bottom" ? 1 : 2, | ||
order: j == "bottom" ? 1 : 2, | ||
position: "sticky", | ||
@@ -1052,7 +1058,7 @@ top: 0, | ||
className: "hsd-input-dropdwon-item-container", | ||
style: { order: W == "bottom" ? 2 : 1 }, | ||
children: W === "bottom" ? v.map((i, m) => /* @__PURE__ */ s.jsxs( | ||
style: { order: j == "bottom" ? 2 : 1 }, | ||
children: j === "bottom" ? v.map((i, w) => /* @__PURE__ */ s.jsxs( | ||
"div", | ||
{ | ||
className: `hsd-input-dropdwon-item ${l != null && l.find((O) => O.value === i.value) ? "active" : ""} ${i.disable ? "hsd-input-dropdwon-item-disable" : null}`, | ||
className: `hsd-input-dropdwon-item ${l != null && l.find((b) => b.value === i.value) ? "active" : ""} ${i.disable ? "hsd-input-dropdwon-item-disable" : null}`, | ||
onClick: () => K(i.label, i.value), | ||
@@ -1069,7 +1075,7 @@ children: [ | ||
}, | ||
m | ||
)) : v.reverse().map((i, m) => /* @__PURE__ */ s.jsxs( | ||
w | ||
)) : v.reverse().map((i, w) => /* @__PURE__ */ s.jsxs( | ||
"div", | ||
{ | ||
className: `hsd-input-dropdwon-item ${l != null && l.find((O) => O.value === i.value) ? "active" : ""} ${i.disable ? "hsd-input-dropdwon-item-disable" : null}`, | ||
className: `hsd-input-dropdwon-item ${l != null && l.find((b) => b.value === i.value) ? "active" : ""} ${i.disable ? "hsd-input-dropdwon-item-disable" : null}`, | ||
onClick: () => K(i.label, i.value), | ||
@@ -1086,3 +1092,3 @@ children: [ | ||
}, | ||
m | ||
w | ||
)) | ||
@@ -1089,0 +1095,0 @@ } |
@@ -1,2 +0,2 @@ | ||
(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:{}},M={};/** | ||
(function(A,f){typeof exports=="object"&&typeof module<"u"?f(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],f):(A=typeof globalThis<"u"?globalThis:A||self,f(A.Dropdown={},A.React))})(this,function(A,f){"use strict";var or={exports:{}},M={};/** | ||
* @license React | ||
@@ -9,3 +9,3 @@ * react-jsx-runtime.production.min.js | ||
* LICENSE file in the root directory of this source tree. | ||
*/var pr;function Nr(){if(pr)return M;pr=1;var g=f,m=Symbol.for("react.element"),C=Symbol.for("react.fragment"),E=Object.prototype.hasOwnProperty,k=g.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,F={key:!0,ref:!0,__self:!0,__source:!0};function I(T,w,A){var h,_={},S=null,$=null;A!==void 0&&(S=""+A),w.key!==void 0&&(S=""+w.key),w.ref!==void 0&&($=w.ref);for(h in w)E.call(w,h)&&!F.hasOwnProperty(h)&&(_[h]=w[h]);if(T&&T.defaultProps)for(h in w=T.defaultProps,w)_[h]===void 0&&(_[h]=w[h]);return{$$typeof:m,type:T,key:S,ref:$,props:_,_owner:k.current}}return M.Fragment=C,M.jsx=I,M.jsxs=I,M}var U={};/** | ||
*/var pr;function Nr(){if(pr)return M;pr=1;var g=f,x=Symbol.for("react.element"),k=Symbol.for("react.fragment"),R=Object.prototype.hasOwnProperty,T=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 v,j={},O=null,W=null;I!==void 0&&(O=""+I),w.key!==void 0&&(O=""+w.key),w.ref!==void 0&&(W=w.ref);for(v in w)R.call(w,v)&&!D.hasOwnProperty(v)&&(j[v]=w[v]);if(S&&S.defaultProps)for(v in w=S.defaultProps,w)j[v]===void 0&&(j[v]=w[v]);return{$$typeof:x,type:S,key:O,ref:W,props:j,_owner:T.current}}return M.Fragment=k,M.jsx=F,M.jsxs=F,M}var U={};/** | ||
* @license React | ||
@@ -18,7 +18,7 @@ * react-jsx-runtime.development.js | ||
* LICENSE file in the root directory of this source tree. | ||
*/var hr;function zr(){return hr||(hr=1,process.env.NODE_ENV!=="production"&&function(){var g=f,m=Symbol.for("react.element"),C=Symbol.for("react.portal"),E=Symbol.for("react.fragment"),k=Symbol.for("react.strict_mode"),F=Symbol.for("react.profiler"),I=Symbol.for("react.provider"),T=Symbol.for("react.context"),w=Symbol.for("react.forward_ref"),A=Symbol.for("react.suspense"),h=Symbol.for("react.suspense_list"),_=Symbol.for("react.memo"),S=Symbol.for("react.lazy"),$=Symbol.for("react.offscreen"),l=Symbol.iterator,N="@@iterator";function z(r){if(r===null||typeof r!="object")return null;var n=l&&r[l]||r[N];return typeof n=="function"?n:null}var j=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=j.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 B=!1,G=!1,or=!1,K=!1,ir=!1,L;L=Symbol.for("react.module.reference");function t(r){return!!(typeof r=="string"||typeof r=="function"||r===E||r===F||ir||r===k||r===A||r===h||K||r===$||B||G||or||typeof r=="object"&&r!==null&&(r.$$typeof===S||r.$$typeof===_||r.$$typeof===I||r.$$typeof===T||r.$$typeof===w||r.$$typeof===L||r.getModuleId!==void 0))}function y(r,n,e){var o=r.displayName;if(o)return o;var d=n.displayName||n.name||"";return d!==""?e+"("+d+")":e}function O(r){return r.displayName||"Context"}function b(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 C:return"Portal";case F:return"Profiler";case k:return"StrictMode";case A:return"Suspense";case h:return"SuspenseList"}if(typeof r=="object")switch(r.$$typeof){case T:var n=r;return O(n)+".Consumer";case I:var e=r;return O(e._context)+".Provider";case w:return y(r,r.render,"ForwardRef");case _:var o=r.displayName||null;return o!==null?o:b(r.type)||"Memo";case S:{var d=r,u=d._payload,a=d._init;try{return b(a(u))}catch{return null}}}return null}var P=Object.assign,J=0,wr,br,mr,yr,xr,Er,Rr;function _r(){}_r.__reactDisabledLog=!0;function Br(){{if(J===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})}J++}}function Jr(){{if(J--,J===0){var r={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:P({},r,{value:wr}),info:P({},r,{value:br}),warn:P({},r,{value:mr}),error:P({},r,{value:yr}),group:P({},r,{value:xr}),groupCollapsed:P({},r,{value:Er}),groupEnd:P({},r,{value:Rr})})}J<0&&v("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var tr=j.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 Hr=typeof WeakMap=="function"?WeakMap:Map;Z=new Hr}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,Br();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(D){o=D}Reflect.construct(r,[],a)}else{try{a.call()}catch(D){o=D}r.call(a.prototype)}}else{try{throw Error()}catch(D){o=D}r()}}catch(D){if(D&&o&&typeof D.stack=="string"){for(var i=D.stack.split(` | ||
`),x=o.stack.split(` | ||
`),c=i.length-1,p=x.length-1;c>=1&&p>=0&&i[c]!==x[p];)p--;for(;c>=1&&p>=0;c--,p--)if(i[c]!==x[p]){if(c!==1||p!==1)do if(c--,p--,p<0||i[c]!==x[p]){var R=` | ||
`+i[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,Jr(),Error.prepareStackTrace=d}var Y=r?r.displayName||r.name:"",Wr=Y?X(Y):"";return typeof r=="function"&&Z.set(r,Wr),Wr}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 A:return X("Suspense");case h:return X("SuspenseList")}if(typeof r=="object")switch(r.$$typeof){case w:return Gr(r.render);case _:return Q(r.type,n,e);case S:{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=j.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 i=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}i=r[a](n,a,o,e,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(c){i=c}i&&!(i 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 i),nr(null)),i instanceof Error&&!(i.message in Cr)&&(Cr[i.message]=!0,nr(d),v("Failed %s type: %s",e,i.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 H=j.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"&&H.current&&n&&H.current.stateNode!==n){var e=b(H.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',b(H.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 i={$$typeof:m,type:r,key:n,ref:e,props:a,_owner:u};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:d}),Object.freeze&&(Object.freeze(i.props),Object.freeze(i)),i};function un(r,n,e,o,d){{var u,a={},i=null,x=null;e!==void 0&&(Sr(e),i=""+e),on(n)&&(Sr(n.key),i=""+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(i||x){var p=typeof r=="function"?r.displayName||r.name||"Unknown":r;i&&an(a,p),x&&dn(a,p)}return sn(r,i,x,d,o,H.current,a)}}var lr=j.ReactCurrentOwner,Dr=j.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===m}function Fr(){{if(lr.current){var r=b(lr.current.type);if(r)return` | ||
*/var hr;function zr(){return hr||(hr=1,process.env.NODE_ENV!=="production"&&function(){var g=f,x=Symbol.for("react.element"),k=Symbol.for("react.portal"),R=Symbol.for("react.fragment"),T=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"),v=Symbol.for("react.suspense_list"),j=Symbol.for("react.memo"),O=Symbol.for("react.lazy"),W=Symbol.for("react.offscreen"),N=Symbol.iterator,l="@@iterator";function z(r){if(r===null||typeof r!="object")return null;var n=N&&r[N]||r[l];return typeof n=="function"?n:null}var C=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];q("error",r,e)}}function q(r,n,e){{var o=C.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 B=!1,J=!1,G=!1,ir=!1,K=!1,X;X=Symbol.for("react.module.reference");function $(r){return!!(typeof r=="string"||typeof r=="function"||r===R||r===D||K||r===T||r===I||r===v||ir||r===W||B||J||G||typeof r=="object"&&r!==null&&(r.$$typeof===O||r.$$typeof===j||r.$$typeof===F||r.$$typeof===S||r.$$typeof===w||r.$$typeof===X||r.getModuleId!==void 0))}function t(r,n,e){var o=r.displayName;if(o)return o;var d=n.displayName||n.name||"";return d!==""?e+"("+d+")":e}function b(r){return r.displayName||"Context"}function m(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 R:return"Fragment";case k:return"Portal";case D:return"Profiler";case T:return"StrictMode";case I:return"Suspense";case v:return"SuspenseList"}if(typeof r=="object")switch(r.$$typeof){case S:var n=r;return b(n)+".Consumer";case F:var e=r;return b(e._context)+".Provider";case w:return t(r,r.render,"ForwardRef");case j:var o=r.displayName||null;return o!==null?o:m(r.type)||"Memo";case O:{var d=r,u=d._payload,a=d._init;try{return m(a(u))}catch{return null}}}return null}var y=Object.assign,L=0,wr,br,mr,yr,xr,Er,Rr;function _r(){}_r.__reactDisabledLog=!0;function Br(){{if(L===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})}L++}}function Jr(){{if(L--,L===0){var r={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:y({},r,{value:wr}),info:y({},r,{value:br}),warn:y({},r,{value:mr}),error:y({},r,{value:yr}),group:y({},r,{value:xr}),groupCollapsed:y({},r,{value:Er}),groupEnd:y({},r,{value:Rr})})}L<0&&p("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var tr=C.ReactCurrentDispatcher,ar;function Z(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,Q;{var Hr=typeof WeakMap=="function"?WeakMap:Map;Q=new Hr}function jr(r,n){if(!r||dr)return"";{var e=Q.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,Br();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 i=P.stack.split(` | ||
`),E=o.stack.split(` | ||
`),c=i.length-1,h=E.length-1;c>=1&&h>=0&&i[c]!==E[h];)h--;for(;c>=1&&h>=0;c--,h--)if(i[c]!==E[h]){if(c!==1||h!==1)do if(c--,h--,h<0||i[c]!==E[h]){var _=` | ||
`+i[c].replace(" at new "," at ");return r.displayName&&_.includes("<anonymous>")&&(_=_.replace("<anonymous>",r.displayName)),typeof r=="function"&&Q.set(r,_),_}while(c>=1&&h>=0);break}}}finally{dr=!1,tr.current=u,Jr(),Error.prepareStackTrace=d}var Y=r?r.displayName||r.name:"",Wr=Y?Z(Y):"";return typeof r=="function"&&Q.set(r,Wr),Wr}function Gr(r,n,e){return jr(r,!1)}function Kr(r){var n=r.prototype;return!!(n&&n.isReactComponent)}function rr(r,n,e){if(r==null)return"";if(typeof r=="function")return jr(r,Kr(r));if(typeof r=="string")return Z(r);switch(r){case I:return Z("Suspense");case v:return Z("SuspenseList")}if(typeof r=="object")switch(r.$$typeof){case w:return Gr(r.render);case j:return rr(r.type,n,e);case O:{var o=r,d=o._payload,u=o._init;try{return rr(u(d),n,e)}catch{}}}return""}var nr=Object.prototype.hasOwnProperty,Cr={},kr=C.ReactDebugCurrentFrame;function er(r){if(r){var n=r._owner,e=rr(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(nr);for(var a in r)if(u(r,a)){var i=void 0;try{if(typeof r[a]!="function"){var E=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 E.name="Invariant Violation",E}i=r[a](n,a,o,e,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(c){i=c}i&&!(i instanceof Error)&&(er(d),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,a,typeof i),er(null)),i instanceof Error&&!(i.message in Cr)&&(Cr[i.message]=!0,er(d),p("Failed %s type: %s",e,i.message),er(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 p("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 H=C.ReactCurrentOwner,nn={key:!0,ref:!0,__self:!0,__source:!0},Or,Pr,ur;ur={};function en(r){if(nr.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(nr.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"&&H.current&&n&&H.current.stateNode!==n){var e=m(H.current.type);ur[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',m(H.current.type),r.ref),ur[e]=!0)}}function an(r,n){{var e=function(){Or||(Or=!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 dn(r,n){{var e=function(){Pr||(Pr=!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 sn=function(r,n,e,o,d,u,a){var i={$$typeof:x,type:r,key:n,ref:e,props:a,_owner:u};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:d}),Object.freeze&&(Object.freeze(i.props),Object.freeze(i)),i};function un(r,n,e,o,d){{var u,a={},i=null,E=null;e!==void 0&&(Sr(e),i=""+e),on(n)&&(Sr(n.key),i=""+n.key),en(n)&&(E=n.ref,tn(n,d));for(u in n)nr.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(i||E){var h=typeof r=="function"?r.displayName||r.name||"Unknown":r;i&&an(a,h),E&&dn(a,h)}return sn(r,i,E,d,o,H.current,a)}}var lr=C.ReactCurrentOwner,Dr=C.ReactDebugCurrentFrame;function V(r){if(r){var n=r._owner,e=rr(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===x}function Fr(){{if(lr.current){var r=m(lr.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 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 "+b(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 $r(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=z(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===_))e=n.propTypes;else return;if(e){var o=b(n);Xr(e,r.props,"prop",o,r)}else if(n.PropTypes!==void 0&&!cr){cr=!0;var d=b(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 Lr(r,n,e,o,d,u){{var a=t(r);if(!a){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 x=ln(d);x?i+=x:i+=Fr();var c;r===null?c="null":sr(r)?c="array":r!==void 0&&r.$$typeof===m?(c="<"+(b(r.type)||"Unknown")+" />",i=" 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,i)}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 Y=0;Y<R.length;Y++)$r(R[Y],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 $r(R,r)}return r===E?pn(p):fn(p),p}}function hn(r,n,e){return Lr(r,n,e,!0)}function vn(r,n,e){return Lr(r,n,e,!1)}var gn=vn,wn=hn;U.Fragment=E,U.jsx=gn,U.jsxs=wn}()),U}process.env.NODE_ENV==="production"?er.exports=Nr():er.exports=zr();var s=er.exports;const Vr=`@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 "+m(r._owner.type)+"."),V(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),V(null)}}function $r(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=z(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===j))e=n.propTypes;else return;if(e){var o=m(n);Xr(e,r.props,"prop",o,r)}else if(n.PropTypes!==void 0&&!cr){cr=!0;var d=m(n);p("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",d||"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"){V(r),p("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),p("Invalid attribute `ref` supplied to `React.Fragment`."),V(null))}}function Lr(r,n,e,o,d,u){{var a=$(r);if(!a){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 E=ln(d);E?i+=E:i+=Fr();var c;r===null?c="null":sr(r)?c="array":r!==void 0&&r.$$typeof===x?(c="<"+(m(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 h=un(r,n,e,d,u);if(h==null)return h;if(a){var _=n.children;if(_!==void 0)if(o)if(sr(_)){for(var Y=0;Y<_.length;Y++)$r(_[Y],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 $r(_,r)}return r===R?pn(h):fn(h),h}}function hn(r,n,e){return Lr(r,n,e,!0)}function vn(r,n,e){return Lr(r,n,e,!1)}var gn=vn,wn=hn;U.Fragment=R,U.jsx=gn,U.jsxs=wn}()),U}process.env.NODE_ENV==="production"?or.exports=Nr():or.exports=zr();var s=or.exports;const Vr=`@import url("https://fonts.googleapis.com/css2?family=Poppins&display=swap"); | ||
* { | ||
@@ -150,2 +150,7 @@ margin: 0; | ||
} | ||
.hsd-input-dropdown-container.disable { | ||
background-color: #f2f3f2; | ||
cursor: not-allowed; | ||
pointer-events: none; | ||
} | ||
@@ -273,3 +278,3 @@ .hsd-input-dropdown-container.error { | ||
} | ||
`;function Yr(g){const[m,C]=f.useState(g),E=f.useRef(null),k=F=>{E.current&&!E.current.contains(F.target)&&C(!1)};return f.useEffect(()=>(document.addEventListener("click",k,!0),()=>{document.removeEventListener("click",k,!0)}),[]),{ref:E,isComponentVisible:m,setIsComponentVisible:C}}const vr="hudoro-input-dropdown-styles";(g=>{if(!document.getElementById(vr)){const m=document.createElement("style");m.id=vr,m.textContent=g,document.head.appendChild(m)}})(Vr);const Mr=({dropdownLists:g,onChange:m,defaultValue:C,size:E="md",multiSelect:k,searchAble:F,iconLeft:I,placeholder:T,onSearch:w,error:A,position:h,onBlur:_,onFocus:S})=>{const $=f.useRef(),[l,N]=f.useState([]),[z,j]=f.useState(""),v=f.useRef(null),{isComponentVisible:q,ref:B,setIsComponentVisible:G}=Yr(!1),or=()=>{G(t=>!t)},K=(t,y)=>{if(!k)N([{label:t,value:y}]),m([{label:t,value:y}]),G(!1);else if(l==null?void 0:l.find(b=>b.value===y)){const b=[...l?l.filter(P=>P.value!==y):[]];N(b),m(b)}else{const b=[...l||[],{label:t,value:y}];N(b),m(b)}};f.useEffect(()=>{JSON.stringify($.current)===JSON.stringify(C)||($.current=C,N($.current||[]))},[C]);const ir=()=>l.length?k?l==null?void 0:l.map((t,y)=>s.jsx("p",{style:{minWidth:"max-content"},className:"hsd-input-dropdown-preview-item",children:t==null?void 0:t.label},y)):s.jsx("p",{style:{minWidth:"max-content"},children:l==null?void 0:l[0].label}):s.jsx("p",{className:"hsd-input-dropdown-placeholder",children:T});f.useEffect(()=>{j(h||"bottom")},[h]);const L=()=>{if(!h&&B.current&&v.current){const t=window.innerHeight,y=B.current.getBoundingClientRect(),O=v.current.getBoundingClientRect();y.bottom+O.height>=t-10?j("top"):j(h||"bottom")}};return f.useEffect(()=>(window.addEventListener("scroll",L),window.addEventListener("resize",L),()=>{window.removeEventListener("scroll",L),window.removeEventListener("resize",L)}),[]),f.useEffect(()=>{L()},[q]),s.jsxs("div",{className:`hsd-input-dropdown-container hsd-input-dropdown-size-${E} ${q?"active":""} ${A?"error":""}`,ref:B,onClick:or,children:[s.jsxs("div",{className:"hsd-input-dropdown-preview-container",children:[I?s.jsx(s.Fragment,{children:f.cloneElement(I,{width:gr(E),color:"#939E99"})}):null,s.jsx("div",{className:"hsd-input-dropdown-container-preview-item",tabIndex:100,onBlur:_,onFocus:S,children:ir()}),s.jsx(qr,{strokeWidth:2,width:gr(E)})]}),q?s.jsxs("div",{className:`hsd-input-dropdown-lists-container | ||
hsd-input-dropdown-lists-container-${z}`,onClick:t=>t.stopPropagation(),ref:v,children:[F?s.jsxs("div",{className:"hsd-input-dropdown-container-dropdown-search",style:{order:z=="bottom"?1:2,position:"sticky",top:0,bottom:0},children:[s.jsx("div",{style:{display:"flex"},children:s.jsx(Ur,{strokeWidth:2,width:20})}),s.jsx("input",{onChange:t=>{w&&w(t.target.value)},autoFocus:!0,style:{width:"100%"}})]}):null,s.jsx("div",{className:"hsd-input-dropdwon-item-container",style:{order:z=="bottom"?2:1},children:z==="bottom"?g.map((t,y)=>s.jsxs("div",{className:`hsd-input-dropdwon-item ${l!=null&&l.find(O=>O.value===t.value)?"active":""} ${t.disable?"hsd-input-dropdwon-item-disable":null}`,onClick:()=>K(t.label,t.value),children:[t.icon?s.jsx("div",{children:f.cloneElement(t.icon,{width:16})}):null,s.jsxs("div",{children:[" ",s.jsx("p",{children:t.label})]})]},y)):g.reverse().map((t,y)=>s.jsxs("div",{className:`hsd-input-dropdwon-item ${l!=null&&l.find(O=>O.value===t.value)?"active":""} ${t.disable?"hsd-input-dropdwon-item-disable":null}`,onClick:()=>K(t.label,t.value),children:[t.icon?s.jsx("div",{children:f.cloneElement(t.icon,{width:16})}):null,s.jsxs("div",{children:[" ",s.jsx("p",{children:t.label})]})]},y))})]}):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"})]}),qr=({...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"})}); | ||
`;function Yr(g){const[x,k]=f.useState(g),R=f.useRef(null),T=D=>{R.current&&!R.current.contains(D.target)&&k(!1)};return f.useEffect(()=>(document.addEventListener("click",T,!0),()=>{document.removeEventListener("click",T,!0)}),[]),{ref:R,isComponentVisible:x,setIsComponentVisible:k}}const vr="hudoro-input-dropdown-styles";(g=>{if(!document.getElementById(vr)){const x=document.createElement("style");x.id=vr,x.textContent=g,document.head.appendChild(x)}})(Vr);const Mr=({dropdownLists:g,onChange:x,defaultValue:k,size:R="md",multiSelect:T,searchAble:D,iconLeft:F,placeholder:S,onSearch:w,error:I,position:v,onBlur:j,onFocus:O,disable:W})=>{const N=f.useRef(),[l,z]=f.useState([]),[C,p]=f.useState(""),q=f.useRef(null),{isComponentVisible:B,ref:J,setIsComponentVisible:G}=Yr(!1),ir=()=>{G(t=>!t)},K=(t,b)=>{if(!T)z([{label:t,value:b}]),x([{label:t,value:b}]),G(!1);else if(l==null?void 0:l.find(y=>y.value===b)){const y=[...l?l.filter(L=>L.value!==b):[]];z(y),x(y)}else{const y=[...l||[],{label:t,value:b}];z(y),x(y)}};f.useEffect(()=>{JSON.stringify(N.current)===JSON.stringify(k)||(N.current=k,z(N.current||[]))},[k]);const X=()=>l.length?T?l==null?void 0:l.map((t,b)=>s.jsx("p",{style:{minWidth:"max-content"},className:"hsd-input-dropdown-preview-item",children:t==null?void 0:t.label},b)):s.jsx("p",{style:{minWidth:"max-content"},children:l==null?void 0:l[0].label}):s.jsx("p",{className:"hsd-input-dropdown-placeholder",children:S});f.useEffect(()=>{p(v||"bottom")},[v]);const $=()=>{if(!v&&J.current&&q.current){const t=window.innerHeight,b=J.current.getBoundingClientRect(),m=q.current.getBoundingClientRect();b.bottom+m.height>=t-10?p("top"):p(v||"bottom")}};return f.useEffect(()=>(window.addEventListener("scroll",$),window.addEventListener("resize",$),()=>{window.removeEventListener("scroll",$),window.removeEventListener("resize",$)}),[]),f.useEffect(()=>{$()},[B]),s.jsxs("div",{className:`hsd-input-dropdown-container ${W?"disable":""} hsd-input-dropdown-size-${R} ${B?"active":""} ${I?"error":""}`,ref:J,onClick:ir,children:[s.jsxs("div",{className:"hsd-input-dropdown-preview-container",children:[F?s.jsx(s.Fragment,{children:f.cloneElement(F,{width:gr(R),color:"#939E99"})}):null,s.jsx("div",{className:"hsd-input-dropdown-container-preview-item",tabIndex:100,onBlur:j,onFocus:O,children:X()}),s.jsx(qr,{strokeWidth:2,width:gr(R)})]}),B?s.jsxs("div",{className:`hsd-input-dropdown-lists-container | ||
hsd-input-dropdown-lists-container-${C}`,onClick:t=>t.stopPropagation(),ref:q,children:[D?s.jsxs("div",{className:"hsd-input-dropdown-container-dropdown-search",style:{order:C=="bottom"?1:2,position:"sticky",top:0,bottom:0},children:[s.jsx("div",{style:{display:"flex"},children:s.jsx(Ur,{strokeWidth:2,width:20})}),s.jsx("input",{onChange:t=>{w&&w(t.target.value)},autoFocus:!0,style:{width:"100%"}})]}):null,s.jsx("div",{className:"hsd-input-dropdwon-item-container",style:{order:C=="bottom"?2:1},children:C==="bottom"?g.map((t,b)=>s.jsxs("div",{className:`hsd-input-dropdwon-item ${l!=null&&l.find(m=>m.value===t.value)?"active":""} ${t.disable?"hsd-input-dropdwon-item-disable":null}`,onClick:()=>K(t.label,t.value),children:[t.icon?s.jsx("div",{children:f.cloneElement(t.icon,{width:16})}):null,s.jsxs("div",{children:[" ",s.jsx("p",{children:t.label})]})]},b)):g.reverse().map((t,b)=>s.jsxs("div",{className:`hsd-input-dropdwon-item ${l!=null&&l.find(m=>m.value===t.value)?"active":""} ${t.disable?"hsd-input-dropdwon-item-disable":null}`,onClick:()=>K(t.label,t.value),children:[t.icon?s.jsx("div",{children:f.cloneElement(t.icon,{width:16})}):null,s.jsxs("div",{children:[" ",s.jsx("p",{children:t.label})]})]},b))})]}):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"})]}),qr=({...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};A.Dropdown=Mr,Object.defineProperty(A,Symbol.toStringTag,{value:"Module"})}); |
@@ -28,2 +28,3 @@ export interface IconPropsDropdown extends React.SVGProps<SVGSVGElement> { | ||
onFocus?: (e: React.FocusEvent<HTMLDivElement, Element>) => void; | ||
disable?: boolean; | ||
} |
{ | ||
"name": "@hudoro/dropdown", | ||
"version": "0.0.3-beta.40", | ||
"version": "0.0.3-beta.41", | ||
"description": "dropdown component for Hudoro UI", | ||
@@ -5,0 +5,0 @@ "author": "Prawito Hudoro", |
68790
1435