welcome-ui 8.1.0 → 8.1.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/dist/{AXB53BZF-XKOjjeWO.mjs → AXB53BZF-BOEe01VW.mjs} +3 -3
- package/dist/Accordion.mjs +23 -30
- package/dist/Alert.mjs +70 -76
- package/dist/AspectRatio.mjs +9 -9
- package/dist/Avatar.mjs +47 -48
- package/dist/{BYC7LY2E-CWSI38FM.mjs → BYC7LY2E-B1IDizRs.mjs} +127 -128
- package/dist/Badge.mjs +25 -25
- package/dist/Box.mjs +5 -5
- package/dist/Breadcrumb.mjs +168 -172
- package/dist/Button.mjs +67 -72
- package/dist/ButtonGroup.mjs +12 -13
- package/dist/Card.mjs +14 -14
- package/dist/Checkbox.mjs +2 -2
- package/dist/ClearButton.mjs +15 -15
- package/dist/CloseButton.mjs +9 -9
- package/dist/{CustomPopper-B2Cqfph4.mjs → CustomInput-IA_gVoXd.mjs} +1445 -1466
- package/dist/DatePicker.mjs +80 -81
- package/dist/DateTimePicker.mjs +61 -66
- package/dist/DateTimePickerCommon.mjs +1 -1
- package/dist/Drawer.mjs +172 -188
- package/dist/DropdownMenu.mjs +411 -414
- package/dist/Field.mjs +91 -103
- package/dist/FieldGroup.mjs +9 -12
- package/dist/FileDrop.mjs +556 -587
- package/dist/FileUpload.mjs +71 -92
- package/dist/Files.mjs +46 -46
- package/dist/Flex.mjs +13 -13
- package/dist/Grid.mjs +29 -29
- package/dist/Hint.mjs +12 -12
- package/dist/{ITI7HKP4-C89kOQb8.mjs → ITI7HKP4-EL9KXYBU.mjs} +67 -68
- package/dist/Icon.mjs +25 -25
- package/dist/Icons.mjs +988 -988
- package/dist/IconsFont.mjs +22 -22
- package/dist/InputText.mjs +58 -66
- package/dist/{JC64G2H7-afsomHuH.mjs → JC64G2H7-BzklVBKM.mjs} +46 -47
- package/dist/{KUU7WJ55-CzsjuIMv.mjs → KUU7WJ55-CS4NemC6.mjs} +1 -1
- package/dist/LVA2YJMS-DDEmK0pp.mjs +1482 -0
- package/dist/Label.mjs +35 -37
- package/dist/Link.mjs +28 -32
- package/dist/Loader.mjs +16 -20
- package/dist/Logo.mjs +42 -55
- package/dist/{MTZPJQMC-TybFZCho.mjs → MTZPJQMC-CMjAwC0N.mjs} +2 -2
- package/dist/Modal.mjs +253 -276
- package/dist/{NLEBE274-oSxMftGy.mjs → NLEBE274-QOMV1l7e.mjs} +9 -9
- package/dist/{P2CTZE2T-DOT1mNnX.mjs → P2CTZE2T-Cl2w7OLV.mjs} +48 -49
- package/dist/{P4IRICAX-CWSZLTGz.mjs → P4IRICAX-DezbJY4s.mjs} +3 -3
- package/dist/Pagination.mjs +104 -104
- package/dist/PasswordInput.mjs +34 -35
- package/dist/Picker.mjs +33 -35
- package/dist/Popover.mjs +99 -106
- package/dist/{QYJ6MIDR-DJ-vUdAM.mjs → QYJ6MIDR-Bb0O5xUM.mjs} +30 -31
- package/dist/Radio.mjs +48 -54
- package/dist/RadioGroup.mjs +47 -47
- package/dist/RadioTab.mjs +35 -37
- package/dist/{SYRFVSLH-B6m278Vb.mjs → SYRFVSLH-jn06-eLy.mjs} +10 -11
- package/dist/Search.mjs +159 -175
- package/dist/Select.mjs +338 -373
- package/dist/Shape.mjs +9 -9
- package/dist/Slider.mjs +336 -359
- package/dist/Stack.mjs +24 -22
- package/dist/Swiper.mjs +224 -231
- package/dist/Table.mjs +23 -23
- package/dist/Tabs.mjs +200 -205
- package/dist/Tag.mjs +53 -55
- package/dist/Text.mjs +47 -49
- package/dist/Textarea.mjs +40 -40
- package/dist/TimePicker.mjs +57 -58
- package/dist/Toast.mjs +128 -135
- package/dist/Toggle.mjs +24 -27
- package/dist/Tooltip.mjs +99 -103
- package/dist/UniversalLink.mjs +15 -15
- package/dist/{VEVQD5MH-0w9Y7Ytc.mjs → VEVQD5MH-CuegL0m0.mjs} +3 -3
- package/dist/{VGCJ63VH-C0UPBY-5.mjs → VGCJ63VH-BMzoZtCu.mjs} +38 -39
- package/dist/VariantIcon.mjs +22 -14
- package/dist/WelcomeLoader.mjs +121 -122
- package/dist/WuiProvider.mjs +58 -69
- package/dist/{X5NMLKT6-BJw3xE-K.mjs → X5NMLKT6-CvSCix-_.mjs} +2 -2
- package/dist/{YV4JVR4I-DPC8mMuG.mjs → YV4JVR4I-Bh7B7TET.mjs} +57 -57
- package/dist/{field-styles-BVlRlvuu.mjs → field-styles-CfVLcVQp.mjs} +1 -1
- package/dist/{hex-to-rgba-DU_XzKIK.mjs → hex-to-rgba-BIDK-3ab.mjs} +2 -2
- package/dist/hide-focus-rings-root-BNyva1yb.mjs +14 -0
- package/dist/{index-5HBq1O6Z.mjs → index-5PUh49rV.mjs} +73 -74
- package/dist/index-B0gDDiFm.mjs +66 -0
- package/dist/index-B22SHR8h.mjs +26 -0
- package/dist/{index-DAZ1SYdj.mjs → index-BNGGwOCo.mjs} +7 -7
- package/dist/{index-SQQQ4dEE.mjs → index-BQtDgQBH.mjs} +8 -8
- package/dist/index-BhcLigYU.mjs +77 -0
- package/dist/{index-QaLwIvZS.mjs → index-Bkl89twW.mjs} +8 -8
- package/dist/{index-BaLGEKs7.mjs → index-C7zM96J_.mjs} +8 -8
- package/dist/index-CQD9fgf_.mjs +11 -0
- package/dist/index-CmsWSKKs.mjs +11 -0
- package/dist/{index-DvzWKxKE.mjs → index-DqBUFsqP.mjs} +7 -7
- package/dist/index-u1oHKa7X.mjs +16 -0
- package/dist/index-wr_b5GSV.mjs +36 -0
- package/dist/radio-group-RFyDp0KD.mjs +51 -0
- package/dist/theme.mjs +801 -801
- package/dist/throttle-BDBzFeFj.mjs +13 -0
- package/dist/types/components/Accordion/index.d.ts +1 -1
- package/dist/types/components/Accordion/styles.d.ts +2 -2
- package/dist/types/components/Accordion/theme.d.ts +1 -1
- package/dist/types/components/Alert/index.d.ts +2 -2
- package/dist/types/components/Alert/styles.d.ts +9 -9
- package/dist/types/components/Alert/theme.d.ts +3 -3
- package/dist/types/components/AspectRatio/styles.d.ts +2 -3
- package/dist/types/components/Avatar/index.d.ts +3 -2
- package/dist/types/components/Avatar/styles.d.ts +8 -8
- package/dist/types/components/Avatar/theme.d.ts +3 -3
- package/dist/types/components/Avatar/utils.d.ts +1 -1
- package/dist/types/components/Badge/index.d.ts +2 -2
- package/dist/types/components/Badge/styles.d.ts +5 -5
- package/dist/types/components/Badge/theme.d.ts +1 -1
- package/dist/types/components/Breadcrumb/Item.d.ts +1 -1
- package/dist/types/components/Breadcrumb/index.d.ts +2 -2
- package/dist/types/components/Breadcrumb/theme.d.ts +1 -1
- package/dist/types/components/Button/index.d.ts +5 -4
- package/dist/types/components/Button/styles.d.ts +1 -1
- package/dist/types/components/Button/theme.d.ts +7 -7
- package/dist/types/components/ButtonGroup/index.d.ts +4 -4
- package/dist/types/components/Card/Cover.styles.d.ts +4 -4
- package/dist/types/components/Card/index.d.ts +3 -2
- package/dist/types/components/Card/theme.d.ts +1 -1
- package/dist/types/components/Checkbox/index.d.ts +2 -2
- package/dist/types/components/Checkbox/styles.d.ts +1 -1
- package/dist/types/components/Checkbox/theme.d.ts +1 -1
- package/dist/types/components/ClearButton/index.d.ts +6 -5
- package/dist/types/components/ClearButton/styles.d.ts +4 -4
- package/dist/types/components/CloseButton/styles.d.ts +4 -4
- package/dist/types/components/DatePicker/index.d.ts +3 -3
- package/dist/types/components/DateTimePicker/index.d.ts +2 -2
- package/dist/types/components/DateTimePickerCommon/CustomHeader.d.ts +1 -1
- package/dist/types/components/DateTimePickerCommon/CustomInput.d.ts +5 -5
- package/dist/types/components/DateTimePickerCommon/CustomPopper.d.ts +1 -1
- package/dist/types/components/DateTimePickerCommon/index.d.ts +2 -2
- package/dist/types/components/DateTimePickerCommon/theme.d.ts +1 -1
- package/dist/types/components/DateTimePickerCommon/utils.d.ts +2 -2
- package/dist/types/components/Drawer/AssetDrawer/Header.d.ts +1 -1
- package/dist/types/components/Drawer/AssetDrawer/index.d.ts +1 -1
- package/dist/types/components/Drawer/index.d.ts +12 -12
- package/dist/types/components/Drawer/styles.d.ts +5 -5
- package/dist/types/components/Drawer/theme.d.ts +2 -2
- package/dist/types/components/DropdownMenu/index.d.ts +4 -4
- package/dist/types/components/DropdownMenu/theme.d.ts +1 -1
- package/dist/types/components/Field/index.d.ts +8 -8
- package/dist/types/components/Field/styles.d.ts +1 -1
- package/dist/types/components/Field/utils.d.ts +1 -1
- package/dist/types/components/FileDrop/FilePreview.d.ts +2 -2
- package/dist/types/components/FileDrop/Message.d.ts +1 -1
- package/dist/types/components/FileDrop/index.d.ts +20 -20
- package/dist/types/components/FileDrop/theme.d.ts +1 -1
- package/dist/types/components/FileUpload/index.d.ts +13 -13
- package/dist/types/components/Files/index.d.ts +5 -5
- package/dist/types/components/Files/types.d.ts +1 -1
- package/dist/types/components/Hint/index.d.ts +2 -1
- package/dist/types/components/Hint/theme.d.ts +1 -1
- package/dist/types/components/Icon/index.d.ts +3 -3
- package/dist/types/components/Icon/styles.d.ts +3 -3
- package/dist/types/components/Icon/theme.d.ts +3 -3
- package/dist/types/components/Icons/Sun/content.json.d.ts +1 -2
- package/dist/types/components/Icons/index.d.ts +2 -2
- package/dist/types/components/IconsFont/index.d.ts +3 -2
- package/dist/types/components/IconsFont/styles.d.ts +1 -1
- package/dist/types/components/InputText/index.d.ts +1 -1
- package/dist/types/components/InputText/styles.d.ts +1 -1
- package/dist/types/components/Label/index.d.ts +3 -2
- package/dist/types/components/Label/theme.d.ts +1 -1
- package/dist/types/components/Link/index.d.ts +5 -5
- package/dist/types/components/Link/styles.d.ts +4 -4
- package/dist/types/components/Link/theme.d.ts +1 -1
- package/dist/types/components/Loader/index.d.ts +1 -1
- package/dist/types/components/Loader/styles.d.ts +4 -4
- package/dist/types/components/Loader/theme.d.ts +4 -4
- package/dist/types/components/Logo/Solutions.d.ts +2 -1
- package/dist/types/components/Logo/Symbol.d.ts +2 -1
- package/dist/types/components/Logo/Wui.d.ts +2 -1
- package/dist/types/components/Logo/index.d.ts +5 -5
- package/dist/types/components/Modal/Assets/Backdrop.d.ts +6 -5
- package/dist/types/components/Modal/Assets/Iframe.d.ts +2 -1
- package/dist/types/components/Modal/Assets/index.d.ts +9 -9
- package/dist/types/components/Modal/Assets/styles.d.ts +8 -8
- package/dist/types/components/Modal/Close.d.ts +4 -3
- package/dist/types/components/Modal/Content.d.ts +5 -3
- package/dist/types/components/Modal/Footer.d.ts +1 -1
- package/dist/types/components/Modal/Header.d.ts +2 -2
- package/dist/types/components/Modal/index.d.ts +17 -17
- package/dist/types/components/Modal/styles.d.ts +7 -7
- package/dist/types/components/Modal/theme.d.ts +2 -2
- package/dist/types/components/Pagination/index.d.ts +2 -2
- package/dist/types/components/Pagination/theme.d.ts +1 -1
- package/dist/types/components/Pagination/utils.d.ts +1 -1
- package/dist/types/components/Picker/index.d.ts +1 -1
- package/dist/types/components/Picker/styles.d.ts +1 -1
- package/dist/types/components/Popover/Arrow.d.ts +2 -1
- package/dist/types/components/Popover/Content.d.ts +3 -2
- package/dist/types/components/Popover/Popover.d.ts +5 -4
- package/dist/types/components/Popover/PopoverHover.d.ts +4 -3
- package/dist/types/components/Popover/Trigger.d.ts +1 -1
- package/dist/types/components/Popover/styles.d.ts +4 -4
- package/dist/types/components/Popover/theme.d.ts +1 -1
- package/dist/types/components/Popover/usePopover.d.ts +6 -6
- package/dist/types/components/Radio/index.d.ts +3 -3
- package/dist/types/components/Radio/styles.d.ts +5 -5
- package/dist/types/components/Radio/theme.d.ts +1 -1
- package/dist/types/components/RadioGroup/index.d.ts +2 -2
- package/dist/types/components/RadioTab/index.d.ts +3 -3
- package/dist/types/components/RadioTab/styles.d.ts +9 -3
- package/dist/types/components/RadioTab/theme.d.ts +1 -1
- package/dist/types/components/Search/index.d.ts +5 -5
- package/dist/types/components/Select/index.d.ts +11 -11
- package/dist/types/components/Select/styles.d.ts +6 -6
- package/dist/types/components/Select/utils.d.ts +7 -11
- package/dist/types/components/Shape/index.d.ts +1 -1
- package/dist/types/components/Shape/styles.d.ts +3 -3
- package/dist/types/components/Slider/Range.d.ts +3 -3
- package/dist/types/components/Slider/index.d.ts +2 -2
- package/dist/types/components/Slider/styles.d.ts +16 -16
- package/dist/types/components/Slider/theme.d.ts +1 -1
- package/dist/types/components/Stack/index.d.ts +1 -1
- package/dist/types/components/Swiper/index.d.ts +17 -16
- package/dist/types/components/Swiper/styles.d.ts +53 -53
- package/dist/types/components/Swiper/theme.d.ts +1 -1
- package/dist/types/components/System/index.d.ts +14 -14
- package/dist/types/components/Table/index.d.ts +7 -6
- package/dist/types/components/Table/styles.d.ts +1 -1
- package/dist/types/components/Table/theme.d.ts +1 -1
- package/dist/types/components/Tabs/ActiveBar.d.ts +5 -5
- package/dist/types/components/Tabs/TabList.d.ts +4 -4
- package/dist/types/components/Tabs/TabPanel.d.ts +2 -2
- package/dist/types/components/Tabs/styles.d.ts +2 -2
- package/dist/types/components/Tabs/theme.d.ts +2 -2
- package/dist/types/components/Tag/index.d.ts +3 -2
- package/dist/types/components/Tag/styles.d.ts +1 -1
- package/dist/types/components/Tag/theme.d.ts +2 -2
- package/dist/types/components/Text/index.d.ts +2 -2
- package/dist/types/components/Textarea/index.d.ts +1 -1
- package/dist/types/components/Textarea/theme.d.ts +1 -1
- package/dist/types/components/TimePicker/index.d.ts +2 -2
- package/dist/types/components/Toast/Growl.d.ts +1 -1
- package/dist/types/components/Toast/Snackbar.d.ts +1 -1
- package/dist/types/components/Toast/ToastWrapper.d.ts +5 -5
- package/dist/types/components/Toast/index.d.ts +6 -6
- package/dist/types/components/Toast/styles.d.ts +16 -16
- package/dist/types/components/Toast/theme.d.ts +2 -2
- package/dist/types/components/Toast/utils.d.ts +13 -13
- package/dist/types/components/Toggle/index.d.ts +3 -3
- package/dist/types/components/Toggle/styles.d.ts +4 -5
- package/dist/types/components/Toggle/theme.d.ts +5 -5
- package/dist/types/components/Tooltip/index.d.ts +2 -2
- package/dist/types/components/Tooltip/styles.d.ts +1 -1
- package/dist/types/components/Tooltip/theme.d.ts +1 -1
- package/dist/types/components/VariantIcon/index.d.ts +1 -1
- package/dist/types/components/VariantIcon/styles.d.ts +1 -1
- package/dist/types/components/VariantIcon/theme.d.ts +2 -2
- package/dist/types/components/WuiProvider/font.d.ts +5 -3
- package/dist/types/components/WuiProvider/index.d.ts +1 -1
- package/dist/types/theme/colors.d.ts +11 -3
- package/dist/types/theme/dark.d.ts +1 -1
- package/dist/types/theme/defaultFields.d.ts +10 -10
- package/dist/types/theme/fonts.d.ts +5 -5
- package/dist/types/theme/index.d.ts +31 -31
- package/dist/types/theme/screens.d.ts +1 -1
- package/dist/types/theme/space.d.ts +1 -1
- package/dist/types/theme/typography.d.ts +1 -1
- package/dist/types/utils/field-styles.d.ts +6 -6
- package/dist/types/utils/index.d.ts +2 -2
- package/dist/types/utils/ts-utils.d.ts +1 -1
- package/dist/types/utils/use-copy-text.d.ts +1 -1
- package/dist/types/utils/use-create-portal.d.ts +1 -1
- package/dist/types/utils/use-viewport.d.ts +2 -2
- package/dist/types/utils/wrap-children.d.ts +1 -1
- package/dist/{use-fork-ref-DvaCTfQ_.mjs → use-fork-ref-CUZErtAC.mjs} +3 -4
- package/dist/{use-viewport-CWpjoHXy.mjs → use-viewport-CfklieD-.mjs} +2 -2
- package/dist/utils.mjs +29 -102
- package/dist/wrap-children-aq69jtFP.mjs +12 -0
- package/package.json +28 -4
- package/dist/LVA2YJMS-C-kJ1lkr.mjs +0 -873
- package/dist/hide-focus-rings-root-CCXdysih.mjs +0 -15
- package/dist/index-CYmF7qCH.mjs +0 -11
- package/dist/index-C_k-m0Rl.mjs +0 -36
- package/dist/index-D8v_VJ9z.mjs +0 -26
- package/dist/index-DpkNUfAS.mjs +0 -11
- package/dist/index-i_anpNhw.mjs +0 -66
- package/dist/index-wl3X6EM1.mjs +0 -16
- package/dist/jsx-runtime-B7I4PJ0H.mjs +0 -613
- package/dist/radio-group-C0fUHvam.mjs +0 -52
- package/dist/throttle-CW18pWlW.mjs +0 -13
- package/dist/wrap-children-DBSD-X5-.mjs +0 -9
- package/dist/{downshift.esm-B7Jil1wW.mjs → downshift.esm-D0ns_SQs.mjs} +9 -9
package/dist/Select.mjs
CHANGED
|
@@ -1,22 +1,21 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import { D as pe } from "./downshift.esm-
|
|
4
|
-
import { g as
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { D as Je } from "./index-DAZ1SYdj.mjs";
|
|
9
|
-
import { shouldForwardProp as ne, forwardRef as Ge } from "./System.mjs";
|
|
10
|
-
import { c as et } from "./create-event-rXDe5aCQ.mjs";
|
|
11
|
-
import { d as tt, F as nt } from "./field-styles-BVlRlvuu.mjs";
|
|
12
|
-
import { StyledTag as rt, Tag as ot } from "./Tag.mjs";
|
|
13
|
-
import b, { system as Ce, th as v, css as _ } from "@xstyled/styled-components";
|
|
14
|
-
import { Box as st } from "./Box.mjs";
|
|
15
|
-
import { IconWrapper as it } from "./Field.mjs";
|
|
2
|
+
import m, { useMemo as ze, useState as B, useEffect as he, Fragment as Le } from "react";
|
|
3
|
+
import { D as pe } from "./downshift.esm-D0ns_SQs.mjs";
|
|
4
|
+
import { g as Ze } from "./_commonjsHelpers-CXJ7dpIk.mjs";
|
|
5
|
+
import { c as Qe } from "./create-event-rXDe5aCQ.mjs";
|
|
6
|
+
import { d as Xe, F as qe } from "./field-styles-CfVLcVQp.mjs";
|
|
7
|
+
import C, { system as Oe, th as v, css as W } from "@xstyled/styled-components";
|
|
16
8
|
import { o as G } from "./overflow-ellipsis-DGV5Kgt-.mjs";
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
9
|
+
import { StyledIcon as Ge } from "./Icon.mjs";
|
|
10
|
+
import { IconWrapper as Je } from "./Field.mjs";
|
|
11
|
+
import { StyledTag as et, Tag as tt } from "./Tag.mjs";
|
|
12
|
+
import { shouldForwardProp as te, forwardRef as nt } from "./System.mjs";
|
|
13
|
+
import { Box as rt } from "./Box.mjs";
|
|
14
|
+
import { ClearButton as ot } from "./ClearButton.mjs";
|
|
15
|
+
import { D as at } from "./index-BNGGwOCo.mjs";
|
|
16
|
+
var _ = { exports: {} }, ge;
|
|
17
|
+
function it() {
|
|
18
|
+
if (ge) return _.exports;
|
|
20
19
|
ge = 1;
|
|
21
20
|
var e = {
|
|
22
21
|
À: "A",
|
|
@@ -482,22 +481,22 @@ function lt() {
|
|
|
482
481
|
function o(l) {
|
|
483
482
|
return e[l];
|
|
484
483
|
}
|
|
485
|
-
var
|
|
484
|
+
var a = function(l) {
|
|
486
485
|
return l.replace(n, o);
|
|
487
486
|
}, u = function(l) {
|
|
488
487
|
return !!l.match(r);
|
|
489
488
|
};
|
|
490
|
-
return
|
|
489
|
+
return _.exports = a, _.exports.has = u, _.exports.remove = a, _.exports;
|
|
491
490
|
}
|
|
492
|
-
var
|
|
493
|
-
const
|
|
491
|
+
var st = it();
|
|
492
|
+
const lt = /* @__PURE__ */ Ze(st);
|
|
494
493
|
/**
|
|
495
494
|
* @name match-sorter
|
|
496
495
|
* @license MIT license.
|
|
497
496
|
* @copyright (c) 2020 Kent C. Dodds
|
|
498
497
|
* @author Kent C. Dodds <me@kentcdodds.com> (https://kentcdodds.com)
|
|
499
498
|
*/
|
|
500
|
-
const
|
|
499
|
+
const I = {
|
|
501
500
|
CASE_SENSITIVE_EQUAL: 7,
|
|
502
501
|
EQUAL: 6,
|
|
503
502
|
STARTS_WITH: 5,
|
|
@@ -506,125 +505,125 @@ const g = {
|
|
|
506
505
|
ACRONYM: 2,
|
|
507
506
|
MATCHES: 1,
|
|
508
507
|
NO_MATCH: 0
|
|
509
|
-
},
|
|
510
|
-
function
|
|
508
|
+
}, ct = (e, t) => String(e.rankedValue).localeCompare(String(t.rankedValue));
|
|
509
|
+
function J(e, t, n) {
|
|
511
510
|
n === void 0 && (n = {});
|
|
512
511
|
const {
|
|
513
512
|
keys: r,
|
|
514
|
-
threshold: o =
|
|
515
|
-
baseSort:
|
|
516
|
-
sorter: u = (f) => f.sort((d, i) =>
|
|
517
|
-
} = n, l = e.reduce(
|
|
513
|
+
threshold: o = I.MATCHES,
|
|
514
|
+
baseSort: a = ct,
|
|
515
|
+
sorter: u = (f) => f.sort((d, i) => mt(d, i, a))
|
|
516
|
+
} = n, l = e.reduce(c, []);
|
|
518
517
|
return u(l).map((f) => {
|
|
519
518
|
let {
|
|
520
519
|
item: d
|
|
521
520
|
} = f;
|
|
522
521
|
return d;
|
|
523
522
|
});
|
|
524
|
-
function
|
|
525
|
-
const
|
|
526
|
-
rank:
|
|
527
|
-
keyThreshold:
|
|
528
|
-
} =
|
|
529
|
-
return
|
|
530
|
-
...
|
|
523
|
+
function c(f, d, i) {
|
|
524
|
+
const h = ut(d, r, t, n), {
|
|
525
|
+
rank: x,
|
|
526
|
+
keyThreshold: E = o
|
|
527
|
+
} = h;
|
|
528
|
+
return x >= E && f.push({
|
|
529
|
+
...h,
|
|
531
530
|
item: d,
|
|
532
531
|
index: i
|
|
533
532
|
}), f;
|
|
534
533
|
}
|
|
535
534
|
}
|
|
536
|
-
|
|
537
|
-
function
|
|
535
|
+
J.rankings = I;
|
|
536
|
+
function ut(e, t, n, r) {
|
|
538
537
|
if (!t) {
|
|
539
|
-
const
|
|
538
|
+
const a = e;
|
|
540
539
|
return {
|
|
541
540
|
// ends up being duplicate of 'item' in matches but consistent
|
|
542
|
-
rankedValue:
|
|
543
|
-
rank:
|
|
541
|
+
rankedValue: a,
|
|
542
|
+
rank: Ie(a, n, r),
|
|
544
543
|
keyIndex: -1,
|
|
545
544
|
keyThreshold: r.threshold
|
|
546
545
|
};
|
|
547
546
|
}
|
|
548
|
-
return gt(e, t).reduce((
|
|
547
|
+
return gt(e, t).reduce((a, u, l) => {
|
|
549
548
|
let {
|
|
550
|
-
rank:
|
|
549
|
+
rank: c,
|
|
551
550
|
rankedValue: f,
|
|
552
551
|
keyIndex: d,
|
|
553
552
|
keyThreshold: i
|
|
554
|
-
} =
|
|
555
|
-
itemValue:
|
|
556
|
-
attributes:
|
|
557
|
-
} = u,
|
|
553
|
+
} = a, {
|
|
554
|
+
itemValue: h,
|
|
555
|
+
attributes: x
|
|
556
|
+
} = u, E = Ie(h, n, r), $ = f;
|
|
558
557
|
const {
|
|
559
|
-
minRanking:
|
|
560
|
-
maxRanking:
|
|
558
|
+
minRanking: H,
|
|
559
|
+
maxRanking: N,
|
|
561
560
|
threshold: K
|
|
562
|
-
} =
|
|
563
|
-
return
|
|
564
|
-
rankedValue:
|
|
565
|
-
rank:
|
|
561
|
+
} = x;
|
|
562
|
+
return E < H && E >= I.MATCHES ? E = H : E > N && (E = N), E > c && (c = E, d = l, i = K, $ = h), {
|
|
563
|
+
rankedValue: $,
|
|
564
|
+
rank: c,
|
|
566
565
|
keyIndex: d,
|
|
567
566
|
keyThreshold: i
|
|
568
567
|
};
|
|
569
568
|
}, {
|
|
570
569
|
rankedValue: e,
|
|
571
|
-
rank:
|
|
570
|
+
rank: I.NO_MATCH,
|
|
572
571
|
keyIndex: -1,
|
|
573
572
|
keyThreshold: r.threshold
|
|
574
573
|
});
|
|
575
574
|
}
|
|
576
|
-
function
|
|
577
|
-
return e =
|
|
575
|
+
function Ie(e, t, n) {
|
|
576
|
+
return e = Ae(e, n), t = Ae(t, n), t.length > e.length ? I.NO_MATCH : e === t ? I.CASE_SENSITIVE_EQUAL : (e = e.toLowerCase(), t = t.toLowerCase(), e === t ? I.EQUAL : e.startsWith(t) ? I.STARTS_WITH : e.includes(` ${t}`) ? I.WORD_STARTS_WITH : e.includes(t) ? I.CONTAINS : t.length === 1 ? I.NO_MATCH : dt(e).includes(t) ? I.ACRONYM : ft(e, t));
|
|
578
577
|
}
|
|
579
|
-
function
|
|
578
|
+
function dt(e) {
|
|
580
579
|
let t = "";
|
|
581
580
|
return e.split(" ").forEach((r) => {
|
|
582
|
-
r.split("-").forEach((
|
|
583
|
-
t +=
|
|
581
|
+
r.split("-").forEach((a) => {
|
|
582
|
+
t += a.substr(0, 1);
|
|
584
583
|
});
|
|
585
584
|
}), t;
|
|
586
585
|
}
|
|
587
|
-
function
|
|
586
|
+
function ft(e, t) {
|
|
588
587
|
let n = 0, r = 0;
|
|
589
|
-
function o(
|
|
590
|
-
for (let i = d,
|
|
591
|
-
if (f[i] ===
|
|
588
|
+
function o(c, f, d) {
|
|
589
|
+
for (let i = d, h = f.length; i < h; i++)
|
|
590
|
+
if (f[i] === c)
|
|
592
591
|
return n += 1, i + 1;
|
|
593
592
|
return -1;
|
|
594
593
|
}
|
|
595
|
-
function
|
|
596
|
-
const f = 1 /
|
|
597
|
-
return
|
|
594
|
+
function a(c) {
|
|
595
|
+
const f = 1 / c, d = n / t.length;
|
|
596
|
+
return I.MATCHES + d * f;
|
|
598
597
|
}
|
|
599
598
|
const u = o(t[0], e, 0);
|
|
600
599
|
if (u < 0)
|
|
601
|
-
return
|
|
600
|
+
return I.NO_MATCH;
|
|
602
601
|
r = u;
|
|
603
|
-
for (let
|
|
604
|
-
const d = t[
|
|
602
|
+
for (let c = 1, f = t.length; c < f; c++) {
|
|
603
|
+
const d = t[c];
|
|
605
604
|
if (r = o(d, e, r), !(r > -1))
|
|
606
|
-
return
|
|
605
|
+
return I.NO_MATCH;
|
|
607
606
|
}
|
|
608
607
|
const l = r - u;
|
|
609
|
-
return
|
|
608
|
+
return a(l);
|
|
610
609
|
}
|
|
611
|
-
function
|
|
610
|
+
function mt(e, t, n) {
|
|
612
611
|
const {
|
|
613
|
-
rank:
|
|
612
|
+
rank: a,
|
|
614
613
|
keyIndex: u
|
|
615
614
|
} = e, {
|
|
616
615
|
rank: l,
|
|
617
|
-
keyIndex:
|
|
616
|
+
keyIndex: c
|
|
618
617
|
} = t;
|
|
619
|
-
return
|
|
618
|
+
return a === l ? u === c ? n(e, t) : u < c ? -1 : 1 : a > l ? -1 : 1;
|
|
620
619
|
}
|
|
621
|
-
function
|
|
620
|
+
function Ae(e, t) {
|
|
622
621
|
let {
|
|
623
622
|
keepDiacritics: n
|
|
624
623
|
} = t;
|
|
625
|
-
return e = `${e}`, n || (e =
|
|
624
|
+
return e = `${e}`, n || (e = lt(e)), e;
|
|
626
625
|
}
|
|
627
|
-
function
|
|
626
|
+
function ht(e, t) {
|
|
628
627
|
typeof t == "object" && (t = t.key);
|
|
629
628
|
let n;
|
|
630
629
|
if (typeof t == "function")
|
|
@@ -635,19 +634,19 @@ function pt(e, t) {
|
|
|
635
634
|
n = e[t];
|
|
636
635
|
else {
|
|
637
636
|
if (t.includes("."))
|
|
638
|
-
return
|
|
637
|
+
return pt(t, e);
|
|
639
638
|
n = null;
|
|
640
639
|
}
|
|
641
640
|
return n == null ? [] : Array.isArray(n) ? n : [String(n)];
|
|
642
641
|
}
|
|
643
|
-
function
|
|
642
|
+
function pt(e, t) {
|
|
644
643
|
const n = e.split(".");
|
|
645
644
|
let r = [t];
|
|
646
|
-
for (let o = 0,
|
|
645
|
+
for (let o = 0, a = n.length; o < a; o++) {
|
|
647
646
|
const u = n[o];
|
|
648
647
|
let l = [];
|
|
649
|
-
for (let
|
|
650
|
-
const d = r[
|
|
648
|
+
for (let c = 0, f = r.length; c < f; c++) {
|
|
649
|
+
const d = r[c];
|
|
651
650
|
if (d != null)
|
|
652
651
|
if (Object.hasOwnProperty.call(d, u)) {
|
|
653
652
|
const i = d[u];
|
|
@@ -661,48 +660,83 @@ function It(e, t) {
|
|
|
661
660
|
function gt(e, t) {
|
|
662
661
|
const n = [];
|
|
663
662
|
for (let r = 0, o = t.length; r < o; r++) {
|
|
664
|
-
const
|
|
665
|
-
for (let
|
|
663
|
+
const a = t[r], u = It(a), l = ht(e, a);
|
|
664
|
+
for (let c = 0, f = l.length; c < f; c++)
|
|
666
665
|
n.push({
|
|
667
|
-
itemValue: l[
|
|
666
|
+
itemValue: l[c],
|
|
668
667
|
attributes: u
|
|
669
668
|
});
|
|
670
669
|
}
|
|
671
670
|
return n;
|
|
672
671
|
}
|
|
673
|
-
const
|
|
672
|
+
const Ee = {
|
|
674
673
|
maxRanking: 1 / 0,
|
|
675
674
|
minRanking: -1 / 0
|
|
676
675
|
};
|
|
677
|
-
function
|
|
678
|
-
return typeof e == "string" ?
|
|
679
|
-
...
|
|
676
|
+
function It(e) {
|
|
677
|
+
return typeof e == "string" ? Ee : {
|
|
678
|
+
...Ee,
|
|
680
679
|
...e
|
|
681
680
|
};
|
|
682
681
|
}
|
|
683
|
-
const
|
|
684
|
-
(
|
|
682
|
+
const ne = "", xe = (e) => {
|
|
683
|
+
if (typeof e == "number")
|
|
684
|
+
return String(e);
|
|
685
|
+
if (typeof e == "string") {
|
|
686
|
+
const t = e.match(/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g);
|
|
687
|
+
return t && t.map((n) => n.toLowerCase()).join("-");
|
|
688
|
+
}
|
|
689
|
+
}, ye = (e) => e ? e.label : ne, At = (e) => e.reduce(
|
|
690
|
+
(t, n) => n.label && t.length > n.label.length ? t : n.label,
|
|
691
|
+
ne
|
|
692
|
+
), Et = (e, t, n) => {
|
|
693
|
+
const r = t.find((o) => e.value === o.value);
|
|
694
|
+
return r && n ? t.filter((o) => e.value !== o.value) : r ? t : [...t, e];
|
|
695
|
+
}, X = (e, t) => !!t.find((n) => n.value === e), ee = (e, t = []) => t.find(
|
|
696
|
+
(r) => r.label === (e.label || e) || r.value === (e.value || e)
|
|
697
|
+
) || { value: xe(e), label: e }, yt = (e, t, n = !1) => {
|
|
698
|
+
const r = n ? t.flatMap((o) => o.options) : t;
|
|
699
|
+
return !e && e !== 0 ? [] : Array.isArray(e) ? e.map((o) => ee(o, r)) : [ee(e, r)];
|
|
700
|
+
}, vt = (e, t) => !!t.find((n) => n.value === e.value), bt = (e, t) => vt(e, t) ? e.value : e.label, ve = (e, t) => {
|
|
701
|
+
if (e)
|
|
702
|
+
return e.map((n) => bt(n, t));
|
|
703
|
+
}, Ct = (e, t) => {
|
|
704
|
+
if (e)
|
|
705
|
+
return e.filter(
|
|
706
|
+
(n) => !t.find((r) => r.value === n.value)
|
|
707
|
+
);
|
|
708
|
+
}, Ot = ({
|
|
709
|
+
inputValue: e,
|
|
710
|
+
isMultiple: t,
|
|
711
|
+
isSearchable: n,
|
|
712
|
+
options: r,
|
|
713
|
+
renderItem: o
|
|
714
|
+
}) => {
|
|
715
|
+
const a = ee(e, r);
|
|
716
|
+
return t ? e : a.label ? n ? a.label : o(a) : ne;
|
|
717
|
+
}, ke = C(Je)``, Se = C(rt).withConfig({ shouldForwardProp: te })(
|
|
718
|
+
({ disabled: e }) => W`
|
|
685
719
|
position: relative;
|
|
686
|
-
${
|
|
687
|
-
${
|
|
720
|
+
${Oe}
|
|
721
|
+
${ke} {
|
|
688
722
|
color: ${e ? v("defaultFields.select.disabled.color") : "initial"};
|
|
689
723
|
}
|
|
690
724
|
`
|
|
691
|
-
), xt =
|
|
725
|
+
), xt = C.div`
|
|
692
726
|
position: relative;
|
|
693
|
-
`,
|
|
694
|
-
({ iconPlacement: e, isClearable: t, size: n, transparent: r, variant: o }) =>
|
|
727
|
+
`, be = C.divBox.withConfig({ shouldForwardProp: te })(
|
|
728
|
+
({ iconPlacement: e, isClearable: t, size: n, transparent: r, variant: o }) => W`
|
|
695
729
|
position: relative;
|
|
696
|
-
${
|
|
697
|
-
iconPlacement: e,
|
|
698
|
-
isClearable: t,
|
|
730
|
+
${Xe({
|
|
699
731
|
size: n,
|
|
732
|
+
variant: o,
|
|
700
733
|
transparent: r,
|
|
701
|
-
|
|
734
|
+
isClearable: t,
|
|
735
|
+
iconPlacement: e
|
|
702
736
|
})};
|
|
703
737
|
${G};
|
|
704
738
|
cursor: pointer;
|
|
705
|
-
${
|
|
739
|
+
${Oe}
|
|
706
740
|
line-height: 1em;
|
|
707
741
|
|
|
708
742
|
br {
|
|
@@ -733,7 +767,7 @@ const Se = b(it)``, ke = b(st).withConfig({ shouldForwardProp: ne })(
|
|
|
733
767
|
}
|
|
734
768
|
}
|
|
735
769
|
`
|
|
736
|
-
),
|
|
770
|
+
), kt = C.ul`
|
|
737
771
|
${v("defaultFields.select.default")};
|
|
738
772
|
${v("cards.default")};
|
|
739
773
|
position: absolute;
|
|
@@ -750,8 +784,8 @@ const Se = b(it)``, ke = b(st).withConfig({ shouldForwardProp: ne })(
|
|
|
750
784
|
&:hover > * {
|
|
751
785
|
cursor: pointer;
|
|
752
786
|
}
|
|
753
|
-
`, q =
|
|
754
|
-
({ allowUnselectFromList: e, isDisabled: t, isHighlighted: n, isMultiple: r, isSelected: o }) =>
|
|
787
|
+
`, q = C.li(
|
|
788
|
+
({ allowUnselectFromList: e, isDisabled: t, isHighlighted: n, isMultiple: r, isSelected: o }) => W`
|
|
755
789
|
color: beige-70;
|
|
756
790
|
${n && v("defaultFields.select.highlighted")};
|
|
757
791
|
${o && !r && v("defaultFields.select.selected")};
|
|
@@ -764,8 +798,8 @@ const Se = b(it)``, ke = b(st).withConfig({ shouldForwardProp: ne })(
|
|
|
764
798
|
font-size: sm;
|
|
765
799
|
transition: background ${v.transition("medium")};
|
|
766
800
|
`
|
|
767
|
-
),
|
|
768
|
-
({ size: e }) =>
|
|
801
|
+
), St = C.divBox(
|
|
802
|
+
({ size: e }) => W`
|
|
769
803
|
position: absolute;
|
|
770
804
|
padding: 0;
|
|
771
805
|
top: 0;
|
|
@@ -774,8 +808,8 @@ const Se = b(it)``, ke = b(st).withConfig({ shouldForwardProp: ne })(
|
|
|
774
808
|
display: flex;
|
|
775
809
|
gap: xs;
|
|
776
810
|
`
|
|
777
|
-
),
|
|
778
|
-
({ isOpen: e }) =>
|
|
811
|
+
), Ce = C.button.withConfig({ shouldForwardProp: te })(
|
|
812
|
+
({ isOpen: e }) => W`
|
|
779
813
|
position: relative;
|
|
780
814
|
height: 100%;
|
|
781
815
|
padding: 0;
|
|
@@ -788,7 +822,7 @@ const Se = b(it)``, ke = b(st).withConfig({ shouldForwardProp: ne })(
|
|
|
788
822
|
align-items: center;
|
|
789
823
|
justify-content: center;
|
|
790
824
|
|
|
791
|
-
${
|
|
825
|
+
${Ge} {
|
|
792
826
|
transform: ${e ? "rotate3d(0, 0, 1, 180deg)" : "rotate3d(0)"};
|
|
793
827
|
transition: medium;
|
|
794
828
|
}
|
|
@@ -801,11 +835,11 @@ const Se = b(it)``, ke = b(st).withConfig({ shouldForwardProp: ne })(
|
|
|
801
835
|
color: ${v("defaultFields.select.disabled.color")};
|
|
802
836
|
}
|
|
803
837
|
`
|
|
804
|
-
),
|
|
838
|
+
), wt = C.divBox`
|
|
805
839
|
margin-top: lg;
|
|
806
840
|
|
|
807
841
|
${/* sc-selector */
|
|
808
|
-
|
|
842
|
+
et}:not(:last-child) {
|
|
809
843
|
margin-right: sm;
|
|
810
844
|
margin-bottom: sm;
|
|
811
845
|
}
|
|
@@ -814,291 +848,222 @@ rt}:not(:last-child) {
|
|
|
814
848
|
display: none;
|
|
815
849
|
}
|
|
816
850
|
`;
|
|
817
|
-
function
|
|
818
|
-
return /* @__PURE__ */
|
|
851
|
+
function Tt(e, t) {
|
|
852
|
+
return /* @__PURE__ */ m.createElement(wt, { role: "list" }, e.map((n) => /* @__PURE__ */ m.createElement(tt, { key: n.value, onRemove: () => t(n.value.toString()), role: "listitem" }, n.label)));
|
|
819
853
|
}
|
|
820
|
-
const
|
|
821
|
-
if (typeof e == "number")
|
|
822
|
-
return String(e);
|
|
823
|
-
if (typeof e == "string") {
|
|
824
|
-
const t = e.match(/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g);
|
|
825
|
-
return t && t.map((n) => n.toLowerCase()).join("-") || void 0;
|
|
826
|
-
}
|
|
827
|
-
}, be = (e) => e ? e.label : re, Ot = (e) => e.reduce(
|
|
828
|
-
(t, n) => n.label && t.length > n.label.length ? t : n.label,
|
|
829
|
-
re
|
|
830
|
-
), Ct = (e, t, n) => {
|
|
831
|
-
const r = t.find((o) => e.value === o.value);
|
|
832
|
-
return r && n ? t.filter((o) => e.value !== o.value) : r ? t : [...t, e];
|
|
833
|
-
}, J = (e, t) => !!t.find((n) => n.value === e), te = (e, t = []) => t.find(
|
|
834
|
-
(r) => r.label === (e.label || e) || r.value === (e.value || e)
|
|
835
|
-
) || { label: e, value: we(e) }, St = ({
|
|
836
|
-
groupsEnabled: e = !1,
|
|
837
|
-
options: t,
|
|
838
|
-
selected: n
|
|
839
|
-
}) => {
|
|
840
|
-
const r = e ? (
|
|
841
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
842
|
-
// @ts-expect-error
|
|
843
|
-
t.flatMap((o) => o.options)
|
|
844
|
-
) : t;
|
|
845
|
-
return !n && n !== 0 ? [] : Array.isArray(n) ? n.map((o) => te(o, r)) : [te(n, r)];
|
|
846
|
-
}, kt = (e, t) => (
|
|
847
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
848
|
-
// @ts-expect-error
|
|
849
|
-
!!t.find((n) => n.value === e.value)
|
|
850
|
-
), wt = (e, t) => kt(e, t) ? e.value : e.label, Oe = (e, t) => e ? e.map((n) => wt(n, t)) : null, jt = (e, t) => e ? e.filter(
|
|
851
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
852
|
-
// @ts-expect-error
|
|
853
|
-
(n) => !t.find((r) => r.value === n.value)
|
|
854
|
-
) : null, Tt = ({
|
|
855
|
-
inputValue: e,
|
|
856
|
-
isMultiple: t,
|
|
857
|
-
isSearchable: n,
|
|
858
|
-
options: r,
|
|
859
|
-
renderItem: o
|
|
860
|
-
}) => {
|
|
861
|
-
const s = te(e, r);
|
|
862
|
-
return t ? e : s.label ? n ? s.label : o(s) : re;
|
|
863
|
-
}, Vt = pe.default || pe, Lt = Ge(
|
|
854
|
+
const Vt = pe.default || pe, Yt = nt(
|
|
864
855
|
({
|
|
865
856
|
allowUnselectFromList: e,
|
|
866
857
|
autoComplete: t = "off",
|
|
867
858
|
autoFocus: n,
|
|
868
859
|
dataTestId: r,
|
|
869
860
|
disableCloseOnSelect: o,
|
|
870
|
-
disabled:
|
|
861
|
+
disabled: a,
|
|
871
862
|
groupsEnabled: u,
|
|
872
863
|
icon: l,
|
|
873
|
-
id:
|
|
864
|
+
id: c,
|
|
874
865
|
isClearable: f,
|
|
875
866
|
isCreatable: d,
|
|
876
867
|
isMultiple: i,
|
|
877
|
-
isSearchable:
|
|
878
|
-
name:
|
|
879
|
-
onBlur:
|
|
880
|
-
onChange:
|
|
881
|
-
onClick:
|
|
882
|
-
onCreate:
|
|
868
|
+
isSearchable: h,
|
|
869
|
+
name: x,
|
|
870
|
+
onBlur: E,
|
|
871
|
+
onChange: $,
|
|
872
|
+
onClick: H,
|
|
873
|
+
onCreate: N,
|
|
883
874
|
onFocus: K,
|
|
884
875
|
options: A = [],
|
|
885
|
-
placeholder:
|
|
886
|
-
renderCreateItem:
|
|
887
|
-
renderGroupHeader:
|
|
888
|
-
renderItem:
|
|
889
|
-
renderMultiple:
|
|
890
|
-
size:
|
|
891
|
-
transparent:
|
|
892
|
-
value:
|
|
893
|
-
variant:
|
|
894
|
-
...
|
|
895
|
-
},
|
|
896
|
-
const
|
|
897
|
-
() =>
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
if (m && c !== E) {
|
|
911
|
-
let h = [];
|
|
912
|
-
u ? h = ee(A, c, {
|
|
876
|
+
placeholder: re = "Choose from…",
|
|
877
|
+
renderCreateItem: we = (w) => `Create "${w}"`,
|
|
878
|
+
renderGroupHeader: Te,
|
|
879
|
+
renderItem: Y = ye,
|
|
880
|
+
renderMultiple: Ve = Tt,
|
|
881
|
+
size: M = "md",
|
|
882
|
+
transparent: Re,
|
|
883
|
+
value: oe,
|
|
884
|
+
variant: Ue,
|
|
885
|
+
...ae
|
|
886
|
+
}, D) => {
|
|
887
|
+
const w = ze(
|
|
888
|
+
() => yt(oe, A, u),
|
|
889
|
+
[oe, A, u]
|
|
890
|
+
), z = !i && w[0] || null, L = z ? z.label : "", [k, Z] = B(w), [b, F] = B(L), [j, P] = B(A), [S, T] = B(!1);
|
|
891
|
+
h = d || h, he(() => {
|
|
892
|
+
var s;
|
|
893
|
+
n && ((s = D == null ? void 0 : D.current) == null || s.focus(), h && T(!0));
|
|
894
|
+
}, [h, n, D]), he(() => {
|
|
895
|
+
Z(w), F(L), P(A);
|
|
896
|
+
}, [L, A, w]);
|
|
897
|
+
const $e = (s) => {
|
|
898
|
+
if (h && s !== b) {
|
|
899
|
+
let p = [];
|
|
900
|
+
u ? p = J(A, s, {
|
|
913
901
|
// should match on group.label OR group.options.label
|
|
914
|
-
keys: [(
|
|
915
|
-
}) :
|
|
902
|
+
keys: [(g) => g.label, (g) => g.options.map((V) => V.label)]
|
|
903
|
+
}) : p = J(A, s, { keys: ["label"] }), F(s), P(p);
|
|
916
904
|
}
|
|
917
|
-
},
|
|
918
|
-
|
|
919
|
-
},
|
|
920
|
-
let
|
|
921
|
-
u ?
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
const O = jt(c, A);
|
|
930
|
-
O != null && O.length && (R == null || R(O[0].label, N));
|
|
905
|
+
}, He = () => {
|
|
906
|
+
h && !S && T(!0);
|
|
907
|
+
}, ie = (s) => {
|
|
908
|
+
let p = [];
|
|
909
|
+
u ? p = ve(
|
|
910
|
+
s,
|
|
911
|
+
A.flatMap((R) => R.options)
|
|
912
|
+
) : p = ve(s, A);
|
|
913
|
+
const g = i ? p : p[0], V = Qe({ name: x, value: i ? s : s[0] });
|
|
914
|
+
if ($ && $(g, V), d) {
|
|
915
|
+
const R = Ct(s, A);
|
|
916
|
+
R.length && N && N(R[0].label, V);
|
|
931
917
|
}
|
|
932
|
-
}, Ne = (
|
|
933
|
-
let
|
|
934
|
-
!
|
|
935
|
-
}, De = (
|
|
936
|
-
const
|
|
937
|
-
|
|
938
|
-
}, Fe = (
|
|
939
|
-
i &&
|
|
940
|
-
},
|
|
941
|
-
inputValue:
|
|
942
|
-
isMultiple: i
|
|
943
|
-
isSearchable:
|
|
918
|
+
}, Ne = (s) => {
|
|
919
|
+
let p, g;
|
|
920
|
+
!s || s != null && s.disabled ? (p = i ? k : [], g = !0) : (p = i ? Et(s, k, e) : [s], g = i), g && F(""), P(A), Z(p), ie(p), o || T(!1);
|
|
921
|
+
}, De = (s) => {
|
|
922
|
+
const p = k.filter((g) => g.value !== s);
|
|
923
|
+
Z(p), ie(p);
|
|
924
|
+
}, Fe = (s) => {
|
|
925
|
+
i && s.selectedItem ? F("") : h && s.selectedItem && F(s.selectedItem.label), P(A), T(!1);
|
|
926
|
+
}, _e = At(A), se = Ot({
|
|
927
|
+
inputValue: b,
|
|
928
|
+
isMultiple: i,
|
|
929
|
+
isSearchable: h,
|
|
944
930
|
options: A,
|
|
945
|
-
renderItem:
|
|
931
|
+
renderItem: Y
|
|
946
932
|
});
|
|
947
|
-
return (
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
/* @__PURE__ */
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
index: me,
|
|
1042
|
-
isSelected: he,
|
|
1043
|
-
item: C
|
|
1044
|
-
}),
|
|
1045
|
-
children: z(C, he)
|
|
1046
|
-
},
|
|
1047
|
-
C.value
|
|
1048
|
-
);
|
|
1049
|
-
}) : null
|
|
1050
|
-
] }, y.label)
|
|
1051
|
-
);
|
|
1052
|
-
else if ("value" in y) {
|
|
1053
|
-
const C = J(y.value, w);
|
|
1054
|
-
D.itemsToRender.push(
|
|
1055
|
-
/* @__PURE__ */ p.jsx(
|
|
1056
|
-
q,
|
|
1057
|
-
{
|
|
1058
|
-
allowUnselectFromList: e,
|
|
1059
|
-
isDisabled: y.disabled,
|
|
1060
|
-
isHighlighted: X === fe,
|
|
1061
|
-
isMultiple: i,
|
|
1062
|
-
...I({
|
|
1063
|
-
index: fe,
|
|
1064
|
-
isSelected: C,
|
|
1065
|
-
item: y
|
|
1066
|
-
}),
|
|
1067
|
-
children: z(y, C)
|
|
1068
|
-
},
|
|
1069
|
-
y.value
|
|
1070
|
-
)
|
|
1071
|
-
);
|
|
1072
|
-
}
|
|
1073
|
-
return D;
|
|
1074
|
-
},
|
|
1075
|
-
{ itemIndex: 0, itemsToRender: [] }
|
|
1076
|
-
).itemsToRender,
|
|
1077
|
-
ce && E.length ? /* @__PURE__ */ p.jsx(
|
|
933
|
+
return /* @__PURE__ */ m.createElement(
|
|
934
|
+
Vt,
|
|
935
|
+
{
|
|
936
|
+
id: c,
|
|
937
|
+
inputValue: h ? se : "",
|
|
938
|
+
isOpen: S,
|
|
939
|
+
itemToString: ye,
|
|
940
|
+
onInputValueChange: $e,
|
|
941
|
+
onOuterClick: Fe,
|
|
942
|
+
onSelect: Ne,
|
|
943
|
+
selectedItem: z
|
|
944
|
+
},
|
|
945
|
+
({
|
|
946
|
+
clearSelection: s,
|
|
947
|
+
getInputProps: p,
|
|
948
|
+
getItemProps: g,
|
|
949
|
+
getMenuProps: V,
|
|
950
|
+
getRootProps: R,
|
|
951
|
+
getToggleButtonProps: We,
|
|
952
|
+
highlightedIndex: Q
|
|
953
|
+
}) => {
|
|
954
|
+
const le = !!(d && b && !X(b, k)), Me = S && (j.length || le), je = f && b, Pe = /* @__PURE__ */ m.createElement(Ce, { as: "div" }, /* @__PURE__ */ m.createElement(
|
|
955
|
+
ot,
|
|
956
|
+
{
|
|
957
|
+
onClick: s
|
|
958
|
+
}
|
|
959
|
+
)), Be = /* @__PURE__ */ m.createElement(
|
|
960
|
+
Ce,
|
|
961
|
+
{
|
|
962
|
+
"data-testid": r && `${r}-arrow-icon`,
|
|
963
|
+
disabled: a,
|
|
964
|
+
isOpen: S,
|
|
965
|
+
size: M,
|
|
966
|
+
tabIndex: -1,
|
|
967
|
+
...We({
|
|
968
|
+
onClick: () => T(!S)
|
|
969
|
+
})
|
|
970
|
+
},
|
|
971
|
+
/* @__PURE__ */ m.createElement(at, { size: "sm" })
|
|
972
|
+
), Ke = (U) => {
|
|
973
|
+
H && H(U), T(!S);
|
|
974
|
+
}, Ye = R(ae), ce = p({
|
|
975
|
+
autoComplete: t,
|
|
976
|
+
autoFocus: n,
|
|
977
|
+
"data-spacer": _e || re,
|
|
978
|
+
"data-testid": r,
|
|
979
|
+
disabled: a,
|
|
980
|
+
iconPlacement: l ? "both" : "right",
|
|
981
|
+
id: c,
|
|
982
|
+
name: x,
|
|
983
|
+
onBlur: E,
|
|
984
|
+
onClick: a ? void 0 : Ke,
|
|
985
|
+
onFocus: K,
|
|
986
|
+
onKeyDown: He,
|
|
987
|
+
placeholder: re,
|
|
988
|
+
ref: D,
|
|
989
|
+
size: M,
|
|
990
|
+
tabIndex: 0,
|
|
991
|
+
variant: S ? "focused" : Ue,
|
|
992
|
+
isClearable: f,
|
|
993
|
+
transparent: Re,
|
|
994
|
+
...ae
|
|
995
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
996
|
+
}), ue = qe[M];
|
|
997
|
+
return /* @__PURE__ */ m.createElement(Se, { ...Ye, disabled: a }, /* @__PURE__ */ m.createElement(xt, null, h ? /* @__PURE__ */ m.createElement(be, { as: "input", type: "text", ...ce }) : /* @__PURE__ */ m.createElement(be, { ...ce }, se), l && /* @__PURE__ */ m.createElement(ke, { iconPlacement: "left", size: ue }, m.cloneElement(l, { ...l.props, size: ue })), /* @__PURE__ */ m.createElement(St, { size: M }, je && Pe, Be)), Me && /* @__PURE__ */ m.createElement(kt, { ...V() }, j.reduce(
|
|
998
|
+
(U, y, de) => {
|
|
999
|
+
if (u && "options" in y)
|
|
1000
|
+
U.itemsToRender.push(
|
|
1001
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
1002
|
+
// @ts-ignore
|
|
1003
|
+
/* @__PURE__ */ m.createElement(Le, { key: y.label }, Te(y), y.options && y.options.map((O) => {
|
|
1004
|
+
const fe = U.itemIndex++, me = X(O.value, k);
|
|
1005
|
+
return /* @__PURE__ */ m.createElement(
|
|
1006
|
+
q,
|
|
1007
|
+
{
|
|
1008
|
+
allowUnselectFromList: e,
|
|
1009
|
+
isDisabled: O.disabled,
|
|
1010
|
+
isHighlighted: Q === fe,
|
|
1011
|
+
isMultiple: i,
|
|
1012
|
+
key: O.value,
|
|
1013
|
+
...g({
|
|
1014
|
+
index: fe,
|
|
1015
|
+
isSelected: me,
|
|
1016
|
+
item: O
|
|
1017
|
+
})
|
|
1018
|
+
},
|
|
1019
|
+
Y(O, me)
|
|
1020
|
+
);
|
|
1021
|
+
}))
|
|
1022
|
+
);
|
|
1023
|
+
else if ("value" in y) {
|
|
1024
|
+
const O = X(y.value, k);
|
|
1025
|
+
U.itemsToRender.push(
|
|
1026
|
+
/* @__PURE__ */ m.createElement(
|
|
1078
1027
|
q,
|
|
1079
1028
|
{
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1029
|
+
allowUnselectFromList: e,
|
|
1030
|
+
isDisabled: y.disabled,
|
|
1031
|
+
isHighlighted: Q === de,
|
|
1032
|
+
isMultiple: i,
|
|
1033
|
+
key: y.value,
|
|
1034
|
+
...g({
|
|
1035
|
+
index: de,
|
|
1036
|
+
isSelected: O,
|
|
1037
|
+
item: y
|
|
1038
|
+
})
|
|
1089
1039
|
},
|
|
1090
|
-
|
|
1091
|
-
)
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
}
|
|
1096
|
-
|
|
1097
|
-
|
|
1040
|
+
Y(y, O)
|
|
1041
|
+
)
|
|
1042
|
+
);
|
|
1043
|
+
}
|
|
1044
|
+
return U;
|
|
1045
|
+
},
|
|
1046
|
+
{ itemsToRender: [], itemIndex: 0 }
|
|
1047
|
+
).itemsToRender, le && b.length && /* @__PURE__ */ m.createElement(
|
|
1048
|
+
q,
|
|
1049
|
+
{
|
|
1050
|
+
isHighlighted: Q === j.length,
|
|
1051
|
+
key: "add",
|
|
1052
|
+
...g({
|
|
1053
|
+
index: j.length,
|
|
1054
|
+
item: {
|
|
1055
|
+
value: xe(b),
|
|
1056
|
+
label: b
|
|
1057
|
+
}
|
|
1058
|
+
})
|
|
1059
|
+
},
|
|
1060
|
+
we(b)
|
|
1061
|
+
)), i && Ve(k, De));
|
|
1062
|
+
}
|
|
1098
1063
|
);
|
|
1099
1064
|
}
|
|
1100
|
-
),
|
|
1065
|
+
), zt = Se;
|
|
1101
1066
|
export {
|
|
1102
|
-
|
|
1103
|
-
|
|
1067
|
+
Yt as Select,
|
|
1068
|
+
zt as StyledSelect
|
|
1104
1069
|
};
|