New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@hudoro/dropdown

Package Overview
Dependencies
Maintainers
2
Versions
79
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@hudoro/dropdown - npm Package Compare versions

Comparing version 0.0.3-beta.15 to 0.0.3-beta.16

153

dist/dropdown.es.js

@@ -17,14 +17,14 @@ import q, { useState as Fr, useRef as fn, useEffect as Ir } from "react";

Tr = 1;
var g = q, b = Symbol.for("react.element"), m = Symbol.for("react.fragment"), x = Object.prototype.hasOwnProperty, _ = g.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, O = { key: !0, ref: !0, __self: !0, __source: !0 };
function P(j, w, s) {
var v = q, m = Symbol.for("react.element"), y = Symbol.for("react.fragment"), x = Object.prototype.hasOwnProperty, _ = v.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, O = { key: !0, ref: !0, __self: !0, __source: !0 };
function P(j, g, s) {
var f, E = {}, C = null, F = null;
s !== void 0 && (C = "" + s), w.key !== void 0 && (C = "" + w.key), w.ref !== void 0 && (F = w.ref);
for (f in w)
x.call(w, f) && !O.hasOwnProperty(f) && (E[f] = w[f]);
s !== void 0 && (C = "" + s), g.key !== void 0 && (C = "" + g.key), g.ref !== void 0 && (F = g.ref);
for (f in g)
x.call(g, f) && !O.hasOwnProperty(f) && (E[f] = g[f]);
if (j && j.defaultProps)
for (f in w = j.defaultProps, w)
E[f] === void 0 && (E[f] = w[f]);
return { $$typeof: b, type: j, key: C, ref: F, props: E, _owner: _.current };
for (f in g = j.defaultProps, g)
E[f] === void 0 && (E[f] = g[f]);
return { $$typeof: m, type: j, key: C, ref: F, props: E, _owner: _.current };
}
return L.Fragment = m, L.jsx = P, L.jsxs = P, L;
return L.Fragment = y, L.jsx = P, L.jsxs = P, L;
}

@@ -44,3 +44,3 @@ var N = {};

