welcome-ui 10.0.0-alpha.4 → 10.0.0-alpha.5
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.
- package/dist/2W3RN7C5-DMC82gDP.js +61 -0
- package/dist/{4I4MLMKD-z3Xm3qCo.js → 4I4MLMKD-BO6Lcy7s.js} +17 -17
- package/dist/Accordion.js +19 -17
- package/dist/Alert.js +40 -31
- package/dist/AspectRatio.js +1 -0
- package/dist/Avatar.js +13 -11
- package/dist/{B7UTNDHN-BDa2-8JK.js → B7UTNDHN-BghjolIs.js} +30 -30
- package/dist/Badge.js +1 -0
- package/dist/Breadcrumb.js +76 -71
- package/dist/Button.js +8 -6
- package/dist/ButtonGroup.js +6 -4
- package/dist/Card.css +1 -1
- package/dist/Card.js +68 -15
- package/dist/Checkbox.js +30 -29
- package/dist/CloseButton.js +7 -5
- package/dist/{CustomPopper-vwbOQq72.js → CustomPopper-C1wIDHbM.js} +5 -4
- package/dist/{DSAASPLT-C-2xDjIv.js → DSAASPLT-Fx1kuAsk.js} +3 -3
- package/dist/DatePicker.js +82 -78
- package/dist/DateTimePicker.js +22 -21
- package/dist/Drawer.js +101 -80
- package/dist/DropdownMenu.css +1 -1
- package/dist/DropdownMenu.js +889 -462
- package/dist/Field.js +1 -0
- package/dist/FieldGroup.js +9 -7
- package/dist/FileDrop.js +184 -176
- package/dist/FileUpload.js +43 -40
- package/dist/{GVVKDT6A-C66-lr0B.js → GVVKDT6A-CF9ejW_c.js} +103 -103
- package/dist/Hint.js +9 -7
- package/dist/Icon.js +6 -4
- package/dist/InputText.js +30 -28
- package/dist/{KPUWHTQJ-Byij2al4.js → KPUWHTQJ-Dv3cAqjP.js} +33 -31
- package/dist/Label.js +9 -7
- package/dist/Link.js +25 -21
- package/dist/Loader.js +12 -10
- package/dist/Logo.js +21 -13
- package/dist/Modal.js +145 -114
- package/dist/{NI3IVY7K-DpF3td-7.js → NI3IVY7K-Dy240mkD.js} +160 -160
- package/dist/{NMGNQVTG-BgAqqGOq.js → NMGNQVTG-DRO2uXZT.js} +6 -6
- package/dist/{OE2EFRVA-DkdhQLJL.js → OE2EFRVA-Dg1R6gaC.js} +186 -170
- package/dist/{OLVWQA7U-wHytlFYu.js → OLVWQA7U-Dia3UUnG.js} +36 -36
- package/dist/Pagination.js +39 -37
- package/dist/PasswordInput.js +20 -17
- package/dist/Popover.js +89 -72
- package/dist/{RTNCFSKZ-LcIdBwa8.js → RTNCFSKZ-BywELldk.js} +42 -42
- package/dist/Radio.js +20 -19
- package/dist/RadioGroup.js +29 -27
- package/dist/RadioTab.js +2 -1
- package/dist/{SBSPVDDI-BoxPz2JY.js → SBSPVDDI-CmtnvvUX.js} +46 -46
- package/dist/SQZLCNLX-Dg4KKdNJ.js +83 -0
- package/dist/Search.css +1 -1
- package/dist/Search.js +62 -60
- package/dist/Select.css +1 -1
- package/dist/Select.js +204 -202
- package/dist/Slider.js +66 -61
- package/dist/Stepper.js +34 -27
- package/dist/StickyNote.js +30 -23
- package/dist/Swiper.js +52 -50
- package/dist/{T22PY7TE-CzEDuEn1.js → T22PY7TE-gLuJpoOm.js} +46 -46
- package/dist/Table.js +34 -21
- package/dist/Tabs.js +161 -152
- package/dist/Tag.css +1 -1
- package/dist/Tag.js +70 -65
- package/dist/Text.js +4 -2
- package/dist/Textarea.js +10 -8
- package/dist/TimePicker.js +22 -21
- package/dist/Toast.js +186 -177
- package/dist/Toggle.js +16 -14
- package/dist/Tooltip.js +29 -27
- package/dist/VariantIcon.js +7 -5
- package/dist/VisuallyHidden.js +8 -6
- package/dist/WelcomeLoader.js +3 -2
- package/dist/XCKGTAUF-CJwwVibW.js +25 -0
- package/dist/{Y67KZUMI-BDyUNSJw.js → Y67KZUMI-BwLWwpNF.js} +2 -2
- package/dist/{ZTXFEM5L-CjFLRObi.js → ZTXFEM5L-WGHY_jqg.js} +3 -3
- package/dist/theme.js +1 -0
- package/dist/types/components/Alert/components/Title.d.ts +4 -1
- package/dist/types/components/Alert/index.d.ts +4 -1
- package/dist/types/components/Card/Body.d.ts +2 -3
- package/dist/types/components/Card/Footer.d.ts +6 -0
- package/dist/types/components/Card/Header.d.ts +5 -0
- package/dist/types/components/Card/index.d.ts +7 -8
- package/dist/types/components/Card/types.d.ts +16 -3
- package/dist/types/components/Checkbox/index.d.ts +1 -2
- package/dist/types/components/Checkbox/types.d.ts +3 -1
- package/dist/types/components/DateTimePickerCommon/CustomHeader.d.ts +4 -1
- package/dist/types/components/DateTimePickerCommon/CustomPopper.d.ts +6 -3
- package/dist/types/components/Drawer/AssetDrawer/Header.d.ts +4 -1
- package/dist/types/components/Drawer/AssetDrawer/IconBlock.d.ts +4 -1
- package/dist/types/components/Drawer/components/Close.d.ts +4 -1
- package/dist/types/components/Drawer/components/Title.d.ts +4 -1
- package/dist/types/components/Drawer/index.d.ts +12 -3
- package/dist/types/components/DropdownMenu/Action.d.ts +2 -0
- package/dist/types/components/DropdownMenu/Group.d.ts +4 -0
- package/dist/types/components/DropdownMenu/Item.d.ts +7 -0
- package/dist/types/components/DropdownMenu/Search.d.ts +2 -0
- package/dist/types/components/DropdownMenu/Submenu.d.ts +4 -0
- package/dist/types/components/DropdownMenu/index.d.ts +11 -0
- package/dist/types/components/DropdownMenu/types.d.ts +26 -5
- package/dist/types/components/FileDrop/components/FilePreview.d.ts +4 -1
- package/dist/types/components/FileDrop/components/Message.d.ts +4 -1
- package/dist/types/components/Loader/index.d.ts +4 -1
- package/dist/types/components/Modal/Assets/AssetContent.d.ts +4 -1
- package/dist/types/components/Modal/Assets/AssetTitle.d.ts +4 -1
- package/dist/types/components/Modal/Assets/CloseButton.d.ts +4 -1
- package/dist/types/components/Modal/Assets/Dialog.d.ts +4 -1
- package/dist/types/components/Modal/Assets/Iframe.d.ts +4 -1
- package/dist/types/components/Modal/Assets/index.d.ts +16 -4
- package/dist/types/components/Modal/components/Close.d.ts +4 -1
- package/dist/types/components/Modal/index.d.ts +16 -4
- package/dist/types/components/PasswordInput/ToggleButton.d.ts +4 -1
- package/dist/types/components/Popover/Arrow.d.ts +4 -1
- package/dist/types/components/Popover/ContentWrapper.d.ts +4 -1
- package/dist/types/components/RadioGroup/index.d.ts +4 -1
- package/dist/types/components/Stepper/index.d.ts +8 -2
- package/dist/types/components/StickyNote/components/Button.d.ts +4 -1
- package/dist/types/components/StickyNote/components/Title.d.ts +4 -1
- package/dist/types/components/StickyNote/index.d.ts +8 -2
- package/dist/types/components/Swiper/index.d.ts +4 -1
- package/dist/types/components/Table/index.d.ts +20 -5
- package/dist/types/components/Tabs/components/ActiveBar/index.d.ts +4 -1
- package/dist/types/components/Tag/types.d.ts +4 -2
- package/dist/types/components/Toast/index.d.ts +4 -1
- package/dist/utils.js +1 -0
- package/package.json +2 -2
- package/dist/2W3RN7C5-uG7eBeTQ.js +0 -61
- package/dist/SQZLCNLX-CUlXoT69.js +0 -82
- package/dist/XCKGTAUF-CahZE721.js +0 -25
package/dist/Select.js
CHANGED
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
2
|
+
import './Select.css';
|
|
3
|
+
import { jsx as v, jsxs as L } from "react/jsx-runtime";
|
|
4
|
+
import { D as fe } from "./downshift.esm-xtYanIDi.js";
|
|
5
|
+
import { g as Ke, c as ye } from "./index-PAaZGbyz.js";
|
|
6
|
+
import { forwardRef as Le, useMemo as Pe, useState as P, useEffect as he, useCallback as $e, Fragment as Ye } from "react";
|
|
7
|
+
import { CloseButton as Be } from "./CloseButton.js";
|
|
8
|
+
import { useField as Xe } from "./Field.js";
|
|
8
9
|
import { Icon as _e } from "./Icon.js";
|
|
9
|
-
import { c as
|
|
10
|
-
import { u as
|
|
10
|
+
import { c as Ze } from "./create-event-rXDe5aCQ.js";
|
|
11
|
+
import { u as Qe } from "./useForkRef-D807AV7D.js";
|
|
11
12
|
import { Tag as Ge } from "./Tag.js";
|
|
12
|
-
var
|
|
13
|
+
var V = { exports: {} }, pe;
|
|
13
14
|
function Je() {
|
|
14
|
-
if (pe) return
|
|
15
|
+
if (pe) return V.exports;
|
|
15
16
|
pe = 1;
|
|
16
17
|
var e = {
|
|
17
18
|
À: "A",
|
|
@@ -482,10 +483,10 @@ function Je() {
|
|
|
482
483
|
}, i = function(o) {
|
|
483
484
|
return !!o.match(r);
|
|
484
485
|
};
|
|
485
|
-
return
|
|
486
|
+
return V.exports = c, V.exports.has = i, V.exports.remove = c, V.exports;
|
|
486
487
|
}
|
|
487
488
|
var en = Je();
|
|
488
|
-
const nn = /* @__PURE__ */
|
|
489
|
+
const nn = /* @__PURE__ */ Ke(en);
|
|
489
490
|
/**
|
|
490
491
|
* @name match-sorter
|
|
491
492
|
* @license MIT license.
|
|
@@ -508,24 +509,24 @@ function G(e, n, t) {
|
|
|
508
509
|
keys: r,
|
|
509
510
|
threshold: s = g.MATCHES,
|
|
510
511
|
baseSort: c = tn,
|
|
511
|
-
sorter: i = (
|
|
512
|
+
sorter: i = (m) => m.sort((u, h) => on(u, h, c))
|
|
512
513
|
} = t, o = e.reduce(l, []);
|
|
513
|
-
return i(o).map((
|
|
514
|
+
return i(o).map((m) => {
|
|
514
515
|
let {
|
|
515
516
|
item: u
|
|
516
|
-
} =
|
|
517
|
+
} = m;
|
|
517
518
|
return u;
|
|
518
519
|
});
|
|
519
|
-
function l(
|
|
520
|
-
const
|
|
520
|
+
function l(m, u, h) {
|
|
521
|
+
const E = rn(u, r, n, t), {
|
|
521
522
|
rank: p,
|
|
522
|
-
keyThreshold:
|
|
523
|
-
} =
|
|
524
|
-
return p >=
|
|
525
|
-
...
|
|
523
|
+
keyThreshold: f = s
|
|
524
|
+
} = E;
|
|
525
|
+
return p >= f && m.push({
|
|
526
|
+
...E,
|
|
526
527
|
item: u,
|
|
527
528
|
index: h
|
|
528
|
-
}),
|
|
529
|
+
}), m;
|
|
529
530
|
}
|
|
530
531
|
}
|
|
531
532
|
G.rankings = g;
|
|
@@ -543,20 +544,20 @@ function rn(e, n, t, r) {
|
|
|
543
544
|
return un(e, n).reduce((c, i, o) => {
|
|
544
545
|
let {
|
|
545
546
|
rank: l,
|
|
546
|
-
rankedValue:
|
|
547
|
+
rankedValue: m,
|
|
547
548
|
keyIndex: u,
|
|
548
549
|
keyThreshold: h
|
|
549
550
|
} = c, {
|
|
550
|
-
itemValue:
|
|
551
|
+
itemValue: E,
|
|
551
552
|
attributes: p
|
|
552
|
-
} = i,
|
|
553
|
+
} = i, f = Ae(E, t, r), k = m;
|
|
553
554
|
const {
|
|
554
|
-
minRanking:
|
|
555
|
-
maxRanking:
|
|
556
|
-
threshold:
|
|
555
|
+
minRanking: T,
|
|
556
|
+
maxRanking: R,
|
|
557
|
+
threshold: S
|
|
557
558
|
} = p;
|
|
558
|
-
return
|
|
559
|
-
rankedValue:
|
|
559
|
+
return f < T && f >= g.MATCHES ? f = T : f > R && (f = R), f > l && (l = f, u = o, h = S, k = E), {
|
|
560
|
+
rankedValue: k,
|
|
560
561
|
rank: l,
|
|
561
562
|
keyIndex: u,
|
|
562
563
|
keyThreshold: h
|
|
@@ -581,21 +582,21 @@ function sn(e) {
|
|
|
581
582
|
}
|
|
582
583
|
function an(e, n) {
|
|
583
584
|
let t = 0, r = 0;
|
|
584
|
-
function s(l,
|
|
585
|
-
for (let h = u,
|
|
586
|
-
if (
|
|
585
|
+
function s(l, m, u) {
|
|
586
|
+
for (let h = u, E = m.length; h < E; h++)
|
|
587
|
+
if (m[h] === l)
|
|
587
588
|
return t += 1, h + 1;
|
|
588
589
|
return -1;
|
|
589
590
|
}
|
|
590
591
|
function c(l) {
|
|
591
|
-
const
|
|
592
|
-
return g.MATCHES + u *
|
|
592
|
+
const m = 1 / l, u = t / n.length;
|
|
593
|
+
return g.MATCHES + u * m;
|
|
593
594
|
}
|
|
594
595
|
const i = s(n[0], e, 0);
|
|
595
596
|
if (i < 0)
|
|
596
597
|
return g.NO_MATCH;
|
|
597
598
|
r = i;
|
|
598
|
-
for (let l = 1,
|
|
599
|
+
for (let l = 1, m = n.length; l < m; l++) {
|
|
599
600
|
const u = n[l];
|
|
600
601
|
if (r = s(u, e, r), !(r > -1))
|
|
601
602
|
return g.NO_MATCH;
|
|
@@ -641,7 +642,7 @@ function cn(e, n) {
|
|
|
641
642
|
for (let s = 0, c = t.length; s < c; s++) {
|
|
642
643
|
const i = t[s];
|
|
643
644
|
let o = [];
|
|
644
|
-
for (let l = 0,
|
|
645
|
+
for (let l = 0, m = r.length; l < m; l++) {
|
|
645
646
|
const u = r[l];
|
|
646
647
|
if (u != null)
|
|
647
648
|
if (Object.hasOwnProperty.call(u, i)) {
|
|
@@ -656,8 +657,8 @@ function cn(e, n) {
|
|
|
656
657
|
function un(e, n) {
|
|
657
658
|
const t = [];
|
|
658
659
|
for (let r = 0, s = n.length; r < s; r++) {
|
|
659
|
-
const c = n[r], i =
|
|
660
|
-
for (let l = 0,
|
|
660
|
+
const c = n[r], i = mn(c), o = ln(e, c);
|
|
661
|
+
for (let l = 0, m = o.length; l < m; l++)
|
|
661
662
|
t.push({
|
|
662
663
|
itemValue: o[l],
|
|
663
664
|
attributes: i
|
|
@@ -669,50 +670,50 @@ const Ie = {
|
|
|
669
670
|
maxRanking: 1 / 0,
|
|
670
671
|
minRanking: -1 / 0
|
|
671
672
|
};
|
|
672
|
-
function
|
|
673
|
+
function mn(e) {
|
|
673
674
|
return typeof e == "string" ? Ie : {
|
|
674
675
|
...Ie,
|
|
675
676
|
...e
|
|
676
677
|
};
|
|
677
678
|
}
|
|
678
|
-
const
|
|
679
|
-
indicators:
|
|
680
|
-
"size-xs": "_size-
|
|
681
|
-
"dropdown-indicator": "_dropdown-
|
|
682
|
-
"styled-icon": "_styled-
|
|
683
|
-
open:
|
|
679
|
+
const dn = "_indicators_1q51m_2", fn = "_open_1q51m_34", hn = "_disabled_1q51m_40", _n = "_root_1q51m_51", pn = "_clearable_1q51m_86", An = "_transparent_1q51m_104", gn = "_wrapper_1q51m_200", In = "_menu_1q51m_207", vn = "_item_1q51m_235", En = "_highlighted_1q51m_249", On = "_selected_1q51m_252", yn = "_multiple_1q51m_252", wn = "_allowUnselectFromList_1q51m_256", Cn = "_tags_1q51m_264", we = {
|
|
680
|
+
indicators: dn,
|
|
681
|
+
"size-xs": "_size-xs_1q51m_11",
|
|
682
|
+
"dropdown-indicator": "_dropdown-indicator_1q51m_14",
|
|
683
|
+
"styled-icon": "_styled-icon_1q51m_28",
|
|
684
|
+
open: fn,
|
|
684
685
|
disabled: hn,
|
|
685
|
-
"input-wrapper": "_input-
|
|
686
|
-
"icon-placement-right": "_icon-placement-
|
|
686
|
+
"input-wrapper": "_input-wrapper_1q51m_44",
|
|
687
|
+
"icon-placement-right": "_icon-placement-right_1q51m_47",
|
|
687
688
|
root: _n,
|
|
688
|
-
"icon-placement-left": "_icon-placement-
|
|
689
|
-
"icon-placement-both": "_icon-placement-
|
|
689
|
+
"icon-placement-left": "_icon-placement-left_1q51m_83",
|
|
690
|
+
"icon-placement-both": "_icon-placement-both_1q51m_83",
|
|
690
691
|
clearable: pn,
|
|
691
692
|
transparent: An,
|
|
692
|
-
"variant-danger": "_variant-
|
|
693
|
-
"variant-success": "_variant-
|
|
694
|
-
"variant-warning": "_variant-
|
|
695
|
-
"size-lg": "_size-
|
|
696
|
-
"size-md": "_size-
|
|
697
|
-
"size-sm": "_size-
|
|
698
|
-
"icon-wrapper": "_icon-
|
|
693
|
+
"variant-danger": "_variant-danger_1q51m_139",
|
|
694
|
+
"variant-success": "_variant-success_1q51m_142",
|
|
695
|
+
"variant-warning": "_variant-warning_1q51m_145",
|
|
696
|
+
"size-lg": "_size-lg_1q51m_148",
|
|
697
|
+
"size-md": "_size-md_1q51m_155",
|
|
698
|
+
"size-sm": "_size-sm_1q51m_162",
|
|
699
|
+
"icon-wrapper": "_icon-wrapper_1q51m_169",
|
|
699
700
|
wrapper: gn,
|
|
700
701
|
menu: In,
|
|
701
|
-
item:
|
|
702
|
-
highlighted:
|
|
703
|
-
selected:
|
|
704
|
-
multiple:
|
|
705
|
-
allowUnselectFromList:
|
|
706
|
-
tags:
|
|
707
|
-
"styled-tag": "_styled-
|
|
708
|
-
},
|
|
709
|
-
function
|
|
710
|
-
return /* @__PURE__ */
|
|
702
|
+
item: vn,
|
|
703
|
+
highlighted: En,
|
|
704
|
+
selected: On,
|
|
705
|
+
multiple: yn,
|
|
706
|
+
allowUnselectFromList: wn,
|
|
707
|
+
tags: Cn,
|
|
708
|
+
"styled-tag": "_styled-tag_1q51m_267"
|
|
709
|
+
}, ve = ye(we);
|
|
710
|
+
function xn(e, n) {
|
|
711
|
+
return /* @__PURE__ */ v("div", { className: ve("tags"), role: "list", children: e.map((t) => (
|
|
711
712
|
// TODO migrate after WUI-187/tag
|
|
712
|
-
/* @__PURE__ */
|
|
713
|
+
/* @__PURE__ */ v(
|
|
713
714
|
Ge,
|
|
714
715
|
{
|
|
715
|
-
className:
|
|
716
|
+
className: ve("styled-tag"),
|
|
716
717
|
onRemove: () => n(t.value.toString()),
|
|
717
718
|
role: "listitem",
|
|
718
719
|
children: t.label
|
|
@@ -721,27 +722,27 @@ function Cn(e, n) {
|
|
|
721
722
|
)
|
|
722
723
|
)) });
|
|
723
724
|
}
|
|
724
|
-
const ee = "",
|
|
725
|
+
const ee = "", Nn = /[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g, Ce = (e) => {
|
|
725
726
|
if (typeof e == "number")
|
|
726
727
|
return String(e);
|
|
727
728
|
if (typeof e == "string") {
|
|
728
|
-
const n = e.match(
|
|
729
|
+
const n = e.match(Nn);
|
|
729
730
|
return n && n.map((t) => t.toLowerCase()).join("-");
|
|
730
731
|
}
|
|
731
|
-
},
|
|
732
|
+
}, Ee = (e) => e ? e.label : ee, bn = (e) => e.reduce(
|
|
732
733
|
(n, t) => t.label && n.length > t.label.length ? n : t.label,
|
|
733
734
|
ee
|
|
734
|
-
),
|
|
735
|
+
), Rn = (e, n, t) => {
|
|
735
736
|
const r = n.find((s) => e.value === s.value);
|
|
736
737
|
return r && t ? n.filter((s) => e.value !== s.value) : r ? n : [...n, e];
|
|
737
|
-
},
|
|
738
|
+
}, Q = (e, n) => !!n.find((t) => t.value === e), J = (e, n = []) => n.find(
|
|
738
739
|
(r) => r.label === (e.label || e) || r.value === (e.value || e)
|
|
739
|
-
) || { label: e, value:
|
|
740
|
+
) || { label: e, value: Ce(e) }, qn = (e, n, t = !1) => {
|
|
740
741
|
const r = t ? n.flatMap((s) => s.options) : n;
|
|
741
742
|
return !e && e !== 0 ? [] : Array.isArray(e) ? e.map((s) => J(s, r)) : [J(e, r)];
|
|
742
|
-
},
|
|
743
|
+
}, kn = (e, n) => !!n.find((t) => t.value === e.value), Sn = (e, n) => kn(e, n) ? e.value : e.label, Oe = (e, n) => e ? e.map((t) => Sn(t, n)) : [], Un = (e, n) => e ? e.filter(
|
|
743
744
|
(t) => !n.find((r) => r.value === t.value)
|
|
744
|
-
) : [],
|
|
745
|
+
) : [], Vn = ({
|
|
745
746
|
inputValue: e,
|
|
746
747
|
isMultiple: n,
|
|
747
748
|
isSearchable: t,
|
|
@@ -750,7 +751,7 @@ const ee = "", xn = /[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|
|
|
|
750
751
|
}) => {
|
|
751
752
|
const c = J(e, r);
|
|
752
753
|
return n ? e : c.label ? t ? c.label : s(c) : ee;
|
|
753
|
-
},
|
|
754
|
+
}, w = ye(we), Tn = fe.default || fe, Hn = Le(
|
|
754
755
|
({
|
|
755
756
|
allowUnselectFromList: e,
|
|
756
757
|
autoComplete: n = "off",
|
|
@@ -761,250 +762,251 @@ const ee = "", xn = /[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|
|
|
|
761
762
|
disabled: i,
|
|
762
763
|
groupsEnabled: o,
|
|
763
764
|
icon: l,
|
|
764
|
-
iconPlacement:
|
|
765
|
+
iconPlacement: m = "left",
|
|
765
766
|
id: u,
|
|
766
767
|
isClearable: h,
|
|
767
|
-
isCreatable:
|
|
768
|
+
isCreatable: E,
|
|
768
769
|
isMultiple: p,
|
|
769
|
-
isSearchable:
|
|
770
|
-
name:
|
|
771
|
-
onBlur:
|
|
772
|
-
onChange:
|
|
773
|
-
onClick:
|
|
774
|
-
onCreate:
|
|
775
|
-
onFocus:
|
|
770
|
+
isSearchable: f,
|
|
771
|
+
name: k,
|
|
772
|
+
onBlur: T,
|
|
773
|
+
onChange: R,
|
|
774
|
+
onClick: S,
|
|
775
|
+
onCreate: $,
|
|
776
|
+
onFocus: xe,
|
|
776
777
|
options: I = [],
|
|
777
778
|
placeholder: ne = "Choose from…",
|
|
778
|
-
renderCreateItem:
|
|
779
|
+
renderCreateItem: Ne = (F) => `Create "${F}"`,
|
|
779
780
|
renderGroupHeader: te,
|
|
780
|
-
renderItem:
|
|
781
|
-
renderMultiple: be =
|
|
782
|
-
size:
|
|
781
|
+
renderItem: H = Ee,
|
|
782
|
+
renderMultiple: be = xn,
|
|
783
|
+
size: z = "lg",
|
|
783
784
|
transparent: re,
|
|
784
785
|
value: se,
|
|
785
786
|
variant: ae,
|
|
786
787
|
...oe
|
|
787
|
-
},
|
|
788
|
-
const { getInputProps:
|
|
789
|
-
() =>
|
|
788
|
+
}, Re) => {
|
|
789
|
+
const { getInputProps: F, variant: qe } = Xe(), le = qe || ae, D = Pe(
|
|
790
|
+
() => qn(se, I, o),
|
|
790
791
|
[se, I, o]
|
|
791
|
-
),
|
|
792
|
-
|
|
793
|
-
const [
|
|
792
|
+
), Y = !p && D[0] || null, B = Y ? Y.label : "", [x, X] = P(D), [C, U] = P(B), [M, j] = P(I), [N, q] = P(!1);
|
|
793
|
+
f = E || f;
|
|
794
|
+
const [Z, ke] = Qe(Re);
|
|
794
795
|
he(() => {
|
|
795
|
-
t &&
|
|
796
|
-
}, [
|
|
797
|
-
|
|
798
|
-
}, [
|
|
799
|
-
const
|
|
800
|
-
if (
|
|
801
|
-
let
|
|
802
|
-
o ?
|
|
796
|
+
t && Z.current && (Z.current.focus(), f && q(!0));
|
|
797
|
+
}, [f, t, Z]), he(() => {
|
|
798
|
+
X(D), U(B), j(I);
|
|
799
|
+
}, [B, I, D]);
|
|
800
|
+
const Se = (a) => {
|
|
801
|
+
if (f && a !== C) {
|
|
802
|
+
let d = [];
|
|
803
|
+
o ? d = G(I, a, {
|
|
803
804
|
// should match on group.label OR group.options.label
|
|
804
|
-
keys: [(A) => A.label, (A) => A.options.map((
|
|
805
|
-
}) :
|
|
805
|
+
keys: [(A) => A.label, (A) => A.options.map((O) => O.label)]
|
|
806
|
+
}) : d = G(I, a, { keys: ["label"] }), U(a), j(d);
|
|
806
807
|
}
|
|
807
|
-
},
|
|
808
|
-
|
|
808
|
+
}, Ue = () => {
|
|
809
|
+
f && !N && q(!0);
|
|
809
810
|
}, ce = (a) => {
|
|
810
|
-
let
|
|
811
|
-
o ?
|
|
811
|
+
let d = [];
|
|
812
|
+
o ? d = Oe(
|
|
812
813
|
a,
|
|
813
814
|
I.flatMap((_) => _.options)
|
|
814
|
-
) :
|
|
815
|
-
const A = p ?
|
|
816
|
-
if (
|
|
817
|
-
const _ =
|
|
818
|
-
_.length && (
|
|
815
|
+
) : d = Oe(a, I);
|
|
816
|
+
const A = p ? d : d[0], O = Ze({ name: k, value: p ? a : a[0] });
|
|
817
|
+
if (R == null || R(A, O), E) {
|
|
818
|
+
const _ = Un(a, I);
|
|
819
|
+
_.length && ($ == null || $(_[0].label, O));
|
|
819
820
|
}
|
|
821
|
+
}, Ve = (a) => {
|
|
822
|
+
let d, A;
|
|
823
|
+
!a || a != null && a.disabled ? (d = p ? x : [], A = !0) : (d = p ? Rn(a, x, e) : [a], A = p), A && U(""), j(I), X(d), ce(d), c || q(!1);
|
|
820
824
|
}, Te = (a) => {
|
|
821
|
-
|
|
822
|
-
|
|
825
|
+
const d = x.filter((A) => A.value !== a);
|
|
826
|
+
X(d), ce(d);
|
|
823
827
|
}, He = (a) => {
|
|
824
|
-
|
|
825
|
-
Z(f), ce(f);
|
|
828
|
+
S == null || S(a), q(!N);
|
|
826
829
|
}, ze = (a) => {
|
|
827
|
-
|
|
828
|
-
}, Fe = (
|
|
829
|
-
|
|
830
|
-
}, De = bn(I), ie = Tn({
|
|
831
|
-
inputValue: w,
|
|
830
|
+
p && a.selectedItem ? U("") : f && a.selectedItem && U(a.selectedItem.label), j(I), q(!1);
|
|
831
|
+
}, Fe = bn(I), ie = Vn({
|
|
832
|
+
inputValue: C,
|
|
832
833
|
isMultiple: p,
|
|
833
|
-
isSearchable:
|
|
834
|
+
isSearchable: f,
|
|
834
835
|
options: I,
|
|
835
|
-
renderItem:
|
|
836
|
-
}),
|
|
836
|
+
renderItem: H
|
|
837
|
+
}), De = $e(
|
|
837
838
|
({
|
|
838
839
|
getItemProps: a,
|
|
839
|
-
highlightedIndex:
|
|
840
|
+
highlightedIndex: d,
|
|
840
841
|
options: A
|
|
841
842
|
}) => A.reduce(
|
|
842
|
-
(
|
|
843
|
+
(O, _, W) => {
|
|
843
844
|
if (o && "options" in _)
|
|
844
|
-
|
|
845
|
-
/* @__PURE__ */
|
|
845
|
+
O.itemsToRender.push(
|
|
846
|
+
/* @__PURE__ */ L(Ye, { children: [
|
|
846
847
|
te(_),
|
|
847
|
-
_.options ? _.options.map((
|
|
848
|
-
const b =
|
|
849
|
-
return /* @__PURE__ */
|
|
848
|
+
_.options ? _.options.map((y) => {
|
|
849
|
+
const b = O.itemIndex++, K = Q(y.value, x);
|
|
850
|
+
return /* @__PURE__ */ v(
|
|
850
851
|
"li",
|
|
851
852
|
{
|
|
852
|
-
className:
|
|
853
|
+
className: w(
|
|
853
854
|
"item",
|
|
854
|
-
|
|
855
|
+
d === b && "highlighted",
|
|
855
856
|
p && "multiple",
|
|
856
857
|
e && "allowUnselectFromList",
|
|
857
|
-
|
|
858
|
-
|
|
858
|
+
y.disabled && "disabled",
|
|
859
|
+
K && "selected"
|
|
859
860
|
),
|
|
860
861
|
...a({
|
|
861
862
|
index: b,
|
|
862
|
-
item:
|
|
863
|
+
item: y
|
|
863
864
|
}),
|
|
864
|
-
children:
|
|
865
|
+
children: H(y, K)
|
|
865
866
|
},
|
|
866
|
-
|
|
867
|
+
y.value
|
|
867
868
|
);
|
|
868
869
|
}) : null
|
|
869
870
|
] }, _.label)
|
|
870
871
|
);
|
|
871
872
|
else if ("value" in _) {
|
|
872
|
-
const
|
|
873
|
-
|
|
874
|
-
/* @__PURE__ */
|
|
873
|
+
const y = Q(_.value, x), b = d === W;
|
|
874
|
+
O.itemsToRender.push(
|
|
875
|
+
/* @__PURE__ */ v(
|
|
875
876
|
"li",
|
|
876
877
|
{
|
|
877
|
-
className:
|
|
878
|
+
className: w(
|
|
878
879
|
"item",
|
|
879
880
|
b && "highlighted",
|
|
880
881
|
p && "multiple",
|
|
881
882
|
e && "allowUnselectFromList",
|
|
882
883
|
_.disabled && "disabled",
|
|
883
|
-
|
|
884
|
+
y && "selected"
|
|
884
885
|
),
|
|
885
886
|
...a({
|
|
886
|
-
index:
|
|
887
|
+
index: W,
|
|
887
888
|
item: _
|
|
888
889
|
}),
|
|
889
|
-
children:
|
|
890
|
+
children: H(_, y)
|
|
890
891
|
},
|
|
891
892
|
_.value
|
|
892
893
|
)
|
|
893
894
|
);
|
|
894
895
|
}
|
|
895
|
-
return
|
|
896
|
+
return O;
|
|
896
897
|
},
|
|
897
898
|
{ itemIndex: 0, itemsToRender: [] }
|
|
898
899
|
).itemsToRender,
|
|
899
|
-
[p, e,
|
|
900
|
-
), ue =
|
|
900
|
+
[p, e, x, o, te, H]
|
|
901
|
+
), ue = w(
|
|
901
902
|
"root",
|
|
902
|
-
`size-${
|
|
903
|
+
`size-${z}`,
|
|
903
904
|
le && `variant-${le}`,
|
|
904
905
|
h && "clearable",
|
|
905
906
|
re && "transparent",
|
|
906
|
-
l && `icon-placement-${
|
|
907
|
+
l && `icon-placement-${m}`,
|
|
907
908
|
r,
|
|
908
909
|
i && "disabled"
|
|
909
910
|
);
|
|
910
|
-
return /* @__PURE__ */
|
|
911
|
-
|
|
911
|
+
return /* @__PURE__ */ v(
|
|
912
|
+
Tn,
|
|
912
913
|
{
|
|
913
914
|
id: u,
|
|
914
|
-
inputValue:
|
|
915
|
-
isOpen:
|
|
916
|
-
itemToString:
|
|
917
|
-
onInputValueChange:
|
|
918
|
-
onOuterClick:
|
|
919
|
-
onSelect:
|
|
920
|
-
selectedItem:
|
|
915
|
+
inputValue: f ? ie : "",
|
|
916
|
+
isOpen: N,
|
|
917
|
+
itemToString: Ee,
|
|
918
|
+
onInputValueChange: Se,
|
|
919
|
+
onOuterClick: ze,
|
|
920
|
+
onSelect: Ve,
|
|
921
|
+
selectedItem: Y,
|
|
921
922
|
children: ({
|
|
922
923
|
clearSelection: a,
|
|
923
|
-
getInputProps:
|
|
924
|
+
getInputProps: d,
|
|
924
925
|
getItemProps: A,
|
|
925
|
-
getMenuProps:
|
|
926
|
+
getMenuProps: O,
|
|
926
927
|
getRootProps: _,
|
|
927
|
-
getToggleButtonProps:
|
|
928
|
-
highlightedIndex:
|
|
928
|
+
getToggleButtonProps: W,
|
|
929
|
+
highlightedIndex: y
|
|
929
930
|
}) => {
|
|
930
|
-
const b = !!(
|
|
931
|
-
|
|
931
|
+
const b = !!(E && C && !Q(C, x)), K = N && (M.length || b), me = h && C, Me = /* @__PURE__ */ v("div", { className: w("dropdown-indicator", N && "open"), children: /* @__PURE__ */ v(
|
|
932
|
+
Be,
|
|
932
933
|
{
|
|
933
934
|
animatePresence: !0,
|
|
934
935
|
onClick: a,
|
|
935
936
|
title: "Clear"
|
|
936
937
|
}
|
|
937
|
-
) }),
|
|
938
|
+
) }), je = /* @__PURE__ */ v(
|
|
938
939
|
"div",
|
|
939
940
|
{
|
|
940
|
-
className:
|
|
941
|
+
className: w("dropdown-indicator", N && "open", i && "disabled"),
|
|
941
942
|
"data-testid": s ? `${s}-arrow-icon` : null,
|
|
942
943
|
disabled: i,
|
|
943
944
|
tabIndex: -1,
|
|
944
|
-
...
|
|
945
|
-
onClick: () => !i &&
|
|
945
|
+
...W({
|
|
946
|
+
onClick: () => !i && q(!N)
|
|
946
947
|
}),
|
|
947
|
-
children: /* @__PURE__ */
|
|
948
|
+
children: /* @__PURE__ */ v(_e, { className: w("styled-icon"), name: "angle-down", size: "lg" })
|
|
948
949
|
}
|
|
949
|
-
),
|
|
950
|
+
), We = _(oe, { suppressRefError: !0 }), de = d({
|
|
950
951
|
autoComplete: n,
|
|
951
952
|
autoFocus: t,
|
|
952
|
-
"data-spacer":
|
|
953
|
+
"data-spacer": Fe || ne,
|
|
953
954
|
"data-testid": s,
|
|
954
955
|
disabled: i,
|
|
955
956
|
id: u,
|
|
956
|
-
name:
|
|
957
|
-
onBlur:
|
|
958
|
-
onClick: i ? void 0 :
|
|
959
|
-
onFocus:
|
|
960
|
-
onKeyDown:
|
|
957
|
+
name: k,
|
|
958
|
+
onBlur: T,
|
|
959
|
+
onClick: i ? void 0 : He,
|
|
960
|
+
onFocus: xe,
|
|
961
|
+
onKeyDown: Ue,
|
|
961
962
|
placeholder: ne,
|
|
962
|
-
ref:
|
|
963
|
-
size:
|
|
963
|
+
ref: ke,
|
|
964
|
+
size: z,
|
|
964
965
|
tabIndex: 0,
|
|
965
966
|
transparent: re,
|
|
966
|
-
variant:
|
|
967
|
+
variant: N ? "focused" : ae,
|
|
967
968
|
...oe
|
|
968
969
|
});
|
|
969
|
-
return /* @__PURE__ */
|
|
970
|
-
|
|
970
|
+
return /* @__PURE__ */ L("div", { ...We, className: w("wrapper", i && "disabled"), children: [
|
|
971
|
+
f ? /* @__PURE__ */ v(
|
|
971
972
|
"input",
|
|
972
973
|
{
|
|
973
974
|
className: ue,
|
|
974
975
|
type: "text",
|
|
975
|
-
...
|
|
976
|
+
...F(de)
|
|
976
977
|
}
|
|
977
|
-
) : /* @__PURE__ */
|
|
978
|
-
l ? /* @__PURE__ */
|
|
979
|
-
/* @__PURE__ */
|
|
980
|
-
|
|
981
|
-
|
|
978
|
+
) : /* @__PURE__ */ v("div", { className: ue, ...F(de), children: ie }),
|
|
979
|
+
l ? /* @__PURE__ */ v("div", { className: w("icon-wrapper", "icon-placement-left", `size-${z}`), children: /* @__PURE__ */ v(_e, { ...l.props, size: "md" }) }) : null,
|
|
980
|
+
/* @__PURE__ */ L("div", { className: w("indicators", `size-${z}`), children: [
|
|
981
|
+
me ? Me : null,
|
|
982
|
+
je
|
|
982
983
|
] }),
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
b &&
|
|
984
|
+
K ? /* @__PURE__ */ L("ul", { className: w("menu"), ...O(), children: [
|
|
985
|
+
De({ getItemProps: A, highlightedIndex: y, options: M }),
|
|
986
|
+
b && C.length ? /* @__PURE__ */ v(
|
|
986
987
|
"li",
|
|
987
988
|
{
|
|
988
|
-
className:
|
|
989
|
+
className: w("item", y === M.length && "highlighted"),
|
|
989
990
|
...A({
|
|
990
|
-
index:
|
|
991
|
+
index: M.length,
|
|
991
992
|
item: {
|
|
992
|
-
label:
|
|
993
|
-
value:
|
|
993
|
+
label: C,
|
|
994
|
+
value: Ce(C)
|
|
994
995
|
}
|
|
995
996
|
}),
|
|
996
|
-
children:
|
|
997
|
+
children: Ne(C)
|
|
997
998
|
},
|
|
998
999
|
"add"
|
|
999
1000
|
) : null
|
|
1000
1001
|
] }) : null,
|
|
1001
|
-
p ? be(
|
|
1002
|
+
p ? be(x, Te) : null
|
|
1002
1003
|
] });
|
|
1003
1004
|
}
|
|
1004
1005
|
}
|
|
1005
1006
|
);
|
|
1006
1007
|
}
|
|
1007
1008
|
);
|
|
1009
|
+
Hn.displayName = "Select";
|
|
1008
1010
|
export {
|
|
1009
|
-
|
|
1011
|
+
Hn as Select
|
|
1010
1012
|
};
|