@starasia/dropdown 3.0.0 → 3.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
- import { jsx as e, jsxs as p, Fragment as V } from "react/jsx-runtime";
2
- import M, { useState as R, useRef as z, useEffect as b, forwardRef as K } from "react";
3
- const U = `@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap");
1
+ import { jsx as r, jsxs as w, Fragment as M } from "react/jsx-runtime";
2
+ import P, { useState as B, useRef as z, useEffect as v, forwardRef as G } from "react";
3
+ const Q = `@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap");
4
4
  * {
5
5
  margin: 0;
6
6
  padding: 0;
@@ -314,23 +314,23 @@ const U = `@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@30
314
314
  width: 100%;
315
315
  }
316
316
  `;
317
- function G(r) {
318
- const [c, d] = R(r), s = z(null), a = (o) => {
319
- s.current && !s.current.contains(o.target) && d(!1);
317
+ function T(n) {
318
+ const [l, i] = B(n), c = z(null), a = (o) => {
319
+ c.current && !c.current.contains(o.target) && i(!1);
320
320
  };
321
- return b(() => (document.addEventListener("click", a, !0), () => {
321
+ return v(() => (document.addEventListener("click", a, !0), () => {
322
322
  document.removeEventListener("click", a, !0);
323
- }), []), { ref: s, isComponentVisible: c, setIsComponentVisible: d };
323
+ }), []), { ref: c, isComponentVisible: l, setIsComponentVisible: i };
324
324
  }
325
- const Q = ({ ...r }) => /* @__PURE__ */ e(
325
+ const X = ({ ...n }) => /* @__PURE__ */ r(
326
326
  "svg",
327
327
  {
328
328
  xmlns: "http://www.w3.org/2000/svg",
329
- ...r,
329
+ ...n,
330
330
  viewBox: "0 0 24 24",
331
331
  fill: "none",
332
332
  color: "var(--sa-color-gray-500, #8c8f97)",
333
- children: /* @__PURE__ */ e(
333
+ children: /* @__PURE__ */ r(
334
334
  "path",
335
335
  {
336
336
  d: "M4 9L12 17L20 9",
@@ -341,15 +341,15 @@ const Q = ({ ...r }) => /* @__PURE__ */ e(
341
341
  }
342
342
  )
343
343
  }
344
- ), T = ({ ...r }) => /* @__PURE__ */ p(
344
+ ), Y = ({ ...n }) => /* @__PURE__ */ w(
345
345
  "svg",
346
346
  {
347
347
  xmlns: "http://www.w3.org/2000/svg",
348
- ...r,
348
+ ...n,
349
349
  viewBox: "0 0 20 20",
350
350
  fill: "none",
351
351
  children: [
352
- /* @__PURE__ */ e(
352
+ /* @__PURE__ */ r(
353
353
  "circle",
354
354
  {
355
355
  cx: "9.80547",
@@ -361,7 +361,7 @@ const Q = ({ ...r }) => /* @__PURE__ */ e(
361
361
  strokeLinejoin: "round"
362
362
  }
363
363
  ),
364
- /* @__PURE__ */ e(
364
+ /* @__PURE__ */ r(
365
365
  "path",
366
366
  {
367
367
  d: "M15.0153 15.4043L17.9519 18.3333",
@@ -373,19 +373,19 @@ const Q = ({ ...r }) => /* @__PURE__ */ e(
373
373
  )
374
374
  ]
375
375
  }
376
- ), X = ({ isChecked: r }) => /* @__PURE__ */ p("div", { className: "checkbox-wrapper-30", children: [
377
- /* @__PURE__ */ p("span", { className: "checkbox", children: [
378
- /* @__PURE__ */ e(
376
+ ), Z = ({ isChecked: n }) => /* @__PURE__ */ w("div", { className: "checkbox-wrapper-30", children: [
377
+ /* @__PURE__ */ w("span", { className: "checkbox", children: [
378
+ /* @__PURE__ */ r(
379
379
  "input",
380
380
  {
381
381
  type: "checkbox",
382
382
  style: { pointerEvents: "none" },
383
- checked: r
383
+ checked: n
384
384
  }
385
385
  ),
386
- /* @__PURE__ */ e("svg", { children: /* @__PURE__ */ e("use", { xlinkHref: "#checkbox-30", className: "checkbox" }) })
386
+ /* @__PURE__ */ r("svg", { children: /* @__PURE__ */ r("use", { xlinkHref: "#checkbox-30", className: "checkbox" }) })
387
387
  ] }),
388
- /* @__PURE__ */ e("svg", { xmlns: "http://www.w3.org/2000/svg", style: { display: "none" }, children: /* @__PURE__ */ e("symbol", { id: "checkbox-30", viewBox: "0 0 22 22", children: /* @__PURE__ */ e(
388
+ /* @__PURE__ */ r("svg", { xmlns: "http://www.w3.org/2000/svg", style: { display: "none" }, children: /* @__PURE__ */ r("symbol", { id: "checkbox-30", viewBox: "0 0 22 22", children: /* @__PURE__ */ r(
389
389
  "path",
390
390
  {
391
391
  fill: "none",
@@ -393,55 +393,55 @@ const Q = ({ ...r }) => /* @__PURE__ */ e(
393
393
  d: "M5.5,11.3L9,14.8L20.2,3.3l0,0c-0.5-1-1.5-1.8-2.7-1.8h-13c-1.7,0-3,1.3-3,3v13c0,1.7,1.3,3,3,3h13 c1.7,0,3-1.3,3-3v-13c0-0.4-0.1-0.8-0.3-1.2"
394
394
  }
395
395
  ) }) })
396
- ] }), Y = K(
396
+ ] }), _ = G(
397
397
  ({
398
- positionDropdown: r,
399
- dropdownLists: c,
400
- isComponentVisible: d,
401
- searchAble: s,
398
+ positionDropdown: n,
399
+ dropdownLists: l,
400
+ isComponentVisible: i,
401
+ searchAble: c,
402
402
  onSearch: a,
403
403
  value: o,
404
- handleChangeValue: v,
405
- multiSelect: l,
406
- searchValue: $,
404
+ handleChangeValue: m,
405
+ multiSelect: p,
406
+ searchValue: I,
407
407
  highlightedIndex: g
408
- }, N) => {
409
- const [I, L] = R(0), m = z(null), x = z([]);
410
- return b(() => {
411
- if (m.current) {
412
- const n = m.current.getBoundingClientRect();
413
- L(n.width);
408
+ }, L) => {
409
+ const [$, D] = B(0), k = z(null), R = z([]);
410
+ return v(() => {
411
+ if (k.current) {
412
+ const e = k.current.getBoundingClientRect();
413
+ D(e.width);
414
414
  }
415
- }, [m, d]), b(() => {
416
- var n;
417
- g >= 0 && x.current[g] && ((n = x.current[g]) == null || n.scrollIntoView({ block: "nearest" }));
418
- }, [g]), /* @__PURE__ */ e(V, { children: d ? /* @__PURE__ */ p(
415
+ }, [k, i]), v(() => {
416
+ var e;
417
+ g >= 0 && R.current[g] && ((e = R.current[g]) == null || e.scrollIntoView({ block: "nearest" }));
418
+ }, [g]), /* @__PURE__ */ r(M, { children: i ? /* @__PURE__ */ w(
419
419
  "div",
420
420
  {
421
421
  className: "sa-input-dropdown-lists-container",
422
- onClick: (n) => n.stopPropagation(),
423
- ref: N,
422
+ onClick: (e) => e.stopPropagation(),
423
+ ref: L,
424
424
  children: [
425
- s ? /* @__PURE__ */ p(
425
+ c ? /* @__PURE__ */ w(
426
426
  "div",
427
427
  {
428
428
  className: "sa-input-dropdown-container-dropdown-search",
429
429
  style: {
430
- order: r == "bottom" ? 0 : 2,
430
+ order: n == "bottom" ? 0 : 2,
431
431
  position: "sticky",
432
432
  top: 0,
433
433
  bottom: 0,
434
434
  zIndex: 1
435
435
  },
436
436
  children: [
437
- /* @__PURE__ */ e("div", { style: { display: "flex" }, children: /* @__PURE__ */ e(T, { strokeWidth: 2, width: 20 }) }),
438
- /* @__PURE__ */ e(
437
+ /* @__PURE__ */ r("div", { style: { display: "flex" }, children: /* @__PURE__ */ r(Y, { strokeWidth: 2, width: 20 }) }),
438
+ /* @__PURE__ */ r(
439
439
  "input",
440
440
  {
441
- onChange: (n) => {
442
- a && a(n.target.value);
441
+ onChange: (e) => {
442
+ a && a(e.target.value);
443
443
  },
444
- value: $,
444
+ value: I,
445
445
  autoFocus: !0,
446
446
  style: { width: "100%" }
447
447
  }
@@ -449,57 +449,57 @@ const Q = ({ ...r }) => /* @__PURE__ */ e(
449
449
  ]
450
450
  }
451
451
  ) : null,
452
- /* @__PURE__ */ e(
452
+ /* @__PURE__ */ r(
453
453
  "div",
454
454
  {
455
- className: `sa-input-dropdwon-item-container ${l ? "multi" : ""}`,
456
- ref: m,
457
- children: c.map((n, h) => {
458
- const k = !!(o != null && o.find((y) => y.value === n.value));
459
- return /* @__PURE__ */ p(
455
+ className: `sa-input-dropdwon-item-container ${p ? "multi" : ""}`,
456
+ ref: k,
457
+ children: l.map((e, f) => {
458
+ const s = !!(o != null && o.find((h) => h.value === e.value));
459
+ return /* @__PURE__ */ w(
460
460
  "div",
461
461
  {
462
- className: `sa-input-dropdwon-item ${k ? "active" : ""} ${h === g ? "highlight" : ""} ${n.disable ? "sa-input-dropdwon-item-disable" : ""}`,
463
- ref: (y) => {
464
- x.current[h] = y;
462
+ className: `sa-input-dropdwon-item ${s ? "active" : ""} ${f === g ? "highlight" : ""} ${e.disable ? "sa-input-dropdwon-item-disable" : ""}`,
463
+ ref: (h) => {
464
+ R.current[f] = h;
465
465
  },
466
- onClick: () => v(n.label, n.value),
466
+ onClick: () => m(e.label, e.value),
467
467
  children: [
468
- l ? /* @__PURE__ */ e("div", { style: { marginRight: "8px" }, children: /* @__PURE__ */ e(X, { isChecked: k }) }) : null,
469
- n.icon ? /* @__PURE__ */ e("div", { children: M.cloneElement(n.icon, {
468
+ p ? /* @__PURE__ */ r("div", { style: { marginRight: "8px" }, children: /* @__PURE__ */ r(Z, { isChecked: s }) }) : null,
469
+ e.icon ? /* @__PURE__ */ r("div", { children: P.cloneElement(e.icon, {
470
470
  width: 16
471
471
  }) }) : null,
472
- /* @__PURE__ */ p("div", { children: [
473
- /* @__PURE__ */ e(
472
+ /* @__PURE__ */ w("div", { children: [
473
+ /* @__PURE__ */ r(
474
474
  "p",
475
475
  {
476
- className: `sa-input-dropdwon-item-text ${k ? "active" : null} ${n.disable ? "sa-input-dropdwon-item-disable" : null}`,
476
+ className: `sa-input-dropdwon-item-text ${s ? "active" : null} ${e.disable ? "sa-input-dropdwon-item-disable" : null}`,
477
477
  style: {
478
478
  textWrap: "nowrap",
479
- width: `${I - 12}px`,
479
+ width: `${$ - 12}px`,
480
480
  overflow: "hidden",
481
481
  textOverflow: "ellipsis"
482
482
  },
483
- children: n.label
483
+ children: e.label
484
484
  }
485
485
  ),
486
- n.description ? /* @__PURE__ */ e(
486
+ e.description ? /* @__PURE__ */ r(
487
487
  "p",
488
488
  {
489
- className: `sa-input-dropdwon-item-text-description ${k ? "active" : null} ${n.disable ? "sa-input-dropdwon-item-disable" : null}`,
489
+ className: `sa-input-dropdwon-item-text-description ${s ? "active" : null} ${e.disable ? "sa-input-dropdwon-item-disable" : null}`,
490
490
  style: {
491
491
  textWrap: "nowrap",
492
- width: `${I - 12}px`,
492
+ width: `${$ - 12}px`,
493
493
  overflow: "hidden",
494
494
  textOverflow: "ellipsis"
495
495
  },
496
- children: n.description
496
+ children: e.description
497
497
  }
498
498
  ) : null
499
499
  ] })
500
500
  ]
501
501
  },
502
- h
502
+ f
503
503
  );
504
504
  })
505
505
  }
@@ -508,202 +508,208 @@ const Q = ({ ...r }) => /* @__PURE__ */ e(
508
508
  }
509
509
  ) : null });
510
510
  }
511
- ), Z = ({
512
- children: r,
513
- handleChangePosition: c
511
+ ), nn = ({
512
+ children: n,
513
+ handleChangePosition: l
514
514
  }) => {
515
- const d = z(null);
516
- b(() => {
517
- var v;
515
+ const i = z(null);
516
+ v(() => {
517
+ var m;
518
518
  const a = () => {
519
- if (d.current) {
520
- let l = d.current.parentElement;
521
- for (; l && !s(l); )
522
- l = l.parentElement;
523
- l && c();
519
+ if (i.current) {
520
+ let p = i.current.parentElement;
521
+ for (; p && !c(p); )
522
+ p = p.parentElement;
523
+ p && l();
524
524
  }
525
525
  };
526
- let o = (v = d.current) == null ? void 0 : v.parentElement;
527
- for (; o && !s(o); )
526
+ let o = (m = i.current) == null ? void 0 : m.parentElement;
527
+ for (; o && !c(o); )
528
528
  o = o.parentElement;
529
529
  return o && o.addEventListener("scroll", a), a(), () => {
530
530
  o && o.removeEventListener("scroll", a);
531
531
  };
532
532
  }, []);
533
- const s = (a) => a && (a.scrollHeight > a.clientHeight || a.scrollWidth > a.clientWidth);
534
- return /* @__PURE__ */ e("div", { ref: d, children: r });
535
- }, F = "sa-input-dropdown-styles", _ = (r) => {
536
- if (!document.getElementById(F)) {
537
- const c = document.createElement("style");
538
- c.id = F, c.textContent = r, document.head.appendChild(c);
533
+ const c = (a) => a && (a.scrollHeight > a.clientHeight || a.scrollWidth > a.clientWidth);
534
+ return /* @__PURE__ */ r("div", { ref: i, children: n });
535
+ }, H = "sa-input-dropdown-styles", rn = (n) => {
536
+ if (!document.getElementById(H)) {
537
+ const l = document.createElement("style");
538
+ l.id = H, l.textContent = n, document.head.appendChild(l);
539
539
  }
540
540
  };
541
- _(U);
542
- const on = ({
543
- dropdownLists: r,
544
- onChange: c,
545
- defaultValue: d,
546
- size: s = "md",
547
- multiSelect: a,
548
- searchAble: o,
549
- iconLeft: v,
550
- placeholder: l,
551
- onSearch: $,
552
- error: g,
553
- onBlur: N,
554
- onFocus: I,
555
- disable: L,
556
- searchValue: m
541
+ rn(Q);
542
+ const tn = ({
543
+ dropdownLists: n,
544
+ onChange: l,
545
+ defaultValue: i,
546
+ value: c,
547
+ size: a = "md",
548
+ multiSelect: o,
549
+ searchAble: m,
550
+ iconLeft: p,
551
+ placeholder: I,
552
+ onSearch: g,
553
+ error: L,
554
+ onBlur: $,
555
+ onFocus: D,
556
+ disable: k,
557
+ searchValue: R
557
558
  }) => {
558
- const x = z(), [n, h] = R([]), [k, y] = R(""), [u, D] = R(-1), f = z(null), { isComponentVisible: C, ref: W, setIsComponentVisible: B } = G(!1), P = () => {
559
- B((t) => !t);
560
- }, A = (t, i) => {
561
- if (!a)
562
- h([{ label: t, value: i }]), c([{ label: t, value: i }]), B(!1);
563
- else if (n == null ? void 0 : n.find((w) => w.value === i)) {
564
- const w = [
565
- ...n ? n.filter((J) => J.value !== i) : []
566
- ];
567
- h(w), c(w);
568
- } else {
569
- const w = [...n || [], { label: t, value: i }];
570
- h(w), c(w);
559
+ const e = c !== void 0, f = z(), [s, h] = B(
560
+ e ? c || [] : i || []
561
+ ), [V, F] = B(""), [b, W] = B(-1), x = z(null), { isComponentVisible: y, ref: A, setIsComponentVisible: N } = T(!1), q = () => {
562
+ N((t) => !t);
563
+ }, j = (t, d) => {
564
+ if (o)
565
+ if (s == null ? void 0 : s.find((u) => u.value === d)) {
566
+ const u = s.filter((U) => U.value !== d);
567
+ e || h(u), l(u);
568
+ } else {
569
+ const u = [...s, { label: t, value: d }];
570
+ e || h(u), l(u);
571
+ }
572
+ else {
573
+ const E = [{ label: t, value: d }];
574
+ e || h(E), l(E), N(!1);
571
575
  }
572
576
  };
573
- b(() => {
574
- JSON.stringify(x.current) === JSON.stringify(d) || (x.current = d, h(x.current || []));
575
- }, [d]);
576
- const S = () => n.length ? a ? n == null ? void 0 : n.map((t, i) => /* @__PURE__ */ p("div", { className: "sa-input-dropdown-preview-item", children: [
577
- /* @__PURE__ */ e("p", { style: { minWidth: "max-content" }, children: t == null ? void 0 : t.label }, i),
578
- /* @__PURE__ */ e(
579
- nn,
577
+ v(() => {
578
+ e && h(c || []);
579
+ }, [c]), v(() => {
580
+ e || JSON.stringify(f.current) === JSON.stringify(i) || (f.current = i, h(f.current || []));
581
+ }, [i]);
582
+ const J = () => s.length ? o ? s == null ? void 0 : s.map((t, d) => /* @__PURE__ */ w("div", { className: "sa-input-dropdown-preview-item", children: [
583
+ /* @__PURE__ */ r("p", { style: { minWidth: "max-content" }, children: t == null ? void 0 : t.label }, d),
584
+ /* @__PURE__ */ r(
585
+ on,
580
586
  {
581
- onClick: () => A(t.label, t.value)
587
+ onClick: () => j(t.label, t.value)
582
588
  }
583
589
  )
584
- ] })) : /* @__PURE__ */ e("p", { style: { minWidth: "max-content" }, children: n == null ? void 0 : n[0].label }) : /* @__PURE__ */ e("p", { className: "sa-input-dropdown-placeholder", children: l }), E = () => {
585
- if (W.current && f.current) {
586
- const t = window.innerHeight, i = W.current.getBoundingClientRect(), j = f.current.getBoundingClientRect(), w = i.bottom + j.height;
587
- f.current.style.left = `${i.left}px`, f.current.style.width = `${i.width}px`, w >= t - 10 ? (f.current.style.top = `${i.top - j.height - 5}px`, y("top")) : (f.current.style.top = `${i.top + i.height}px`, y("bottom"));
590
+ ] })) : /* @__PURE__ */ r("p", { style: { minWidth: "max-content" }, children: s == null ? void 0 : s[0].label }) : /* @__PURE__ */ r("p", { className: "sa-input-dropdown-placeholder", children: I }), C = () => {
591
+ if (A.current && x.current) {
592
+ const t = window.innerHeight, d = A.current.getBoundingClientRect(), E = x.current.getBoundingClientRect(), u = d.bottom + E.height;
593
+ x.current.style.left = `${d.left}px`, x.current.style.width = `${d.width}px`, u >= t - 10 ? (x.current.style.top = `${d.top - E.height - 5}px`, F("top")) : (x.current.style.top = `${d.top + d.height}px`, F("bottom"));
588
594
  }
589
595
  };
590
- b(() => (window.addEventListener("scroll", E), window.addEventListener("resize", E), () => {
591
- window.removeEventListener("scroll", E), window.removeEventListener("resize", E);
592
- }), []), b(() => {
593
- E();
594
- }, [C]), b(() => {
595
- C || D(-1);
596
- }, [C]);
597
- const q = (t) => {
598
- if (!C) {
599
- (t.key === "ArrowDown" || t.key === "Enter") && (t.preventDefault(), B(!0));
596
+ v(() => (window.addEventListener("scroll", C), window.addEventListener("resize", C), () => {
597
+ window.removeEventListener("scroll", C), window.removeEventListener("resize", C);
598
+ }), []), v(() => {
599
+ C();
600
+ }, [y]), v(() => {
601
+ y || W(-1);
602
+ }, [y]);
603
+ const K = (t) => {
604
+ if (!y) {
605
+ (t.key === "ArrowDown" || t.key === "Enter") && (t.preventDefault(), N(!0));
600
606
  return;
601
607
  }
602
608
  switch (t.key) {
603
609
  case "ArrowDown": {
604
610
  t.preventDefault();
605
- const i = H(r, u, 1);
606
- i !== -1 && D(i);
611
+ const d = O(n, b, 1);
612
+ d !== -1 && W(d);
607
613
  break;
608
614
  }
609
615
  case "ArrowUp": {
610
616
  t.preventDefault();
611
- const i = H(r, u, -1);
612
- i !== -1 && D(i);
617
+ const d = O(n, b, -1);
618
+ d !== -1 && W(d);
613
619
  break;
614
620
  }
615
621
  case "Enter": {
616
- t.preventDefault(), u >= 0 && r[u] && !r[u].disable && A(
617
- r[u].label,
618
- r[u].value
622
+ t.preventDefault(), b >= 0 && n[b] && !n[b].disable && j(
623
+ n[b].label,
624
+ n[b].value
619
625
  );
620
626
  break;
621
627
  }
622
628
  case "Escape": {
623
- B(!1);
629
+ N(!1);
624
630
  break;
625
631
  }
626
632
  }
627
633
  };
628
- return /* @__PURE__ */ e(Z, { handleChangePosition: E, children: /* @__PURE__ */ p(
634
+ return /* @__PURE__ */ r(nn, { handleChangePosition: C, children: /* @__PURE__ */ w(
629
635
  "div",
630
636
  {
631
- className: `sa-input-dropdown-container ${L ? "disable" : ""} sa-input-dropdown-size-${s} ${C ? "active" : ""} ${g ? "error" : ""}`,
632
- ref: W,
633
- onClick: P,
634
- onKeyDown: q,
637
+ className: `sa-input-dropdown-container ${k ? "disable" : ""} sa-input-dropdown-size-${a} ${y ? "active" : ""} ${L ? "error" : ""}`,
638
+ ref: A,
639
+ onClick: q,
640
+ onKeyDown: K,
635
641
  tabIndex: 0,
636
- onBlur: N,
637
- onFocus: I,
642
+ onBlur: $,
643
+ onFocus: D,
638
644
  children: [
639
- /* @__PURE__ */ p("div", { className: "sa-input-dropdown-preview-container", children: [
640
- v ? /* @__PURE__ */ e(V, { children: M.cloneElement(v, {
641
- width: O(s),
645
+ /* @__PURE__ */ w("div", { className: "sa-input-dropdown-preview-container", children: [
646
+ p ? /* @__PURE__ */ r(M, { children: P.cloneElement(p, {
647
+ width: S(a),
642
648
  color: "var(--sa-color-gray-500, #8c8f97)",
643
649
  style: {
644
650
  color: "var(--sa-color-gray-500, #8c8f97)"
645
651
  }
646
652
  }) }) : null,
647
- /* @__PURE__ */ e(
653
+ /* @__PURE__ */ r(
648
654
  "div",
649
655
  {
650
656
  className: "sa-input-dropdown-container-preview-item",
651
- children: S()
657
+ children: J()
652
658
  }
653
659
  ),
654
- /* @__PURE__ */ e(
655
- Q,
660
+ /* @__PURE__ */ r(
661
+ X,
656
662
  {
657
663
  strokeWidth: 2,
658
- width: O(s),
664
+ width: S(a),
659
665
  style: { color: "var(--sa-color-gray-500, #8c8f97)" }
660
666
  }
661
667
  )
662
668
  ] }),
663
- /* @__PURE__ */ e(
664
- Y,
669
+ /* @__PURE__ */ r(
670
+ _,
665
671
  {
666
- dropdownLists: r,
667
- handleChangeValue: A,
668
- isComponentVisible: C,
669
- positionDropdown: k,
670
- searchAble: !!o,
671
- value: n,
672
- onSearch: $,
673
- ref: f,
674
- multiSelect: a,
675
- searchValue: m,
676
- highlightedIndex: u
672
+ dropdownLists: n,
673
+ handleChangeValue: j,
674
+ isComponentVisible: y,
675
+ positionDropdown: V,
676
+ searchAble: !!m,
677
+ value: s,
678
+ onSearch: g,
679
+ ref: x,
680
+ multiSelect: o,
681
+ searchValue: R,
682
+ highlightedIndex: b
677
683
  }
678
684
  )
679
685
  ]
680
686
  }
681
687
  ) });
682
- }, H = (r, c, d) => {
683
- const s = r.length;
684
- let a = c + d;
685
- for (; a >= 0 && a < s; ) {
686
- if (!r[a].disable)
688
+ }, O = (n, l, i) => {
689
+ const c = n.length;
690
+ let a = l + i;
691
+ for (; a >= 0 && a < c; ) {
692
+ if (!n[a].disable)
687
693
  return a;
688
- a += d;
694
+ a += i;
689
695
  }
690
- if (d === 1) {
691
- for (let o = 0; o < s; o++)
692
- if (!r[o].disable)
696
+ if (i === 1) {
697
+ for (let o = 0; o < c; o++)
698
+ if (!n[o].disable)
693
699
  return o;
694
700
  } else
695
- for (let o = s - 1; o >= 0; o--)
696
- if (!r[o].disable)
701
+ for (let o = c - 1; o >= 0; o--)
702
+ if (!n[o].disable)
697
703
  return o;
698
704
  return -1;
699
- }, O = (r) => {
700
- if (r === "sm")
705
+ }, S = (n) => {
706
+ if (n === "sm")
701
707
  return 16;
702
- if (r === "md")
708
+ if (n === "md")
703
709
  return 16;
704
- if (r === "lg")
710
+ if (n === "lg")
705
711
  return 20;
706
- }, nn = (r) => /* @__PURE__ */ e(
712
+ }, on = (n) => /* @__PURE__ */ r(
707
713
  "svg",
708
714
  {
709
715
  xmlns: "http://www.w3.org/2000/svg",
@@ -711,8 +717,8 @@ const on = ({
711
717
  height: "18",
712
718
  viewBox: "0 0 18 18",
713
719
  fill: "none",
714
- ...r,
715
- children: /* @__PURE__ */ e(
720
+ ...n,
721
+ children: /* @__PURE__ */ r(
716
722
  "path",
717
723
  {
718
724
  d: "M12 6L6 12M6.00001 6L12 12",
@@ -725,5 +731,5 @@ const on = ({
725
731
  }
726
732
  );
727
733
  export {
728
- on as Dropdown
734
+ tn as Dropdown
729
735
  };
@@ -1,4 +1,4 @@
1
- (function(h,n){typeof exports=="object"&&typeof module<"u"?n(exports,require("react/jsx-runtime"),require("react")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react"],n):(h=typeof globalThis<"u"?globalThis:h||self,n(h.Dropdown={},h.jsxRuntime,h.React))})(this,function(h,n,t){"use strict";const O=`@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap");
1
+ (function(u,n){typeof exports=="object"&&typeof module<"u"?n(exports,require("react/jsx-runtime"),require("react")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react"],n):(u=typeof globalThis<"u"?globalThis:u||self,n(u.Dropdown={},u.jsxRuntime,u.React))})(this,function(u,n,d){"use strict";const H=`@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap");
2
2
  * {
3
3
  margin: 0;
4
4
  padding: 0;
@@ -311,4 +311,4 @@
311
311
  height: 100%;
312
312
  width: 100%;
313
313
  }
314
- `;function H(e){const[l,i]=t.useState(e),c=t.useRef(null),a=o=>{c.current&&!c.current.contains(o.target)&&i(!1)};return t.useEffect(()=>(document.addEventListener("click",a,!0),()=>{document.removeEventListener("click",a,!0)}),[]),{ref:c,isComponentVisible:l,setIsComponentVisible:i}}const V=({...e})=>n.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",...e,viewBox:"0 0 24 24",fill:"none",color:"var(--sa-color-gray-500, #8c8f97)",children:n.jsx("path",{d:"M4 9L12 17L20 9",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5})}),M=({...e})=>n.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",...e,viewBox:"0 0 20 20",fill:"none",children:[n.jsx("circle",{cx:"9.80547",cy:"9.8055",r:"7.49047",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round"}),n.jsx("path",{d:"M15.0153 15.4043L17.9519 18.3333",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round"})]}),P=({isChecked:e})=>n.jsxs("div",{className:"checkbox-wrapper-30",children:[n.jsxs("span",{className:"checkbox",children:[n.jsx("input",{type:"checkbox",style:{pointerEvents:"none"},checked:e}),n.jsx("svg",{children:n.jsx("use",{xlinkHref:"#checkbox-30",className:"checkbox"})})]}),n.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",style:{display:"none"},children:n.jsx("symbol",{id:"checkbox-30",viewBox:"0 0 22 22",children:n.jsx("path",{fill:"none",stroke:"currentColor",d:"M5.5,11.3L9,14.8L20.2,3.3l0,0c-0.5-1-1.5-1.8-2.7-1.8h-13c-1.7,0-3,1.3-3,3v13c0,1.7,1.3,3,3,3h13 c1.7,0,3-1.3,3-3v-13c0-0.4-0.1-0.8-0.3-1.2"})})})]}),q=t.forwardRef(({positionDropdown:e,dropdownLists:l,isComponentVisible:i,searchAble:c,onSearch:a,value:o,handleChangeValue:u,multiSelect:p,searchValue:B,highlightedIndex:f},$)=>{const[z,N]=t.useState(0),k=t.useRef(null),g=t.useRef([]);return t.useEffect(()=>{if(k.current){const r=k.current.getBoundingClientRect();N(r.width)}},[k,i]),t.useEffect(()=>{var r;f>=0&&g.current[f]&&((r=g.current[f])==null||r.scrollIntoView({block:"nearest"}))},[f]),n.jsx(n.Fragment,{children:i?n.jsxs("div",{className:"sa-input-dropdown-lists-container",onClick:r=>r.stopPropagation(),ref:$,children:[c?n.jsxs("div",{className:"sa-input-dropdown-container-dropdown-search",style:{order:e=="bottom"?0:2,position:"sticky",top:0,bottom:0,zIndex:1},children:[n.jsx("div",{style:{display:"flex"},children:n.jsx(M,{strokeWidth:2,width:20})}),n.jsx("input",{onChange:r=>{a&&a(r.target.value)},value:B,autoFocus:!0,style:{width:"100%"}})]}):null,n.jsx("div",{className:`sa-input-dropdwon-item-container ${p?"multi":""}`,ref:k,children:l.map((r,b)=>{const y=!!(o!=null&&o.find(m=>m.value===r.value));return n.jsxs("div",{className:`sa-input-dropdwon-item ${y?"active":""} ${b===f?"highlight":""} ${r.disable?"sa-input-dropdwon-item-disable":""}`,ref:m=>{g.current[b]=m},onClick:()=>u(r.label,r.value),children:[p?n.jsx("div",{style:{marginRight:"8px"},children:n.jsx(P,{isChecked:y})}):null,r.icon?n.jsx("div",{children:t.cloneElement(r.icon,{width:16})}):null,n.jsxs("div",{children:[n.jsx("p",{className:`sa-input-dropdwon-item-text ${y?"active":null} ${r.disable?"sa-input-dropdwon-item-disable":null}`,style:{textWrap:"nowrap",width:`${z-12}px`,overflow:"hidden",textOverflow:"ellipsis"},children:r.label}),r.description?n.jsx("p",{className:`sa-input-dropdwon-item-text-description ${y?"active":null} ${r.disable?"sa-input-dropdwon-item-disable":null}`,style:{textWrap:"nowrap",width:`${z-12}px`,overflow:"hidden",textOverflow:"ellipsis"},children:r.description}):null]})]},b)})})]}):null})}),T=({children:e,handleChangePosition:l})=>{const i=t.useRef(null);t.useEffect(()=>{var u;const a=()=>{if(i.current){let p=i.current.parentElement;for(;p&&!c(p);)p=p.parentElement;p&&l()}};let o=(u=i.current)==null?void 0:u.parentElement;for(;o&&!c(o);)o=o.parentElement;return o&&o.addEventListener("scroll",a),a(),()=>{o&&o.removeEventListener("scroll",a)}},[]);const c=a=>a&&(a.scrollHeight>a.clientHeight||a.scrollWidth>a.clientWidth);return n.jsx("div",{ref:i,children:e})},S="sa-input-dropdown-styles";(e=>{if(!document.getElementById(S)){const l=document.createElement("style");l.id=S,l.textContent=e,document.head.appendChild(l)}})(O);const J=({dropdownLists:e,onChange:l,defaultValue:i,size:c="md",multiSelect:a,searchAble:o,iconLeft:u,placeholder:p,onSearch:B,error:f,onBlur:$,onFocus:z,disable:N,searchValue:k})=>{const g=t.useRef(),[r,b]=t.useState([]),[y,m]=t.useState(""),[v,D]=t.useState(-1),x=t.useRef(null),{isComponentVisible:C,ref:L,setIsComponentVisible:I}=H(!1),U=()=>{I(d=>!d)},W=(d,s)=>{if(!a)b([{label:d,value:s}]),l([{label:d,value:s}]),I(!1);else if(r==null?void 0:r.find(w=>w.value===s)){const w=[...r?r.filter(X=>X.value!==s):[]];b(w),l(w)}else{const w=[...r||[],{label:d,value:s}];b(w),l(w)}};t.useEffect(()=>{JSON.stringify(g.current)===JSON.stringify(i)||(g.current=i,b(g.current||[]))},[i]);const G=()=>r.length?a?r==null?void 0:r.map((d,s)=>n.jsxs("div",{className:"sa-input-dropdown-preview-item",children:[n.jsx("p",{style:{minWidth:"max-content"},children:d==null?void 0:d.label},s),n.jsx(K,{onClick:()=>W(d.label,d.value)})]})):n.jsx("p",{style:{minWidth:"max-content"},children:r==null?void 0:r[0].label}):n.jsx("p",{className:"sa-input-dropdown-placeholder",children:p}),E=()=>{if(L.current&&x.current){const d=window.innerHeight,s=L.current.getBoundingClientRect(),j=x.current.getBoundingClientRect(),w=s.bottom+j.height;x.current.style.left=`${s.left}px`,x.current.style.width=`${s.width}px`,w>=d-10?(x.current.style.top=`${s.top-j.height-5}px`,m("top")):(x.current.style.top=`${s.top+s.height}px`,m("bottom"))}};t.useEffect(()=>(window.addEventListener("scroll",E),window.addEventListener("resize",E),()=>{window.removeEventListener("scroll",E),window.removeEventListener("resize",E)}),[]),t.useEffect(()=>{E()},[C]),t.useEffect(()=>{C||D(-1)},[C]);const Q=d=>{if(!C){(d.key==="ArrowDown"||d.key==="Enter")&&(d.preventDefault(),I(!0));return}switch(d.key){case"ArrowDown":{d.preventDefault();const s=A(e,v,1);s!==-1&&D(s);break}case"ArrowUp":{d.preventDefault();const s=A(e,v,-1);s!==-1&&D(s);break}case"Enter":{d.preventDefault(),v>=0&&e[v]&&!e[v].disable&&W(e[v].label,e[v].value);break}case"Escape":{I(!1);break}}};return n.jsx(T,{handleChangePosition:E,children:n.jsxs("div",{className:`sa-input-dropdown-container ${N?"disable":""} sa-input-dropdown-size-${c} ${C?"active":""} ${f?"error":""}`,ref:L,onClick:U,onKeyDown:Q,tabIndex:0,onBlur:$,onFocus:z,children:[n.jsxs("div",{className:"sa-input-dropdown-preview-container",children:[u?n.jsx(n.Fragment,{children:t.cloneElement(u,{width:F(c),color:"var(--sa-color-gray-500, #8c8f97)",style:{color:"var(--sa-color-gray-500, #8c8f97)"}})}):null,n.jsx("div",{className:"sa-input-dropdown-container-preview-item",children:G()}),n.jsx(V,{strokeWidth:2,width:F(c),style:{color:"var(--sa-color-gray-500, #8c8f97)"}})]}),n.jsx(q,{dropdownLists:e,handleChangeValue:W,isComponentVisible:C,positionDropdown:y,searchAble:!!o,value:r,onSearch:B,ref:x,multiSelect:a,searchValue:k,highlightedIndex:v})]})})},A=(e,l,i)=>{const c=e.length;let a=l+i;for(;a>=0&&a<c;){if(!e[a].disable)return a;a+=i}if(i===1){for(let o=0;o<c;o++)if(!e[o].disable)return o}else for(let o=c-1;o>=0;o--)if(!e[o].disable)return o;return-1},F=e=>{if(e==="sm")return 16;if(e==="md")return 16;if(e==="lg")return 20},K=e=>n.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",...e,children:n.jsx("path",{d:"M12 6L6 12M6.00001 6L12 12",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"})});h.Dropdown=J,Object.defineProperty(h,Symbol.toStringTag,{value:"Module"})});
314
+ `;function M(r){const[p,s]=d.useState(r),l=d.useRef(null),a=o=>{l.current&&!l.current.contains(o.target)&&s(!1)};return d.useEffect(()=>(document.addEventListener("click",a,!0),()=>{document.removeEventListener("click",a,!0)}),[]),{ref:l,isComponentVisible:p,setIsComponentVisible:s}}const P=({...r})=>n.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",...r,viewBox:"0 0 24 24",fill:"none",color:"var(--sa-color-gray-500, #8c8f97)",children:n.jsx("path",{d:"M4 9L12 17L20 9",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5})}),q=({...r})=>n.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",...r,viewBox:"0 0 20 20",fill:"none",children:[n.jsx("circle",{cx:"9.80547",cy:"9.8055",r:"7.49047",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round"}),n.jsx("path",{d:"M15.0153 15.4043L17.9519 18.3333",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round"})]}),T=({isChecked:r})=>n.jsxs("div",{className:"checkbox-wrapper-30",children:[n.jsxs("span",{className:"checkbox",children:[n.jsx("input",{type:"checkbox",style:{pointerEvents:"none"},checked:r}),n.jsx("svg",{children:n.jsx("use",{xlinkHref:"#checkbox-30",className:"checkbox"})})]}),n.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",style:{display:"none"},children:n.jsx("symbol",{id:"checkbox-30",viewBox:"0 0 22 22",children:n.jsx("path",{fill:"none",stroke:"currentColor",d:"M5.5,11.3L9,14.8L20.2,3.3l0,0c-0.5-1-1.5-1.8-2.7-1.8h-13c-1.7,0-3,1.3-3,3v13c0,1.7,1.3,3,3,3h13 c1.7,0,3-1.3,3-3v-13c0-0.4-0.1-0.8-0.3-1.2"})})})]}),V=d.forwardRef(({positionDropdown:r,dropdownLists:p,isComponentVisible:s,searchAble:l,onSearch:a,value:o,handleChangeValue:k,multiSelect:w,searchValue:N,highlightedIndex:f},D)=>{const[B,I]=d.useState(0),y=d.useRef(null),z=d.useRef([]);return d.useEffect(()=>{if(y.current){const e=y.current.getBoundingClientRect();I(e.width)}},[y,s]),d.useEffect(()=>{var e;f>=0&&z.current[f]&&((e=z.current[f])==null||e.scrollIntoView({block:"nearest"}))},[f]),n.jsx(n.Fragment,{children:s?n.jsxs("div",{className:"sa-input-dropdown-lists-container",onClick:e=>e.stopPropagation(),ref:D,children:[l?n.jsxs("div",{className:"sa-input-dropdown-container-dropdown-search",style:{order:r=="bottom"?0:2,position:"sticky",top:0,bottom:0,zIndex:1},children:[n.jsx("div",{style:{display:"flex"},children:n.jsx(q,{strokeWidth:2,width:20})}),n.jsx("input",{onChange:e=>{a&&a(e.target.value)},value:N,autoFocus:!0,style:{width:"100%"}})]}):null,n.jsx("div",{className:`sa-input-dropdwon-item-container ${w?"multi":""}`,ref:y,children:p.map((e,g)=>{const c=!!(o!=null&&o.find(h=>h.value===e.value));return n.jsxs("div",{className:`sa-input-dropdwon-item ${c?"active":""} ${g===f?"highlight":""} ${e.disable?"sa-input-dropdwon-item-disable":""}`,ref:h=>{z.current[g]=h},onClick:()=>k(e.label,e.value),children:[w?n.jsx("div",{style:{marginRight:"8px"},children:n.jsx(T,{isChecked:c})}):null,e.icon?n.jsx("div",{children:d.cloneElement(e.icon,{width:16})}):null,n.jsxs("div",{children:[n.jsx("p",{className:`sa-input-dropdwon-item-text ${c?"active":null} ${e.disable?"sa-input-dropdwon-item-disable":null}`,style:{textWrap:"nowrap",width:`${B-12}px`,overflow:"hidden",textOverflow:"ellipsis"},children:e.label}),e.description?n.jsx("p",{className:`sa-input-dropdwon-item-text-description ${c?"active":null} ${e.disable?"sa-input-dropdwon-item-disable":null}`,style:{textWrap:"nowrap",width:`${B-12}px`,overflow:"hidden",textOverflow:"ellipsis"},children:e.description}):null]})]},g)})})]}):null})}),J=({children:r,handleChangePosition:p})=>{const s=d.useRef(null);d.useEffect(()=>{var k;const a=()=>{if(s.current){let w=s.current.parentElement;for(;w&&!l(w);)w=w.parentElement;w&&p()}};let o=(k=s.current)==null?void 0:k.parentElement;for(;o&&!l(o);)o=o.parentElement;return o&&o.addEventListener("scroll",a),a(),()=>{o&&o.removeEventListener("scroll",a)}},[]);const l=a=>a&&(a.scrollHeight>a.clientHeight||a.scrollWidth>a.clientWidth);return n.jsx("div",{ref:s,children:r})},j="sa-input-dropdown-styles";(r=>{if(!document.getElementById(j)){const p=document.createElement("style");p.id=j,p.textContent=r,document.head.appendChild(p)}})(H);const K=({dropdownLists:r,onChange:p,defaultValue:s,value:l,size:a="md",multiSelect:o,searchAble:k,iconLeft:w,placeholder:N,onSearch:f,error:D,onBlur:B,onFocus:I,disable:y,searchValue:z})=>{const e=l!==void 0,g=d.useRef(),[c,h]=d.useState(e?l||[]:s||[]),[G,O]=d.useState(""),[b,L]=d.useState(-1),x=d.useRef(null),{isComponentVisible:m,ref:W,setIsComponentVisible:$}=M(!1),Q=()=>{$(t=>!t)},S=(t,i)=>{if(o)if(c==null?void 0:c.find(v=>v.value===i)){const v=c.filter(Z=>Z.value!==i);e||h(v),p(v)}else{const v=[...c,{label:t,value:i}];e||h(v),p(v)}else{const E=[{label:t,value:i}];e||h(E),p(E),$(!1)}};d.useEffect(()=>{e&&h(l||[])},[l]),d.useEffect(()=>{e||JSON.stringify(g.current)===JSON.stringify(s)||(g.current=s,h(g.current||[]))},[s]);const X=()=>c.length?o?c==null?void 0:c.map((t,i)=>n.jsxs("div",{className:"sa-input-dropdown-preview-item",children:[n.jsx("p",{style:{minWidth:"max-content"},children:t==null?void 0:t.label},i),n.jsx(U,{onClick:()=>S(t.label,t.value)})]})):n.jsx("p",{style:{minWidth:"max-content"},children:c==null?void 0:c[0].label}):n.jsx("p",{className:"sa-input-dropdown-placeholder",children:N}),C=()=>{if(W.current&&x.current){const t=window.innerHeight,i=W.current.getBoundingClientRect(),E=x.current.getBoundingClientRect(),v=i.bottom+E.height;x.current.style.left=`${i.left}px`,x.current.style.width=`${i.width}px`,v>=t-10?(x.current.style.top=`${i.top-E.height-5}px`,O("top")):(x.current.style.top=`${i.top+i.height}px`,O("bottom"))}};d.useEffect(()=>(window.addEventListener("scroll",C),window.addEventListener("resize",C),()=>{window.removeEventListener("scroll",C),window.removeEventListener("resize",C)}),[]),d.useEffect(()=>{C()},[m]),d.useEffect(()=>{m||L(-1)},[m]);const Y=t=>{if(!m){(t.key==="ArrowDown"||t.key==="Enter")&&(t.preventDefault(),$(!0));return}switch(t.key){case"ArrowDown":{t.preventDefault();const i=A(r,b,1);i!==-1&&L(i);break}case"ArrowUp":{t.preventDefault();const i=A(r,b,-1);i!==-1&&L(i);break}case"Enter":{t.preventDefault(),b>=0&&r[b]&&!r[b].disable&&S(r[b].label,r[b].value);break}case"Escape":{$(!1);break}}};return n.jsx(J,{handleChangePosition:C,children:n.jsxs("div",{className:`sa-input-dropdown-container ${y?"disable":""} sa-input-dropdown-size-${a} ${m?"active":""} ${D?"error":""}`,ref:W,onClick:Q,onKeyDown:Y,tabIndex:0,onBlur:B,onFocus:I,children:[n.jsxs("div",{className:"sa-input-dropdown-preview-container",children:[w?n.jsx(n.Fragment,{children:d.cloneElement(w,{width:F(a),color:"var(--sa-color-gray-500, #8c8f97)",style:{color:"var(--sa-color-gray-500, #8c8f97)"}})}):null,n.jsx("div",{className:"sa-input-dropdown-container-preview-item",children:X()}),n.jsx(P,{strokeWidth:2,width:F(a),style:{color:"var(--sa-color-gray-500, #8c8f97)"}})]}),n.jsx(V,{dropdownLists:r,handleChangeValue:S,isComponentVisible:m,positionDropdown:G,searchAble:!!k,value:c,onSearch:f,ref:x,multiSelect:o,searchValue:z,highlightedIndex:b})]})})},A=(r,p,s)=>{const l=r.length;let a=p+s;for(;a>=0&&a<l;){if(!r[a].disable)return a;a+=s}if(s===1){for(let o=0;o<l;o++)if(!r[o].disable)return o}else for(let o=l-1;o>=0;o--)if(!r[o].disable)return o;return-1},F=r=>{if(r==="sm")return 16;if(r==="md")return 16;if(r==="lg")return 20},U=r=>n.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",...r,children:n.jsx("path",{d:"M12 6L6 12M6.00001 6L12 12",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"})});u.Dropdown=K,Object.defineProperty(u,Symbol.toStringTag,{value:"Module"})});
@@ -16,6 +16,10 @@ export interface IDropdown {
16
16
  label: string;
17
17
  value: string;
18
18
  }[];
19
+ value?: {
20
+ label: string;
21
+ value: string;
22
+ }[];
19
23
  size?: "sm" | "md" | "lg";
20
24
  error?: boolean;
21
25
  multiSelect?: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@starasia/dropdown",
3
- "version": "3.0.0",
3
+ "version": "3.1.0",
4
4
  "description": "dropdown component for starasia UI",
5
5
  "author": "Prawito Hudoro",
6
6
  "main": "dist/dropdown.umd.js",