@superdispatch/ui-lab 0.45.1 → 0.47.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.
@@ -0,0 +1,19 @@
1
+ import _objectSpread from "@babel/runtime/helpers/objectSpread2";
2
+ import { SvgIcon } from '@material-ui/core';
3
+ import { Color } from '@superdispatch/ui';
4
+ import { jsx as _jsx } from "react/jsx-runtime";
5
+ export function CloseIcon(props) {
6
+ return /*#__PURE__*/_jsx(SvgIcon, _objectSpread(_objectSpread({}, props), {}, {
7
+ viewBox: "0 0 6 6",
8
+ style: {
9
+ width: '6px',
10
+ height: '6px'
11
+ },
12
+ children: /*#__PURE__*/_jsx("path", {
13
+ fillRule: "evenodd",
14
+ clipRule: "evenodd",
15
+ d: "M3.72278 2.99999L5.91671 0.806074L5.19396 0.0833282L3.00004 2.27725L0.80612 0.0833282L0.083374 0.806076L2.27729 2.99999L0.083374 5.19391L0.80612 5.91666L3.00004 3.72274L5.19396 5.91666L5.91671 5.19392L3.72278 2.99999Z",
16
+ fill: Color.Dark100
17
+ })
18
+ }));
19
+ }
@@ -0,0 +1,97 @@
1
+ import _objectSpread from "@babel/runtime/helpers/objectSpread2";
2
+ import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
+ var _excluded = ["value", "onChange", "TextFieldProps"];
4
+ import { IconButton, TextField } from '@material-ui/core';
5
+ import { Autocomplete } from '@material-ui/lab';
6
+ import { Inline, Tag } from '@superdispatch/ui';
7
+ import { TextBox } from '@superdispatch/ui-lab';
8
+ import { forwardRef } from 'react';
9
+ import styled from 'styled-components';
10
+ import { CloseIcon } from "./CloseIcon.js";
11
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
12
+ var MultipleFieldText = /*#__PURE__*/styled(TextField).withConfig({
13
+ displayName: "EmailAutocomplete__MultipleFieldText",
14
+ componentId: "SD__sc-126rmmq-0"
15
+ })(["&{width:100%;margin-top:8px;overflow:hidden;}&& .MuiAutocomplete-inputRoot{flex-direction:column;align-items:flex-start;width:100%;gap:8px;& .MuiAutocomplete-input{width:100%;}}"]);
16
+ export var EmailAutocomplete = /*#__PURE__*/forwardRef((_ref, ref) => {
17
+ var {
18
+ value,
19
+ onChange: _onChange,
20
+ TextFieldProps
21
+ } = _ref,
22
+ props = _objectWithoutProperties(_ref, _excluded);
23
+ function handleDelete(index) {
24
+ var filteredOrders = value === null || value === void 0 ? void 0 : value.filter((_item, fieldIndex) => fieldIndex !== index);
25
+ void (_onChange === null || _onChange === void 0 ? void 0 : _onChange(filteredOrders, 'remove-option'));
26
+ }
27
+ return /*#__PURE__*/_jsx(Autocomplete, _objectSpread(_objectSpread({}, props), {}, {
28
+ ref: ref,
29
+ multiple: true,
30
+ freeSolo: true,
31
+ filterSelectedOptions: true,
32
+ disableClearable: true,
33
+ value: value,
34
+ filterOptions: _filterOptions => {
35
+ return _filterOptions.filter(option => option !== '');
36
+ },
37
+ onChange: (event, selectedValue) => {
38
+ var keyboardEvent = event;
39
+ var lastElement = selectedValue[selectedValue.length - 1];
40
+ if (keyboardEvent.key === 'Backspace') {
41
+ var removeLatesElement = value === null || value === void 0 ? void 0 : value.filter((_, index) => index < value.length - 1);
42
+ _onChange === null || _onChange === void 0 ? void 0 : _onChange(removeLatesElement, 'remove-option');
43
+ } else if (keyboardEvent.key === 'Enter' && lastElement) {
44
+ _onChange === null || _onChange === void 0 ? void 0 : _onChange([...(value || []), lastElement], 'select-option');
45
+ } else if (lastElement) {
46
+ var emails = lastElement.split(',').map(item => item.replace(' ', ''));
47
+ _onChange === null || _onChange === void 0 ? void 0 : _onChange(emails, 'select-option');
48
+ } else {
49
+ _onChange === null || _onChange === void 0 ? void 0 : _onChange(selectedValue, 'select-option');
50
+ }
51
+ },
52
+ renderTags: items => {
53
+ return /*#__PURE__*/_jsx(Inline, {
54
+ space: "xxsmall",
55
+ children: items.map((option, index) => {
56
+ return /*#__PURE__*/_jsx(Tag, {
57
+ color: "grey",
58
+ variant: "subtle",
59
+ children: /*#__PURE__*/_jsxs(Inline, {
60
+ space: "xxsmall",
61
+ children: [/*#__PURE__*/_jsx(TextBox, {
62
+ wrapOverflow: true,
63
+ color: "primary",
64
+ children: option
65
+ }), /*#__PURE__*/_jsx(IconButton, {
66
+ size: "small",
67
+ onClick: () => {
68
+ handleDelete(index);
69
+ },
70
+ children: /*#__PURE__*/_jsx(CloseIcon, {})
71
+ })]
72
+ })
73
+ }, index);
74
+ })
75
+ });
76
+ },
77
+ renderInput: params => /*#__PURE__*/_jsx(MultipleFieldText, _objectSpread(_objectSpread(_objectSpread({}, params), TextFieldProps), {}, {
78
+ multiline: true,
79
+ minRows: 2,
80
+ variant: "outlined",
81
+ fullWidth: true,
82
+ InputProps: _objectSpread(_objectSpread(_objectSpread({}, TextFieldProps === null || TextFieldProps === void 0 ? void 0 : TextFieldProps.InputProps), params.InputProps), {}, {
83
+ startAdornment: params.InputProps.startAdornment
84
+ }),
85
+ placeholder: "Enter individual emails on each line or separate them with comma (,)",
86
+ onChange: event => {
87
+ var text = event.target.value.replace(/,/g, '');
88
+ var hasCommaOrSpace = /,|\s/.test(event.target.value);
89
+ if (hasCommaOrSpace && text.trim() !== '') {
90
+ _onChange === null || _onChange === void 0 ? void 0 : _onChange([...(value || []), text.trim()], 'select-option');
91
+ }
92
+ }
93
+ }))
94
+ }));
95
+ });
96
+ if (process.env.NODE_ENV !== "production") EmailAutocomplete.displayName = "EmailAutocomplete";
97
+ EmailAutocomplete.displayName = 'EmailAutocomplete';
package/dist-src/index.js CHANGED
@@ -8,6 +8,7 @@ export * from "./chat/ChatMessage.js";
8
8
  export * from "./container/Container.js";