return Sr || (Sr = 1, process.env.NODE_ENV !== "production" && function() {
var g = q, b = Symbol.for("react.element"), m = Symbol.for("react.portal"), x = Symbol.for("react.fragment"), _ = Symbol.for("react.strict_mode"), O = Symbol.for("react.profiler"), P = Symbol.for("react.provider"), j = Symbol.for("react.context"), w = Symbol.for("react.forward_ref"), s = Symbol.for("react.suspense"), f = Symbol.for("react.suspense_list"), E = Symbol.for("react.memo"), C = Symbol.for("react.lazy"), F = Symbol.for("react.offscreen"), z = Symbol.iterator, J = "@@iterator";
var v = q, m = Symbol.for("react.element"), y = Symbol.for("react.portal"), x = Symbol.for("react.fragment"), _ = Symbol.for("react.strict_mode"), O = Symbol.for("react.profiler"), P = Symbol.for("react.provider"), j = Symbol.for("react.context"), g = Symbol.for("react.forward_ref"), s = Symbol.for("react.suspense"), f = Symbol.for("react.suspense_list"), E = Symbol.for("react.memo"), C = Symbol.for("react.lazy"), F = Symbol.for("react.offscreen"), z = Symbol.iterator, J = "@@iterator";
function u(r) {

@@ -52,3 +52,3 @@ if (r === null || typeof r != "object")

}
var v = g.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
var w = v.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
function p(r) {

@@ -63,3 +63,3 @@ {

{
var o = v.ReactDebugCurrentFrame, a = o.getStackAddendum();
var o = w.ReactDebugCurrentFrame, a = o.getStackAddendum();
a !== "" && (n += "%s", e = e.concat([a]));

@@ -75,3 +75,3 @@ var d = e.map(function(t) {

function Lr(r) {
return !!(typeof r == "string" || typeof r == "function" || r === x || r === O || $r || r === _ || r === s || r === f || Wr || r === F || G || Dr || Ar || typeof r == "object" && r !== null && (r.$$typeof === C || r.$$typeof === E || r.$$typeof === P || r.$$typeof === j || r.$$typeof === w || // This needs to include all possible module reference object
return !!(typeof r == "string" || typeof r == "function" || r === x || r === O || $r || r === _ || r === s || r === f || Wr || r === F || G || Dr || Ar || typeof r == "object" && r !== null && (r.$$typeof === C || r.$$typeof === E || r.$$typeof === P || r.$$typeof === j || r.$$typeof === g || // This needs to include all possible module reference object
// types supported by any Flight configuration anywhere since

@@ -102,3 +102,3 @@ // we don't know which Flight build this will end up being used

return "Fragment";
case m:
case y:
return "Portal";

@@ -122,3 +122,3 @@ case O:

return tr(e._context) + ".Provider";
case w:
case g:
return Nr(r, r.render, "ForwardRef");

@@ -201,3 +201,3 @@ case E:

}
var K = v.ReactCurrentDispatcher, H;
var K = w.ReactCurrentDispatcher, H;
function Y(r, n, e) {

@@ -270,10 +270,10 @@ {

for (var i = S.stack.split(`
`), y = o.stack.split(`
`), c = i.length - 1, h = y.length - 1; c >= 1 && h >= 0 && i[c] !== y[h]; )
`), b = o.stack.split(`
`), c = i.length - 1, h = b.length - 1; c >= 1 && h >= 0 && i[c] !== b[h]; )
h--;
for (; c >= 1 && h >= 0; c--, h--)
if (i[c] !== y[h]) {
if (i[c] !== b[h]) {
if (c !== 1 || h !== 1)
do
if (c--, h--, h < 0 || i[c] !== y[h]) {
if (c--, h--, h < 0 || i[c] !== b[h]) {
var R = `

@@ -315,3 +315,3 @@ ` + i[c].replace(" at new ", " at ");

switch (r.$$typeof) {
case w:
case g:
return Vr(r.render);

@@ -330,3 +330,3 @@ case E:

}
var U = Object.prototype.hasOwnProperty, vr = {}, gr = v.ReactDebugCurrentFrame;
var U = Object.prototype.hasOwnProperty, vr = {}, gr = w.ReactDebugCurrentFrame;
function B(r) {

@@ -347,4 +347,4 @@ if (r) {

if (typeof r[t] != "function") {
var y = 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 y.name = "Invariant Violation", y;
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;
}

@@ -383,3 +383,3 @@ i = r[t](n, t, o, e, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");

}
var $ = v.ReactCurrentOwner, Kr = {
var $ = w.ReactCurrentOwner, Kr = {
key: !0,

@@ -438,3 +438,3 @@ ref: !0,

// This tag allows us to uniquely identify this as a React Element
$$typeof: b,
$$typeof: m,
// Built-in properties that belong on the element

@@ -467,4 +467,4 @@ type: r,

{
var d, t = {}, i = null, y = null;
e !== void 0 && (mr(e), i = "" + e), Xr(n) && (mr(n.key), i = "" + n.key), Hr(n) && (y = n.ref, Zr(n, a));
var d, t = {}, i = null, b = null;
e !== void 0 && (mr(e), i = "" + e), Xr(n) && (mr(n.key), i = "" + n.key), Hr(n) && (b = n.ref, Zr(n, a));
for (d in n)

@@ -477,10 +477,10 @@ U.call(n, d) && !Kr.hasOwnProperty(d) && (t[d] = n[d]);

}
if (i || y) {
if (i || b) {
var h = typeof r == "function" ? r.displayName || r.name || "Unknown" : r;
i && Qr(t, h), y && rn(t, h);
i && Qr(t, h), b && rn(t, h);
}
return nn(r, i, y, a, o, $.current, t);
return nn(r, i, b, a, o, $.current, t);
}
}
var rr = v.ReactCurrentOwner, xr = v.ReactDebugCurrentFrame;
var rr = w.ReactCurrentOwner, xr = w.ReactDebugCurrentFrame;
function D(r) {

@@ -496,3 +496,3 @@ if (r) {

function er(r) {
return typeof r == "object" && r !== null && r.$$typeof === b;
return typeof r == "object" && r !== null && r.$$typeof === m;
}

@@ -575,3 +575,3 @@ function Er() {

e = n.propTypes;
else if (typeof n == "object" && (n.$$typeof === w || // 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.

@@ -611,6 +611,6 @@ n.$$typeof === E))

(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 y = on(a);
y ? i += y : i += Er();
var b = on(a);
b ? i += b : i += Er();
var c;
r === null ? c = "null" : Z(r) ? c = "array" : r !== void 0 && r.$$typeof === b ? (c = "<" + (T(r.type) || "Unknown") + " />", i = " Did you accidentally export a JSX literal instead of a component?") : c = typeof r, p("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", c, i);
r === null ? c = "null" : Z(r) ? c = "array" : r !== void 0 && r.$$typeof === m ? (c = "<" + (T(r.type) || "Unknown") + " />", i = " Did you accidentally export a JSX literal instead of a component?") : c = typeof r, p("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", c, i);
}

@@ -841,14 +841,14 @@ var h = en(r, n, e, a, d);

`;
function gn(g) {
const [b, m] = Fr(g), x = fn(null), _ = (O) => {
x.current && !x.current.contains(O.target) && m(!1);
function gn(v) {
const [m, y] = Fr(v), x = fn(null), _ = (O) => {
x.current && !x.current.contains(O.target) && y(!1);
};
return Ir(() => (document.addEventListener("click", _, !0), () => {
document.removeEventListener("click", _, !0);
}), []), { ref: x, isComponentVisible: b, setIsComponentVisible: m };
}), []), { ref: x, isComponentVisible: m, setIsComponentVisible: y };
}
const Or = "hudoro-input-dropdown-styles", wn = (g) => {
const Or = "hudoro-input-dropdown-styles", wn = (v) => {
if (!document.getElementById(Or)) {
const b = document.createElement("style");
b.id = Or, b.textContent = g, document.head.appendChild(b);
const m = document.createElement("style");
m.id = Or, m.textContent = v, document.head.appendChild(m);
}

@@ -858,5 +858,5 @@ };

const xn = ({
dropdownLists: g,
onChange: b,
defaultValue: m,
dropdownLists: v,
onChange: m,
defaultValue: y,
size: x = "md",

@@ -867,36 +867,33 @@ multiSelect: _,

placeholder: j,
onSearch: w
onSearch: g
}) => {
const [s, f] = Fr([]), { isComponentVisible: E, ref: C, setIsComponentVisible: F } = gn(!1), z = () => {
F((u) => !u);
}, J = (u, v) => {
}, J = (u, w) => {
if (!_)
f([{ label: u, value: v }]), b([{ label: u, value: v }]), F(!1);
else if (s == null ? void 0 : s.find((k) => k.value === v)) {
f([{ label: u, value: w }]), m([{ label: u, value: w }]), F(!1);
else if (s == null ? void 0 : s.find((k) => k.value === w)) {
const k = [
...s ? s.filter((G) => G.value !== v) : []
...s ? s.filter((G) => G.value !== w) : []
];
f(k), b(k);
f(k), m(k);
} else {
const k = [...s || [], { label: u, value: v }];
f(k), b(k);
const k = [...s || [], { label: u, value: w }];
f(k), m(k);
}
};
return Ir(() => {
if (m) {
if (y) {
if (!s.length)
console.log("why", s), f(m);
console.log("why", s), f(y);
else if (s.length) {
console.log("value", s), console.log("defaultValue", m);
for (let u of m) {
const v = s.findIndex((p) => p.value === u.value);
if (v < 0) {
console.log("asdfsdf", v), f(m);
for (let u of y)
if (s.findIndex((p) => p.value === u.value) < 0) {
f(s);
return;
}
}
}
}
m != null && m.length || f([]);
}, [m, g]), /* @__PURE__ */ l.jsxs(
y != null && y.length || f([]);
}, [y, v]), /* @__PURE__ */ l.jsxs(
"div",

@@ -913,3 +910,3 @@ {

}) }) : null,
/* @__PURE__ */ l.jsx("div", { className: "hsd-input-dropdown-container-preview-item", children: s.length ? _ ? s == null ? void 0 : s.map((u, v) => /* @__PURE__ */ l.jsx(
/* @__PURE__ */ l.jsx("div", { className: "hsd-input-dropdown-container-preview-item", children: s.length ? _ ? s == null ? void 0 : s.map((u, w) => /* @__PURE__ */ l.jsx(
"p",

@@ -921,3 +918,3 @@ {

},
v
w
)) : /* @__PURE__ */ l.jsx("p", { style: { minWidth: "max-content" }, children: s == null ? void 0 : s[0].label }) : /* @__PURE__ */ l.jsx("p", { className: "hsd-input-dropdown-placeholder", children: j || "Search" }) }),

@@ -938,3 +935,3 @@ /* @__PURE__ */ l.jsx(bn, { strokeWidth: 2, width: Pr(x) })

onChange: (u) => {
w && w(u.target.value);
g && g(u.target.value);
}

@@ -944,3 +941,3 @@ }

] }) : null,
/* @__PURE__ */ l.jsx("div", { className: "hsd-input-dropdwon-item-container", children: g.map((u, v) => /* @__PURE__ */ l.jsxs(
/* @__PURE__ */ l.jsx("div", { className: "hsd-input-dropdwon-item-container", children: v.map((u, w) => /* @__PURE__ */ l.jsxs(
"div",

@@ -960,3 +957,3 @@ {

},
v
w
)) })

@@ -969,7 +966,7 @@ ]

);
}, mn = ({ ...g }) => /* @__PURE__ */ l.jsxs(
}, mn = ({ ...v }) => /* @__PURE__ */ l.jsxs(
"svg",
{
xmlns: "http://www.w3.org/2000/svg",
...g,
...v,
viewBox: "0 0 20 20",

@@ -1002,7 +999,7 @@ fill: "none",

}
), bn = ({ ...g }) => /* @__PURE__ */ l.jsx(
), bn = ({ ...v }) => /* @__PURE__ */ l.jsx(
"svg",
{
xmlns: "http://www.w3.org/2000/svg",
...g,
...v,
viewBox: "0 0 24 24",

@@ -1021,8 +1018,8 @@ fill: "none",

}
), Pr = (g) => {
if (g === "sm")
), Pr = (v) => {
if (v === "sm")
return 16;
if (g === "md")
if (v === "md")
return 20;
if (g === "lg")
if (v === "lg")
return 20;

@@ -1029,0 +1026,0 @@ };

@@ -9,3 +9,3 @@ (function(F,E){typeof exports=="object"&&typeof module<"u"?E(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],E):(F=typeof globalThis<"u"?globalThis:F||self,E(F.Dropdown={},F.React))})(this,function(F,E){"use strict";var K={exports:{}},N={};/**

* LICENSE file in the root directory of this source tree.
*/var ir;function Fr(){if(ir)return N;ir=1;var g=E,b=Symbol.for("react.element"),m=Symbol.for("react.fragment"),x=Object.prototype.hasOwnProperty,j=g.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,P={key:!0,ref:!0,__self:!0,__source:!0};function D(C,w,s){var f,R={},T=null,I=null;s!==void 0&&(T=""+s),w.key!==void 0&&(T=""+w.key),w.ref!==void 0&&(I=w.ref);for(f in w)x.call(w,f)&&!P.hasOwnProperty(f)&&(R[f]=w[f]);if(C&&C.defaultProps)for(f in w=C.defaultProps,w)R[f]===void 0&&(R[f]=w[f]);return{$$typeof:b,type:C,key:T,ref:I,props:R,_owner:j.current}}return N.Fragment=m,N.jsx=D,N.jsxs=D,N}var z={};/**
*/var ir;function Fr(){if(ir)return N;ir=1;var v=E,m=Symbol.for("react.element"),y=Symbol.for("react.fragment"),x=Object.prototype.hasOwnProperty,j=v.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,P={key:!0,ref:!0,__self:!0,__source:!0};function D(C,g,s){var f,R={},T=null,I=null;s!==void 0&&(T=""+s),g.key!==void 0&&(T=""+g.key),g.ref!==void 0&&(I=g.ref);for(f in g)x.call(g,f)&&!P.hasOwnProperty(f)&&(R[f]=g[f]);if(C&&C.defaultProps)for(f in g=C.defaultProps,g)R[f]===void 0&&(R[f]=g[f]);return{$$typeof:m,type:C,key:T,ref:I,props:R,_owner:j.current}}return N.Fragment=y,N.jsx=D,N.jsxs=D,N}var z={};/**
* @license React

@@ -18,7 +18,7 @@ * react-jsx-runtime.development.js

* LICENSE file in the root directory of this source tree.
*/var ar;function Ir(){return ar||(ar=1,process.env.NODE_ENV!=="production"&&function(){var g=E,b=Symbol.for("react.element"),m=Symbol.for("react.portal"),x=Symbol.for("react.fragment"),j=Symbol.for("react.strict_mode"),P=Symbol.for("react.profiler"),D=Symbol.for("react.provider"),C=Symbol.for("react.context"),w=Symbol.for("react.forward_ref"),s=Symbol.for("react.suspense"),f=Symbol.for("react.suspense_list"),R=Symbol.for("react.memo"),T=Symbol.for("react.lazy"),I=Symbol.for("react.offscreen"),V=Symbol.iterator,H="@@iterator";function l(r){if(r===null||typeof r!="object")return null;var n=V&&r[V]||r[H];return typeof n=="function"?n:null}var v=g.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function p(r){{for(var n=arguments.length,e=new Array(n>1?n-1:0),o=1;o<n;o++)e[o-1]=arguments[o];k("error",r,e)}}function k(r,n,e){{var o=v.ReactDebugCurrentFrame,a=o.getStackAddendum();a!==""&&(n+="%s",e=e.concat([a]));var d=e.map(function(i){return String(i)});d.unshift("Warning: "+n),Function.prototype.apply.call(console[r],console,d)}}var X=!1,Yr=!1,Mr=!1,Vr=!1,Ur=!1,ur;ur=Symbol.for("react.module.reference");function Br(r){return!!(typeof r=="string"||typeof r=="function"||r===x||r===P||Ur||r===j||r===s||r===f||Vr||r===I||X||Yr||Mr||typeof r=="object"&&r!==null&&(r.$$typeof===T||r.$$typeof===R||r.$$typeof===D||r.$$typeof===C||r.$$typeof===w||r.$$typeof===ur||r.getModuleId!==void 0))}function $r(r,n,e){var o=r.displayName;if(o)return o;var a=n.displayName||n.name||"";return a!==""?e+"("+a+")":e}function lr(r){return r.displayName||"Context"}function S(r){if(r==null)return null;if(typeof r.tag=="number"&&p("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof r=="function")return r.displayName||r.name||null;if(typeof r=="string")return r;switch(r){case x:return"Fragment";case m:return"Portal";case P:return"Profiler";case j:return"StrictMode";case s:return"Suspense";case f:return"SuspenseList"}if(typeof r=="object")switch(r.$$typeof){case C:var n=r;return lr(n)+".Consumer";case D:var e=r;return lr(e._context)+".Provider";case w:return $r(r,r.render,"ForwardRef");case R:var o=r.displayName||null;return o!==null?o:S(r.type)||"Memo";case T:{var a=r,d=a._payload,i=a._init;try{return S(i(d))}catch{return null}}}return null}var A=Object.assign,Y=0,cr,fr,pr,hr,vr,gr,wr;function mr(){}mr.__reactDisabledLog=!0;function Jr(){{if(Y===0){cr=console.log,fr=console.info,pr=console.warn,hr=console.error,vr=console.group,gr=console.groupCollapsed,wr=console.groupEnd;var r={configurable:!0,enumerable:!0,value:mr,writable:!0};Object.defineProperties(console,{info:r,log:r,warn:r,error:r,group:r,groupCollapsed:r,groupEnd:r})}Y++}}function Gr(){{if(Y--,Y===0){var r={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:A({},r,{value:cr}),info:A({},r,{value:fr}),warn:A({},r,{value:pr}),error:A({},r,{value:hr}),group:A({},r,{value:vr}),groupCollapsed:A({},r,{value:gr}),groupEnd:A({},r,{value:wr})})}Y<0&&p("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var Z=v.ReactCurrentDispatcher,q;function U(r,n,e){{if(q===void 0)try{throw Error()}catch(a){var o=a.stack.trim().match(/\n( *(at )?)/);q=o&&o[1]||""}return`
*/var ar;function Ir(){return ar||(ar=1,process.env.NODE_ENV!=="production"&&function(){var v=E,m=Symbol.for("react.element"),y=Symbol.for("react.portal"),x=Symbol.for("react.fragment"),j=Symbol.for("react.strict_mode"),P=Symbol.for("react.profiler"),D=Symbol.for("react.provider"),C=Symbol.for("react.context"),g=Symbol.for("react.forward_ref"),s=Symbol.for("react.suspense"),f=Symbol.for("react.suspense_list"),R=Symbol.for("react.memo"),T=Symbol.for("react.lazy"),I=Symbol.for("react.offscreen"),V=Symbol.iterator,H="@@iterator";function l(r){if(r===null||typeof r!="object")return null;var n=V&&r[V]||r[H];return typeof n=="function"?n:null}var w=v.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function p(r){{for(var n=arguments.length,e=new Array(n>1?n-1:0),o=1;o<n;o++)e[o-1]=arguments[o];k("error",r,e)}}function k(r,n,e){{var o=w.ReactDebugCurrentFrame,a=o.getStackAddendum();a!==""&&(n+="%s",e=e.concat([a]));var d=e.map(function(i){return String(i)});d.unshift("Warning: "+n),Function.prototype.apply.call(console[r],console,d)}}var X=!1,Yr=!1,Mr=!1,Vr=!1,Ur=!1,ur;ur=Symbol.for("react.module.reference");function Br(r){return!!(typeof r=="string"||typeof r=="function"||r===x||r===P||Ur||r===j||r===s||r===f||Vr||r===I||X||Yr||Mr||typeof r=="object"&&r!==null&&(r.$$typeof===T||r.$$typeof===R||r.$$typeof===D||r.$$typeof===C||r.$$typeof===g||r.$$typeof===ur||r.getModuleId!==void 0))}function $r(r,n,e){var o=r.displayName;if(o)return o;var a=n.displayName||n.name||"";return a!==""?e+"("+a+")":e}function lr(r){return r.displayName||"Context"}function S(r){if(r==null)return null;if(typeof r.tag=="number"&&p("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof r=="function")return r.displayName||r.name||null;if(typeof r=="string")return r;switch(r){case x:return"Fragment";case y:return"Portal";case P:return"Profiler";case j:return"StrictMode";case s:return"Suspense";case f:return"SuspenseList"}if(typeof r=="object")switch(r.$$typeof){case C:var n=r;return lr(n)+".Consumer";case D:var e=r;return lr(e._context)+".Provider";case g:return $r(r,r.render,"ForwardRef");case R:var o=r.displayName||null;return o!==null?o:S(r.type)||"Memo";case T:{var a=r,d=a._payload,i=a._init;try{return S(i(d))}catch{return null}}}return null}var A=Object.assign,Y=0,cr,fr,pr,hr,vr,gr,wr;function mr(){}mr.__reactDisabledLog=!0;function Jr(){{if(Y===0){cr=console.log,fr=console.info,pr=console.warn,hr=console.error,vr=console.group,gr=console.groupCollapsed,wr=console.groupEnd;var r={configurable:!0,enumerable:!0,value:mr,writable:!0};Object.defineProperties(console,{info:r,log:r,warn:r,error:r,group:r,groupCollapsed:r,groupEnd:r})}Y++}}function Gr(){{if(Y--,Y===0){var r={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:A({},r,{value:cr}),info:A({},r,{value:fr}),warn:A({},r,{value:pr}),error:A({},r,{value:hr}),group:A({},r,{value:vr}),groupCollapsed:A({},r,{value:gr}),groupEnd:A({},r,{value:wr})})}Y<0&&p("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var Z=w.ReactCurrentDispatcher,q;function U(r,n,e){{if(q===void 0)try{throw Error()}catch(a){var o=a.stack.trim().match(/\n( *(at )?)/);q=o&&o[1]||""}return`
`+q+r}}var Q=!1,B;{var Kr=typeof WeakMap=="function"?WeakMap:Map;B=new Kr}function br(r,n){if(!r||Q)return"";{var e=B.get(r);if(e!==void 0)return e}var o;Q=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var d;d=Z.current,Z.current=null,Jr();try{if(n){var i=function(){throw Error()};if(Object.defineProperty(i.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(i,[])}catch(O){o=O}Reflect.construct(r,[],i)}else{try{i.call()}catch(O){o=O}r.call(i.prototype)}}else{try{throw Error()}catch(O){o=O}r()}}catch(O){if(O&&o&&typeof O.stack=="string"){for(var t=O.stack.split(`
`),y=o.stack.split(`
`),c=t.length-1,h=y.length-1;c>=1&&h>=0&&t[c]!==y[h];)h--;for(;c>=1&&h>=0;c--,h--)if(t[c]!==y[h]){if(c!==1||h!==1)do if(c--,h--,h<0||t[c]!==y[h]){var _=`
`+t[c].replace(" at new "," at ");return r.displayName&&_.includes("<anonymous>")&&(_=_.replace("<anonymous>",r.displayName)),typeof r=="function"&&B.set(r,_),_}while(c>=1&&h>=0);break}}}finally{Q=!1,Z.current=d,Gr(),Error.prepareStackTrace=a}var L=r?r.displayName||r.name:"",Dr=L?U(L):"";return typeof r=="function"&&B.set(r,Dr),Dr}function Hr(r,n,e){return br(r,!1)}function Xr(r){var n=r.prototype;return!!(n&&n.isReactComponent)}function $(r,n,e){if(r==null)return"";if(typeof r=="function")return br(r,Xr(r));if(typeof r=="string")return U(r);switch(r){case s:return U("Suspense");case f:return U("SuspenseList")}if(typeof r=="object")switch(r.$$typeof){case w:return Hr(r.render);case R:return $(r.type,n,e);case T:{var o=r,a=o._payload,d=o._init;try{return $(d(a),n,e)}catch{}}}return""}var J=Object.prototype.hasOwnProperty,yr={},xr=v.ReactDebugCurrentFrame;function G(r){if(r){var n=r._owner,e=$(r.type,r._source,n?n.type:null);xr.setExtraStackFrame(e)}else xr.setExtraStackFrame(null)}function Zr(r,n,e,o,a){{var d=Function.call.bind(J);for(var i in r)if(d(r,i)){var t=void 0;try{if(typeof r[i]!="function"){var y=Error((o||"React class")+": "+e+" type `"+i+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof r[i]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw y.name="Invariant Violation",y}t=r[i](n,i,o,e,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(c){t=c}t&&!(t instanceof Error)&&(G(a),p("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",o||"React class",e,i,typeof t),G(null)),t instanceof Error&&!(t.message in yr)&&(yr[t.message]=!0,G(a),p("Failed %s type: %s",e,t.message),G(null))}}}var qr=Array.isArray;function rr(r){return qr(r)}function Qr(r){{var n=typeof Symbol=="function"&&Symbol.toStringTag,e=n&&r[Symbol.toStringTag]||r.constructor.name||"Object";return e}}function rn(r){try{return Er(r),!1}catch{return!0}}function Er(r){return""+r}function Rr(r){if(rn(r))return p("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Qr(r)),Er(r)}var M=v.ReactCurrentOwner,nn={key:!0,ref:!0,__self:!0,__source:!0},_r,jr,nr;nr={};function en(r){if(J.call(r,"ref")){var n=Object.getOwnPropertyDescriptor(r,"ref").get;if(n&&n.isReactWarning)return!1}return r.ref!==void 0}function on(r){if(J.call(r,"key")){var n=Object.getOwnPropertyDescriptor(r,"key").get;if(n&&n.isReactWarning)return!1}return r.key!==void 0}function tn(r,n){if(typeof r.ref=="string"&&M.current&&n&&M.current.stateNode!==n){var e=S(M.current.type);nr[e]||(p('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',S(M.current.type),r.ref),nr[e]=!0)}}function an(r,n){{var e=function(){_r||(_r=!0,p("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",n))};e.isReactWarning=!0,Object.defineProperty(r,"key",{get:e,configurable:!0})}}function sn(r,n){{var e=function(){jr||(jr=!0,p("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",n))};e.isReactWarning=!0,Object.defineProperty(r,"ref",{get:e,configurable:!0})}}var dn=function(r,n,e,o,a,d,i){var t={$$typeof:b,type:r,key:n,ref:e,props:i,_owner:d};return t._store={},Object.defineProperty(t._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(t,"_self",{configurable:!1,enumerable:!1,writable:!1,value:o}),Object.defineProperty(t,"_source",{configurable:!1,enumerable:!1,writable:!1,value:a}),Object.freeze&&(Object.freeze(t.props),Object.freeze(t)),t};function un(r,n,e,o,a){{var d,i={},t=null,y=null;e!==void 0&&(Rr(e),t=""+e),on(n)&&(Rr(n.key),t=""+n.key),en(n)&&(y=n.ref,tn(n,a));for(d in n)J.call(n,d)&&!nn.hasOwnProperty(d)&&(i[d]=n[d]);if(r&&r.defaultProps){var c=r.defaultProps;for(d in c)i[d]===void 0&&(i[d]=c[d])}if(t||y){var h=typeof r=="function"?r.displayName||r.name||"Unknown":r;t&&an(i,h),y&&sn(i,h)}return dn(r,t,y,a,o,M.current,i)}}var er=v.ReactCurrentOwner,Cr=v.ReactDebugCurrentFrame;function W(r){if(r){var n=r._owner,e=$(r.type,r._source,n?n.type:null);Cr.setExtraStackFrame(e)}else Cr.setExtraStackFrame(null)}var or;or=!1;function tr(r){return typeof r=="object"&&r!==null&&r.$$typeof===b}function Tr(){{if(er.current){var r=S(er.current.type);if(r)return`
`),b=o.stack.split(`
`),c=t.length-1,h=b.length-1;c>=1&&h>=0&&t[c]!==b[h];)h--;for(;c>=1&&h>=0;c--,h--)if(t[c]!==b[h]){if(c!==1||h!==1)do if(c--,h--,h<0||t[c]!==b[h]){var _=`
`+t[c].replace(" at new "," at ");return r.displayName&&_.includes("<anonymous>")&&(_=_.replace("<anonymous>",r.displayName)),typeof r=="function"&&B.set(r,_),_}while(c>=1&&h>=0);break}}}finally{Q=!1,Z.current=d,Gr(),Error.prepareStackTrace=a}var L=r?r.displayName||r.name:"",Dr=L?U(L):"";return typeof r=="function"&&B.set(r,Dr),Dr}function Hr(r,n,e){return br(r,!1)}function Xr(r){var n=r.prototype;return!!(n&&n.isReactComponent)}function $(r,n,e){if(r==null)return"";if(typeof r=="function")return br(r,Xr(r));if(typeof r=="string")return U(r);switch(r){case s:return U("Suspense");case f:return U("SuspenseList")}if(typeof r=="object")switch(r.$$typeof){case g:return Hr(r.render);case R:return $(r.type,n,e);case T:{var o=r,a=o._payload,d=o._init;try{return $(d(a),n,e)}catch{}}}return""}var J=Object.prototype.hasOwnProperty,yr={},xr=w.ReactDebugCurrentFrame;function G(r){if(r){var n=r._owner,e=$(r.type,r._source,n?n.type:null);xr.setExtraStackFrame(e)}else xr.setExtraStackFrame(null)}function Zr(r,n,e,o,a){{var d=Function.call.bind(J);for(var i in r)if(d(r,i)){var t=void 0;try{if(typeof r[i]!="function"){var b=Error((o||"React class")+": "+e+" type `"+i+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof r[i]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw b.name="Invariant Violation",b}t=r[i](n,i,o,e,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(c){t=c}t&&!(t instanceof Error)&&(G(a),p("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",o||"React class",e,i,typeof t),G(null)),t instanceof Error&&!(t.message in yr)&&(yr[t.message]=!0,G(a),p("Failed %s type: %s",e,t.message),G(null))}}}var qr=Array.isArray;function rr(r){return qr(r)}function Qr(r){{var n=typeof Symbol=="function"&&Symbol.toStringTag,e=n&&r[Symbol.toStringTag]||r.constructor.name||"Object";return e}}function rn(r){try{return Er(r),!1}catch{return!0}}function Er(r){return""+r}function Rr(r){if(rn(r))return p("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Qr(r)),Er(r)}var M=w.ReactCurrentOwner,nn={key:!0,ref:!0,__self:!0,__source:!0},_r,jr,nr;nr={};function en(r){if(J.call(r,"ref")){var n=Object.getOwnPropertyDescriptor(r,"ref").get;if(n&&n.isReactWarning)return!1}return r.ref!==void 0}function on(r){if(J.call(r,"key")){var n=Object.getOwnPropertyDescriptor(r,"key").get;if(n&&n.isReactWarning)return!1}return r.key!==void 0}function tn(r,n){if(typeof r.ref=="string"&&M.current&&n&&M.current.stateNode!==n){var e=S(M.current.type);nr[e]||(p('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',S(M.current.type),r.ref),nr[e]=!0)}}function an(r,n){{var e=function(){_r||(_r=!0,p("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",n))};e.isReactWarning=!0,Object.defineProperty(r,"key",{get:e,configurable:!0})}}function sn(r,n){{var e=function(){jr||(jr=!0,p("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",n))};e.isReactWarning=!0,Object.defineProperty(r,"ref",{get:e,configurable:!0})}}var dn=function(r,n,e,o,a,d,i){var t={$$typeof:m,type:r,key:n,ref:e,props:i,_owner:d};return t._store={},Object.defineProperty(t._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(t,"_self",{configurable:!1,enumerable:!1,writable:!1,value:o}),Object.defineProperty(t,"_source",{configurable:!1,enumerable:!1,writable:!1,value:a}),Object.freeze&&(Object.freeze(t.props),Object.freeze(t)),t};function un(r,n,e,o,a){{var d,i={},t=null,b=null;e!==void 0&&(Rr(e),t=""+e),on(n)&&(Rr(n.key),t=""+n.key),en(n)&&(b=n.ref,tn(n,a));for(d in n)J.call(n,d)&&!nn.hasOwnProperty(d)&&(i[d]=n[d]);if(r&&r.defaultProps){var c=r.defaultProps;for(d in c)i[d]===void 0&&(i[d]=c[d])}if(t||b){var h=typeof r=="function"?r.displayName||r.name||"Unknown":r;t&&an(i,h),b&&sn(i,h)}return dn(r,t,b,a,o,M.current,i)}}var er=w.ReactCurrentOwner,Cr=w.ReactDebugCurrentFrame;function W(r){if(r){var n=r._owner,e=$(r.type,r._source,n?n.type:null);Cr.setExtraStackFrame(e)}else Cr.setExtraStackFrame(null)}var or;or=!1;function tr(r){return typeof r=="object"&&r!==null&&r.$$typeof===m}function Tr(){{if(er.current){var r=S(er.current.type);if(r)return`

@@ -29,3 +29,3 @@ Check the render method of \``+r+"`."}return""}}function ln(r){{if(r!==void 0){var n=r.fileName.replace(/^.*[\\\/]/,""),e=r.lineNumber;return`

Check the top-level render call using <`+e+">.")}return n}}function Sr(r,n){{if(!r._store||r._store.validated||r.key!=null)return;r._store.validated=!0;var e=cn(n);if(kr[e])return;kr[e]=!0;var o="";r&&r._owner&&r._owner!==er.current&&(o=" It was passed a child from "+S(r._owner.type)+"."),W(r),p('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',e,o),W(null)}}function Or(r,n){{if(typeof r!="object")return;if(rr(r))for(var e=0;e<r.length;e++){var o=r[e];tr(o)&&Sr(o,n)}else if(tr(r))r._store&&(r._store.validated=!0);else if(r){var a=l(r);if(typeof a=="function"&&a!==r.entries)for(var d=a.call(r),i;!(i=d.next()).done;)tr(i.value)&&Sr(i.value,n)}}}function fn(r){{var n=r.type;if(n==null||typeof n=="string")return;var e;if(typeof n=="function")e=n.propTypes;else if(typeof n=="object"&&(n.$$typeof===w||n.$$typeof===R))e=n.propTypes;else return;if(e){var o=S(n);Zr(e,r.props,"prop",o,r)}else if(n.PropTypes!==void 0&&!or){or=!0;var a=S(n);p("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",a||"Unknown")}typeof n.getDefaultProps=="function"&&!n.getDefaultProps.isReactClassApproved&&p("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function pn(r){{for(var n=Object.keys(r.props),e=0;e<n.length;e++){var o=n[e];if(o!=="children"&&o!=="key"){W(r),p("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",o),W(null);break}}r.ref!==null&&(W(r),p("Invalid attribute `ref` supplied to `React.Fragment`."),W(null))}}function Pr(r,n,e,o,a,d){{var i=Br(r);if(!i){var t="";(r===void 0||typeof r=="object"&&r!==null&&Object.keys(r).length===0)&&(t+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var y=ln(a);y?t+=y:t+=Tr();var c;r===null?c="null":rr(r)?c="array":r!==void 0&&r.$$typeof===b?(c="<"+(S(r.type)||"Unknown")+" />",t=" Did you accidentally export a JSX literal instead of a component?"):c=typeof r,p("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",c,t)}var h=un(r,n,e,a,d);if(h==null)return h;if(i){var _=n.children;if(_!==void 0)if(o)if(rr(_)){for(var L=0;L<_.length;L++)Or(_[L],r);Object.freeze&&Object.freeze(_)}else p("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else Or(_,r)}return r===x?pn(h):fn(h),h}}function hn(r,n,e){return Pr(r,n,e,!0)}function vn(r,n,e){return Pr(r,n,e,!1)}var gn=vn,wn=hn;z.Fragment=x,z.jsx=gn,z.jsxs=wn}()),z}process.env.NODE_ENV==="production"?K.exports=Fr():K.exports=Ir();var u=K.exports;const Ar=`@import url("https://fonts.googleapis.com/css2?family=Poppins&display=swap");
Check the top-level render call using <`+e+">.")}return n}}function Sr(r,n){{if(!r._store||r._store.validated||r.key!=null)return;r._store.validated=!0;var e=cn(n);if(kr[e])return;kr[e]=!0;var o="";r&&r._owner&&r._owner!==er.current&&(o=" It was passed a child from "+S(r._owner.type)+"."),W(r),p('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',e,o),W(null)}}function Or(r,n){{if(typeof r!="object")return;if(rr(r))for(var e=0;e<r.length;e++){var o=r[e];tr(o)&&Sr(o,n)}else if(tr(r))r._store&&(r._store.validated=!0);else if(r){var a=l(r);if(typeof a=="function"&&a!==r.entries)for(var d=a.call(r),i;!(i=d.next()).done;)tr(i.value)&&Sr(i.value,n)}}}function fn(r){{var n=r.type;if(n==null||typeof n=="string")return;var e;if(typeof n=="function")e=n.propTypes;else if(typeof n=="object"&&(n.$$typeof===g||n.$$typeof===R))e=n.propTypes;else return;if(e){var o=S(n);Zr(e,r.props,"prop",o,r)}else if(n.PropTypes!==void 0&&!or){or=!0;var a=S(n);p("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",a||"Unknown")}typeof n.getDefaultProps=="function"&&!n.getDefaultProps.isReactClassApproved&&p("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function pn(r){{for(var n=Object.keys(r.props),e=0;e<n.length;e++){var o=n[e];if(o!=="children"&&o!=="key"){W(r),p("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",o),W(null);break}}r.ref!==null&&(W(r),p("Invalid attribute `ref` supplied to `React.Fragment`."),W(null))}}function Pr(r,n,e,o,a,d){{var i=Br(r);if(!i){var t="";(r===void 0||typeof r=="object"&&r!==null&&Object.keys(r).length===0)&&(t+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var b=ln(a);b?t+=b:t+=Tr();var c;r===null?c="null":rr(r)?c="array":r!==void 0&&r.$$typeof===m?(c="<"+(S(r.type)||"Unknown")+" />",t=" Did you accidentally export a JSX literal instead of a component?"):c=typeof r,p("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",c,t)}var h=un(r,n,e,a,d);if(h==null)return h;if(i){var _=n.children;if(_!==void 0)if(o)if(rr(_)){for(var L=0;L<_.length;L++)Or(_[L],r);Object.freeze&&Object.freeze(_)}else p("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else Or(_,r)}return r===x?pn(h):fn(h),h}}function hn(r,n,e){return Pr(r,n,e,!0)}function vn(r,n,e){return Pr(r,n,e,!1)}var gn=vn,wn=hn;z.Fragment=x,z.jsx=gn,z.jsxs=wn}()),z}process.env.NODE_ENV==="production"?K.exports=Fr():K.exports=Ir();var u=K.exports;const Ar=`@import url("https://fonts.googleapis.com/css2?family=Poppins&display=swap");
* {

@@ -222,2 +222,2 @@ margin: 0;

}
`;function Wr(g){const[b,m]=E.useState(g),x=E.useRef(null),j=P=>{x.current&&!x.current.contains(P.target)&&m(!1)};return E.useEffect(()=>(document.addEventListener("click",j,!0),()=>{document.removeEventListener("click",j,!0)}),[]),{ref:x,isComponentVisible:b,setIsComponentVisible:m}}const sr="hudoro-input-dropdown-styles";(g=>{if(!document.getElementById(sr)){const b=document.createElement("style");b.id=sr,b.textContent=g,document.head.appendChild(b)}})(Ar);const Lr=({dropdownLists:g,onChange:b,defaultValue:m,size:x="md",multiSelect:j,searchAble:P,iconLeft:D,placeholder:C,onSearch:w})=>{const[s,f]=E.useState([]),{isComponentVisible:R,ref:T,setIsComponentVisible:I}=Wr(!1),V=()=>{I(l=>!l)},H=(l,v)=>{if(!j)f([{label:l,value:v}]),b([{label:l,value:v}]),I(!1);else if(s==null?void 0:s.find(k=>k.value===v)){const k=[...s?s.filter(X=>X.value!==v):[]];f(k),b(k)}else{const k=[...s||[],{label:l,value:v}];f(k),b(k)}};return E.useEffect(()=>{if(m){if(!s.length)console.log("why",s),f(m);else if(s.length){console.log("value",s),console.log("defaultValue",m);for(let l of m){const v=s.findIndex(p=>p.value===l.value);if(v<0){console.log("asdfsdf",v),f(m);return}}}}m!=null&&m.length||f([])},[m,g]),u.jsxs("div",{className:`hsd-input-dropdown-container hsd-input-dropdown-size-${x} ${R?"active":""}`,ref:T,onClick:V,children:[u.jsxs("div",{className:"hsd-input-dropdown-preview-container",children:[D?u.jsx(u.Fragment,{children:E.cloneElement(D,{width:dr(x),color:"#939E99"})}):null,u.jsx("div",{className:"hsd-input-dropdown-container-preview-item",children:s.length?j?s==null?void 0:s.map((l,v)=>u.jsx("p",{style:{minWidth:"max-content"},className:"hsd-input-dropdown-preview-item",children:l==null?void 0:l.label},v)):u.jsx("p",{style:{minWidth:"max-content"},children:s==null?void 0:s[0].label}):u.jsx("p",{className:"hsd-input-dropdown-placeholder",children:C||"Search"})}),u.jsx(zr,{strokeWidth:2,width:dr(x)})]}),R?u.jsxs("div",{className:"hsd-input-dropdown-lists-container",onClick:l=>l.stopPropagation(),children:[P?u.jsxs("div",{className:"hsd-input-dropdown-container-dropdown-search",children:[u.jsx("div",{style:{display:"flex"},children:u.jsx(Nr,{strokeWidth:2,width:20})}),u.jsx("input",{onChange:l=>{w&&w(l.target.value)}})]}):null,u.jsx("div",{className:"hsd-input-dropdwon-item-container",children:g.map((l,v)=>u.jsxs("div",{className:`hsd-input-dropdwon-item ${s!=null&&s.find(p=>p.value===l.value)?"active":""}`,onClick:()=>H(l.label,l.value),children:[l.icon?u.jsx("div",{children:E.cloneElement(l.icon,{width:16})}):null,u.jsxs("div",{children:[" ",u.jsx("p",{children:l.label})]})]},v))})]}):null]})},Nr=({...g})=>u.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",...g,viewBox:"0 0 20 20",fill:"none",children:[u.jsx("circle",{cx:"9.80547",cy:"9.8055",r:"7.49047",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round"}),u.jsx("path",{d:"M15.0153 15.4043L17.9519 18.3333",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round"})]}),zr=({...g})=>u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",...g,viewBox:"0 0 24 24",fill:"none",color:"#1976D2",children:u.jsx("path",{d:"M4 9L12 17L20 9",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})}),dr=g=>{if(g==="sm")return 16;if(g==="md")return 20;if(g==="lg")return 20};F.Dropdown=Lr,Object.defineProperty(F,Symbol.toStringTag,{value:"Module"})});
`;function Wr(v){const[m,y]=E.useState(v),x=E.useRef(null),j=P=>{x.current&&!x.current.contains(P.target)&&y(!1)};return E.useEffect(()=>(document.addEventListener("click",j,!0),()=>{document.removeEventListener("click",j,!0)}),[]),{ref:x,isComponentVisible:m,setIsComponentVisible:y}}const sr="hudoro-input-dropdown-styles";(v=>{if(!document.getElementById(sr)){const m=document.createElement("style");m.id=sr,m.textContent=v,document.head.appendChild(m)}})(Ar);const Lr=({dropdownLists:v,onChange:m,defaultValue:y,size:x="md",multiSelect:j,searchAble:P,iconLeft:D,placeholder:C,onSearch:g})=>{const[s,f]=E.useState([]),{isComponentVisible:R,ref:T,setIsComponentVisible:I}=Wr(!1),V=()=>{I(l=>!l)},H=(l,w)=>{if(!j)f([{label:l,value:w}]),m([{label:l,value:w}]),I(!1);else if(s==null?void 0:s.find(k=>k.value===w)){const k=[...s?s.filter(X=>X.value!==w):[]];f(k),m(k)}else{const k=[...s||[],{label:l,value:w}];f(k),m(k)}};return E.useEffect(()=>{if(y){if(!s.length)console.log("why",s),f(y);else if(s.length){for(let l of y)if(s.findIndex(p=>p.value===l.value)<0){f(s);return}}}y!=null&&y.length||f([])},[y,v]),u.jsxs("div",{className:`hsd-input-dropdown-container hsd-input-dropdown-size-${x} ${R?"active":""}`,ref:T,onClick:V,children:[u.jsxs("div",{className:"hsd-input-dropdown-preview-container",children:[D?u.jsx(u.Fragment,{children:E.cloneElement(D,{width:dr(x),color:"#939E99"})}):null,u.jsx("div",{className:"hsd-input-dropdown-container-preview-item",children:s.length?j?s==null?void 0:s.map((l,w)=>u.jsx("p",{style:{minWidth:"max-content"},className:"hsd-input-dropdown-preview-item",children:l==null?void 0:l.label},w)):u.jsx("p",{style:{minWidth:"max-content"},children:s==null?void 0:s[0].label}):u.jsx("p",{className:"hsd-input-dropdown-placeholder",children:C||"Search"})}),u.jsx(zr,{strokeWidth:2,width:dr(x)})]}),R?u.jsxs("div",{className:"hsd-input-dropdown-lists-container",onClick:l=>l.stopPropagation(),children:[P?u.jsxs("div",{className:"hsd-input-dropdown-container-dropdown-search",children:[u.jsx("div",{style:{display:"flex"},children:u.jsx(Nr,{strokeWidth:2,width:20})}),u.jsx("input",{onChange:l=>{g&&g(l.target.value)}})]}):null,u.jsx("div",{className:"hsd-input-dropdwon-item-container",children:v.map((l,w)=>u.jsxs("div",{className:`hsd-input-dropdwon-item ${s!=null&&s.find(p=>p.value===l.value)?"active":""}`,onClick:()=>H(l.label,l.value),children:[l.icon?u.jsx("div",{children:E.cloneElement(l.icon,{width:16})}):null,u.jsxs("div",{children:[" ",u.jsx("p",{children:l.label})]})]},w))})]}):null]})},Nr=({...v})=>u.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",...v,viewBox:"0 0 20 20",fill:"none",children:[u.jsx("circle",{cx:"9.80547",cy:"9.8055",r:"7.49047",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round"}),u.jsx("path",{d:"M15.0153 15.4043L17.9519 18.3333",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round"})]}),zr=({...v})=>u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",...v,viewBox:"0 0 24 24",fill:"none",color:"#1976D2",children:u.jsx("path",{d:"M4 9L12 17L20 9",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})}),dr=v=>{if(v==="sm")return 16;if(v==="md")return 20;if(v==="lg")return 20};F.Dropdown=Lr,Object.defineProperty(F,Symbol.toStringTag,{value:"Module"})});
{
"name": "@hudoro/dropdown",
"version": "0.0.3-beta.15",
"version": "0.0.3-beta.16",
"description": "dropdown component for Hudoro UI",

@@ -5,0 +5,0 @@ "author": "Prawito Hudoro",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc