welcome-ui 10.6.4 → 10.6.6
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/Accordion.js +6 -6
- package/dist/Button.js +2 -2
- package/dist/Checkbox.js +1 -1
- package/dist/{CustomPopper-C1wIDHbM.js → CustomPopper-DWdMQOgg.js} +1 -1
- package/dist/D5lwkpmX-BTxFdaqc.js +1061 -0
- package/dist/DatePicker.js +2 -2
- package/dist/DateTimePicker.js +3 -3
- package/dist/DjvJNLSl-CB2sOBlX.js +88 -0
- package/dist/Drawer.js +4 -4
- package/dist/DropdownMenu.js +811 -925
- package/dist/Modal.js +14 -14
- package/dist/Popover.js +25 -24
- package/dist/Radio.js +1 -1
- package/dist/RadioGroup.js +41 -46
- package/dist/RadioTab.js +1 -1
- package/dist/Search.css +1 -1
- package/dist/Search.js +105 -106
- package/dist/Select.css +1 -1
- package/dist/Select.js +257 -251
- package/dist/Tabs.js +192 -198
- package/dist/TimePicker.js +4 -4
- package/dist/Toggle.js +1 -1
- package/dist/Tooltip.css +1 -1
- package/dist/Tooltip.js +150 -185
- package/dist/WelcomeLoader.js +86 -86
- package/dist/Window.js +5 -5
- package/dist/button-BmXyuOyT.js +24 -0
- package/dist/combobox-context-COdkPD-I.js +14 -0
- package/dist/command-JKE9Az0e.js +78 -0
- package/dist/composite-BOnUaIWf.js +198 -0
- package/dist/composite-item-CzuZunbi.js +763 -0
- package/dist/composite-store-BbsZpdXc.js +21 -0
- package/dist/dialog-RAMLmAdq.js +1222 -0
- package/dist/dialog-disclosure-xHQQLmS6.js +25 -0
- package/dist/dialog-dismiss-DVxKs13g.js +48 -0
- package/dist/disclosure-BQqv9Q8p.js +47 -0
- package/dist/disclosure-store-KfU9xwem.js +168 -0
- package/dist/hovercard-anchor-CgWES4cl.js +19 -0
- package/dist/hovercard-store-DjVhDVte.js +569 -0
- package/dist/index-B0vSTNCB.js +609 -0
- package/dist/popover-context-B2YQ_e3N.js +12 -0
- package/dist/popover-disclosure-a-bqp8Gt.js +183 -0
- package/dist/radio-J8ogFsWS.js +77 -0
- package/dist/tab-panel-DMICXMJc.js +187 -0
- package/dist/types/components/Accordion/index.d.ts +1 -1
- package/dist/types/components/Alert/components/Title.d.ts +1 -1
- package/dist/types/components/Alert/index.d.ts +1 -1
- package/dist/types/components/DateTimePickerCommon/CustomHeader.d.ts +1 -1
- package/dist/types/components/DateTimePickerCommon/CustomPopper.d.ts +1 -1
- package/dist/types/components/Drawer/AssetDrawer/Header.d.ts +1 -1
- package/dist/types/components/Drawer/AssetDrawer/IconBlock.d.ts +1 -1
- package/dist/types/components/Drawer/components/Close.d.ts +1 -1
- package/dist/types/components/Drawer/index.d.ts +6 -6
- package/dist/types/components/FileDrop/components/FilePreview.d.ts +1 -1
- package/dist/types/components/FileDrop/components/Message.d.ts +1 -1
- package/dist/types/components/Icon/Sprite.d.ts +1 -1
- package/dist/types/components/Loader/index.d.ts +1 -1
- package/dist/types/components/Modal/Assets/AssetContent.d.ts +1 -1
- package/dist/types/components/Modal/Assets/AssetTitle.d.ts +1 -1
- package/dist/types/components/Modal/Assets/CloseButton.d.ts +1 -1
- package/dist/types/components/Modal/Assets/Iframe.d.ts +1 -1
- package/dist/types/components/Modal/Assets/index.d.ts +3 -3
- package/dist/types/components/Modal/components/Footer.d.ts +2 -2
- package/dist/types/components/Modal/index.d.ts +9 -9
- package/dist/types/components/PasswordInput/ToggleButton.d.ts +1 -1
- package/dist/types/components/Popover/Arrow.d.ts +1 -1
- package/dist/types/components/Popover/ContentWrapper.d.ts +1 -1
- package/dist/types/components/RadioGroup/index.d.ts +1 -1
- package/dist/types/components/Stepper/index.d.ts +2 -2
- package/dist/types/components/Stepper/utils.d.ts +1 -1
- package/dist/types/components/StickyNote/components/Button.d.ts +1 -1
- package/dist/types/components/StickyNote/components/Title.d.ts +1 -1
- package/dist/types/components/StickyNote/index.d.ts +2 -2
- package/dist/types/components/Swiper/components/SwiperNextButton.d.ts +1 -1
- package/dist/types/components/Swiper/components/SwiperPrevButton.d.ts +1 -1
- package/dist/types/components/Swiper/components/SwiperSlides.d.ts +1 -1
- package/dist/types/components/Swiper/index.d.ts +4 -4
- package/dist/types/components/Table/index.d.ts +5 -5
- package/dist/types/components/Tabs/utils.d.ts +1 -1
- package/dist/types/components/Toast/index.d.ts +2 -2
- package/dist/types/components/Window/components/Header.d.ts +4 -4
- package/dist/types/components/Window/index.d.ts +4 -4
- package/package.json +2 -2
- package/dist/5TKKKQCL-rs260p95.js +0 -80
- package/dist/7PRQYBBV-D9IY4qtU.js +0 -14
- package/dist/APVORPDK-i7Z_eBMP.js +0 -25
- package/dist/CVCFNOHX-Ck0bUDvo.js +0 -20
- package/dist/ECBEZ4YM-o09xUuV6.js +0 -600
- package/dist/HMKTUWOU-NkVXWCyR.js +0 -25
- package/dist/I7KWAPMF-DQWZpGyL.js +0 -86
- package/dist/IQYAUKXT-Cltvp3KN.js +0 -303
- package/dist/JMU4N4M5-DnfyqGdJ.js +0 -15
- package/dist/NDVACHQI-WTOpOfgG.js +0 -37
- package/dist/OCCHVUS4-BJVLPRH8.js +0 -48
- package/dist/PZ3OL7I2-Cfim3UGe.js +0 -61
- package/dist/Q5W46E73-5xQblshY.js +0 -346
- package/dist/RFRKSHIZ-C_FLl4qI.js +0 -147
- package/dist/U6HHPQDW-CzxyP5H7.js +0 -856
- package/dist/WLZ6H5FH-CuTcX7sR.js +0 -183
- package/dist/WZWDIE3S-CGqoM1Fy.js +0 -290
- package/dist/Z32PU2LQ-DMjfxuT9.js +0 -945
- package/dist/ZMWF7ASR-Jc8y_k3t.js +0 -166
- package/dist/tab-panel-Cc3MfOBM.js +0 -212
package/dist/Select.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import './Select.css';
|
|
3
|
-
import { jsx as p, jsxs as
|
|
3
|
+
import { jsx as p, jsxs as V } from "react/jsx-runtime";
|
|
4
4
|
import { D as _e } from "./downshift.esm-BtYj0L0Y.js";
|
|
5
|
-
import { g as
|
|
6
|
-
import { useRef as
|
|
5
|
+
import { g as $e, c as ye } from "./index-B6iGEm-i.js";
|
|
6
|
+
import { useRef as Xe, useMemo as Ce, forwardRef as Ze, useState as L, useEffect as pe, useCallback as Qe, Fragment as Be } from "react";
|
|
7
7
|
import { CloseButton as Ge } from "./CloseButton.js";
|
|
8
8
|
import { useField as Je } from "./Field.js";
|
|
9
9
|
import { Icon as ge } from "./Icon.js";
|
|
10
10
|
import { c as en } from "./create-event-rXDe5aCQ.js";
|
|
11
11
|
import { Tag as nn } from "./Tag.js";
|
|
12
|
-
var
|
|
12
|
+
var H = { exports: {} }, Ae;
|
|
13
13
|
function tn() {
|
|
14
|
-
if (Ae) return
|
|
14
|
+
if (Ae) return H.exports;
|
|
15
15
|
Ae = 1;
|
|
16
16
|
var e = {
|
|
17
17
|
À: "A",
|
|
@@ -474,18 +474,18 @@ function tn() {
|
|
|
474
474
|
ё: "е",
|
|
475
475
|
Ё: "Е"
|
|
476
476
|
}, n = Object.keys(e).join("|"), t = new RegExp(n, "g"), r = new RegExp(n, "");
|
|
477
|
-
function
|
|
478
|
-
return e[
|
|
477
|
+
function s(l) {
|
|
478
|
+
return e[l];
|
|
479
479
|
}
|
|
480
|
-
var
|
|
481
|
-
return
|
|
482
|
-
}, c = function(
|
|
483
|
-
return !!
|
|
480
|
+
var i = function(l) {
|
|
481
|
+
return l.replace(t, s);
|
|
482
|
+
}, c = function(l) {
|
|
483
|
+
return !!l.match(r);
|
|
484
484
|
};
|
|
485
|
-
return
|
|
485
|
+
return H.exports = i, H.exports.has = c, H.exports.remove = i, H.exports;
|
|
486
486
|
}
|
|
487
487
|
var rn = tn();
|
|
488
|
-
const
|
|
488
|
+
const sn = /* @__PURE__ */ $e(rn);
|
|
489
489
|
/**
|
|
490
490
|
* @name match-sorter
|
|
491
491
|
* @license MIT license.
|
|
@@ -501,21 +501,21 @@ const I = {
|
|
|
501
501
|
ACRONYM: 2,
|
|
502
502
|
MATCHES: 1,
|
|
503
503
|
NO_MATCH: 0
|
|
504
|
-
},
|
|
504
|
+
}, ln = (e, n) => String(e.rankedValue).localeCompare(String(n.rankedValue));
|
|
505
505
|
function J(e, n, t = {}) {
|
|
506
506
|
const {
|
|
507
507
|
keys: r,
|
|
508
|
-
threshold:
|
|
509
|
-
baseSort:
|
|
510
|
-
sorter: c = (u) => u.sort((f, h) => fn(f, h,
|
|
511
|
-
} = t,
|
|
512
|
-
return c(
|
|
508
|
+
threshold: s = I.MATCHES,
|
|
509
|
+
baseSort: i = ln,
|
|
510
|
+
sorter: c = (u) => u.sort((f, h) => fn(f, h, i))
|
|
511
|
+
} = t, l = e.reduce(a, []);
|
|
512
|
+
return c(l).map(({
|
|
513
513
|
item: u
|
|
514
514
|
}) => u);
|
|
515
515
|
function a(u, f, h) {
|
|
516
516
|
const g = an(f, r, n, t), {
|
|
517
517
|
rank: C,
|
|
518
|
-
keyThreshold: R =
|
|
518
|
+
keyThreshold: R = s
|
|
519
519
|
} = g;
|
|
520
520
|
return C >= R && u.push({
|
|
521
521
|
...g,
|
|
@@ -527,19 +527,19 @@ function J(e, n, t = {}) {
|
|
|
527
527
|
J.rankings = I;
|
|
528
528
|
function an(e, n, t, r) {
|
|
529
529
|
if (!n) {
|
|
530
|
-
const
|
|
530
|
+
const i = e;
|
|
531
531
|
return {
|
|
532
532
|
// ends up being duplicate of 'item' in matches but consistent
|
|
533
|
-
rankedValue:
|
|
534
|
-
rank: Ie(
|
|
533
|
+
rankedValue: i,
|
|
534
|
+
rank: Ie(i, t, r),
|
|
535
535
|
keyIndex: -1,
|
|
536
536
|
keyThreshold: r.threshold
|
|
537
537
|
};
|
|
538
538
|
}
|
|
539
539
|
return hn(e, n).reduce(({
|
|
540
|
-
rank:
|
|
540
|
+
rank: i,
|
|
541
541
|
rankedValue: c,
|
|
542
|
-
keyIndex:
|
|
542
|
+
keyIndex: l,
|
|
543
543
|
keyThreshold: a
|
|
544
544
|
}, {
|
|
545
545
|
itemValue: u,
|
|
@@ -549,12 +549,12 @@ function an(e, n, t, r) {
|
|
|
549
549
|
const {
|
|
550
550
|
minRanking: R,
|
|
551
551
|
maxRanking: A,
|
|
552
|
-
threshold:
|
|
552
|
+
threshold: E
|
|
553
553
|
} = f;
|
|
554
|
-
return g < R && g >= I.MATCHES ? g = R : g > A && (g = A), g >
|
|
554
|
+
return g < R && g >= I.MATCHES ? g = R : g > A && (g = A), g > i && (i = g, l = h, a = E, C = u), {
|
|
555
555
|
rankedValue: C,
|
|
556
|
-
rank:
|
|
557
|
-
keyIndex:
|
|
556
|
+
rank: i,
|
|
557
|
+
keyIndex: l,
|
|
558
558
|
keyThreshold: a
|
|
559
559
|
};
|
|
560
560
|
}, {
|
|
@@ -571,70 +571,70 @@ function* on(e, n) {
|
|
|
571
571
|
return -1;
|
|
572
572
|
}
|
|
573
573
|
function Ie(e, n, t) {
|
|
574
|
-
if (e =
|
|
574
|
+
if (e = ve(e, t), n = ve(n, t), n.length > e.length)
|
|
575
575
|
return I.NO_MATCH;
|
|
576
576
|
if (e === n)
|
|
577
577
|
return I.CASE_SENSITIVE_EQUAL;
|
|
578
578
|
e = e.toLowerCase(), n = n.toLowerCase();
|
|
579
|
-
const r = on(e, n),
|
|
580
|
-
if (e.length === n.length &&
|
|
579
|
+
const r = on(e, n), s = r.next(), i = s.value;
|
|
580
|
+
if (e.length === n.length && i === 0)
|
|
581
581
|
return I.EQUAL;
|
|
582
|
-
if (
|
|
582
|
+
if (i === 0)
|
|
583
583
|
return I.STARTS_WITH;
|
|
584
|
-
let c =
|
|
584
|
+
let c = s;
|
|
585
585
|
for (; !c.done; ) {
|
|
586
586
|
if (c.value > 0 && e[c.value - 1] === " ")
|
|
587
587
|
return I.WORD_STARTS_WITH;
|
|
588
588
|
c = r.next();
|
|
589
589
|
}
|
|
590
|
-
return
|
|
590
|
+
return i > 0 ? I.CONTAINS : n.length === 1 ? I.NO_MATCH : cn(e).includes(n) ? I.ACRONYM : un(e, n);
|
|
591
591
|
}
|
|
592
592
|
function cn(e) {
|
|
593
593
|
let n = "", t = " ";
|
|
594
594
|
for (let r = 0; r < e.length; r++) {
|
|
595
|
-
const
|
|
596
|
-
(t === " " || t === "-") && !(
|
|
595
|
+
const s = e.charAt(r);
|
|
596
|
+
(t === " " || t === "-") && !(s === " " || s === "-") && (n += s), t = s;
|
|
597
597
|
}
|
|
598
598
|
return n;
|
|
599
599
|
}
|
|
600
600
|
function un(e, n) {
|
|
601
601
|
let t = 0, r = 0;
|
|
602
|
-
function
|
|
602
|
+
function s(a, u, f) {
|
|
603
603
|
for (let h = f, g = u.length; h < g; h++)
|
|
604
604
|
if (u[h] === a)
|
|
605
605
|
return t += 1, h + 1;
|
|
606
606
|
return -1;
|
|
607
607
|
}
|
|
608
|
-
function
|
|
608
|
+
function i(a) {
|
|
609
609
|
const u = 1 / a, f = t / n.length;
|
|
610
610
|
return I.MATCHES + f * u;
|
|
611
611
|
}
|
|
612
|
-
const c =
|
|
612
|
+
const c = s(n[0], e, 0);
|
|
613
613
|
if (c < 0)
|
|
614
614
|
return I.NO_MATCH;
|
|
615
615
|
r = c;
|
|
616
616
|
for (let a = 1, u = n.length; a < u; a++) {
|
|
617
617
|
const f = n[a];
|
|
618
|
-
if (r =
|
|
618
|
+
if (r = s(f, e, r), !(r > -1))
|
|
619
619
|
return I.NO_MATCH;
|
|
620
620
|
}
|
|
621
|
-
const
|
|
622
|
-
return l
|
|
621
|
+
const l = r - c;
|
|
622
|
+
return i(l);
|
|
623
623
|
}
|
|
624
624
|
function fn(e, n, t) {
|
|
625
625
|
const {
|
|
626
|
-
rank:
|
|
626
|
+
rank: i,
|
|
627
627
|
keyIndex: c
|
|
628
628
|
} = e, {
|
|
629
|
-
rank:
|
|
629
|
+
rank: l,
|
|
630
630
|
keyIndex: a
|
|
631
631
|
} = n;
|
|
632
|
-
return
|
|
632
|
+
return i === l ? c === a ? t(e, n) : c < a ? -1 : 1 : i > l ? -1 : 1;
|
|
633
633
|
}
|
|
634
|
-
function
|
|
634
|
+
function ve(e, {
|
|
635
635
|
keepDiacritics: n
|
|
636
636
|
}) {
|
|
637
|
-
return e = `${e}`, n || (e =
|
|
637
|
+
return e = `${e}`, n || (e = sn(e)), e;
|
|
638
638
|
}
|
|
639
639
|
function dn(e, n) {
|
|
640
640
|
typeof n == "object" && (n = n.key);
|
|
@@ -655,40 +655,40 @@ function dn(e, n) {
|
|
|
655
655
|
function mn(e, n) {
|
|
656
656
|
const t = e.split(".");
|
|
657
657
|
let r = [n];
|
|
658
|
-
for (let
|
|
659
|
-
const c = t[
|
|
660
|
-
let
|
|
658
|
+
for (let s = 0, i = t.length; s < i; s++) {
|
|
659
|
+
const c = t[s];
|
|
660
|
+
let l = [];
|
|
661
661
|
for (let a = 0, u = r.length; a < u; a++) {
|
|
662
662
|
const f = r[a];
|
|
663
663
|
if (f != null)
|
|
664
664
|
if (Object.hasOwnProperty.call(f, c)) {
|
|
665
665
|
const h = f[c];
|
|
666
|
-
h != null &&
|
|
667
|
-
} else c === "*" && (
|
|
666
|
+
h != null && l.push(h);
|
|
667
|
+
} else c === "*" && (l = l.concat(f));
|
|
668
668
|
}
|
|
669
|
-
r =
|
|
669
|
+
r = l;
|
|
670
670
|
}
|
|
671
671
|
return Array.isArray(r[0]) ? [].concat(...r) : r;
|
|
672
672
|
}
|
|
673
673
|
function hn(e, n) {
|
|
674
674
|
const t = [];
|
|
675
|
-
for (let r = 0,
|
|
676
|
-
const
|
|
677
|
-
for (let a = 0, u =
|
|
675
|
+
for (let r = 0, s = n.length; r < s; r++) {
|
|
676
|
+
const i = n[r], c = _n(i), l = dn(e, i);
|
|
677
|
+
for (let a = 0, u = l.length; a < u; a++)
|
|
678
678
|
t.push({
|
|
679
|
-
itemValue:
|
|
679
|
+
itemValue: l[a],
|
|
680
680
|
attributes: c
|
|
681
681
|
});
|
|
682
682
|
}
|
|
683
683
|
return t;
|
|
684
684
|
}
|
|
685
|
-
const
|
|
685
|
+
const Oe = {
|
|
686
686
|
maxRanking: 1 / 0,
|
|
687
687
|
minRanking: -1 / 0
|
|
688
688
|
};
|
|
689
689
|
function _n(e) {
|
|
690
|
-
return typeof e == "string" ?
|
|
691
|
-
...
|
|
690
|
+
return typeof e == "string" ? Oe : {
|
|
691
|
+
...Oe,
|
|
692
692
|
...e
|
|
693
693
|
};
|
|
694
694
|
}
|
|
@@ -701,48 +701,48 @@ function gn(e, n) {
|
|
|
701
701
|
e && (typeof e == "function" && n !== void 0 ? e(n) : e.current = n ?? null);
|
|
702
702
|
}
|
|
703
703
|
function An(e, n) {
|
|
704
|
-
const t =
|
|
704
|
+
const t = Xe(null), r = Ce(() => pn(e, t, n), [e, t, n]);
|
|
705
705
|
return [t, r];
|
|
706
706
|
}
|
|
707
|
-
const In = "
|
|
707
|
+
const In = "_indicators_13eqn_2", vn = "_open_13eqn_34", On = "_disabled_13eqn_40", En = "_root_13eqn_51", xn = "_clearable_13eqn_86", wn = "_transparent_13eqn_104", yn = "_wrapper_13eqn_204", Cn = "_menu_13eqn_211", Rn = "_item_13eqn_239", Sn = "_highlighted_13eqn_256", Tn = "_selected_13eqn_259", bn = "_multiple_13eqn_259", Nn = "_allowUnselectFromList_13eqn_263", qn = "_tags_13eqn_271", Re = {
|
|
708
708
|
indicators: In,
|
|
709
|
-
"size-xs": "_size-
|
|
710
|
-
"dropdown-indicator": "_dropdown-
|
|
711
|
-
"styled-icon": "_styled-
|
|
712
|
-
open:
|
|
713
|
-
disabled:
|
|
714
|
-
"input-wrapper": "_input-
|
|
715
|
-
"icon-placement-right": "_icon-placement-
|
|
716
|
-
root:
|
|
717
|
-
"icon-placement-left": "_icon-placement-
|
|
718
|
-
"icon-placement-both": "_icon-placement-
|
|
719
|
-
clearable:
|
|
720
|
-
transparent:
|
|
721
|
-
"variant-danger": "_variant-
|
|
722
|
-
"variant-success": "_variant-
|
|
723
|
-
"variant-warning": "_variant-
|
|
724
|
-
"size-lg": "_size-
|
|
725
|
-
"size-md": "_size-
|
|
726
|
-
"size-sm": "_size-
|
|
727
|
-
"icon-wrapper": "_icon-
|
|
728
|
-
wrapper:
|
|
709
|
+
"size-xs": "_size-xs_13eqn_11",
|
|
710
|
+
"dropdown-indicator": "_dropdown-indicator_13eqn_14",
|
|
711
|
+
"styled-icon": "_styled-icon_13eqn_28",
|
|
712
|
+
open: vn,
|
|
713
|
+
disabled: On,
|
|
714
|
+
"input-wrapper": "_input-wrapper_13eqn_44",
|
|
715
|
+
"icon-placement-right": "_icon-placement-right_13eqn_47",
|
|
716
|
+
root: En,
|
|
717
|
+
"icon-placement-left": "_icon-placement-left_13eqn_83",
|
|
718
|
+
"icon-placement-both": "_icon-placement-both_13eqn_83",
|
|
719
|
+
clearable: xn,
|
|
720
|
+
transparent: wn,
|
|
721
|
+
"variant-danger": "_variant-danger_13eqn_140",
|
|
722
|
+
"variant-success": "_variant-success_13eqn_143",
|
|
723
|
+
"variant-warning": "_variant-warning_13eqn_146",
|
|
724
|
+
"size-lg": "_size-lg_13eqn_149",
|
|
725
|
+
"size-md": "_size-md_13eqn_157",
|
|
726
|
+
"size-sm": "_size-sm_13eqn_165",
|
|
727
|
+
"icon-wrapper": "_icon-wrapper_13eqn_173",
|
|
728
|
+
wrapper: yn,
|
|
729
729
|
menu: Cn,
|
|
730
730
|
item: Rn,
|
|
731
|
-
"no-results": "_no-
|
|
731
|
+
"no-results": "_no-results_13eqn_253",
|
|
732
732
|
highlighted: Sn,
|
|
733
733
|
selected: Tn,
|
|
734
734
|
multiple: bn,
|
|
735
735
|
allowUnselectFromList: Nn,
|
|
736
|
-
tags:
|
|
737
|
-
"styled-tag": "_styled-
|
|
738
|
-
},
|
|
739
|
-
function
|
|
740
|
-
return /* @__PURE__ */ p("div", { className:
|
|
736
|
+
tags: qn,
|
|
737
|
+
"styled-tag": "_styled-tag_13eqn_274"
|
|
738
|
+
}, Ee = ye(Re);
|
|
739
|
+
function Un(e, n) {
|
|
740
|
+
return /* @__PURE__ */ p("div", { className: Ee("tags"), role: "list", children: e.map((t) => (
|
|
741
741
|
// TODO migrate after WUI-187/tag
|
|
742
742
|
/* @__PURE__ */ p(
|
|
743
743
|
nn,
|
|
744
744
|
{
|
|
745
|
-
className:
|
|
745
|
+
className: Ee("styled-tag"),
|
|
746
746
|
onRemove: () => n(t.value.toString()),
|
|
747
747
|
role: "listitem",
|
|
748
748
|
children: t.label
|
|
@@ -751,45 +751,45 @@ function kn(e, n) {
|
|
|
751
751
|
)
|
|
752
752
|
)) });
|
|
753
753
|
}
|
|
754
|
-
const ne = "",
|
|
754
|
+
const ne = "", kn = /[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g, Se = (e) => {
|
|
755
755
|
if (typeof e == "number")
|
|
756
756
|
return String(e);
|
|
757
757
|
if (typeof e == "string") {
|
|
758
|
-
const n = e.match(
|
|
758
|
+
const n = e.match(kn);
|
|
759
759
|
return n && n.map((t) => t.toLowerCase()).join("-");
|
|
760
760
|
}
|
|
761
|
-
},
|
|
761
|
+
}, xe = (e) => e ? e.label : ne, Vn = (e) => e.reduce(
|
|
762
762
|
(n, t) => t.label && n.length > t.label.length ? n : t.label,
|
|
763
763
|
ne
|
|
764
|
-
),
|
|
765
|
-
const r = n.find((
|
|
766
|
-
return r && t ? n.filter((
|
|
764
|
+
), Hn = (e, n, t) => {
|
|
765
|
+
const r = n.find((s) => e.value === s.value);
|
|
766
|
+
return r && t ? n.filter((s) => e.value !== s.value) : r ? n : [...n, e];
|
|
767
767
|
}, G = (e, n) => !!n.find((t) => t.value === e), ee = (e, n = []) => n.find(
|
|
768
768
|
(r) => r.label === (e.label || e) || r.value === (e.value || e)
|
|
769
|
-
) || { label: e, value: Se(e) },
|
|
770
|
-
const r = t ? n.flatMap((
|
|
771
|
-
return !e && e !== 0 ? [] : Array.isArray(e) ? e.map((
|
|
772
|
-
},
|
|
769
|
+
) || { label: e, value: Se(e) }, Dn = (e, n, t = !1) => {
|
|
770
|
+
const r = t ? n.flatMap((s) => s.options) : n;
|
|
771
|
+
return !e && e !== 0 ? [] : Array.isArray(e) ? e.map((s) => ee(s, r)) : [ee(e, r)];
|
|
772
|
+
}, zn = (e, n) => !!n.find((t) => t.value === e.value), Fn = (e, n) => zn(e, n) ? e.value : e.label, we = (e, n) => e ? e.map((t) => Fn(t, n)) : [], jn = (e, n) => e ? e.filter(
|
|
773
773
|
(t) => !n.find((r) => r.value === t.value)
|
|
774
|
-
) : [],
|
|
774
|
+
) : [], Mn = ({
|
|
775
775
|
inputValue: e,
|
|
776
776
|
isMultiple: n,
|
|
777
777
|
isSearchable: t,
|
|
778
778
|
options: r,
|
|
779
|
-
renderItem:
|
|
779
|
+
renderItem: s
|
|
780
780
|
}) => {
|
|
781
|
-
const
|
|
782
|
-
return n ? e :
|
|
783
|
-
},
|
|
781
|
+
const i = ee(e, r);
|
|
782
|
+
return n ? e : i.label ? t ? i.label : s(i) : ne;
|
|
783
|
+
}, O = ye(Re), Wn = _e.default || _e, Kn = Ze(
|
|
784
784
|
({
|
|
785
785
|
allowUnselectFromList: e,
|
|
786
786
|
autoComplete: n = "off",
|
|
787
787
|
autoFocus: t,
|
|
788
788
|
className: r,
|
|
789
|
-
dataTestId:
|
|
790
|
-
defaultHighlightedIndex:
|
|
789
|
+
dataTestId: s,
|
|
790
|
+
defaultHighlightedIndex: i,
|
|
791
791
|
disableCloseOnSelect: c,
|
|
792
|
-
disabled:
|
|
792
|
+
disabled: l,
|
|
793
793
|
groupsEnabled: a,
|
|
794
794
|
highlightedIndex: u,
|
|
795
795
|
icon: f,
|
|
@@ -798,254 +798,260 @@ const ne = "", Vn = /[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|
|
|
|
798
798
|
isClearable: C,
|
|
799
799
|
isCreatable: R,
|
|
800
800
|
isMultiple: A,
|
|
801
|
-
isSearchable:
|
|
801
|
+
isSearchable: E,
|
|
802
802
|
name: te,
|
|
803
803
|
onBlur: Te,
|
|
804
|
-
onChange:
|
|
805
|
-
onClick:
|
|
806
|
-
onCreate:
|
|
804
|
+
onChange: P,
|
|
805
|
+
onClick: Y,
|
|
806
|
+
onCreate: $,
|
|
807
807
|
onFocus: be,
|
|
808
|
-
options:
|
|
808
|
+
options: v = [],
|
|
809
809
|
placeholder: re = "Choose from…",
|
|
810
|
-
renderCreateItem: Ne = (
|
|
811
|
-
renderGroupHeader:
|
|
812
|
-
renderItem:
|
|
813
|
-
renderMultiple:
|
|
814
|
-
renderNoResults:
|
|
815
|
-
size:
|
|
816
|
-
transparent:
|
|
817
|
-
value:
|
|
810
|
+
renderCreateItem: Ne = (F) => `Create "${F}"`,
|
|
811
|
+
renderGroupHeader: se,
|
|
812
|
+
renderItem: D = xe,
|
|
813
|
+
renderMultiple: qe = Un,
|
|
814
|
+
renderNoResults: U,
|
|
815
|
+
size: z = "lg",
|
|
816
|
+
transparent: ie,
|
|
817
|
+
value: le,
|
|
818
818
|
variant: ae,
|
|
819
819
|
...oe
|
|
820
|
-
},
|
|
821
|
-
const { getInputProps:
|
|
822
|
-
() =>
|
|
823
|
-
[
|
|
824
|
-
),
|
|
825
|
-
|
|
826
|
-
const [B,
|
|
820
|
+
}, Ue) => {
|
|
821
|
+
const { getInputProps: F, variant: ke } = Je(), ce = ke || ae, j = Ce(
|
|
822
|
+
() => Dn(le, v, a),
|
|
823
|
+
[le, v, a]
|
|
824
|
+
), X = !A && j[0] || null, Z = X ? X.label : "", [S, Q] = L(j), [w, k] = L(Z), [N, M] = L(v), [T, q] = L(!1);
|
|
825
|
+
E = R || E;
|
|
826
|
+
const [B, Ve] = An(Ue);
|
|
827
827
|
pe(() => {
|
|
828
|
-
t && B.current && (B.current.focus(),
|
|
829
|
-
}, [
|
|
830
|
-
|
|
831
|
-
}, [
|
|
832
|
-
const
|
|
833
|
-
if (
|
|
828
|
+
t && B.current && (B.current.focus(), E && q(!0));
|
|
829
|
+
}, [E, t, B]), pe(() => {
|
|
830
|
+
Q(j), k(Z), M(v);
|
|
831
|
+
}, [Z, v, j]);
|
|
832
|
+
const He = (o) => {
|
|
833
|
+
if (E && o !== w) {
|
|
834
834
|
let d = [];
|
|
835
|
-
a ? d = J(
|
|
835
|
+
a ? d = J(v, o, {
|
|
836
836
|
// should match on group.label OR group.options.label
|
|
837
|
-
keys: [(_) => _.label, (_) => _.options.map((
|
|
838
|
-
}) : d = J(
|
|
837
|
+
keys: [(_) => _.label, (_) => _.options.map((x) => x.label)]
|
|
838
|
+
}) : d = J(v, o, { keys: ["label"] }), k(o), M(d);
|
|
839
839
|
}
|
|
840
|
-
},
|
|
841
|
-
|
|
840
|
+
}, De = () => {
|
|
841
|
+
E && !T && q(!0);
|
|
842
842
|
}, ue = (o) => {
|
|
843
843
|
let d = [];
|
|
844
|
-
a ? d =
|
|
844
|
+
a ? d = we(
|
|
845
845
|
o,
|
|
846
|
-
|
|
847
|
-
) : d =
|
|
848
|
-
const _ = A ? d : d[0],
|
|
849
|
-
if (
|
|
850
|
-
const m =
|
|
851
|
-
m.length && (
|
|
846
|
+
v.flatMap((m) => m.options)
|
|
847
|
+
) : d = we(o, v);
|
|
848
|
+
const _ = A ? d : d[0], x = en({ name: te, value: A ? o : o[0] });
|
|
849
|
+
if (P == null || P(_, x), R) {
|
|
850
|
+
const m = jn(o, v);
|
|
851
|
+
m.length && ($ == null || $(m[0].label, x));
|
|
852
852
|
}
|
|
853
|
-
},
|
|
853
|
+
}, ze = (o) => {
|
|
854
854
|
let d, _;
|
|
855
|
-
!o || o != null && o.disabled ? (d = A ? S : [], _ = !0) : (d = A ?
|
|
856
|
-
},
|
|
855
|
+
!o || o != null && o.disabled ? (d = A ? S : [], _ = !0) : (d = A ? Hn(o, S, e) : [o], _ = A), _ && k(""), M(v), Q(d), ue(d), c || q(!1);
|
|
856
|
+
}, Fe = (o) => {
|
|
857
857
|
const d = S.filter((_) => _.value !== o);
|
|
858
|
-
|
|
858
|
+
Q(d), ue(d);
|
|
859
|
+
}, je = (o) => {
|
|
860
|
+
Y == null || Y(o), q(!T);
|
|
859
861
|
}, Me = (o) => {
|
|
860
|
-
|
|
861
|
-
}, We = (
|
|
862
|
-
|
|
863
|
-
}, Ke = Hn(y), fe = Wn({
|
|
864
|
-
inputValue: x,
|
|
862
|
+
A && o.selectedItem ? k("") : E && o.selectedItem && k(o.selectedItem.label), M(v), q(!1);
|
|
863
|
+
}, We = Vn(v), fe = Mn({
|
|
864
|
+
inputValue: w,
|
|
865
865
|
isMultiple: A,
|
|
866
|
-
isSearchable:
|
|
867
|
-
options:
|
|
868
|
-
renderItem:
|
|
869
|
-
}),
|
|
866
|
+
isSearchable: E,
|
|
867
|
+
options: v,
|
|
868
|
+
renderItem: D
|
|
869
|
+
}), Ke = Qe(
|
|
870
870
|
({
|
|
871
871
|
getItemProps: o,
|
|
872
872
|
highlightedIndex: d,
|
|
873
873
|
options: _
|
|
874
874
|
}) => _.reduce(
|
|
875
|
-
(
|
|
875
|
+
(x, m, W) => {
|
|
876
876
|
if (a && "options" in m)
|
|
877
|
-
|
|
878
|
-
/* @__PURE__ */
|
|
879
|
-
|
|
880
|
-
m.options ? m.options.map((
|
|
881
|
-
const b =
|
|
877
|
+
x.itemsToRender.push(
|
|
878
|
+
/* @__PURE__ */ V(Be, { children: [
|
|
879
|
+
se(m),
|
|
880
|
+
m.options ? m.options.map((y) => {
|
|
881
|
+
const b = x.itemIndex++, K = G(y.value, S);
|
|
882
882
|
return /* @__PURE__ */ p(
|
|
883
883
|
"li",
|
|
884
884
|
{
|
|
885
|
-
className:
|
|
885
|
+
className: O(
|
|
886
886
|
"item",
|
|
887
887
|
d === b && "highlighted",
|
|
888
888
|
A && "multiple",
|
|
889
889
|
e && "allowUnselectFromList",
|
|
890
|
-
|
|
891
|
-
|
|
890
|
+
y.disabled && "disabled",
|
|
891
|
+
K && "selected"
|
|
892
892
|
),
|
|
893
893
|
...o({
|
|
894
894
|
index: b,
|
|
895
|
-
item:
|
|
895
|
+
item: y
|
|
896
896
|
}),
|
|
897
|
-
children:
|
|
897
|
+
children: D(y, K)
|
|
898
898
|
},
|
|
899
|
-
|
|
899
|
+
y.value
|
|
900
900
|
);
|
|
901
901
|
}) : null
|
|
902
902
|
] }, m.label)
|
|
903
903
|
);
|
|
904
904
|
else if ("value" in m) {
|
|
905
|
-
const
|
|
906
|
-
|
|
905
|
+
const y = G(m.value, S), b = d === W;
|
|
906
|
+
x.itemsToRender.push(
|
|
907
907
|
/* @__PURE__ */ p(
|
|
908
908
|
"li",
|
|
909
909
|
{
|
|
910
|
-
className:
|
|
910
|
+
className: O(
|
|
911
911
|
"item",
|
|
912
912
|
b && "highlighted",
|
|
913
913
|
A && "multiple",
|
|
914
914
|
e && "allowUnselectFromList",
|
|
915
915
|
m.disabled && "disabled",
|
|
916
|
-
|
|
916
|
+
y && "selected"
|
|
917
917
|
),
|
|
918
918
|
...o({
|
|
919
|
-
index:
|
|
919
|
+
index: W,
|
|
920
920
|
item: m
|
|
921
921
|
}),
|
|
922
|
-
children:
|
|
922
|
+
children: D(m, y)
|
|
923
923
|
},
|
|
924
924
|
m.value
|
|
925
925
|
)
|
|
926
926
|
);
|
|
927
927
|
}
|
|
928
|
-
return
|
|
928
|
+
return x;
|
|
929
929
|
},
|
|
930
930
|
{ itemIndex: 0, itemsToRender: [] }
|
|
931
931
|
).itemsToRender,
|
|
932
|
-
[A, e, S, a,
|
|
933
|
-
), de =
|
|
932
|
+
[A, e, S, a, se, D]
|
|
933
|
+
), de = O(
|
|
934
934
|
"root",
|
|
935
|
-
`size-${
|
|
935
|
+
`size-${z}`,
|
|
936
936
|
ce && `variant-${ce}`,
|
|
937
937
|
C && "clearable",
|
|
938
|
-
|
|
938
|
+
ie && "transparent",
|
|
939
939
|
f && `icon-placement-${h}`,
|
|
940
|
-
|
|
941
|
-
s && "disabled"
|
|
940
|
+
l && "disabled"
|
|
942
941
|
);
|
|
943
942
|
return /* @__PURE__ */ p(
|
|
944
|
-
|
|
943
|
+
Wn,
|
|
945
944
|
{
|
|
946
|
-
defaultHighlightedIndex:
|
|
945
|
+
defaultHighlightedIndex: i,
|
|
947
946
|
highlightedIndex: u,
|
|
948
947
|
id: g,
|
|
949
|
-
inputValue:
|
|
948
|
+
inputValue: E ? fe : "",
|
|
950
949
|
isOpen: T,
|
|
951
|
-
itemToString:
|
|
952
|
-
onInputValueChange:
|
|
953
|
-
onOuterClick:
|
|
954
|
-
onSelect:
|
|
955
|
-
selectedItem:
|
|
950
|
+
itemToString: xe,
|
|
951
|
+
onInputValueChange: He,
|
|
952
|
+
onOuterClick: Me,
|
|
953
|
+
onSelect: ze,
|
|
954
|
+
selectedItem: X,
|
|
956
955
|
children: ({
|
|
957
956
|
clearSelection: o,
|
|
958
957
|
getInputProps: d,
|
|
959
958
|
getItemProps: _,
|
|
960
|
-
getMenuProps:
|
|
959
|
+
getMenuProps: x,
|
|
961
960
|
getRootProps: m,
|
|
962
|
-
getToggleButtonProps:
|
|
963
|
-
highlightedIndex:
|
|
961
|
+
getToggleButtonProps: W,
|
|
962
|
+
highlightedIndex: y
|
|
964
963
|
}) => {
|
|
965
|
-
const b = !!(R &&
|
|
964
|
+
const b = !!(R && w && !G(w, S)), K = T && (N.length || b), me = C && w, Le = /* @__PURE__ */ p("div", { className: O("dropdown-indicator", T && "open"), children: /* @__PURE__ */ p(
|
|
966
965
|
Ge,
|
|
967
966
|
{
|
|
968
967
|
animatePresence: !0,
|
|
969
968
|
onClick: o,
|
|
970
969
|
title: "Clear"
|
|
971
970
|
}
|
|
972
|
-
) }),
|
|
971
|
+
) }), Pe = /* @__PURE__ */ p(
|
|
973
972
|
"div",
|
|
974
973
|
{
|
|
975
|
-
className:
|
|
976
|
-
"data-testid":
|
|
977
|
-
disabled:
|
|
974
|
+
className: O("dropdown-indicator", T && "open", l && "disabled"),
|
|
975
|
+
"data-testid": s ? `${s}-arrow-icon` : null,
|
|
976
|
+
disabled: l,
|
|
978
977
|
tabIndex: -1,
|
|
979
|
-
...
|
|
980
|
-
onClick: () => !
|
|
978
|
+
...W({
|
|
979
|
+
onClick: () => !l && q(!T)
|
|
981
980
|
}),
|
|
982
|
-
children: /* @__PURE__ */ p(ge, { className:
|
|
981
|
+
children: /* @__PURE__ */ p(ge, { className: O("styled-icon"), name: "angle-down", size: "lg" })
|
|
983
982
|
}
|
|
984
|
-
),
|
|
983
|
+
), Ye = m(oe, { suppressRefError: !0 }), he = d({
|
|
985
984
|
autoComplete: n,
|
|
986
985
|
autoFocus: t,
|
|
987
|
-
"data-spacer":
|
|
988
|
-
"data-testid":
|
|
989
|
-
disabled:
|
|
986
|
+
"data-spacer": We || re,
|
|
987
|
+
"data-testid": s,
|
|
988
|
+
disabled: l,
|
|
990
989
|
id: g,
|
|
991
990
|
name: te,
|
|
992
991
|
onBlur: Te,
|
|
993
|
-
onClick:
|
|
992
|
+
onClick: l ? void 0 : je,
|
|
994
993
|
onFocus: be,
|
|
995
|
-
onKeyDown:
|
|
994
|
+
onKeyDown: De,
|
|
996
995
|
placeholder: re,
|
|
997
|
-
ref:
|
|
998
|
-
size:
|
|
996
|
+
ref: Ve,
|
|
997
|
+
size: z,
|
|
999
998
|
tabIndex: 0,
|
|
1000
|
-
transparent:
|
|
999
|
+
transparent: ie,
|
|
1001
1000
|
variant: T ? "focused" : ae,
|
|
1002
1001
|
...oe
|
|
1003
1002
|
});
|
|
1004
|
-
return /* @__PURE__ */
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
Ye
|
|
1018
|
-
] })
|
|
1019
|
-
] }),
|
|
1020
|
-
L ? /* @__PURE__ */ H("ul", { className: v("menu"), ...E(), children: [
|
|
1021
|
-
Le({ getItemProps: _, highlightedIndex: w, options: N }),
|
|
1022
|
-
N.length ? null : k == null ? void 0 : k(x),
|
|
1023
|
-
b && x.length ? /* @__PURE__ */ p(
|
|
1024
|
-
"li",
|
|
1025
|
-
{
|
|
1026
|
-
className: v("item", w === N.length && "highlighted"),
|
|
1027
|
-
..._({
|
|
1028
|
-
index: N.length,
|
|
1029
|
-
item: {
|
|
1030
|
-
label: x,
|
|
1031
|
-
value: Se(x)
|
|
1003
|
+
return /* @__PURE__ */ V(
|
|
1004
|
+
"div",
|
|
1005
|
+
{
|
|
1006
|
+
...Ye,
|
|
1007
|
+
className: O("wrapper", l && "disabled", "field-input", r),
|
|
1008
|
+
children: [
|
|
1009
|
+
/* @__PURE__ */ V("div", { className: O("input-wrapper"), children: [
|
|
1010
|
+
E ? /* @__PURE__ */ p(
|
|
1011
|
+
"input",
|
|
1012
|
+
{
|
|
1013
|
+
className: de,
|
|
1014
|
+
type: "text",
|
|
1015
|
+
...F(he)
|
|
1032
1016
|
}
|
|
1033
|
-
}),
|
|
1034
|
-
children:
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1017
|
+
) : /* @__PURE__ */ p("div", { className: de, ...F(he), children: fe }),
|
|
1018
|
+
f ? /* @__PURE__ */ p("div", { className: O("icon-wrapper", "icon-placement-left", `size-${z}`), children: /* @__PURE__ */ p(ge, { ...f.props, size: "md" }) }) : null,
|
|
1019
|
+
/* @__PURE__ */ V("div", { className: O("indicators", `size-${z}`), children: [
|
|
1020
|
+
me ? Le : null,
|
|
1021
|
+
Pe
|
|
1022
|
+
] })
|
|
1023
|
+
] }),
|
|
1024
|
+
K ? /* @__PURE__ */ V("ul", { className: O("menu"), ...x(), children: [
|
|
1025
|
+
Ke({ getItemProps: _, highlightedIndex: y, options: N }),
|
|
1026
|
+
N.length ? null : U == null ? void 0 : U(w),
|
|
1027
|
+
b && w.length ? /* @__PURE__ */ p(
|
|
1028
|
+
"li",
|
|
1029
|
+
{
|
|
1030
|
+
className: O("item", y === N.length && "highlighted"),
|
|
1031
|
+
..._({
|
|
1032
|
+
index: N.length,
|
|
1033
|
+
item: {
|
|
1034
|
+
label: w,
|
|
1035
|
+
value: Se(w)
|
|
1036
|
+
}
|
|
1037
|
+
}),
|
|
1038
|
+
children: Ne(w)
|
|
1039
|
+
},
|
|
1040
|
+
"add"
|
|
1041
|
+
) : null
|
|
1042
|
+
] }) : null,
|
|
1043
|
+
!N.length && U ? /* @__PURE__ */ p("ul", { className: O("menu"), ...x(), children: /* @__PURE__ */ p("li", { className: O("item", "no-results"), children: U(w) }) }) : null,
|
|
1044
|
+
A ? qe(S, Fe) : null
|
|
1045
|
+
]
|
|
1046
|
+
}
|
|
1047
|
+
);
|
|
1042
1048
|
}
|
|
1043
1049
|
}
|
|
1044
1050
|
);
|
|
1045
1051
|
}
|
|
1046
1052
|
);
|
|
1047
|
-
|
|
1053
|
+
Kn.displayName = "Select";
|
|
1048
1054
|
export {
|
|
1049
|
-
|
|
1055
|
+
Kn as Select,
|
|
1050
1056
|
Re as selectClasses
|
|
1051
1057
|
};
|