9
9
  export * from "./description-item/DescriptionItem.js";
10
10
  export * from "./description-line-item/DescriptionLineItem.js";
11
+ export * from "./email-autocomplate/EmailAutocomplete.js";
11
12
  export * from "./file-drop-zone/FileDropZone.js";
12
13
  export * from "./file-list-item/FileListItem.js";
13
14
  export * from "./flag-list/FlagList.js";
@@ -4,10 +4,11 @@ import { CSSTransition } from 'react-transition-group';
4
4
  import { CSSTransitionProps } from 'react-transition-group/CSSTransition';
5
5
  import { SpaceProp, NegativeSpaceProp, ResponsiveProp, ColorProp } from '@superdispatch/ui';
6
6
  import { Property } from 'csstype';
7
- import { ButtonBaseProps, AvatarProps, IconButtonProps, TooltipProps } from '@material-ui/core';
7
+ import { ButtonBaseProps, StandardTextFieldProps, AvatarProps, IconButtonProps, TooltipProps } from '@material-ui/core';
8
8
  import { PrimitiveDateInput } from '@superdispatch/dates';
9
9
  import { DateTime } from 'luxon';
10
10
  import { StyledComponent, DefaultTheme } from 'styled-components';
11
+ import { AutocompleteProps, AutocompleteChangeReason } from '@material-ui/lab';
11
12
  import { FileRejection } from 'react-dropzone';
