@eyesee/ui-components 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +37 -0
- package/dist/components/Avatar/Avatar.js +61 -0
- package/dist/components/Avatar/Avatar.module.scss.js +27 -0
- package/dist/components/Badge/Badge.js +18 -0
- package/dist/components/Badge/Badge.module.scss.js +7 -0
- package/dist/components/Badge/badgeVariants.js +29 -0
- package/dist/components/Button/Button.js +96 -0
- package/dist/components/Button/Button.module.scss.js +51 -0
- package/dist/components/Checkbox/Checkbox.js +51 -0
- package/dist/components/Checkbox/Checkbox.module.scss.js +17 -0
- package/dist/components/DropdownList/DropdownList.js +37 -0
- package/dist/components/DropdownList/DropdownList.module.scss.js +11 -0
- package/dist/components/EllipsisTooltip/EllipsisTooltip.js +40 -0
- package/dist/components/EllipsisTooltip/EllipsisTooltip.module.scss.js +9 -0
- package/dist/components/ExpandableItem/ExpandableItem.js +25 -0
- package/dist/components/ExpandableItem/ExpandableItem.module.scss.js +11 -0
- package/dist/components/Fields/InputField/InputField.js +84 -0
- package/dist/components/Fields/InputField/InputField.module.scss.js +23 -0
- package/dist/components/Fields/InputFieldContainer.js +115 -0
- package/dist/components/Fields/InputFieldContainer.module.scss.js +19 -0
- package/dist/components/Fields/SelectField/SelectField.js +220 -0
- package/dist/components/Fields/SelectField/SelectField.module.scss.js +11 -0
- package/dist/components/Fields/SelectField/SelectFieldTags.js +111 -0
- package/dist/components/Fields/SelectField/SelectFieldTags.module.scss.js +13 -0
- package/dist/components/Fields/SelectField/selectOptionRow.js +92 -0
- package/dist/components/Fields/SelectField/selectUtils.js +77 -0
- package/dist/components/Fields/TextField/TextField.js +66 -0
- package/dist/components/Fields/TextField/TextField.module.scss.js +13 -0
- package/dist/components/FileType/FileType.js +30 -0
- package/dist/components/FileType/FileType.module.scss.js +15 -0
- package/dist/components/FileType/PaperIcon.js +22 -0
- package/dist/components/ImagePlaceholder/ImagePlaceholder.js +146 -0
- package/dist/components/ImagePlaceholder/ImagePlaceholder.module.scss.js +39 -0
- package/dist/components/ImagePlaceholder/constantsImgPh.js +15 -0
- package/dist/components/ImagePlaceholder/utilsImgPh.js +19 -0
- package/dist/components/ImageWithData/ImageWithData.js +146 -0
- package/dist/components/ImageWithData/ImageWithData.module.scss.js +39 -0
- package/dist/components/Infobox/Infobox.js +33 -0
- package/dist/components/Infobox/Infobox.module.scss.js +19 -0
- package/dist/components/Infobox/infoboxVariants.js +31 -0
- package/dist/components/ListItem/ListItem.js +69 -0
- package/dist/components/ListItem/ListItem.module.scss.js +21 -0
- package/dist/components/ListItem/useListItems.js +58 -0
- package/dist/components/Modal/Modal.js +70 -0
- package/dist/components/Modal/Modal.module.scss.js +21 -0
- package/dist/components/Notifications/Notifications.js +119 -0
- package/dist/components/Notifications/Notifications.module.scss.js +21 -0
- package/dist/components/Notifications/useNotifications.js +103 -0
- package/dist/components/Pill/Pill.js +32 -0
- package/dist/components/Pill/Pill.module.scss.js +13 -0
- package/dist/components/Pill/pillVariants.js +36 -0
- package/dist/components/ProgressBar/ProgressBar.js +48 -0
- package/dist/components/ProgressBar/ProgressBar.module.scss.js +19 -0
- package/dist/components/Radio/Radio.js +20 -0
- package/dist/components/Radio/Radio.module.scss.js +15 -0
- package/dist/components/Tab/Tab.js +51 -0
- package/dist/components/Tab/Tab.module.scss.js +43 -0
- package/dist/components/Tabs/Tabs.js +62 -0
- package/dist/components/Tabs/Tabs.module.scss.js +17 -0
- package/dist/components/Tabs/tabsUtils.js +17 -0
- package/dist/components/Tag/Tag.js +49 -0
- package/dist/components/Tag/Tag.module.scss.js +25 -0
- package/dist/components/Tag/tagVariants.js +5 -0
- package/dist/components/TextHoverable/TextHoverable.js +14 -0
- package/dist/components/TextHoverable/TextHoverable.module.scss.js +9 -0
- package/dist/components/Toggle/Toggle.js +59 -0
- package/dist/components/Toggle/Toggle.module.scss.js +21 -0
- package/dist/components/Tooltip/Tooltip.js +103 -0
- package/dist/components/Tooltip/Tooltip.module.scss.js +39 -0
- package/dist/components/Tooltip/useTooltipPositioning.js +60 -0
- package/dist/components/icons-v2/AdIcon.js +48 -0
- package/dist/components/icons-v2/AddMessageIcon.js +37 -0
- package/dist/components/icons-v2/AddUserIcon.js +47 -0
- package/dist/components/icons-v2/AdjustmentsIcon.js +15 -0
- package/dist/components/icons-v2/AlertIcon.js +37 -0
- package/dist/components/icons-v2/AlignCenterIcon.js +47 -0
- package/dist/components/icons-v2/AlignHorizontallyIcon.js +47 -0
- package/dist/components/icons-v2/AlignJustifyIcon.js +47 -0
- package/dist/components/icons-v2/AlignLeftIcon.js +47 -0
- package/dist/components/icons-v2/AlignRightIcon.js +47 -0
- package/dist/components/icons-v2/AlignVerticallyIcon.js +47 -0
- package/dist/components/icons-v2/AlphabetIcon.js +37 -0
- package/dist/components/icons-v2/ArchiveIcon.js +37 -0
- package/dist/components/icons-v2/ArrowDownIcon.js +37 -0
- package/dist/components/icons-v2/ArrowDownRightIcon.js +15 -0
- package/dist/components/icons-v2/ArrowLeftIcon.js +37 -0
- package/dist/components/icons-v2/ArrowMoveDownIcon.js +37 -0
- package/dist/components/icons-v2/ArrowRightIcon.js +37 -0
- package/dist/components/icons-v2/ArrowUpIcon.js +37 -0
- package/dist/components/icons-v2/AttributesEvaluationIcon.js +77 -0
- package/dist/components/icons-v2/BellIcon.js +15 -0
- package/dist/components/icons-v2/BoldIcon.js +27 -0
- package/dist/components/icons-v2/BoltIcon.js +15 -0
- package/dist/components/icons-v2/BookIcon.js +15 -0
- package/dist/components/icons-v2/BookmarkIcon.js +15 -0
- package/dist/components/icons-v2/BooksIcon.js +77 -0
- package/dist/components/icons-v2/BoxIcon.js +15 -0
- package/dist/components/icons-v2/BugIcon.js +97 -0
- package/dist/components/icons-v2/CalendarIcon.js +47 -0
- package/dist/components/icons-v2/CameraPlusIcon.js +15 -0
- package/dist/components/icons-v2/CardsIcon.js +15 -0
- package/dist/components/icons-v2/CellIcon.js +15 -0
- package/dist/components/icons-v2/ChartbarIcon.js +47 -0
- package/dist/components/icons-v2/ChartbarOffIcon.js +15 -0
- package/dist/components/icons-v2/ChatBubbleIcon.js +15 -0
- package/dist/components/icons-v2/ChatbotIcon.js +15 -0
- package/dist/components/icons-v2/CheckCircleIcon.js +27 -0
- package/dist/components/icons-v2/CheckboxIcon.js +27 -0
- package/dist/components/icons-v2/CheckmarkDoubleIcon.js +27 -0
- package/dist/components/icons-v2/CheckmarkLargeIcon.js +15 -0
- package/dist/components/icons-v2/ChevronDownIcon.js +15 -0
- package/dist/components/icons-v2/ChevronLeftIcon.js +15 -0
- package/dist/components/icons-v2/ChevronRightIcon.js +15 -0
- package/dist/components/icons-v2/ChevronUpIcon.js +15 -0
- package/dist/components/icons-v2/ChevronsDownIcon.js +27 -0
- package/dist/components/icons-v2/ChevronsLeftIcon.js +27 -0
- package/dist/components/icons-v2/ChevronsRightIcon.js +27 -0
- package/dist/components/icons-v2/ChevronsUpIcon.js +27 -0
- package/dist/components/icons-v2/CircleIcon.js +12 -0
- package/dist/components/icons-v2/CirclesIcon.js +37 -0
- package/dist/components/icons-v2/ClickIcon.js +67 -0
- package/dist/components/icons-v2/ClipboardIcon.js +27 -0
- package/dist/components/icons-v2/ClockIcon.js +27 -0
- package/dist/components/icons-v2/ClockShareIcon.js +15 -0
- package/dist/components/icons-v2/CloseIcon.js +37 -0
- package/dist/components/icons-v2/CopyIcon.js +27 -0
- package/dist/components/icons-v2/CreditCardIcon.js +15 -0
- package/dist/components/icons-v2/CropIcon.js +27 -0
- package/dist/components/icons-v2/DashboardMeterIcon.js +37 -0
- package/dist/components/icons-v2/DatabaseCheckIcon.js +47 -0
- package/dist/components/icons-v2/DatabaseIcon.js +37 -0
- package/dist/components/icons-v2/DeleteIcon.js +47 -0
- package/dist/components/icons-v2/DetailsIcon.js +47 -0
- package/dist/components/icons-v2/DevicesIcon.js +37 -0
- package/dist/components/icons-v2/DislikeIcon.js +15 -0
- package/dist/components/icons-v2/DollarIcon.js +15 -0
- package/dist/components/icons-v2/DownloadIcon.js +15 -0
- package/dist/components/icons-v2/DragToolIcon.js +73 -0
- package/dist/components/icons-v2/DrawRectangleIcon.js +87 -0
- package/dist/components/icons-v2/EditIcon.js +27 -0
- package/dist/components/icons-v2/EmailIcon.js +27 -0
- package/dist/components/icons-v2/EmojiNeutralIcon.js +15 -0
- package/dist/components/icons-v2/EmojiSadIcon.js +15 -0
- package/dist/components/icons-v2/EmojiSlightSmileyIcon.js +15 -0
- package/dist/components/icons-v2/EmojiSmileyIcon.js +47 -0
- package/dist/components/icons-v2/EmojiVerySadIcon.js +15 -0
- package/dist/components/icons-v2/EraserIcon.js +27 -0
- package/dist/components/icons-v2/EtShelfIcon.js +127 -0
- package/dist/components/icons-v2/EtStandaloneIcon.js +57 -0
- package/dist/components/icons-v2/ExternalLinkIcon.js +15 -0
- package/dist/components/icons-v2/FileExportIcon.js +27 -0
- package/dist/components/icons-v2/FileIcon.js +27 -0
- package/dist/components/icons-v2/FileImportIcon.js +27 -0
- package/dist/components/icons-v2/FileNewIcon.js +47 -0
- package/dist/components/icons-v2/FileRemoveIcon.js +37 -0
- package/dist/components/icons-v2/FileTemplateIcon.js +15 -0
- package/dist/components/icons-v2/FileUploadIcon.js +15 -0
- package/dist/components/icons-v2/FilesIcon.js +15 -0
- package/dist/components/icons-v2/FilterOffIcon.js +27 -0
- package/dist/components/icons-v2/FilterOnIcon.js +15 -0
- package/dist/components/icons-v2/FlagIcon.js +27 -0
- package/dist/components/icons-v2/FolderIcon.js +15 -0
- package/dist/components/icons-v2/FullscreenIcon.js +15 -0
- package/dist/components/icons-v2/GridviewIcon.js +47 -0
- package/dist/components/icons-v2/HelpIcon.js +37 -0
- package/dist/components/icons-v2/HomeIcon.js +27 -0
- package/dist/components/icons-v2/ImageIcon.js +15 -0
- package/dist/components/icons-v2/ImageOffIcon.js +15 -0
- package/dist/components/icons-v2/ImageStarIcon.js +15 -0
- package/dist/components/icons-v2/ImageUploadIcon.js +15 -0
- package/dist/components/icons-v2/InfoIcon.js +37 -0
- package/dist/components/icons-v2/ItalicIcon.js +37 -0
- package/dist/components/icons-v2/LanguageIcon.js +15 -0
- package/dist/components/icons-v2/LaunchIcon.js +37 -0
- package/dist/components/icons-v2/LayersIcon.js +37 -0
- package/dist/components/icons-v2/LeftSidebarCollapseIcon.js +15 -0
- package/dist/components/icons-v2/LeftSidebarExpandIcon.js +15 -0
- package/dist/components/icons-v2/LightDarkIcon.js +67 -0
- package/dist/components/icons-v2/LightbulbIcon.js +37 -0
- package/dist/components/icons-v2/LikeIcon.js +15 -0
- package/dist/components/icons-v2/LinkIcon.js +27 -0
- package/dist/components/icons-v2/ListViewIcon.js +67 -0
- package/dist/components/icons-v2/LoaderIcon.js +90 -0
- package/dist/components/icons-v2/LoadingIcon.js +70 -0
- package/dist/components/icons-v2/LockIcon.js +27 -0
- package/dist/components/icons-v2/LockOffIcon.js +27 -0
- package/dist/components/icons-v2/LoginIcon.js +37 -0
- package/dist/components/icons-v2/LogoutIcon.js +37 -0
- package/dist/components/icons-v2/MagicwandIcon.js +15 -0
- package/dist/components/icons-v2/MaximizeIcon.js +47 -0
- package/dist/components/icons-v2/MenuIcon.js +37 -0
- package/dist/components/icons-v2/MessageIcon.js +37 -0
- package/dist/components/icons-v2/MeterIcon.js +97 -0
- package/dist/components/icons-v2/MinimizeIcon.js +47 -0
- package/dist/components/icons-v2/MinusIcon.js +15 -0
- package/dist/components/icons-v2/MoreHorizontalIcon.js +40 -0
- package/dist/components/icons-v2/MoreIcon.js +40 -0
- package/dist/components/icons-v2/MouseIcon.js +27 -0
- package/dist/components/icons-v2/MoveIcon.js +67 -0
- package/dist/components/icons-v2/Multiplier05Icon.js +15 -0
- package/dist/components/icons-v2/Multiplier10Icon.js +15 -0
- package/dist/components/icons-v2/Multiplier15Icon.js +15 -0
- package/dist/components/icons-v2/Multiplier20Icon.js +15 -0
- package/dist/components/icons-v2/NoteIcon.js +47 -0
- package/dist/components/icons-v2/NoteOffIcon.js +57 -0
- package/dist/components/icons-v2/NotifyIcon.js +15 -0
- package/dist/components/icons-v2/PackAIIcon.js +27 -0
- package/dist/components/icons-v2/PaperclipIcon.js +15 -0
- package/dist/components/icons-v2/PauseIcon.js +27 -0
- package/dist/components/icons-v2/PdfIcon.js +67 -0
- package/dist/components/icons-v2/PentoolIcon.js +47 -0
- package/dist/components/icons-v2/PiechartIcon.js +27 -0
- package/dist/components/icons-v2/PinIcon.js +37 -0
- package/dist/components/icons-v2/PinskewedIcon.js +37 -0
- package/dist/components/icons-v2/PlayIcon.js +15 -0
- package/dist/components/icons-v2/PlusIcon.js +27 -0
- package/dist/components/icons-v2/PredictiveETIcon.js +77 -0
- package/dist/components/icons-v2/RedoIcon.js +27 -0
- package/dist/components/icons-v2/RefreshAlertIcon.js +15 -0
- package/dist/components/icons-v2/RefreshIcon.js +15 -0
- package/dist/components/icons-v2/ReplaceIcon.js +15 -0
- package/dist/components/icons-v2/ReplyIcon.js +13 -0
- package/dist/components/icons-v2/SaveIcon.js +37 -0
- package/dist/components/icons-v2/ScalesIcon.js +57 -0
- package/dist/components/icons-v2/SearchIcon.js +27 -0
- package/dist/components/icons-v2/SendIcon.js +27 -0
- package/dist/components/icons-v2/SettingsIcon.js +27 -0
- package/dist/components/icons-v2/ShareIcon.js +27 -0
- package/dist/components/icons-v2/ShoppingIcon.js +47 -0
- package/dist/components/icons-v2/SlideshowIcon.js +77 -0
- package/dist/components/icons-v2/SocialFacebookIcon.js +15 -0
- package/dist/components/icons-v2/SocialInstagramIcon.js +37 -0
- package/dist/components/icons-v2/SocialSnapchatIcon.js +15 -0
- package/dist/components/icons-v2/SocialTiktok2Icon.js +15 -0
- package/dist/components/icons-v2/SocialTiktokIcon.js +15 -0
- package/dist/components/icons-v2/SocialXIcon.js +27 -0
- package/dist/components/icons-v2/SocialYoutubeIcon.js +27 -0
- package/dist/components/icons-v2/SortHorizontalIcon.js +77 -0
- package/dist/components/icons-v2/StarIcon.js +15 -0
- package/dist/components/icons-v2/StopIcon.js +13 -0
- package/dist/components/icons-v2/SurveyIcon.js +37 -0
- package/dist/components/icons-v2/TableExportIcon.js +57 -0
- package/dist/components/icons-v2/TableIcon.js +37 -0
- package/dist/components/icons-v2/TableOptionsIcon.js +107 -0
- package/dist/components/icons-v2/TagIcon.js +27 -0
- package/dist/components/icons-v2/TargetArrowIcon.js +57 -0
- package/dist/components/icons-v2/TargetIcon.js +68 -0
- package/dist/components/icons-v2/TextRecognitionIcon.js +67 -0
- package/dist/components/icons-v2/TriangleFlagIcon.js +15 -0
- package/dist/components/icons-v2/TrophyIcon.js +15 -0
- package/dist/components/icons-v2/UnderlineIcon.js +27 -0
- package/dist/components/icons-v2/UndoIcon.js +27 -0
- package/dist/components/icons-v2/UnitBuyRateIcon.js +27 -0
- package/dist/components/icons-v2/UploadIcon.js +15 -0
- package/dist/components/icons-v2/UserGroupIcon.js +67 -0
- package/dist/components/icons-v2/UserIcon.js +27 -0
- package/dist/components/icons-v2/UsersIcon.js +47 -0
- package/dist/components/icons-v2/ValueBuyRateIcon.js +15 -0
- package/dist/components/icons-v2/VideoIcon.js +27 -0
- package/dist/components/icons-v2/ViewOffIcon.js +27 -0
- package/dist/components/icons-v2/ViewOnIcon.js +27 -0
- package/dist/components/icons-v2/VolumeOffIcon.js +15 -0
- package/dist/components/icons-v2/VolumeOnIcon.js +15 -0
- package/dist/components/icons-v2/WebIcon.js +57 -0
- package/dist/components/icons-v2/XIcon.js +27 -0
- package/dist/components/icons-v2/ZipFileIcon.js +15 -0
- package/dist/components/icons-v2/ZonePercentageIcon.js +107 -0
- package/dist/components/icons-v2/ZoomInIcon.js +47 -0
- package/dist/components/icons-v2/ZoomOutIcon.js +37 -0
- package/dist/components/icons-v2/constants.js +23 -0
- package/dist/components/icons-v2/createIcon.js +52 -0
- package/dist/components/icons-v2/createIcon.module.scss.js +15 -0
- package/dist/components/icons-v2/index.js +400 -0
- package/dist/hooks/useClickOutside.js +12 -0
- package/dist/hooks/useEscapeKey.js +13 -0
- package/dist/index.js +62 -0
- package/dist/style.css +1 -0
- package/package.json +56 -0
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { jsx as n, jsxs as C } from "react/jsx-runtime";
|
|
2
|
+
import { useId as y } from "react";
|
|
3
|
+
import E from "clsx";
|
|
4
|
+
import { useController as P } from "react-hook-form";
|
|
5
|
+
import r from "./InputFieldContainer.module.scss.js";
|
|
6
|
+
const k = (
|
|
7
|
+
/** @type {const} */
|
|
8
|
+
["default", "error"]
|
|
9
|
+
), A = ({
|
|
10
|
+
id: c,
|
|
11
|
+
label: i,
|
|
12
|
+
isRequiredField: f = !1,
|
|
13
|
+
validationStatus: e = "default",
|
|
14
|
+
disabled: a = !1,
|
|
15
|
+
computedInfoText: l,
|
|
16
|
+
children: d
|
|
17
|
+
}) => {
|
|
18
|
+
const u = !!l && `${l}`.trim().length > 0;
|
|
19
|
+
return /* @__PURE__ */ C(
|
|
20
|
+
"div",
|
|
21
|
+
{
|
|
22
|
+
className: E(
|
|
23
|
+
r.wrapper,
|
|
24
|
+
e === "error" && r.wrapperError,
|
|
25
|
+
a && r.disabledField
|
|
26
|
+
),
|
|
27
|
+
children: [
|
|
28
|
+
i ? /* @__PURE__ */ C("label", { className: r.label, htmlFor: c, children: [
|
|
29
|
+
i,
|
|
30
|
+
f ? /* @__PURE__ */ n("span", { className: r.requiredMark, children: "*" }) : null
|
|
31
|
+
] }) : null,
|
|
32
|
+
d,
|
|
33
|
+
u ? /* @__PURE__ */ n("div", { className: r.infoText, children: l }) : null
|
|
34
|
+
]
|
|
35
|
+
}
|
|
36
|
+
);
|
|
37
|
+
}, D = (c) => {
|
|
38
|
+
const i = (e) => {
|
|
39
|
+
const {
|
|
40
|
+
status: a = "default",
|
|
41
|
+
label: l,
|
|
42
|
+
infoText: d,
|
|
43
|
+
id: u,
|
|
44
|
+
name: o,
|
|
45
|
+
type: m = "text",
|
|
46
|
+
value: b,
|
|
47
|
+
defaultValue: S,
|
|
48
|
+
placeholder: B = "Text",
|
|
49
|
+
disabled: p = !1,
|
|
50
|
+
onChange: N = () => {
|
|
51
|
+
},
|
|
52
|
+
onBlur: v,
|
|
53
|
+
inputRef: F,
|
|
54
|
+
error: s,
|
|
55
|
+
rules: h,
|
|
56
|
+
required: q = !1,
|
|
57
|
+
"aria-label": R,
|
|
58
|
+
...T
|
|
59
|
+
} = e, I = y(), g = u ?? I, V = k.includes(a) ? a : "default", x = s != null && s.message ? "error" : V, j = (s == null ? void 0 : s.message) ?? d, w = !!(h != null && h.required) || q, t = { ...T };
|
|
60
|
+
return delete t.control, delete t.rules, delete t.invalid, delete t.defaultValues, v && (t.onBlur = v), F && (t.ref = F), /* @__PURE__ */ n(
|
|
61
|
+
A,
|
|
62
|
+
{
|
|
63
|
+
id: g,
|
|
64
|
+
label: l,
|
|
65
|
+
isRequiredField: w,
|
|
66
|
+
validationStatus: x,
|
|
67
|
+
disabled: p,
|
|
68
|
+
computedInfoText: j,
|
|
69
|
+
children: /* @__PURE__ */ n(
|
|
70
|
+
c,
|
|
71
|
+
{
|
|
72
|
+
...e,
|
|
73
|
+
id: g,
|
|
74
|
+
name: o,
|
|
75
|
+
type: m,
|
|
76
|
+
value: b,
|
|
77
|
+
defaultValue: S,
|
|
78
|
+
placeholder: B,
|
|
79
|
+
disabled: p,
|
|
80
|
+
onChange: N,
|
|
81
|
+
ariaLabel: R,
|
|
82
|
+
label: l,
|
|
83
|
+
inputProps: t,
|
|
84
|
+
validationStatus: x,
|
|
85
|
+
containerFieldClassName: r.field
|
|
86
|
+
}
|
|
87
|
+
)
|
|
88
|
+
}
|
|
89
|
+
);
|
|
90
|
+
}, f = (e) => {
|
|
91
|
+
const { control: a, name: l, rules: d, defaultValue: u } = e, { field: o, fieldState: m } = P({
|
|
92
|
+
name: l,
|
|
93
|
+
control: a,
|
|
94
|
+
rules: d,
|
|
95
|
+
defaultValue: u
|
|
96
|
+
});
|
|
97
|
+
return /* @__PURE__ */ n(
|
|
98
|
+
i,
|
|
99
|
+
{
|
|
100
|
+
...e,
|
|
101
|
+
name: l,
|
|
102
|
+
value: o.value,
|
|
103
|
+
onChange: o.onChange,
|
|
104
|
+
onBlur: o.onBlur,
|
|
105
|
+
inputRef: o.ref,
|
|
106
|
+
error: m.error
|
|
107
|
+
}
|
|
108
|
+
);
|
|
109
|
+
};
|
|
110
|
+
return (e) => e.control && e.name ? /* @__PURE__ */ n(f, { ...e }) : /* @__PURE__ */ n(i, { ...e });
|
|
111
|
+
};
|
|
112
|
+
export {
|
|
113
|
+
A as InputFieldContainer,
|
|
114
|
+
D as createField
|
|
115
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
const r = "_wrapper_fkxmy_1", e = "_label_fkxmy_8", _ = "_infoText_fkxmy_9", a = "_requiredMark_fkxmy_29", l = "_wrapperError_fkxmy_37", d = "_field_fkxmy_40", i = "_disabledField_fkxmy_67", o = {
|
|
2
|
+
wrapper: r,
|
|
3
|
+
label: e,
|
|
4
|
+
infoText: _,
|
|
5
|
+
requiredMark: a,
|
|
6
|
+
wrapperError: l,
|
|
7
|
+
field: d,
|
|
8
|
+
disabledField: i
|
|
9
|
+
};
|
|
10
|
+
export {
|
|
11
|
+
o as default,
|
|
12
|
+
i as disabledField,
|
|
13
|
+
d as field,
|
|
14
|
+
_ as infoText,
|
|
15
|
+
e as label,
|
|
16
|
+
a as requiredMark,
|
|
17
|
+
r as wrapper,
|
|
18
|
+
l as wrapperError
|
|
19
|
+
};
|
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
import { jsx as n, jsxs as $, Fragment as pe } from "react/jsx-runtime";
|
|
2
|
+
import { useState as z, useRef as me, useMemo as g } from "react";
|
|
3
|
+
import V from "./SelectField.module.scss.js";
|
|
4
|
+
import { createField as fe } from "../InputFieldContainer.js";
|
|
5
|
+
import { InputFieldContent as M } from "../InputField/InputField.js";
|
|
6
|
+
import { ChevronDownIcon as de } from "../../icons-v2/ChevronDownIcon.js";
|
|
7
|
+
import { ChevronUpIcon as ue } from "../../icons-v2/ChevronUpIcon.js";
|
|
8
|
+
import { LoadingIcon as ge } from "../../icons-v2/LoadingIcon.js";
|
|
9
|
+
import { SearchIcon as Se } from "../../icons-v2/SearchIcon.js";
|
|
10
|
+
import ve from "../../../hooks/useClickOutside.js";
|
|
11
|
+
import { DropdownList as he } from "../../DropdownList/DropdownList.js";
|
|
12
|
+
import { ExpandableItem as ye } from "../../ExpandableItem/ExpandableItem.js";
|
|
13
|
+
import { renderOptionRow as xe } from "./selectOptionRow.js";
|
|
14
|
+
import { SelectFieldTags as Ie } from "./SelectFieldTags.js";
|
|
15
|
+
import { normalizeSelectOptions as Oe, getEffectiveSelectValue as we, getSelectedOptions as Te, getSelectFieldDisplayValue as Fe, filterOptionsByQuery as H, toArrayValue as Q, filterSectionsByQuery as Ce, getNextToggleAllValues as be, getResolvedListItemType as ke, emitSelectChange as De, isOptionSelected as Be, areAllOptionsSelected as Ee } from "./selectUtils.js";
|
|
16
|
+
const Re = ({ isOpen: r }) => r ? /* @__PURE__ */ n(ue, {}) : /* @__PURE__ */ n(de, {}), Ae = ({
|
|
17
|
+
withSections: r,
|
|
18
|
+
sections: p,
|
|
19
|
+
flatOptionList: s,
|
|
20
|
+
searchValue: i,
|
|
21
|
+
listItemType: F,
|
|
22
|
+
value: l,
|
|
23
|
+
selectAllLabel: v,
|
|
24
|
+
onSelectOption: C,
|
|
25
|
+
onToggleAll: h
|
|
26
|
+
}) => {
|
|
27
|
+
const m = g(
|
|
28
|
+
() => Ce(p, i),
|
|
29
|
+
[p, i]
|
|
30
|
+
), y = g(
|
|
31
|
+
() => H(s, i),
|
|
32
|
+
[s, i]
|
|
33
|
+
), b = (t) => Be(l, t), S = (t, c = F, x = b, f = !1) => xe(t, c, x, C, h, f);
|
|
34
|
+
return /* @__PURE__ */ $(pe, { children: [
|
|
35
|
+
v ? S(
|
|
36
|
+
{ label: v },
|
|
37
|
+
"checkbox",
|
|
38
|
+
() => Ee(l, s),
|
|
39
|
+
!0
|
|
40
|
+
) : null,
|
|
41
|
+
r ? m.map((t) => /* @__PURE__ */ n(
|
|
42
|
+
ye,
|
|
43
|
+
{
|
|
44
|
+
title: t.sectionTitle,
|
|
45
|
+
defaultOpen: !0,
|
|
46
|
+
arrowPositionEnd: !0,
|
|
47
|
+
children: t.options.map((c) => /* @__PURE__ */ n("div", { children: S(c) }, `${t.sectionTitle}-${String(c.value)}`))
|
|
48
|
+
},
|
|
49
|
+
t.sectionTitle
|
|
50
|
+
)) : y.map((t) => /* @__PURE__ */ n("div", { children: S(t) }, String(t.value)))
|
|
51
|
+
] });
|
|
52
|
+
}, Ve = ({
|
|
53
|
+
id: r,
|
|
54
|
+
name: p,
|
|
55
|
+
value: s,
|
|
56
|
+
defaultValue: i,
|
|
57
|
+
placeholder: F = "Select",
|
|
58
|
+
disabled: l = !1,
|
|
59
|
+
onChange: v = () => {
|
|
60
|
+
},
|
|
61
|
+
ariaLabel: C,
|
|
62
|
+
label: h,
|
|
63
|
+
inputProps: m = {},
|
|
64
|
+
options: y = [],
|
|
65
|
+
size: b = "lg",
|
|
66
|
+
startIcon: S,
|
|
67
|
+
onEndIconClick: t,
|
|
68
|
+
containerFieldClassName: c,
|
|
69
|
+
multiSelect: x = !1,
|
|
70
|
+
tags: f = !1,
|
|
71
|
+
tagsWrap: U = !1,
|
|
72
|
+
search: q = !1,
|
|
73
|
+
onSearchChange: k = () => {
|
|
74
|
+
},
|
|
75
|
+
onLoadMore: G,
|
|
76
|
+
optionsLoading: J = !1,
|
|
77
|
+
selectAllLabel: W = null,
|
|
78
|
+
listItemType: X = null,
|
|
79
|
+
dir: Y = "down",
|
|
80
|
+
dropdownMaxHeight: Z
|
|
81
|
+
}) => {
|
|
82
|
+
const d = !!(x || f), _ = !!(q || f), P = !!(f && d), ee = ke({
|
|
83
|
+
multiSelect: x,
|
|
84
|
+
tags: f,
|
|
85
|
+
listItemType: X
|
|
86
|
+
}), [D, B] = z(!1), [I, O] = z(""), L = me(null), w = r ? `${r}-listbox` : void 0;
|
|
87
|
+
ve(L, () => {
|
|
88
|
+
B(!1), O("");
|
|
89
|
+
});
|
|
90
|
+
const {
|
|
91
|
+
withSections: te,
|
|
92
|
+
sections: oe,
|
|
93
|
+
options: a
|
|
94
|
+
} = g(() => Oe(y), [y]), u = g(
|
|
95
|
+
() => we(s, i),
|
|
96
|
+
[s, i]
|
|
97
|
+
), K = g(
|
|
98
|
+
() => Te(u, a),
|
|
99
|
+
[u, a]
|
|
100
|
+
), ne = Fe(s, i, a), le = g(
|
|
101
|
+
() => H(a, I),
|
|
102
|
+
[a, I]
|
|
103
|
+
), E = (e) => {
|
|
104
|
+
const o = d ? e : e[0] ?? "";
|
|
105
|
+
De(v, o);
|
|
106
|
+
}, N = (e) => {
|
|
107
|
+
const o = Q(u), R = o.map((A) => String(A)), j = String(e), ae = R.includes(j) ? o.filter((A) => String(A) !== j) : [...o, e];
|
|
108
|
+
E(d ? ae : [e]), d || (B(!1), O(""));
|
|
109
|
+
}, ie = (e) => {
|
|
110
|
+
if (l) return;
|
|
111
|
+
const o = Q(u).filter((R) => String(R) !== String(e));
|
|
112
|
+
E(o);
|
|
113
|
+
}, re = P && K.length > 0 ? /* @__PURE__ */ n(
|
|
114
|
+
Ie,
|
|
115
|
+
{
|
|
116
|
+
options: K,
|
|
117
|
+
wrap: U,
|
|
118
|
+
disabled: l,
|
|
119
|
+
onRemove: ie
|
|
120
|
+
}
|
|
121
|
+
) : null, T = () => {
|
|
122
|
+
l || (B((e) => !e), O(""));
|
|
123
|
+
}, se = () => {
|
|
124
|
+
d && E(be(u, a));
|
|
125
|
+
}, ce = () => {
|
|
126
|
+
if (t) {
|
|
127
|
+
t();
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
T();
|
|
131
|
+
};
|
|
132
|
+
return /* @__PURE__ */ $("div", { className: V.wrapper, ref: L, children: [
|
|
133
|
+
/* @__PURE__ */ n(
|
|
134
|
+
M,
|
|
135
|
+
{
|
|
136
|
+
id: r,
|
|
137
|
+
name: p,
|
|
138
|
+
value: ne,
|
|
139
|
+
placeholder: F,
|
|
140
|
+
disabled: l,
|
|
141
|
+
onChange: () => {
|
|
142
|
+
},
|
|
143
|
+
startIcon: S,
|
|
144
|
+
endIcon: Re({ isOpen: D }),
|
|
145
|
+
onEndIconClick: ce,
|
|
146
|
+
onFieldClick: T,
|
|
147
|
+
onEnter: T,
|
|
148
|
+
size: b,
|
|
149
|
+
ariaLabel: C ?? (h ? void 0 : "select field"),
|
|
150
|
+
label: h,
|
|
151
|
+
containerFieldClassName: c,
|
|
152
|
+
content: re,
|
|
153
|
+
inputProps: {
|
|
154
|
+
readOnly: !0,
|
|
155
|
+
role: "combobox",
|
|
156
|
+
"aria-controls": w,
|
|
157
|
+
"aria-expanded": D,
|
|
158
|
+
"aria-haspopup": "listbox",
|
|
159
|
+
...m,
|
|
160
|
+
onKeyDown: (e) => {
|
|
161
|
+
var o;
|
|
162
|
+
e.key === " " && !l && (e.preventDefault(), T()), (o = m.onKeyDown) == null || o.call(m, e);
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
),
|
|
167
|
+
D ? /* @__PURE__ */ $(
|
|
168
|
+
he,
|
|
169
|
+
{
|
|
170
|
+
id: w,
|
|
171
|
+
dir: Y,
|
|
172
|
+
maxHeight: Z,
|
|
173
|
+
onLoadMore: G,
|
|
174
|
+
children: [
|
|
175
|
+
_ ? /* @__PURE__ */ n("div", { className: V.search, onClick: (e) => e.stopPropagation(), children: /* @__PURE__ */ n(
|
|
176
|
+
M,
|
|
177
|
+
{
|
|
178
|
+
id: w ? `${w}-search` : void 0,
|
|
179
|
+
name: p ? `${p}-search` : void 0,
|
|
180
|
+
value: I,
|
|
181
|
+
placeholder: "Search",
|
|
182
|
+
disabled: l,
|
|
183
|
+
ariaLabel: "Search options",
|
|
184
|
+
size: "sm",
|
|
185
|
+
onChange: (e) => {
|
|
186
|
+
O(e.target.value), k == null || k(e.target.value);
|
|
187
|
+
},
|
|
188
|
+
containerFieldClassName: c,
|
|
189
|
+
startIcon: /* @__PURE__ */ n(Se, {}),
|
|
190
|
+
inputProps: {
|
|
191
|
+
onKeyDown: (e) => {
|
|
192
|
+
if (e.key !== "Enter") return;
|
|
193
|
+
const o = le[0];
|
|
194
|
+
o && N(o.value);
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
) }) : null,
|
|
199
|
+
J ? /* @__PURE__ */ n("span", { className: V.spinning, children: /* @__PURE__ */ n(ge, {}) }) : /* @__PURE__ */ n(
|
|
200
|
+
Ae,
|
|
201
|
+
{
|
|
202
|
+
withSections: te,
|
|
203
|
+
sections: oe,
|
|
204
|
+
flatOptionList: a,
|
|
205
|
+
searchValue: I,
|
|
206
|
+
listItemType: ee,
|
|
207
|
+
value: u,
|
|
208
|
+
selectAllLabel: d ? W : null,
|
|
209
|
+
onSelectOption: N,
|
|
210
|
+
onToggleAll: se
|
|
211
|
+
}
|
|
212
|
+
)
|
|
213
|
+
]
|
|
214
|
+
}
|
|
215
|
+
) : null
|
|
216
|
+
] });
|
|
217
|
+
}, Ze = fe(Ve);
|
|
218
|
+
export {
|
|
219
|
+
Ze as SelectField
|
|
220
|
+
};
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { jsxs as D, jsx as l } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as h, useState as N, useLayoutEffect as j } from "react";
|
|
3
|
+
import E from "clsx";
|
|
4
|
+
import { Tag as f } from "../../Tag/Tag.js";
|
|
5
|
+
import { Tooltip as V } from "../../Tooltip/Tooltip.js";
|
|
6
|
+
import d from "./SelectFieldTags.module.scss.js";
|
|
7
|
+
const $ = (e) => {
|
|
8
|
+
const s = window.getComputedStyle(e);
|
|
9
|
+
return parseFloat(s.columnGap || s.gap) || 0;
|
|
10
|
+
}, C = (e, { containerWidth: s, gap: n, maxRows: i }) => s <= 0 ? !0 : !e.reduce(
|
|
11
|
+
(t, o) => {
|
|
12
|
+
if (t.exceeded) return t;
|
|
13
|
+
if (t.rowWidth === 0)
|
|
14
|
+
return { ...t, rowWidth: o };
|
|
15
|
+
if (t.rowWidth + n + o <= s)
|
|
16
|
+
return { ...t, rowWidth: t.rowWidth + n + o };
|
|
17
|
+
const a = t.row + 1;
|
|
18
|
+
return a > i ? { ...t, row: a, exceeded: !0 } : { row: a, rowWidth: o, exceeded: !1 };
|
|
19
|
+
},
|
|
20
|
+
{ row: 1, rowWidth: 0, exceeded: !1 }
|
|
21
|
+
).exceeded, A = ({ itemWidths: e, overflowWidth: s, containerWidth: n, gap: i, maxRows: u }) => {
|
|
22
|
+
const t = e.length;
|
|
23
|
+
if (t === 0) return 0;
|
|
24
|
+
const o = { containerWidth: n, gap: i, maxRows: u };
|
|
25
|
+
return C(e, o) ? t : Array.from({ length: t }, (c, m) => t - 1 - m).find(
|
|
26
|
+
(c) => C([...e.slice(0, c), s], o)
|
|
27
|
+
) ?? 0;
|
|
28
|
+
}, B = ({ label: e, onRemove: s, disabled: n }) => /* @__PURE__ */ l(
|
|
29
|
+
f,
|
|
30
|
+
{
|
|
31
|
+
label: e,
|
|
32
|
+
shape: "pill",
|
|
33
|
+
state: n ? "disabled" : "default",
|
|
34
|
+
onDismiss: n ? void 0 : (i) => {
|
|
35
|
+
i.stopPropagation(), s == null || s(i);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
), I = ({
|
|
39
|
+
options: e = [],
|
|
40
|
+
wrap: s = !1,
|
|
41
|
+
disabled: n = !1,
|
|
42
|
+
onRemove: i = () => {
|
|
43
|
+
}
|
|
44
|
+
}) => {
|
|
45
|
+
const u = h(null), t = h(null), o = h(null), [a, g] = N(e.length), c = `+${Math.max(e.length, 1)}`;
|
|
46
|
+
j(() => {
|
|
47
|
+
const r = u.current, w = t.current, v = o.current;
|
|
48
|
+
if (!r || !w || !v) return;
|
|
49
|
+
const b = () => {
|
|
50
|
+
const y = Array.from(w.children).map((T) => T.getBoundingClientRect().width), M = v.getBoundingClientRect().width, R = $(r), S = s ? 2 : 1;
|
|
51
|
+
g(
|
|
52
|
+
A({
|
|
53
|
+
itemWidths: y,
|
|
54
|
+
overflowWidth: M,
|
|
55
|
+
containerWidth: r.clientWidth,
|
|
56
|
+
gap: R,
|
|
57
|
+
maxRows: S
|
|
58
|
+
})
|
|
59
|
+
);
|
|
60
|
+
};
|
|
61
|
+
b();
|
|
62
|
+
const x = new ResizeObserver(b);
|
|
63
|
+
return x.observe(r), () => x.disconnect();
|
|
64
|
+
}, [e, s, c]);
|
|
65
|
+
const m = e.slice(0, a), p = Math.max(0, e.length - a), W = e.map((r) => r.label).join(", ");
|
|
66
|
+
return /* @__PURE__ */ D("div", { className: E(d.tags, s && d.tagsWrap), ref: u, children: [
|
|
67
|
+
/* @__PURE__ */ l("div", { className: d.tagsMeasure, "aria-hidden": !0, ref: t, children: e.map((r) => /* @__PURE__ */ l(
|
|
68
|
+
f,
|
|
69
|
+
{
|
|
70
|
+
label: r.label,
|
|
71
|
+
shape: "pill",
|
|
72
|
+
onDismiss: () => {
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
`measure-${String(r.value)}`
|
|
76
|
+
)) }),
|
|
77
|
+
/* @__PURE__ */ l("span", { className: d.tagsMeasure, "aria-hidden": !0, ref: o, children: /* @__PURE__ */ l(f, { label: c, shape: "pill", showDismiss: !1 }) }),
|
|
78
|
+
m.map((r) => /* @__PURE__ */ l(
|
|
79
|
+
B,
|
|
80
|
+
{
|
|
81
|
+
label: r.label,
|
|
82
|
+
disabled: n,
|
|
83
|
+
onRemove: () => i(r.value)
|
|
84
|
+
},
|
|
85
|
+
String(r.value)
|
|
86
|
+
)),
|
|
87
|
+
p > 0 ? /* @__PURE__ */ l(
|
|
88
|
+
V,
|
|
89
|
+
{
|
|
90
|
+
className: d.overflowTag,
|
|
91
|
+
content: W,
|
|
92
|
+
position: "top",
|
|
93
|
+
variant: "light",
|
|
94
|
+
maxWidth: 280,
|
|
95
|
+
disabled: n,
|
|
96
|
+
children: /* @__PURE__ */ l("span", { onClick: (r) => r.stopPropagation(), children: /* @__PURE__ */ l(
|
|
97
|
+
f,
|
|
98
|
+
{
|
|
99
|
+
label: `+${p}`,
|
|
100
|
+
shape: "pill",
|
|
101
|
+
showDismiss: !1,
|
|
102
|
+
state: n ? "disabled" : "default"
|
|
103
|
+
}
|
|
104
|
+
) })
|
|
105
|
+
}
|
|
106
|
+
) : null
|
|
107
|
+
] });
|
|
108
|
+
};
|
|
109
|
+
export {
|
|
110
|
+
I as SelectFieldTags
|
|
111
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
const a = "_tags_11rh6_1", s = "_tagsWrap_11rh6_13", t = "_tagsMeasure_11rh6_18", r = "_overflowTag_11rh6_30", e = {
|
|
2
|
+
tags: a,
|
|
3
|
+
tagsWrap: s,
|
|
4
|
+
tagsMeasure: t,
|
|
5
|
+
overflowTag: r
|
|
6
|
+
};
|
|
7
|
+
export {
|
|
8
|
+
e as default,
|
|
9
|
+
r as overflowTag,
|
|
10
|
+
a as tags,
|
|
11
|
+
t as tagsMeasure,
|
|
12
|
+
s as tagsWrap
|
|
13
|
+
};
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { Checkbox as h } from "../../Checkbox/Checkbox.js";
|
|
3
|
+
import { CheckmarkLargeIcon as o } from "../../icons-v2/CheckmarkLargeIcon.js";
|
|
4
|
+
import { InfoIcon as f } from "../../icons-v2/InfoIcon.js";
|
|
5
|
+
import { ListItem as m } from "../../ListItem/ListItem.js";
|
|
6
|
+
import { Tooltip as C } from "../../Tooltip/Tooltip.js";
|
|
7
|
+
const v = "var(--color--icon--default--default)", k = /* @__PURE__ */ a(o, { strokeColorOnHover: v }), n = {
|
|
8
|
+
horizontalSpacing: "xs",
|
|
9
|
+
verticalSpacing: "none"
|
|
10
|
+
}, T = (i, c, r, l, s, e = !1) => {
|
|
11
|
+
const d = {
|
|
12
|
+
trailing: r(i) ? [{ type: "checkmark", icon: k }] : [],
|
|
13
|
+
trailingDisplay: "always"
|
|
14
|
+
};
|
|
15
|
+
switch (c) {
|
|
16
|
+
case "checkbox":
|
|
17
|
+
return /* @__PURE__ */ a(
|
|
18
|
+
u,
|
|
19
|
+
{
|
|
20
|
+
...n,
|
|
21
|
+
title: i == null ? void 0 : i.label,
|
|
22
|
+
active: r(i),
|
|
23
|
+
checked: r(i),
|
|
24
|
+
disabled: i.disabled,
|
|
25
|
+
ariaLabel: i == null ? void 0 : i.label,
|
|
26
|
+
onChange: () => e ? s() : l(i == null ? void 0 : i.value)
|
|
27
|
+
}
|
|
28
|
+
);
|
|
29
|
+
case "info": {
|
|
30
|
+
const b = [
|
|
31
|
+
{
|
|
32
|
+
type: "info",
|
|
33
|
+
icon: i != null && i.infoTooltip ? /* @__PURE__ */ a(
|
|
34
|
+
C,
|
|
35
|
+
{
|
|
36
|
+
content: i.infoTooltip,
|
|
37
|
+
position: "bottom",
|
|
38
|
+
variant: "light",
|
|
39
|
+
showArrow: !0,
|
|
40
|
+
children: /* @__PURE__ */ a(f, {})
|
|
41
|
+
}
|
|
42
|
+
) : /* @__PURE__ */ a(f, {})
|
|
43
|
+
}
|
|
44
|
+
];
|
|
45
|
+
return r(i) && b.push({ type: "checkmark", icon: k }), /* @__PURE__ */ a(
|
|
46
|
+
m,
|
|
47
|
+
{
|
|
48
|
+
...n,
|
|
49
|
+
title: i == null ? void 0 : i.label,
|
|
50
|
+
active: r(i),
|
|
51
|
+
trailing: b,
|
|
52
|
+
trailingDisplay: "always",
|
|
53
|
+
disabled: i.disabled,
|
|
54
|
+
onClick: () => l(i == null ? void 0 : i.value)
|
|
55
|
+
}
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
default:
|
|
59
|
+
return /* @__PURE__ */ a(
|
|
60
|
+
m,
|
|
61
|
+
{
|
|
62
|
+
...n,
|
|
63
|
+
title: i == null ? void 0 : i.label,
|
|
64
|
+
disabled: i.disabled,
|
|
65
|
+
active: r(i),
|
|
66
|
+
...d,
|
|
67
|
+
onClick: () => l(i == null ? void 0 : i.value)
|
|
68
|
+
}
|
|
69
|
+
);
|
|
70
|
+
}
|
|
71
|
+
}, u = ({ title: i, active: c, checked: r, disabled: l, ariaLabel: s, onChange: e }) => /* @__PURE__ */ a(
|
|
72
|
+
m,
|
|
73
|
+
{
|
|
74
|
+
title: i,
|
|
75
|
+
active: c,
|
|
76
|
+
...n,
|
|
77
|
+
controlItem: /* @__PURE__ */ a(
|
|
78
|
+
h,
|
|
79
|
+
{
|
|
80
|
+
size: "lg",
|
|
81
|
+
checked: r,
|
|
82
|
+
disabled: l,
|
|
83
|
+
"aria-label": s,
|
|
84
|
+
onChange: e
|
|
85
|
+
}
|
|
86
|
+
),
|
|
87
|
+
onClick: e
|
|
88
|
+
}
|
|
89
|
+
);
|
|
90
|
+
export {
|
|
91
|
+
T as renderOptionRow
|
|
92
|
+
};
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
const f = (e) => typeof e == "string" || typeof e == "number" ? { value: e, label: String(e), disabled: !1 } : {
|
|
2
|
+
value: e == null ? void 0 : e.value,
|
|
3
|
+
label: (e == null ? void 0 : e.label) ?? (e == null ? void 0 : e.text) ?? String((e == null ? void 0 : e.value) ?? ""),
|
|
4
|
+
disabled: !!(e != null && e.disabled),
|
|
5
|
+
infoTooltip: e == null ? void 0 : e.infoTooltip
|
|
6
|
+
}, c = (e) => Array.isArray(e) ? e.filter(Boolean).map(f) : [], i = (e) => ({
|
|
7
|
+
sectionTitle: (e == null ? void 0 : e.sectionTitle) ?? (e == null ? void 0 : e.title) ?? "",
|
|
8
|
+
options: c((e == null ? void 0 : e.options) ?? [])
|
|
9
|
+
}), u = (e) => e && typeof e == "object" && !Array.isArray(e) && Array.isArray(e.options) && (e.sectionTitle != null || e.title != null), d = (e) => {
|
|
10
|
+
const r = { withSections: !1, sections: [], options: [] };
|
|
11
|
+
if (e == null) return r;
|
|
12
|
+
if (!Array.isArray(e) && typeof e == "object") {
|
|
13
|
+
const t = Object.values(e).filter(Boolean).map(i).filter((n) => n.sectionTitle && n.options.length > 0);
|
|
14
|
+
return {
|
|
15
|
+
withSections: t.length > 0,
|
|
16
|
+
sections: t,
|
|
17
|
+
options: t.flatMap((n) => n.options)
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
if (!Array.isArray(e)) return r;
|
|
21
|
+
if (e.some(u)) {
|
|
22
|
+
const t = e.filter(Boolean).map(i).filter((n) => n.sectionTitle && n.options.length > 0);
|
|
23
|
+
return {
|
|
24
|
+
withSections: !0,
|
|
25
|
+
sections: t,
|
|
26
|
+
options: t.flatMap((n) => n.options)
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
return {
|
|
30
|
+
withSections: !1,
|
|
31
|
+
sections: [],
|
|
32
|
+
options: c(e)
|
|
33
|
+
};
|
|
34
|
+
}, s = (e) => Array.isArray(e) ? e.filter((r) => r != null && `${r}`.length > 0) : e == null || e === "" ? [] : [e], y = (e, r) => e.find((t) => String(t.value) === String(r)), a = (e) => s(e).length > 0, g = (e) => {
|
|
35
|
+
if (e != null)
|
|
36
|
+
return Array.isArray(e) ? e.length > 0 ? e : void 0 : typeof e == "object" && "value" in e ? e.value : e;
|
|
37
|
+
}, S = (e, r) => {
|
|
38
|
+
if (a(e)) return e;
|
|
39
|
+
const t = g(r);
|
|
40
|
+
return t == null || Array.isArray(t) && t.length === 0 ? e : t;
|
|
41
|
+
}, A = (e, r) => s(e).map((t) => y(r, t)).filter(Boolean), b = (e, r) => A(e, r).map((t) => t.label).join(", "), m = (e, r, t) => {
|
|
42
|
+
const n = S(e, r), l = b(n, t);
|
|
43
|
+
return l || (!a(e) && r && typeof r == "object" && !Array.isArray(r) ? r.label ?? r.text ?? "" : "");
|
|
44
|
+
}, v = (e, r) => {
|
|
45
|
+
e(r);
|
|
46
|
+
}, h = (e, r) => {
|
|
47
|
+
const t = `${r}`.trim().toLowerCase();
|
|
48
|
+
return t ? e.filter((n) => {
|
|
49
|
+
var l;
|
|
50
|
+
return (l = n == null ? void 0 : n.label) == null ? void 0 : l.toLowerCase().includes(t);
|
|
51
|
+
}) : e;
|
|
52
|
+
}, w = (e, r) => e.map((t) => ({
|
|
53
|
+
...t,
|
|
54
|
+
options: h(t.options, r)
|
|
55
|
+
})).filter((t) => t.options.length > 0), o = (e, r) => {
|
|
56
|
+
if (r.length === 0) return !1;
|
|
57
|
+
const t = s(e).map((n) => String(n));
|
|
58
|
+
return r.every((n) => t.includes(String(n.value)));
|
|
59
|
+
}, B = (e, r) => o(e, r) ? [] : r.map((t) => t.value), T = ({ multiSelect: e, tags: r, listItemType: t }) => t || (e || r ? "checkbox" : null), O = (e, r) => s(e).map((t) => String(t)).includes(String(r == null ? void 0 : r.value));
|
|
60
|
+
export {
|
|
61
|
+
o as areAllOptionsSelected,
|
|
62
|
+
v as emitSelectChange,
|
|
63
|
+
h as filterOptionsByQuery,
|
|
64
|
+
w as filterSectionsByQuery,
|
|
65
|
+
S as getEffectiveSelectValue,
|
|
66
|
+
B as getNextToggleAllValues,
|
|
67
|
+
y as getOptionByValue,
|
|
68
|
+
T as getResolvedListItemType,
|
|
69
|
+
m as getSelectFieldDisplayValue,
|
|
70
|
+
b as getSelectedLabelsPreview,
|
|
71
|
+
A as getSelectedOptions,
|
|
72
|
+
a as hasSelectValue,
|
|
73
|
+
O as isOptionSelected,
|
|
74
|
+
d as normalizeSelectOptions,
|
|
75
|
+
g as resolveDefaultSelectValue,
|
|
76
|
+
s as toArrayValue
|
|
77
|
+
};
|