welcome-ui 9.0.0-alpha.4 → 9.0.1
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/README.md +47 -3
- package/dist/2W3RN7C5-bkX-rIa3.js +61 -0
- package/dist/4I4MLMKD-BLxAidnq.js +43 -0
- package/dist/Accordion.js +6 -6
- package/dist/Alert.js +1 -1
- package/dist/AspectRatio.js +1 -1
- package/dist/Avatar.js +1 -1
- package/dist/{4CMBR7SL-Dhp8uJop.js → B7UTNDHN-BlIblHCu.js} +59 -59
- package/dist/Badge.js +1 -1
- package/dist/Breadcrumb.css +1 -1
- package/dist/Breadcrumb.js +27 -27
- package/dist/Button.js +2 -2
- package/dist/ButtonGroup.js +1 -1
- package/dist/Card.js +1 -1
- package/dist/Checkbox.css +1 -1
- package/dist/Checkbox.js +22 -22
- package/dist/CloseButton.js +3 -3
- package/dist/{SYRFVSLH-CHNUB1rW.js → DSAASPLT-BaaCUKsb.js} +7 -7
- package/dist/DatePicker.js +5 -5
- package/dist/DateTimePicker.js +2 -2
- package/dist/Drawer.css +1 -1
- package/dist/Drawer.js +67 -67
- package/dist/DropdownMenu.js +261 -259
- package/dist/Field.js +1 -1
- package/dist/FieldGroup.js +1 -1
- package/dist/FileDrop.js +194 -221
- package/dist/FileUpload.js +2 -2
- package/dist/GVVKDT6A-bET6V7Py.js +724 -0
- package/dist/Hint.js +1 -1
- package/dist/{Icon-BisRi8B3.js → Icon-EG7O4YwD.js} +1 -1
- package/dist/Icon.js +12 -12
- package/dist/InputText.js +1 -1
- package/dist/{ASMQKSDT-SH1qSiMi.js → KPUWHTQJ-D2TPji47.js} +30 -30
- package/dist/Label.js +3 -3
- package/dist/Link.css +1 -1
- package/dist/Link.js +27 -27
- package/dist/Loader.js +1 -1
- package/dist/Logo.js +1 -1
- package/dist/Modal.js +10 -10
- package/dist/{JC64G2H7-DPy9R0De.js → NI3IVY7K-Ztb3-XAv.js} +571 -571
- package/dist/{P4IRICAX-7kH4HzWI.js → NMGNQVTG-C6TqBngP.js} +5 -5
- package/dist/{LVA2YJMS-NUHCRwFZ.js → OE2EFRVA-C3721cM3.js} +316 -315
- package/dist/{ITI7HKP4-C5xLpoVY.js → OLVWQA7U-DysaSaZj.js} +59 -59
- package/dist/Pagination.css +1 -1
- package/dist/Pagination.js +81 -73
- package/dist/PasswordInput.js +17 -18
- package/dist/Popover.js +14 -14
- package/dist/{YV4JVR4I-CVFstk2K.js → RTNCFSKZ-qpPg689E.js} +75 -73
- package/dist/Radio.css +1 -1
- package/dist/Radio.js +29 -29
- package/dist/RadioGroup.js +21 -21
- package/dist/RadioTab.js +2 -2
- package/dist/{P2CTZE2T-D1TepwxQ.js → SBSPVDDI-DJKkC1eb.js} +43 -43
- package/dist/{NLEBE274-B4zy25kL.js → SQZLCNLX-CHDXnZ16.js} +16 -16
- package/dist/Search.js +2 -2
- package/dist/Select.js +170 -181
- package/dist/Slider.js +1 -1
- package/dist/Swiper.css +1 -1
- package/dist/Swiper.js +151 -151
- package/dist/{VGCJ63VH-CVhs4PYt.js → T22PY7TE-C1N0q8Kn.js} +109 -109
- package/dist/Table.js +1 -1
- package/dist/Tabs.js +303 -308
- package/dist/Tag.js +3 -3
- package/dist/Text.js +1 -1
- package/dist/Textarea.js +1 -1
- package/dist/TimePicker.js +2 -2
- package/dist/Toast.js +1 -1
- package/dist/Toggle.js +2 -2
- package/dist/Tooltip.js +72 -72
- package/dist/VariantIcon.js +3 -3
- package/dist/WelcomeLoader.js +1 -1
- package/dist/XCKGTAUF-DkxWCbaW.js +25 -0
- package/dist/Y67KZUMI-DFEgrUv2.js +15 -0
- package/dist/{AXB53BZF-BHeessqV.js → ZTXFEM5L-CkrIQCN1.js} +7 -7
- package/dist/{field-icon-size-Du58qHNC.js → field-icon-size-Z5NulTSk.js} +216 -224
- package/dist/{index-5rXezknO.js → index-BC2bF45u.js} +1 -1
- package/dist/{index-C8GsqBDe.js → index-BeetbagJ.js} +1 -1
- package/dist/{index-BJLXLdM3.js → index-Bt79XJ8R.js} +1 -1
- package/dist/{index-Dcq5gh3E.js → index-BtwrJ6N4.js} +1 -1
- package/dist/{index-DL4-ut3P.js → index-CCASZBtz.js} +1 -1
- package/dist/{index-lbUBMgHp.js → index-CPqDZeah.js} +2 -2
- package/dist/{index-CTgip19b.js → index-CQEPCbEE.js} +1 -1
- package/dist/{index-CnxSNAPH.js → index-Crpe9CvH.js} +1 -1
- package/dist/{index-CWVOLBDY.js → index-D5a8Oe6k.js} +1 -1
- package/dist/{index-C1jjVTAc.js → index-D8dq-I5s.js} +1 -1
- package/dist/{index-Cvtm6uuS.js → index-DkwTwo3z.js} +1 -1
- package/dist/{index-BG2aV9o8.js → index-DnO8yBVT.js} +1 -1
- package/dist/index.css +0 -0
- package/dist/tslib.es6-DpB4Y59c.js +683 -0
- package/dist/types/components/Pagination/index.d.ts +1 -2
- package/dist/types/components/Pagination/types.d.ts +5 -2
- package/dist/types/components/PasswordInput/ToggleButton.d.ts +1 -1
- package/dist/types/components/PasswordInput/types.d.ts +1 -1
- package/dist/types/components/Tabs/components/TabList/index.d.ts +1 -1
- package/dist/types/components/Tabs/index.d.ts +1 -1
- package/dist/types/components/Tabs/types.d.ts +1 -2
- package/dist/types/components/Tabs/utils.d.ts +1 -2
- package/dist/types/utils/index.d.ts +1 -0
- package/dist/types/utils/theme/index.d.ts +0 -0
- package/dist/types/utils/useForkRef.d.ts +7 -1
- package/dist/useForkRef-D807AV7D.js +22 -0
- package/dist/{utils-BNMgUIHQ.js → utils-BpbIqM56.js} +1 -1
- package/dist/utils.js +2 -2
- package/package.json +5 -5
- package/dist/BYC7LY2E-DbSoi9cN.js +0 -673
- package/dist/KUU7WJ55-CsIy9XMu.js +0 -61
- package/dist/MTZPJQMC-D_TnSwZf.js +0 -15
- package/dist/QYJ6MIDR-Dm7lYMh6.js +0 -43
- package/dist/X5NMLKT6-PeY306ft.js +0 -25
- package/dist/index--0U5Rubs.js +0 -644
- /package/dist/{index-PAaZGbyz.js → index-CdiHdiVB.js} +0 -0
package/dist/Select.js
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as I, jsxs as P } from "react/jsx-runtime";
|
|
3
|
-
import { D as me, F as
|
|
4
|
-
import { g as
|
|
5
|
-
import
|
|
6
|
-
import { CloseButton as
|
|
7
|
-
import { useField as
|
|
8
|
-
import "./Icon-
|
|
9
|
-
import { D as
|
|
10
|
-
import { c as
|
|
3
|
+
import { D as me, F as Ke } from "./field-icon-size-Z5NulTSk.js";
|
|
4
|
+
import { g as Pe, c as be } from "./index-CdiHdiVB.js";
|
|
5
|
+
import $e, { forwardRef as Ye, useMemo as Be, useState as $, useEffect as _e, useCallback as Ze, Fragment as Xe } from "react";
|
|
6
|
+
import { CloseButton as Qe } from "./CloseButton.js";
|
|
7
|
+
import { useField as qe } from "./Field.js";
|
|
8
|
+
import "./Icon-EG7O4YwD.js";
|
|
9
|
+
import { D as Ge } from "./index-CQEPCbEE.js";
|
|
10
|
+
import { c as Je } from "./create-event-rXDe5aCQ.js";
|
|
11
|
+
import { u as en } from "./useForkRef-D807AV7D.js";
|
|
11
12
|
import { Tag as nn } from "./Tag.js";
|
|
12
13
|
var H = { exports: {} }, he;
|
|
13
14
|
function tn() {
|
|
@@ -474,18 +475,18 @@ function tn() {
|
|
|
474
475
|
ё: "е",
|
|
475
476
|
Ё: "Е"
|
|
476
477
|
}, n = Object.keys(e).join("|"), t = new RegExp(n, "g"), r = new RegExp(n, "");
|
|
477
|
-
function s(
|
|
478
|
-
return e[
|
|
478
|
+
function s(o) {
|
|
479
|
+
return e[o];
|
|
479
480
|
}
|
|
480
|
-
var
|
|
481
|
-
return
|
|
482
|
-
}, i = function(
|
|
483
|
-
return !!
|
|
481
|
+
var c = function(o) {
|
|
482
|
+
return o.replace(t, s);
|
|
483
|
+
}, i = function(o) {
|
|
484
|
+
return !!o.match(r);
|
|
484
485
|
};
|
|
485
|
-
return H.exports =
|
|
486
|
+
return H.exports = c, H.exports.has = i, H.exports.remove = c, H.exports;
|
|
486
487
|
}
|
|
487
488
|
var rn = tn();
|
|
488
|
-
const sn = /* @__PURE__ */
|
|
489
|
+
const sn = /* @__PURE__ */ Pe(rn);
|
|
489
490
|
/**
|
|
490
491
|
* @name match-sorter
|
|
491
492
|
* @license MIT license.
|
|
@@ -501,23 +502,23 @@ const A = {
|
|
|
501
502
|
ACRONYM: 2,
|
|
502
503
|
MATCHES: 1,
|
|
503
504
|
NO_MATCH: 0
|
|
504
|
-
},
|
|
505
|
+
}, an = (e, n) => String(e.rankedValue).localeCompare(String(n.rankedValue));
|
|
505
506
|
function G(e, n, t) {
|
|
506
507
|
t === void 0 && (t = {});
|
|
507
508
|
const {
|
|
508
509
|
keys: r,
|
|
509
510
|
threshold: s = A.MATCHES,
|
|
510
|
-
baseSort:
|
|
511
|
-
sorter: i = (f) => f.sort((u, _) => un(u, _,
|
|
512
|
-
} = t,
|
|
513
|
-
return i(
|
|
511
|
+
baseSort: c = an,
|
|
512
|
+
sorter: i = (f) => f.sort((u, _) => un(u, _, c))
|
|
513
|
+
} = t, o = e.reduce(l, []);
|
|
514
|
+
return i(o).map((f) => {
|
|
514
515
|
let {
|
|
515
516
|
item: u
|
|
516
517
|
} = f;
|
|
517
518
|
return u;
|
|
518
519
|
});
|
|
519
|
-
function
|
|
520
|
-
const x =
|
|
520
|
+
function l(f, u, _) {
|
|
521
|
+
const x = on(u, r, n, t), {
|
|
521
522
|
rank: p,
|
|
522
523
|
keyThreshold: m = s
|
|
523
524
|
} = x;
|
|
@@ -529,35 +530,35 @@ function G(e, n, t) {
|
|
|
529
530
|
}
|
|
530
531
|
}
|
|
531
532
|
G.rankings = A;
|
|
532
|
-
function
|
|
533
|
+
function on(e, n, t, r) {
|
|
533
534
|
if (!n) {
|
|
534
|
-
const
|
|
535
|
+
const c = e;
|
|
535
536
|
return {
|
|
536
537
|
// ends up being duplicate of 'item' in matches but consistent
|
|
537
|
-
rankedValue:
|
|
538
|
-
rank: pe(
|
|
538
|
+
rankedValue: c,
|
|
539
|
+
rank: pe(c, t, r),
|
|
539
540
|
keyIndex: -1,
|
|
540
541
|
keyThreshold: r.threshold
|
|
541
542
|
};
|
|
542
543
|
}
|
|
543
|
-
return mn(e, n).reduce((
|
|
544
|
+
return mn(e, n).reduce((c, i, o) => {
|
|
544
545
|
let {
|
|
545
|
-
rank:
|
|
546
|
+
rank: l,
|
|
546
547
|
rankedValue: f,
|
|
547
548
|
keyIndex: u,
|
|
548
549
|
keyThreshold: _
|
|
549
|
-
} =
|
|
550
|
+
} = c, {
|
|
550
551
|
itemValue: x,
|
|
551
552
|
attributes: p
|
|
552
553
|
} = i, m = pe(x, t, r), k = f;
|
|
553
554
|
const {
|
|
554
555
|
minRanking: D,
|
|
555
|
-
maxRanking:
|
|
556
|
+
maxRanking: R,
|
|
556
557
|
threshold: U
|
|
557
558
|
} = p;
|
|
558
|
-
return m < D && m >= A.MATCHES ? m = D : m >
|
|
559
|
+
return m < D && m >= A.MATCHES ? m = D : m > R && (m = R), m > l && (l = m, u = o, _ = U, k = x), {
|
|
559
560
|
rankedValue: k,
|
|
560
|
-
rank:
|
|
561
|
+
rank: l,
|
|
561
562
|
keyIndex: u,
|
|
562
563
|
keyThreshold: _
|
|
563
564
|
};
|
|
@@ -569,49 +570,49 @@ function an(e, n, t, r) {
|
|
|
569
570
|
});
|
|
570
571
|
}
|
|
571
572
|
function pe(e, n, t) {
|
|
572
|
-
return e = ve(e, t), n = ve(n, t), n.length > e.length ? A.NO_MATCH : e === n ? A.CASE_SENSITIVE_EQUAL : (e = e.toLowerCase(), n = n.toLowerCase(), e === n ? A.EQUAL : e.startsWith(n) ? A.STARTS_WITH : e.includes(` ${n}`) ? A.WORD_STARTS_WITH : e.includes(n) ? A.CONTAINS : n.length === 1 ? A.NO_MATCH :
|
|
573
|
+
return e = ve(e, t), n = ve(n, t), n.length > e.length ? A.NO_MATCH : e === n ? A.CASE_SENSITIVE_EQUAL : (e = e.toLowerCase(), n = n.toLowerCase(), e === n ? A.EQUAL : e.startsWith(n) ? A.STARTS_WITH : e.includes(` ${n}`) ? A.WORD_STARTS_WITH : e.includes(n) ? A.CONTAINS : n.length === 1 ? A.NO_MATCH : ln(e).includes(n) ? A.ACRONYM : cn(e, n));
|
|
573
574
|
}
|
|
574
|
-
function
|
|
575
|
+
function ln(e) {
|
|
575
576
|
let n = "";
|
|
576
577
|
return e.split(" ").forEach((r) => {
|
|
577
|
-
r.split("-").forEach((
|
|
578
|
-
n +=
|
|
578
|
+
r.split("-").forEach((c) => {
|
|
579
|
+
n += c.substr(0, 1);
|
|
579
580
|
});
|
|
580
581
|
}), n;
|
|
581
582
|
}
|
|
582
|
-
function
|
|
583
|
+
function cn(e, n) {
|
|
583
584
|
let t = 0, r = 0;
|
|
584
|
-
function s(
|
|
585
|
+
function s(l, f, u) {
|
|
585
586
|
for (let _ = u, x = f.length; _ < x; _++)
|
|
586
|
-
if (f[_] ===
|
|
587
|
+
if (f[_] === l)
|
|
587
588
|
return t += 1, _ + 1;
|
|
588
589
|
return -1;
|
|
589
590
|
}
|
|
590
|
-
function l
|
|
591
|
-
const f = 1 /
|
|
591
|
+
function c(l) {
|
|
592
|
+
const f = 1 / l, u = t / n.length;
|
|
592
593
|
return A.MATCHES + u * f;
|
|
593
594
|
}
|
|
594
595
|
const i = s(n[0], e, 0);
|
|
595
596
|
if (i < 0)
|
|
596
597
|
return A.NO_MATCH;
|
|
597
598
|
r = i;
|
|
598
|
-
for (let
|
|
599
|
-
const u = n[
|
|
599
|
+
for (let l = 1, f = n.length; l < f; l++) {
|
|
600
|
+
const u = n[l];
|
|
600
601
|
if (r = s(u, e, r), !(r > -1))
|
|
601
602
|
return A.NO_MATCH;
|
|
602
603
|
}
|
|
603
|
-
const
|
|
604
|
-
return
|
|
604
|
+
const o = r - i;
|
|
605
|
+
return c(o);
|
|
605
606
|
}
|
|
606
607
|
function un(e, n, t) {
|
|
607
608
|
const {
|
|
608
|
-
rank:
|
|
609
|
+
rank: c,
|
|
609
610
|
keyIndex: i
|
|
610
611
|
} = e, {
|
|
611
|
-
rank:
|
|
612
|
-
keyIndex:
|
|
612
|
+
rank: o,
|
|
613
|
+
keyIndex: l
|
|
613
614
|
} = n;
|
|
614
|
-
return
|
|
615
|
+
return c === o ? i === l ? t(e, n) : i < l ? -1 : 1 : c > o ? -1 : 1;
|
|
615
616
|
}
|
|
616
617
|
function ve(e, n) {
|
|
617
618
|
let {
|
|
@@ -638,28 +639,28 @@ function fn(e, n) {
|
|
|
638
639
|
function dn(e, n) {
|
|
639
640
|
const t = e.split(".");
|
|
640
641
|
let r = [n];
|
|
641
|
-
for (let s = 0,
|
|
642
|
+
for (let s = 0, c = t.length; s < c; s++) {
|
|
642
643
|
const i = t[s];
|
|
643
|
-
let
|
|
644
|
-
for (let
|
|
645
|
-
const u = r[
|
|
644
|
+
let o = [];
|
|
645
|
+
for (let l = 0, f = r.length; l < f; l++) {
|
|
646
|
+
const u = r[l];
|
|
646
647
|
if (u != null)
|
|
647
648
|
if (Object.hasOwnProperty.call(u, i)) {
|
|
648
649
|
const _ = u[i];
|
|
649
|
-
_ != null &&
|
|
650
|
-
} else i === "*" && (
|
|
650
|
+
_ != null && o.push(_);
|
|
651
|
+
} else i === "*" && (o = o.concat(u));
|
|
651
652
|
}
|
|
652
|
-
r =
|
|
653
|
+
r = o;
|
|
653
654
|
}
|
|
654
655
|
return Array.isArray(r[0]) ? [].concat(...r) : r;
|
|
655
656
|
}
|
|
656
657
|
function mn(e, n) {
|
|
657
658
|
const t = [];
|
|
658
659
|
for (let r = 0, s = n.length; r < s; r++) {
|
|
659
|
-
const
|
|
660
|
-
for (let
|
|
660
|
+
const c = n[r], i = _n(c), o = fn(e, c);
|
|
661
|
+
for (let l = 0, f = o.length; l < f; l++)
|
|
661
662
|
t.push({
|
|
662
|
-
itemValue:
|
|
663
|
+
itemValue: o[l],
|
|
663
664
|
attributes: i
|
|
664
665
|
});
|
|
665
666
|
}
|
|
@@ -675,31 +676,19 @@ function _n(e) {
|
|
|
675
676
|
...e
|
|
676
677
|
};
|
|
677
678
|
}
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
e.forEach((t) => pn(t, n));
|
|
681
|
-
};
|
|
682
|
-
}
|
|
683
|
-
function pn(e, n) {
|
|
684
|
-
e && (typeof e == "function" && n !== void 0 ? e(n) : e.current = n ?? null);
|
|
685
|
-
}
|
|
686
|
-
function vn(e, n) {
|
|
687
|
-
const t = Ze(null), r = Ee(() => hn(e, t, n), [e, t, n]);
|
|
688
|
-
return [t, r];
|
|
689
|
-
}
|
|
690
|
-
const An = "_indicators_1fbxv_2", gn = "_open_1fbxv_33", In = "_root_1fbxv_49", xn = "_clearable_1fbxv_83", bn = "_transparent_1fbxv_101", En = "_wrapper_1fbxv_208", On = "_disabled_1fbxv_212", yn = "_menu_1fbxv_215", wn = "_item_1fbxv_243", Cn = "_highlighted_1fbxv_257", Rn = "_selected_1fbxv_260", Nn = "_multiple_1fbxv_260", Sn = "_allowUnselectFromList_1fbxv_264", kn = "_tags_1fbxv_272", Oe = {
|
|
691
|
-
indicators: An,
|
|
679
|
+
const hn = "_indicators_1fbxv_2", pn = "_open_1fbxv_33", vn = "_root_1fbxv_49", An = "_clearable_1fbxv_83", gn = "_transparent_1fbxv_101", In = "_wrapper_1fbxv_208", xn = "_disabled_1fbxv_212", bn = "_menu_1fbxv_215", En = "_item_1fbxv_243", On = "_highlighted_1fbxv_257", yn = "_selected_1fbxv_260", wn = "_multiple_1fbxv_260", Cn = "_allowUnselectFromList_1fbxv_264", Nn = "_tags_1fbxv_272", Ee = {
|
|
680
|
+
indicators: hn,
|
|
692
681
|
"size-xs": "_size-xs_1fbxv_11",
|
|
693
682
|
"dropdown-indicator": "_dropdown-indicator_1fbxv_14",
|
|
694
683
|
"styled-icon": "_styled-icon_1fbxv_27",
|
|
695
|
-
open:
|
|
684
|
+
open: pn,
|
|
696
685
|
"input-wrapper": "_input-wrapper_1fbxv_42",
|
|
697
686
|
"icon-placement-right": "_icon-placement-right_1fbxv_45",
|
|
698
|
-
root:
|
|
687
|
+
root: vn,
|
|
699
688
|
"icon-placement-left": "_icon-placement-left_1fbxv_80",
|
|
700
689
|
"icon-placement-both": "_icon-placement-both_1fbxv_80",
|
|
701
|
-
clearable:
|
|
702
|
-
transparent:
|
|
690
|
+
clearable: An,
|
|
691
|
+
transparent: gn,
|
|
703
692
|
"variant-danger": "_variant-danger_1fbxv_136",
|
|
704
693
|
"variant-success": "_variant-success_1fbxv_140",
|
|
705
694
|
"variant-warning": "_variant-warning_1fbxv_144",
|
|
@@ -707,18 +696,18 @@ const An = "_indicators_1fbxv_2", gn = "_open_1fbxv_33", In = "_root_1fbxv_49",
|
|
|
707
696
|
"size-md": "_size-md_1fbxv_155",
|
|
708
697
|
"size-sm": "_size-sm_1fbxv_162",
|
|
709
698
|
"icon-wrapper": "_icon-wrapper_1fbxv_177",
|
|
710
|
-
wrapper:
|
|
711
|
-
disabled:
|
|
712
|
-
menu:
|
|
713
|
-
item:
|
|
714
|
-
highlighted:
|
|
715
|
-
selected:
|
|
716
|
-
multiple:
|
|
717
|
-
allowUnselectFromList:
|
|
718
|
-
tags:
|
|
699
|
+
wrapper: In,
|
|
700
|
+
disabled: xn,
|
|
701
|
+
menu: bn,
|
|
702
|
+
item: En,
|
|
703
|
+
highlighted: On,
|
|
704
|
+
selected: yn,
|
|
705
|
+
multiple: wn,
|
|
706
|
+
allowUnselectFromList: Cn,
|
|
707
|
+
tags: Nn,
|
|
719
708
|
"styled-tag": "_styled-tag_1fbxv_275"
|
|
720
|
-
}, ge = be(
|
|
721
|
-
function
|
|
709
|
+
}, ge = be(Ee);
|
|
710
|
+
function Rn(e, n) {
|
|
722
711
|
return /* @__PURE__ */ I("div", { className: ge("tags"), role: "list", children: e.map((t) => (
|
|
723
712
|
// TODO migrate after WUI-187/tag
|
|
724
713
|
/* @__PURE__ */ I(
|
|
@@ -733,46 +722,46 @@ function Un(e, n) {
|
|
|
733
722
|
)
|
|
734
723
|
)) });
|
|
735
724
|
}
|
|
736
|
-
const ee = "",
|
|
725
|
+
const ee = "", Sn = /[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g, Oe = (e) => {
|
|
737
726
|
if (typeof e == "number")
|
|
738
727
|
return String(e);
|
|
739
728
|
if (typeof e == "string") {
|
|
740
|
-
const n = e.match(
|
|
729
|
+
const n = e.match(Sn);
|
|
741
730
|
return n && n.map((t) => t.toLowerCase()).join("-");
|
|
742
731
|
}
|
|
743
|
-
}, Ie = (e) => e ? e.label : ee,
|
|
732
|
+
}, Ie = (e) => e ? e.label : ee, kn = (e) => e.reduce(
|
|
744
733
|
(n, t) => t.label && n.length > t.label.length ? n : t.label,
|
|
745
734
|
ee
|
|
746
|
-
),
|
|
735
|
+
), Un = (e, n, t) => {
|
|
747
736
|
const r = n.find((s) => e.value === s.value);
|
|
748
737
|
return r && t ? n.filter((s) => e.value !== s.value) : r ? n : [...n, e];
|
|
749
738
|
}, q = (e, n) => !!n.find((t) => t.value === e), J = (e, n = []) => n.find(
|
|
750
739
|
(r) => r.label === (e.label || e) || r.value === (e.value || e)
|
|
751
|
-
) || { label: e, value:
|
|
740
|
+
) || { label: e, value: Oe(e) }, Vn = (e, n, t = !1) => {
|
|
752
741
|
const r = t ? n.flatMap((s) => s.options) : n;
|
|
753
742
|
return !e && e !== 0 ? [] : Array.isArray(e) ? e.map((s) => J(s, r)) : [J(e, r)];
|
|
754
|
-
},
|
|
743
|
+
}, Tn = (e, n) => !!n.find((t) => t.value === e.value), Hn = (e, n) => Tn(e, n) ? e.value : e.label, xe = (e, n) => e ? e.map((t) => Hn(t, n)) : [], Dn = (e, n) => e ? e.filter(
|
|
755
744
|
(t) => !n.find((r) => r.value === t.value)
|
|
756
|
-
) : [],
|
|
745
|
+
) : [], Fn = ({
|
|
757
746
|
inputValue: e,
|
|
758
747
|
isMultiple: n,
|
|
759
748
|
isSearchable: t,
|
|
760
749
|
options: r,
|
|
761
750
|
renderItem: s
|
|
762
751
|
}) => {
|
|
763
|
-
const
|
|
764
|
-
return n ? e :
|
|
765
|
-
}, O = be(
|
|
752
|
+
const c = J(e, r);
|
|
753
|
+
return n ? e : c.label ? t ? c.label : s(c) : ee;
|
|
754
|
+
}, O = be(Ee), zn = me.default || me, Qn = Ye(
|
|
766
755
|
({
|
|
767
756
|
allowUnselectFromList: e,
|
|
768
757
|
autoComplete: n = "off",
|
|
769
758
|
autoFocus: t,
|
|
770
759
|
className: r,
|
|
771
760
|
dataTestId: s,
|
|
772
|
-
disableCloseOnSelect:
|
|
761
|
+
disableCloseOnSelect: c,
|
|
773
762
|
disabled: i,
|
|
774
|
-
groupsEnabled:
|
|
775
|
-
icon:
|
|
763
|
+
groupsEnabled: o,
|
|
764
|
+
icon: l,
|
|
776
765
|
iconPlacement: f = "left",
|
|
777
766
|
id: u,
|
|
778
767
|
isClearable: _,
|
|
@@ -781,96 +770,96 @@ const ee = "", Vn = /[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|
|
|
|
781
770
|
isSearchable: m,
|
|
782
771
|
name: k,
|
|
783
772
|
onBlur: D,
|
|
784
|
-
onChange:
|
|
773
|
+
onChange: R,
|
|
785
774
|
onClick: U,
|
|
786
775
|
onCreate: Y,
|
|
787
|
-
onFocus:
|
|
776
|
+
onFocus: ye,
|
|
788
777
|
options: g = [],
|
|
789
778
|
placeholder: ne = "Choose from…",
|
|
790
|
-
renderCreateItem:
|
|
779
|
+
renderCreateItem: we = (z) => `Create "${z}"`,
|
|
791
780
|
renderGroupHeader: te,
|
|
792
781
|
renderItem: F = Ie,
|
|
793
|
-
renderMultiple:
|
|
782
|
+
renderMultiple: Ce = Rn,
|
|
794
783
|
size: V = "md",
|
|
795
784
|
transparent: re,
|
|
796
785
|
value: se,
|
|
797
|
-
variant:
|
|
798
|
-
...
|
|
786
|
+
variant: ae,
|
|
787
|
+
...oe
|
|
799
788
|
}, Ne) => {
|
|
800
|
-
const { getInputProps: z, variant:
|
|
801
|
-
() =>
|
|
802
|
-
[se, g,
|
|
803
|
-
),
|
|
789
|
+
const { getInputProps: z, variant: Re } = qe(), le = Re || ae, M = Be(
|
|
790
|
+
() => Vn(se, g, o),
|
|
791
|
+
[se, g, o]
|
|
792
|
+
), B = !p && M[0] || null, Z = B ? B.label : "", [w, X] = $(M), [y, T] = $(Z), [j, W] = $(g), [C, S] = $(!1);
|
|
804
793
|
m = x || m;
|
|
805
|
-
const [Q,
|
|
794
|
+
const [Q, Se] = en(Ne);
|
|
806
795
|
_e(() => {
|
|
807
796
|
t && Q.current && (Q.current.focus(), m && S(!0));
|
|
808
797
|
}, [m, t, Q]), _e(() => {
|
|
809
|
-
X(M), T(
|
|
810
|
-
}, [
|
|
811
|
-
const
|
|
812
|
-
if (m &&
|
|
798
|
+
X(M), T(Z), W(g);
|
|
799
|
+
}, [Z, g, M]);
|
|
800
|
+
const ke = (a) => {
|
|
801
|
+
if (m && a !== y) {
|
|
813
802
|
let d = [];
|
|
814
|
-
|
|
803
|
+
o ? d = G(g, a, {
|
|
815
804
|
// should match on group.label OR group.options.label
|
|
816
805
|
keys: [(v) => v.label, (v) => v.options.map((b) => b.label)]
|
|
817
|
-
}) : d = G(g,
|
|
806
|
+
}) : d = G(g, a, { keys: ["label"] }), T(a), W(d);
|
|
818
807
|
}
|
|
819
|
-
},
|
|
808
|
+
}, Ue = () => {
|
|
820
809
|
m && !C && S(!0);
|
|
821
|
-
},
|
|
810
|
+
}, ce = (a) => {
|
|
822
811
|
let d = [];
|
|
823
|
-
|
|
824
|
-
|
|
812
|
+
o ? d = xe(
|
|
813
|
+
a,
|
|
825
814
|
g.flatMap((h) => h.options)
|
|
826
|
-
) : d = xe(
|
|
827
|
-
const v = p ? d : d[0], b =
|
|
828
|
-
if (
|
|
829
|
-
const h =
|
|
815
|
+
) : d = xe(a, g);
|
|
816
|
+
const v = p ? d : d[0], b = Je({ name: k, value: p ? a : a[0] });
|
|
817
|
+
if (R == null || R(v, b), x) {
|
|
818
|
+
const h = Dn(a, g);
|
|
830
819
|
h.length && (Y == null || Y(h[0].label, b));
|
|
831
820
|
}
|
|
832
|
-
},
|
|
821
|
+
}, Ve = (a) => {
|
|
833
822
|
let d, v;
|
|
834
|
-
!
|
|
835
|
-
},
|
|
836
|
-
const d = w.filter((v) => v.value !==
|
|
837
|
-
X(d),
|
|
838
|
-
},
|
|
839
|
-
U == null || U(
|
|
840
|
-
},
|
|
841
|
-
p &&
|
|
842
|
-
},
|
|
823
|
+
!a || a != null && a.disabled ? (d = p ? w : [], v = !0) : (d = p ? Un(a, w, e) : [a], v = p), v && T(""), W(g), X(d), ce(d), c || S(!1);
|
|
824
|
+
}, Te = (a) => {
|
|
825
|
+
const d = w.filter((v) => v.value !== a);
|
|
826
|
+
X(d), ce(d);
|
|
827
|
+
}, He = (a) => {
|
|
828
|
+
U == null || U(a), S(!C);
|
|
829
|
+
}, De = (a) => {
|
|
830
|
+
p && a.selectedItem ? T("") : m && a.selectedItem && T(a.selectedItem.label), W(g), S(!1);
|
|
831
|
+
}, Fe = kn(g), ie = Fn({
|
|
843
832
|
inputValue: y,
|
|
844
833
|
isMultiple: p,
|
|
845
834
|
isSearchable: m,
|
|
846
835
|
options: g,
|
|
847
836
|
renderItem: F
|
|
848
|
-
}),
|
|
837
|
+
}), ze = Ze(
|
|
849
838
|
({
|
|
850
|
-
getItemProps:
|
|
839
|
+
getItemProps: a,
|
|
851
840
|
highlightedIndex: d,
|
|
852
841
|
options: v
|
|
853
842
|
}) => v.reduce(
|
|
854
843
|
(b, h, L) => {
|
|
855
|
-
if (
|
|
844
|
+
if (o && "options" in h)
|
|
856
845
|
b.itemsToRender.push(
|
|
857
|
-
/* @__PURE__ */ P(
|
|
846
|
+
/* @__PURE__ */ P(Xe, { children: [
|
|
858
847
|
te(h),
|
|
859
848
|
h.options ? h.options.map((E) => {
|
|
860
|
-
const
|
|
849
|
+
const N = b.itemIndex++, K = q(E.value, w);
|
|
861
850
|
return /* @__PURE__ */ I(
|
|
862
851
|
"li",
|
|
863
852
|
{
|
|
864
853
|
className: O(
|
|
865
854
|
"item",
|
|
866
|
-
d ===
|
|
855
|
+
d === N && "highlighted",
|
|
867
856
|
p && "multiple",
|
|
868
857
|
e && "allowUnselectFromList",
|
|
869
858
|
E.disabled && "disabled",
|
|
870
859
|
K && "selected"
|
|
871
860
|
),
|
|
872
|
-
...
|
|
873
|
-
index:
|
|
861
|
+
...a({
|
|
862
|
+
index: N,
|
|
874
863
|
item: E
|
|
875
864
|
}),
|
|
876
865
|
children: F(E, K)
|
|
@@ -881,20 +870,20 @@ const ee = "", Vn = /[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|
|
|
|
881
870
|
] }, h.label)
|
|
882
871
|
);
|
|
883
872
|
else if ("value" in h) {
|
|
884
|
-
const E = q(h.value, w),
|
|
873
|
+
const E = q(h.value, w), N = d === L;
|
|
885
874
|
b.itemsToRender.push(
|
|
886
875
|
/* @__PURE__ */ I(
|
|
887
876
|
"li",
|
|
888
877
|
{
|
|
889
878
|
className: O(
|
|
890
879
|
"item",
|
|
891
|
-
|
|
880
|
+
N && "highlighted",
|
|
892
881
|
p && "multiple",
|
|
893
882
|
e && "allowUnselectFromList",
|
|
894
883
|
h.disabled && "disabled",
|
|
895
884
|
E && "selected"
|
|
896
885
|
),
|
|
897
|
-
...
|
|
886
|
+
...a({
|
|
898
887
|
index: L,
|
|
899
888
|
item: h
|
|
900
889
|
}),
|
|
@@ -908,29 +897,29 @@ const ee = "", Vn = /[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|
|
|
|
908
897
|
},
|
|
909
898
|
{ itemIndex: 0, itemsToRender: [] }
|
|
910
899
|
).itemsToRender,
|
|
911
|
-
[p, e, w,
|
|
912
|
-
),
|
|
900
|
+
[p, e, w, o, te, F]
|
|
901
|
+
), Me = Ke[V], ue = O(
|
|
913
902
|
"root",
|
|
914
903
|
`size-${V}`,
|
|
915
|
-
|
|
904
|
+
le && `variant-${le}`,
|
|
916
905
|
_ && "clearable",
|
|
917
906
|
re && "transparent",
|
|
918
|
-
|
|
907
|
+
l && `icon-placement-${f}`,
|
|
919
908
|
r
|
|
920
909
|
);
|
|
921
910
|
return /* @__PURE__ */ I(
|
|
922
|
-
|
|
911
|
+
zn,
|
|
923
912
|
{
|
|
924
913
|
id: u,
|
|
925
914
|
inputValue: m ? ie : "",
|
|
926
915
|
isOpen: C,
|
|
927
916
|
itemToString: Ie,
|
|
928
|
-
onInputValueChange:
|
|
929
|
-
onOuterClick:
|
|
930
|
-
onSelect:
|
|
931
|
-
selectedItem:
|
|
917
|
+
onInputValueChange: ke,
|
|
918
|
+
onOuterClick: De,
|
|
919
|
+
onSelect: Ve,
|
|
920
|
+
selectedItem: B,
|
|
932
921
|
children: ({
|
|
933
|
-
clearSelection:
|
|
922
|
+
clearSelection: a,
|
|
934
923
|
getInputProps: d,
|
|
935
924
|
getItemProps: v,
|
|
936
925
|
getMenuProps: b,
|
|
@@ -938,14 +927,14 @@ const ee = "", Vn = /[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|
|
|
|
938
927
|
getToggleButtonProps: L,
|
|
939
928
|
highlightedIndex: E
|
|
940
929
|
}) => {
|
|
941
|
-
const
|
|
942
|
-
|
|
930
|
+
const N = !!(x && y && !q(y, w)), K = C && (j.length || N), fe = _ && y, je = /* @__PURE__ */ I("div", { className: O("dropdown-indicator", C && "open"), children: /* @__PURE__ */ I(
|
|
931
|
+
Qe,
|
|
943
932
|
{
|
|
944
933
|
animatePresence: !0,
|
|
945
|
-
onClick:
|
|
934
|
+
onClick: a,
|
|
946
935
|
title: "Clear"
|
|
947
936
|
}
|
|
948
|
-
) }),
|
|
937
|
+
) }), We = /* @__PURE__ */ I(
|
|
949
938
|
"div",
|
|
950
939
|
{
|
|
951
940
|
className: O("dropdown-indicator", C && "open"),
|
|
@@ -955,29 +944,29 @@ const ee = "", Vn = /[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|
|
|
|
955
944
|
...L({
|
|
956
945
|
onClick: () => S(!C)
|
|
957
946
|
}),
|
|
958
|
-
children: /* @__PURE__ */ I(
|
|
947
|
+
children: /* @__PURE__ */ I(Ge, { className: O("styled-icon"), size: "sm" })
|
|
959
948
|
}
|
|
960
|
-
),
|
|
949
|
+
), Le = h(oe, { suppressRefError: !0 }), de = d({
|
|
961
950
|
autoComplete: n,
|
|
962
951
|
autoFocus: t,
|
|
963
|
-
"data-spacer":
|
|
952
|
+
"data-spacer": Fe || ne,
|
|
964
953
|
"data-testid": s,
|
|
965
954
|
disabled: i,
|
|
966
955
|
id: u,
|
|
967
956
|
name: k,
|
|
968
957
|
onBlur: D,
|
|
969
|
-
onClick: i ? void 0 :
|
|
970
|
-
onFocus:
|
|
971
|
-
onKeyDown:
|
|
958
|
+
onClick: i ? void 0 : He,
|
|
959
|
+
onFocus: ye,
|
|
960
|
+
onKeyDown: Ue,
|
|
972
961
|
placeholder: ne,
|
|
973
|
-
ref:
|
|
962
|
+
ref: Se,
|
|
974
963
|
size: V,
|
|
975
964
|
tabIndex: 0,
|
|
976
965
|
transparent: re,
|
|
977
|
-
variant: C ? "focused" :
|
|
978
|
-
...
|
|
966
|
+
variant: C ? "focused" : ae,
|
|
967
|
+
...oe
|
|
979
968
|
});
|
|
980
|
-
return /* @__PURE__ */ P("div", { ...
|
|
969
|
+
return /* @__PURE__ */ P("div", { ...Le, className: O("wrapper", i && "disabled"), children: [
|
|
981
970
|
m ? /* @__PURE__ */ I(
|
|
982
971
|
"input",
|
|
983
972
|
{
|
|
@@ -986,14 +975,14 @@ const ee = "", Vn = /[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|
|
|
|
986
975
|
...z(de)
|
|
987
976
|
}
|
|
988
977
|
) : /* @__PURE__ */ I("div", { className: ue, ...z(de), children: ie }),
|
|
989
|
-
|
|
978
|
+
l ? /* @__PURE__ */ I("div", { className: O("icon-wrapper", "icon-placement-left", `size-${V}`), children: $e.cloneElement(l, { ...l.props, size: Me }) }) : null,
|
|
990
979
|
/* @__PURE__ */ P("div", { className: O("indicators", `size-${V}`), children: [
|
|
991
|
-
fe ?
|
|
992
|
-
|
|
980
|
+
fe ? je : null,
|
|
981
|
+
We
|
|
993
982
|
] }),
|
|
994
983
|
K ? /* @__PURE__ */ P("ul", { className: O("menu"), ...b(), children: [
|
|
995
|
-
|
|
996
|
-
|
|
984
|
+
ze({ getItemProps: v, highlightedIndex: E, options: j }),
|
|
985
|
+
N && y.length ? /* @__PURE__ */ I(
|
|
997
986
|
"li",
|
|
998
987
|
{
|
|
999
988
|
className: O("item", E === j.length && "highlighted"),
|
|
@@ -1001,15 +990,15 @@ const ee = "", Vn = /[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|
|
|
|
1001
990
|
index: j.length,
|
|
1002
991
|
item: {
|
|
1003
992
|
label: y,
|
|
1004
|
-
value:
|
|
993
|
+
value: Oe(y)
|
|
1005
994
|
}
|
|
1006
995
|
}),
|
|
1007
|
-
children:
|
|
996
|
+
children: we(y)
|
|
1008
997
|
},
|
|
1009
998
|
"add"
|
|
1010
999
|
) : null
|
|
1011
1000
|
] }) : null,
|
|
1012
|
-
p ?
|
|
1001
|
+
p ? Ce(w, Te) : null
|
|
1013
1002
|
] });
|
|
1014
1003
|
}
|
|
1015
1004
|
}
|
|
@@ -1017,5 +1006,5 @@ const ee = "", Vn = /[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|
|
|
|
1017
1006
|
}
|
|
1018
1007
|
);
|
|
1019
1008
|
export {
|
|
1020
|
-
|
|
1009
|
+
Qn as Select
|
|
1021
1010
|
};
|