12
13
 
13
14
  declare type AlertSeverityProp = 'positive' | 'info' | 'caution' | 'critical';
@@ -167,6 +168,15 @@ interface DescriptionLineItemProps {
167
168
  }
168
169
  declare const DescriptionLineItem: ForwardRefExoticComponent<DescriptionLineItemProps & RefAttributes<HTMLDivElement>>;
169
170
 
171
+ interface EmailAutocompleteProps extends Omit<AutocompleteProps<string, true, true, true>, 'onChange' | 'renderInput' | 'renderTags'> {
172
+ options: string[];
173
+ TextFieldProps?: StandardTextFieldProps;
174
+ onAdd?: (value: string) => void;
175
+ onRemove?: (value: string) => void;
176
+ onChange?: (value: string[] | undefined, reason: AutocompleteChangeReason) => void;
177
+ }
178
+ declare const EmailAutocomplete: ForwardRefExoticComponent<Pick<EmailAutocompleteProps, "className" | "style" | "classes" | "innerRef" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "slot" | "spellCheck" | "tabIndex" | "title" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "disabled" | "value" | "fullWidth" | "size" | "open" | "onClose" | "autoComplete" | "loading" | "multiple" | "disabledItemsFocusable" | "disableListWrap" | "disablePortal" | "options" | "onOpen" | "PopperComponent" | "closeText" | "disableCloseOnSelect" | "inputValue" | "filterOptions" | "freeSolo" | "includeInputInList" | "getOptionLabel" | "onInputChange" | "ChipProps" | "closeIcon" | "clearText" | "forcePopupIcon" | "getLimitTagsText" | "ListboxComponent" | "ListboxProps" | "loadingText" | "limitTags" | "noOptionsText" | "openText" | "PaperComponent" | "popupIcon" | "renderGroup" | "renderOption" | "autoHighlight" | "autoSelect" | "blurOnSelect" | "clearOnBlur" | "clearOnEscape" | "componentName" | "debug" | "disableClearable" | "filterSelectedOptions" | "getOptionDisabled" | "getOptionSelected" | "groupBy" | "handleHomeEndKeys" | "onHighlightChange" | "openOnFocus" | "selectOnFocus" | "TextFieldProps" | "onAdd" | "onRemove"> & RefAttributes<unknown>>;
179
+
170
180
  declare function toBytes(input: number, unit: 'kb' | 'mb' | 'gb'): number;
171
181
  declare function formatBytes(bytes: number): string;
172
182
  interface FileDropZoneProps {
@@ -419,4 +429,4 @@ interface TextBoxProps {
419
429
  }
420
430
  declare const TextBox: ForwardRefExoticComponent<TextBoxProps & RefAttributes<HTMLElement>>;
421
431
 
422
- export { Alert, AlertProps, AlertSeverityProp, AnchorButton, AnchorButtonProps, Banner, BorderRadiusProp, BorderWidthProp, Box, BoxProps, Button, ButtonArea, ButtonAreaProps, ButtonProps, ButtonSizeProp, ButtonVariantProp, Chat, ChatMessage, Container, ContainerProps, DescriptionItem, DescriptionItemProps, DescriptionLineItem, DottedLine, FileDropZone, FileDropZoneProps, FileListItem, FileListItemProps, FlagList, FlagListItem, LinkComponentProps, LinkedText, LinkedTextProps, MarginProp, MultilineText, MultilineTextProps, Navbar, NavbarAccordionOptions, NavbarAvatar, NavbarBadge, NavbarBottomBar, NavbarBottomBarItem, NavbarItem, NavbarItemOptions, NavbarItemProps, NavbarLabel, NavbarList, NavbarMenu, NavbarMenuItem, NavbarMenuItemOption, Sidebar, SidebarBackButton, SidebarContainer, SidebarContainerProps, SidebarContent, SidebarContentProps, SidebarDivider, SidebarMenuItem, SidebarMenuItemAction, SidebarMenuItemActionProps, SidebarMenuItemAvatar, SidebarMenuItemAvatarProps, SidebarMenuItemProps, SidebarProps, SidebarSubheader, SidebarSubheaderProps, TextAlignProp, TextBox, TextBoxProps, TextColorProp, TextDisplayProp, TextVariantProp, formatBytes, toBytes, useNavbarContext, useSidebarContext };
432
+ export { Alert, AlertProps, AlertSeverityProp, AnchorButton, AnchorButtonProps, Banner, BorderRadiusProp, BorderWidthProp, Box, BoxProps, Button, ButtonArea, ButtonAreaProps, ButtonProps, ButtonSizeProp, ButtonVariantProp, Chat, ChatMessage, Container, ContainerProps, DescriptionItem, DescriptionItemProps, DescriptionLineItem, DottedLine, EmailAutocomplete, FileDropZone, FileDropZoneProps, FileListItem, FileListItemProps, FlagList, FlagListItem, LinkComponentProps, LinkedText, LinkedTextProps, MarginProp, MultilineText, MultilineTextProps, Navbar, NavbarAccordionOptions, NavbarAvatar, NavbarBadge, NavbarBottomBar, NavbarBottomBarItem, NavbarItem, NavbarItemOptions, NavbarItemProps, NavbarLabel, NavbarList, NavbarMenu, NavbarMenuItem, NavbarMenuItemOption, Sidebar, SidebarBackButton, SidebarContainer, SidebarContainerProps, SidebarContent, SidebarContentProps, SidebarDivider, SidebarMenuItem, SidebarMenuItemAction, SidebarMenuItemActionProps, SidebarMenuItemAvatar, SidebarMenuItemAvatarProps, SidebarMenuItemProps, SidebarProps, SidebarSubheader, SidebarSubheaderProps, TextAlignProp, TextBox, TextBoxProps, TextColorProp, TextDisplayProp, TextVariantProp, formatBytes, toBytes, useNavbarContext, useSidebarContext };
package/dist-web/index.js CHANGED
@@ -1,15 +1,15 @@
1
1
  import { CheckCircle, Info, Error as Error$1, WarningRounded, Image, Refresh, Delete, Warning, Flag, Help, Menu, ExpandMore, MenuOpen, ArrowBack, OpenInNew } from '@material-ui/icons';
2
- import { Alert as Alert$1 } from '@material-ui/lab';
3
- import { ColorDynamic, parseResponsiveProp, isColorDynamicProp, parseSpaceProp, Stack, Color, Inline, mergeRefs, useUID, isEmptyReactNode, Columns, Column, CardButton, useResponsiveValue, ColorDark, useCollapseBreakpoint } from '@superdispatch/ui';
2
+ import { Alert as Alert$1, Autocomplete } from '@material-ui/lab';
3
+ import { ColorDynamic, parseResponsiveProp, isColorDynamicProp, parseSpaceProp, Stack, Color, Inline, mergeRefs, useUID, isEmptyReactNode, Columns, Column, Tag, CardButton, useResponsiveValue, ColorDark, useCollapseBreakpoint } from '@superdispatch/ui';
4
4
  import { forwardRef, useState, useEffect, Children, useRef, useLayoutEffect, Suspense, memo, useContext, createContext, useMemo, createElement } from 'react';
5
5
  import styled, { css, keyframes } from 'styled-components';
6
6
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
7
7
  import _objectSpread from '@babel/runtime/helpers/objectSpread2';
8
8
  import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
9
9
  import { CSSTransition } from 'react-transition-group';
10
- import { ButtonBase, Typography, CircularProgress, SvgIcon, Link, Tooltip, IconButton, BottomNavigation, BottomNavigationAction, alpha, Accordion, AccordionSummary, useTheme, useMediaQuery, Drawer, Avatar, MenuItem, Menu as Menu$1, Toolbar, AppBar, Divider as Divider$1, Checkbox } from '@material-ui/core';
10
+ import { ButtonBase, Typography, CircularProgress, SvgIcon, IconButton, TextField, Link, Tooltip, BottomNavigation, BottomNavigationAction, alpha, Accordion, AccordionSummary, useTheme, useMediaQuery, Drawer, Avatar, MenuItem, Menu as Menu$1, Toolbar, AppBar, Divider as Divider$1, Checkbox } from '@material-ui/core';
11
11
  import { formatDate } from '@superdispatch/dates';
12
- import { Box as Box$1 } from '@superdispatch/ui-lab';
12
+ import { Box as Box$1, TextBox as TextBox$1 } from '@superdispatch/ui-lab';
13
13
  import { mdiUpload, mdiFilePdfBox, mdiTextBox } from '@mdi/js';
14
14
  import Dropzone from 'react-dropzone';
15
15
  import { Anchorme } from 'react-anchorme';
@@ -860,7 +860,111 @@ var DescriptionLineItem = /*#__PURE__*/forwardRef((_ref, ref) => {
860
860
  if (process.env.NODE_ENV !== "production") DescriptionLineItem.displayName = "DescriptionLineItem";
861
861
  DescriptionLineItem.displayName = 'DescriptionLineItem';
862
862
 
863
- var _excluded$5 = ["disabled", "children", "hintText", "startIcon", "fallback", "accept", "maxSize", "maxFiles", "onDropRejected", "onDropAccepted"];
863
+ function CloseIcon(props) {
864
+ return /*#__PURE__*/jsx(SvgIcon, _objectSpread(_objectSpread({}, props), {}, {
865
+ viewBox: "0 0 6 6",
866
+ style: {
867
+ width: '6px',
868
+ height: '6px'
869
+ },
870
+ children: /*#__PURE__*/jsx("path", {
871
+ fillRule: "evenodd",
872
+ clipRule: "evenodd",
873
+ d: "M3.72278 2.99999L5.91671 0.806074L5.19396 0.0833282L3.00004 2.27725L0.80612 0.0833282L0.083374 0.806076L2.27729 2.99999L0.083374 5.19391L0.80612 5.91666L3.00004 3.72274L5.19396 5.91666L5.91671 5.19392L3.72278 2.99999Z",
874
+ fill: Color.Dark100
875
+ })
876
+ }));
877
+ }
878
+
879
+ var _excluded$5 = ["value", "onChange", "TextFieldProps"];
880
+ var MultipleFieldText = /*#__PURE__*/styled(TextField).withConfig({
881
+ displayName: "EmailAutocomplete__MultipleFieldText",
882
+ componentId: "SD__sc-126rmmq-0"
883
+ })(["&{width:100%;margin-top:8px;overflow:hidden;}&& .MuiAutocomplete-inputRoot{flex-direction:column;align-items:flex-start;width:100%;gap:8px;& .MuiAutocomplete-input{width:100%;}}"]);
884
+ var EmailAutocomplete = /*#__PURE__*/forwardRef((_ref, ref) => {
885
+ var {
886
+ value,
887
+ onChange: _onChange,
888
+ TextFieldProps
889
+ } = _ref,
890
+ props = _objectWithoutProperties(_ref, _excluded$5);
891
+ function handleDelete(index) {
892
+ var filteredOrders = value === null || value === void 0 ? void 0 : value.filter((_item, fieldIndex) => fieldIndex !== index);
893
+ void (_onChange === null || _onChange === void 0 ? void 0 : _onChange(filteredOrders, 'remove-option'));
894
+ }
895
+ return /*#__PURE__*/jsx(Autocomplete, _objectSpread(_objectSpread({}, props), {}, {
896
+ ref: ref,
897
+ multiple: true,
898
+ freeSolo: true,
899
+ filterSelectedOptions: true,
900
+ disableClearable: true,
901
+ value: value,
902
+ filterOptions: _filterOptions => {
903
+ return _filterOptions.filter(option => option !== '');
904
+ },
905
+ onChange: (event, selectedValue) => {
906
+ var keyboardEvent = event;
907
+ var lastElement = selectedValue[selectedValue.length - 1];
908
+ if (keyboardEvent.key === 'Backspace') {
909
+ var removeLatesElement = value === null || value === void 0 ? void 0 : value.filter((_, index) => index < value.length - 1);
910
+ _onChange === null || _onChange === void 0 ? void 0 : _onChange(removeLatesElement, 'remove-option');
911
+ } else if (keyboardEvent.key === 'Enter' && lastElement) {
912
+ _onChange === null || _onChange === void 0 ? void 0 : _onChange([...(value || []), lastElement], 'select-option');
913
+ } else if (lastElement) {
914
+ var emails = lastElement.split(',').map(item => item.replace(' ', ''));
915
+ _onChange === null || _onChange === void 0 ? void 0 : _onChange(emails, 'select-option');
916
+ } else {
917
+ _onChange === null || _onChange === void 0 ? void 0 : _onChange(selectedValue, 'select-option');
918
+ }
919
+ },
920
+ renderTags: items => {
921
+ return /*#__PURE__*/jsx(Inline, {
922
+ space: "xxsmall",
923
+ children: items.map((option, index) => {
924
+ return /*#__PURE__*/jsx(Tag, {
925
+ color: "grey",
926
+ variant: "subtle",
927
+ children: /*#__PURE__*/jsxs(Inline, {
928
+ space: "xxsmall",
929
+ children: [/*#__PURE__*/jsx(TextBox$1, {
930
+ wrapOverflow: true,
931
+ color: "primary",
932
+ children: option
933
+ }), /*#__PURE__*/jsx(IconButton, {
934
+ size: "small",
935
+ onClick: () => {
936
+ handleDelete(index);
937
+ },
938
+ children: /*#__PURE__*/jsx(CloseIcon, {})
939
+ })]
940
+ })
941
+ }, index);
942
+ })
943
+ });
944
+ },
945
+ renderInput: params => /*#__PURE__*/jsx(MultipleFieldText, _objectSpread(_objectSpread(_objectSpread({}, params), TextFieldProps), {}, {
946
+ multiline: true,
947
+ minRows: 2,
948
+ variant: "outlined",
949
+ fullWidth: true,
950
+ InputProps: _objectSpread(_objectSpread(_objectSpread({}, TextFieldProps === null || TextFieldProps === void 0 ? void 0 : TextFieldProps.InputProps), params.InputProps), {}, {
951
+ startAdornment: params.InputProps.startAdornment
952
+ }),
953
+ placeholder: "Enter individual emails on each line or separate them with comma (,)",
954
+ onChange: event => {
955
+ var text = event.target.value.replace(/,/g, '');
956
+ var hasCommaOrSpace = /,|\s/.test(event.target.value);
957
+ if (hasCommaOrSpace && text.trim() !== '') {
958
+ _onChange === null || _onChange === void 0 ? void 0 : _onChange([...(value || []), text.trim()], 'select-option');
959
+ }
960
+ }
961
+ }))
962
+ }));
963
+ });
964
+ if (process.env.NODE_ENV !== "production") EmailAutocomplete.displayName = "EmailAutocomplete";
965
+ EmailAutocomplete.displayName = 'EmailAutocomplete';
966
+
967
+ var _excluded$6 = ["disabled", "children", "hintText", "startIcon", "fallback", "accept", "maxSize", "maxFiles", "onDropRejected", "onDropAccepted"];
864
968
  function toBytes(input, unit) {
865
969
  if (unit === 'gb') return input * (1 << 30);
866
970
  if (unit === 'mb') return input * (1 << 20);
@@ -929,7 +1033,7 @@ var FileDropZone = /*#__PURE__*/forwardRef((props, ref) => {
929
1033
  onDropRejected: _onDropRejected,
930
1034
  onDropAccepted: _onDropAccepted
931
1035
  } = props,
932
- dropzoneProps = _objectWithoutProperties(props, _excluded$5);
1036
+ dropzoneProps = _objectWithoutProperties(props, _excluded$6);
933
1037
  return /*#__PURE__*/jsx(Suspense, {
934
1038
  fallback: fallback,
935
1039
  children: /*#__PURE__*/jsx(Dropzone, _objectSpread(_objectSpread({}, dropzoneProps), {}, {
@@ -1126,7 +1230,7 @@ var FlagList = /*#__PURE__*/forwardRef((_ref2, ref) => {
1126
1230
  });
1127
1231
  if (process.env.NODE_ENV !== "production") FlagList.displayName = "FlagList";
1128
1232
 
1129
- var _excluded$6 = ["variant", "showHelpIcon", "endAction", "children"];
1233
+ var _excluded$7 = ["variant", "showHelpIcon", "endAction", "children"];
1130
1234
  var IconContainer = /*#__PURE__*/styled.div.withConfig({
1131
1235
  displayName: "FlagListItem__IconContainer",
1132
1236
  componentId: "SD__sc-o5bqru-0"
@@ -1186,7 +1290,7 @@ var FlagListItem = /*#__PURE__*/forwardRef((_ref7, ref) => {
1186
1290
  endAction,
1187
1291
  children
1188
1292
  } = _ref7,
1189
- rest = _objectWithoutProperties(_ref7, _excluded$6);
1293
+ rest = _objectWithoutProperties(_ref7, _excluded$7);
1190
1294
  return /*#__PURE__*/jsxs(BannerListContainer, _objectSpread(_objectSpread({}, rest), {}, {
1191
1295
  ref: ref,
1192
1296
  $variant: variant,
@@ -1203,7 +1307,7 @@ var FlagListItem = /*#__PURE__*/forwardRef((_ref7, ref) => {
1203
1307
  });
1204
1308
  if (process.env.NODE_ENV !== "production") FlagListItem.displayName = "FlagListItem";
1205
1309
 
1206
- var _excluded$7 = ["color", "target", "rel"],
1310
+ var _excluded$8 = ["color", "target", "rel"],
1207
1311
  _excluded2$2 = ["children", "linkComponent"];
1208
1312
  var DefaultLinkComponent = /*#__PURE__*/forwardRef((_ref, ref) => {
1209
1313
  var {
@@ -1211,7 +1315,7 @@ var DefaultLinkComponent = /*#__PURE__*/forwardRef((_ref, ref) => {
1211
1315
  target = '_blank',
1212
1316
  rel = 'noreferrer noopener'
1213
1317
  } = _ref,
1214
- props = _objectWithoutProperties(_ref, _excluded$7);
1318
+ props = _objectWithoutProperties(_ref, _excluded$8);
1215
1319
  return /*#__PURE__*/jsx(Link, _objectSpread(_objectSpread({}, props), {}, {
1216
1320
  ref: ref,
1217
1321
  rel: rel,
@@ -1257,7 +1361,7 @@ function useNavbarContext() {
1257
1361
  return useContext(NavbarContext);
1258
1362
  }
1259
1363
 
1260
- var _excluded$8 = ["active", "hasBadge"];
1364
+ var _excluded$9 = ["active", "hasBadge"];
1261
1365
  var StyledBottomNavigation = /*#__PURE__*/styled(BottomNavigation).withConfig({
1262
1366
  displayName: "NavbarBottomBar__StyledBottomNavigation",
1263
1367
  componentId: "SD__sc-9z6v3k-0"
@@ -1301,7 +1405,7 @@ function NavbarBottomBar(_ref) {
1301
1405
  active,
1302
1406
  hasBadge
1303
1407
  } = _ref2,
1304
- item = _objectWithoutProperties(_ref2, _excluded$8);
1408
+ item = _objectWithoutProperties(_ref2, _excluded$9);
1305
1409
  return /*#__PURE__*/createElement(StyledBottomNavigationAction, _objectSpread(_objectSpread({}, item), {}, {
1306
1410
  key: item.value,
1307
1411
  icon: hasBadge ? /*#__PURE__*/jsxs(IconWrapper, {
@@ -1661,7 +1765,7 @@ function Navbar(_ref) {
1661
1765
  });
1662
1766
  }
1663
1767
 
1664
- var _excluded$9 = ["title", "subtitle", "children"];
1768
+ var _excluded$a = ["title", "subtitle", "children"];
1665
1769
  var StyledTypography = /*#__PURE__*/styled(Typography).withConfig({
1666
1770
  displayName: "NavbarAvatar__StyledTypography",
1667
1771
  componentId: "SD__sc-19q2zd0-0"
@@ -1672,7 +1776,7 @@ function NavbarAvatar(_ref) {
1672
1776
  subtitle,
1673
1777
  children
1674
1778
  } = _ref,
1675
- props = _objectWithoutProperties(_ref, _excluded$9);
1779
+ props = _objectWithoutProperties(_ref, _excluded$a);
1676
1780
  var {
1677
1781
  isNavbarExpanded
1678
1782
  } = useNavbarContext();
@@ -1882,7 +1986,7 @@ var SidebarContainer = /*#__PURE__*/forwardRef((_ref, ref) => {
1882
1986
  });
1883
1987
  if (process.env.NODE_ENV !== "production") SidebarContainer.displayName = "SidebarContainer";
1884
1988
 
1885
- var _excluded$a = ["onClick", "children"];
1989
+ var _excluded$b = ["onClick", "children"];
1886
1990
  function SidebarBackButton(_ref) {
1887
1991
  var {
1888
1992
  onClick: _onClick,
@@ -1890,7 +1994,7 @@ function SidebarBackButton(_ref) {
1890
1994
  fontSize: "small"
1891
1995
  })
1892
1996
  } = _ref,
1893
- props = _objectWithoutProperties(_ref, _excluded$a);
1997
+ props = _objectWithoutProperties(_ref, _excluded$b);
1894
1998
  var isCollapsed = useCollapseBreakpoint('sm');
1895
1999
  var {
1896
2000
  openSidebar
@@ -2256,5 +2360,5 @@ var SidebarSubheader = /*#__PURE__*/forwardRef((_ref, ref) => {
2256
2360
  });
2257
2361
  if (process.env.NODE_ENV !== "production") SidebarSubheader.displayName = "SidebarSubheader";
2258
2362
 
2259
- export { Alert, AnchorButton, Banner, Box, Button, ButtonArea, Chat, ChatMessage, Container, DescriptionItem, DescriptionLineItem, DottedLine, FileDropZone, FileListItem, FlagList, FlagListItem, LinkedText, MultilineText, Navbar, NavbarAvatar, NavbarBadge, NavbarBottomBar, NavbarItem, NavbarLabel, NavbarList, NavbarMenu, NavbarMenuItem, Sidebar, SidebarBackButton, SidebarContainer, SidebarContent, SidebarDivider, SidebarMenuItem, SidebarMenuItemAction, SidebarMenuItemAvatar, SidebarSubheader, TextBox, formatBytes, toBytes, useNavbarContext, useSidebarContext };
2363
+ export { Alert, AnchorButton, Banner, Box, Button, ButtonArea, Chat, ChatMessage, Container, DescriptionItem, DescriptionLineItem, DottedLine, EmailAutocomplete, FileDropZone, FileListItem, FlagList, FlagListItem, LinkedText, MultilineText, Navbar, NavbarAvatar, NavbarBadge, NavbarBottomBar, NavbarItem, NavbarLabel, NavbarList, NavbarMenu, NavbarMenuItem, Sidebar, SidebarBackButton, SidebarContainer, SidebarContent, SidebarDivider, SidebarMenuItem, SidebarMenuItemAction, SidebarMenuItemAvatar, SidebarSubheader, TextBox, formatBytes, toBytes, useNavbarContext, useSidebarContext };
2260
2364
  //# sourceMappingURL=index.js.map