kui-complex 0.0.112 → 0.0.113
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/ButtonSelect/cjs/index.js +17 -31
- package/ButtonSelect/cjs/index.js.map +1 -1
- package/ButtonSelect/index.js +19 -33
- package/ButtonSelect/index.js.map +1 -1
- package/CalendarHeaderWithSelect/cjs/index.js +17 -31
- package/CalendarHeaderWithSelect/cjs/index.js.map +1 -1
- package/CalendarHeaderWithSelect/index.js +19 -33
- package/CalendarHeaderWithSelect/index.js.map +1 -1
- package/InputDropdown/cjs/index.js +10 -24
- package/InputDropdown/cjs/index.js.map +1 -1
- package/InputDropdown/index.d.ts +2 -1
- package/InputDropdown/index.js +12 -26
- package/InputDropdown/index.js.map +1 -1
- package/InputMultiSelect/cjs/index.js +17 -31
- package/InputMultiSelect/cjs/index.js.map +1 -1
- package/InputMultiSelect/index.js +19 -33
- package/InputMultiSelect/index.js.map +1 -1
- package/InputSelect/cjs/index.js +17 -31
- package/InputSelect/cjs/index.js.map +1 -1
- package/InputSelect/index.js +19 -33
- package/InputSelect/index.js.map +1 -1
- package/InputSelectBase/cjs/index.js +17 -31
- package/InputSelectBase/cjs/index.js.map +1 -1
- package/InputSelectBase/index.js +19 -33
- package/InputSelectBase/index.js.map +1 -1
- package/InputSelectDropdown/cjs/index.js +12 -26
- package/InputSelectDropdown/cjs/index.js.map +1 -1
- package/InputSelectDropdown/index.d.ts +2 -1
- package/InputSelectDropdown/index.js +14 -28
- package/InputSelectDropdown/index.js.map +1 -1
- package/InputSelectWithController/cjs/index.js +17 -31
- package/InputSelectWithController/cjs/index.js.map +1 -1
- package/InputSelectWithController/index.js +19 -33
- package/InputSelectWithController/index.js.map +1 -1
- package/InputWithAutocomplete/cjs/index.js +17 -29
- package/InputWithAutocomplete/cjs/index.js.map +1 -1
- package/InputWithAutocomplete/index.js +18 -30
- package/InputWithAutocomplete/index.js.map +1 -1
- package/InputWithDatePicker/cjs/index.js +17 -31
- package/InputWithDatePicker/cjs/index.js.map +1 -1
- package/InputWithDatePicker/index.js +18 -32
- package/InputWithDatePicker/index.js.map +1 -1
- package/SelectMonth/cjs/index.js +17 -31
- package/SelectMonth/cjs/index.js.map +1 -1
- package/SelectMonth/index.js +19 -33
- package/SelectMonth/index.js.map +1 -1
- package/SelectYear/cjs/index.js +17 -31
- package/SelectYear/cjs/index.js.map +1 -1
- package/SelectYear/index.js +19 -33
- package/SelectYear/index.js.map +1 -1
- package/TestForm/cjs/index.js +17 -31
- package/TestForm/cjs/index.js.map +1 -1
- package/TestForm/index.js +18 -32
- package/TestForm/index.js.map +1 -1
- package/cjs/index.js +26 -38
- package/cjs/index.js.map +1 -1
- package/index.d.ts +3 -1
- package/index.js +27 -39
- package/index.js.map +1 -1
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -130,13 +130,14 @@ type DesktopMenuPanelProps = {
|
|
|
130
130
|
declare const DesktopMenuPanel: React.ForwardRefExoticComponent<DesktopMenuPanelProps & React.RefAttributes<HTMLDivElement>>;
|
|
131
131
|
|
|
132
132
|
declare const InputDropdown: React.ForwardRefExoticComponent<Pick<{
|
|
133
|
+
input: React.ReactNode;
|
|
133
134
|
isOpen?: boolean | undefined;
|
|
134
135
|
handleClose: () => void;
|
|
135
136
|
buttonRef?: React.RefObject<HTMLDivElement> | undefined;
|
|
136
137
|
className?: string | undefined;
|
|
137
138
|
children: React.ReactNode | React.ReactNode[];
|
|
138
139
|
endComponent?: React.ReactNode;
|
|
139
|
-
} & kui_basic.GridProps, "color" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "slot" | "spellCheck" | "style" | "tabIndex" | "title" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "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" | "children" | "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" | "alignContent" | "alignItems" | "direction" | "xs" | "sm" | "md" | "lg" | "endComponent" | "spacing" | "item" | "container" | "justify" | "wrap" | "xl" | "isOpen" | "handleClose" | "buttonRef"> & React.RefAttributes<HTMLDivElement>>;
|
|
140
|
+
} & kui_basic.GridProps, "color" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "slot" | "spellCheck" | "style" | "tabIndex" | "title" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "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" | "children" | "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" | "input" | "alignContent" | "alignItems" | "direction" | "xs" | "sm" | "md" | "lg" | "endComponent" | "spacing" | "item" | "container" | "justify" | "wrap" | "xl" | "isOpen" | "handleClose" | "buttonRef"> & React.RefAttributes<HTMLDivElement>>;
|
|
140
141
|
|
|
141
142
|
interface InputWithMaskProps
|
|
142
143
|
extends Omit<InputWithMaskProps$1, "form"> {
|
|
@@ -157,6 +158,7 @@ interface InputWithControllerProps
|
|
|
157
158
|
declare const InputPassword: React.ForwardRefExoticComponent<InputWithControllerProps & React.RefAttributes<HTMLInputElement>>;
|
|
158
159
|
|
|
159
160
|
type InputSelectDropdownProps = {
|
|
161
|
+
input: ReactNode
|
|
160
162
|
options: OptionParams$1[]
|
|
161
163
|
inputRef: RefObject<HTMLInputElement | HTMLDivElement>
|
|
162
164
|
isOpenDropdown: boolean
|
package/index.js
CHANGED
|
@@ -6,7 +6,7 @@ import { css, Global } from '@emotion/react';
|
|
|
6
6
|
import * as React from 'react';
|
|
7
7
|
import { forwardRef, useEffect, useState, useRef } from 'react';
|
|
8
8
|
import { jsx, jsxs as jsxs$1, Fragment as Fragment$1 } from 'react/jsx-runtime';
|
|
9
|
-
import { Caption, theme, Button, Grid, Container, InputWithAdornments, Heading, InputWithMask as InputWithMask$1, IconButton, LinearProgress, Divider, Modal, Switch as Switch$1, InputWithCountryDropdown, Checkbox, Radio, InputMessage, CircularProgress, Box } from 'kui-basic';
|
|
9
|
+
import { Caption, theme, Button, Grid, Container, Tooltip as Tooltip$1, InputWithAdornments, Heading, InputWithMask as InputWithMask$1, IconButton, LinearProgress, Divider, Modal, Switch as Switch$1, InputWithCountryDropdown, Checkbox, Radio, InputMessage, CircularProgress, Box } from 'kui-basic';
|
|
10
10
|
import { updateQueryParams, useForkRef, strongPasswordRegExp, mediumPasswordRegExp, simplePasswordRegExp, useToggle, isValidWithMaskExp, useWindowWidth } from 'kui-utils';
|
|
11
11
|
import classNames from 'classnames';
|
|
12
12
|
import { DateTime } from 'luxon';
|
|
@@ -139,14 +139,14 @@ var largeAvatarCSS = function (_a) {
|
|
|
139
139
|
};
|
|
140
140
|
var StyledUndefinedAvatar = styled(UndefinedAvatar, {
|
|
141
141
|
shouldForwardProp: function (prop) { return prop !== "size"; },
|
|
142
|
-
})(templateObject_4$
|
|
142
|
+
})(templateObject_4$8 || (templateObject_4$8 = __makeTemplateObject(["\n ", ";\n"], ["\n ", ";\n"])), largeAvatarCSS);
|
|
143
143
|
var sizeStyles = {
|
|
144
144
|
xs: css(templateObject_5$4 || (templateObject_5$4 = __makeTemplateObject(["\n min-width: 24px;\n width: 24px;\n height: 24px;\n p {\n font-size: 10px;\n }\n "], ["\n min-width: 24px;\n width: 24px;\n height: 24px;\n p {\n font-size: 10px;\n }\n "]))),
|
|
145
145
|
s: css(templateObject_6$1 || (templateObject_6$1 = __makeTemplateObject(["\n min-width: 32px;\n width: 32px;\n height: 32px;\n "], ["\n min-width: 32px;\n width: 32px;\n height: 32px;\n "]))),
|
|
146
146
|
md: css(templateObject_7$1 || (templateObject_7$1 = __makeTemplateObject(["\n min-width: 40px;\n width: 40px;\n height: 40px;\n @media (max-width: 600px) {\n min-width: 32px;\n width: 32px;\n height: 32px;\n }\n "], ["\n min-width: 40px;\n width: 40px;\n height: 40px;\n @media (max-width: 600px) {\n min-width: 32px;\n width: 32px;\n height: 32px;\n }\n "]))),
|
|
147
147
|
lg: css(templateObject_8$1 || (templateObject_8$1 = __makeTemplateObject(["\n min-width: 80px;\n width: 80px;\n height: 80px;\n "], ["\n min-width: 80px;\n width: 80px;\n height: 80px;\n "]))),
|
|
148
148
|
};
|
|
149
|
-
var templateObject_1$G, templateObject_2$q, templateObject_3$c, templateObject_4$
|
|
149
|
+
var templateObject_1$G, templateObject_2$q, templateObject_3$c, templateObject_4$8, templateObject_5$4, templateObject_6$1, templateObject_7$1, templateObject_8$1;
|
|
150
150
|
|
|
151
151
|
var ButtonTab = forwardRef(function (_a, ref) {
|
|
152
152
|
var index = _a.index, onClick = _a.onClick, isActive = _a.isActive, label = _a.label;
|
|
@@ -183,23 +183,14 @@ var StyledWrapper$9 = styled(Container)(templateObject_3$b || (templateObject_3$
|
|
|
183
183
|
var templateObject_1$E, templateObject_2$o, templateObject_3$b;
|
|
184
184
|
|
|
185
185
|
var InputDropdown = forwardRef(function (props, ref) {
|
|
186
|
-
var isOpen = props.isOpen, handleClose = props.handleClose, buttonRef = props.buttonRef, children = props.children, endComponent = props.endComponent, otherProps = __rest(props, ["isOpen", "handleClose", "buttonRef", "children", "endComponent"]);
|
|
186
|
+
var isOpen = props.isOpen, handleClose = props.handleClose, buttonRef = props.buttonRef, children = props.children, endComponent = props.endComponent, input = props.input, otherProps = __rest(props, ["isOpen", "handleClose", "buttonRef", "children", "endComponent", "input"]);
|
|
187
187
|
var _a = useState(false), isScrollable = _a[0], setIsScrollable = _a[1];
|
|
188
188
|
var dropdownRef = useRef(null);
|
|
189
|
-
var
|
|
190
|
-
if (
|
|
191
|
-
|
|
192
|
-
!buttonRef.current.contains(e.target)) {
|
|
193
|
-
handleClose();
|
|
194
|
-
}
|
|
189
|
+
var handleChange = function (open) {
|
|
190
|
+
if (!open) {
|
|
191
|
+
handleClose();
|
|
195
192
|
}
|
|
196
193
|
};
|
|
197
|
-
useEffect(function () {
|
|
198
|
-
document.addEventListener("click", closePopUp);
|
|
199
|
-
return function () {
|
|
200
|
-
document.removeEventListener("click", closePopUp);
|
|
201
|
-
};
|
|
202
|
-
});
|
|
203
194
|
useEffect(function () {
|
|
204
195
|
var _a;
|
|
205
196
|
if (buttonRef === null || buttonRef === void 0 ? void 0 : buttonRef.current) {
|
|
@@ -216,9 +207,6 @@ var InputDropdown = forwardRef(function (props, ref) {
|
|
|
216
207
|
}
|
|
217
208
|
}
|
|
218
209
|
}, [isOpen]);
|
|
219
|
-
if (!isOpen) {
|
|
220
|
-
return null;
|
|
221
|
-
}
|
|
222
210
|
var forwardedRef = function (elem) {
|
|
223
211
|
if (typeof ref === "function")
|
|
224
212
|
ref(elem);
|
|
@@ -226,30 +214,28 @@ var InputDropdown = forwardRef(function (props, ref) {
|
|
|
226
214
|
ref.current = elem;
|
|
227
215
|
dropdownRef.current = elem;
|
|
228
216
|
};
|
|
229
|
-
return (jsxs$1(StyledDropdown$2, __assign({ "data-testid": "input_dropdown", container: true, ref: forwardedRef
|
|
217
|
+
return (jsx(StyledTooltip, __assign({ fullWidth: true, open: isOpen, onChange: handleChange, toggleMethod: "click", strategy: "fixed", placement: "bottom", content: jsxs$1(StyledDropdown$2, __assign({ "data-testid": "input_dropdown", container: true, ref: forwardedRef }, otherProps, { children: [jsx(StyledWrapper$8, __assign({ isScrollable: isScrollable }, { children: jsx(ScrollingContainer, __assign({ isScrollable: isScrollable, className: "KUI-InputDropdown_scroll" }, { children: children })) })), endComponent] })) }, { children: input })));
|
|
230
218
|
});
|
|
231
|
-
var
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
}, theme.palette.grey.zero);
|
|
235
|
-
var StyledWrapper$8 = styled.div(templateObject_2$n || (templateObject_2$n = __makeTemplateObject(["\n width: 100%;\n box-sizing: border-box;\n padding: ", ";\n"], ["\n width: 100%;\n box-sizing: border-box;\n padding: ", ";\n"])), function (_a) {
|
|
219
|
+
var StyledTooltip = styled(Tooltip$1)(templateObject_1$D || (templateObject_1$D = __makeTemplateObject(["\n .KUI-Popper {\n max-width: unset;\n > div {\n user-select: none;\n padding: 0;\n border-radius: 0 0 8px 8px;\n box-shadow: 0px 26px 34px 0px #0000001a;\n }\n }\n"], ["\n .KUI-Popper {\n max-width: unset;\n > div {\n user-select: none;\n padding: 0;\n border-radius: 0 0 8px 8px;\n box-shadow: 0px 26px 34px 0px #0000001a;\n }\n }\n"])));
|
|
220
|
+
var StyledDropdown$2 = styled(Grid)(templateObject_2$n || (templateObject_2$n = __makeTemplateObject(["\n width: 100%;\n user-select: none;\n"], ["\n width: 100%;\n user-select: none;\n"])));
|
|
221
|
+
var StyledWrapper$8 = styled.div(templateObject_3$a || (templateObject_3$a = __makeTemplateObject(["\n width: 100%;\n box-sizing: border-box;\n padding: ", ";\n"], ["\n width: 100%;\n box-sizing: border-box;\n padding: ", ";\n"])), function (_a) {
|
|
236
222
|
var isScrollable = _a.isScrollable;
|
|
237
223
|
return isScrollable ? "14px 8px 8px 0" : "14px 0px 8px 0";
|
|
238
224
|
});
|
|
239
|
-
var ScrollingContainer = styled.div(
|
|
225
|
+
var ScrollingContainer = styled.div(templateObject_4$7 || (templateObject_4$7 = __makeTemplateObject(["\n width: 100%;\n max-height: 389px;\n box-sizing: border-box;\n z-index: 3;\n overflow: auto;\n -ms-overflow-style: none;\n overflow-y: scroll;\n overflow-x: hidden;\n user-select: none;\n ::-webkit-scrollbar {\n width: ", ";\n position: absolute;\n right: 8px;\n }\n ::-webkit-scrollbar-track,\n ::-webkit-scrollbar-thumb {\n border-radius: 4px;\n transition: all ease-out 0.3s;\n }\n\n ::-webkit-resizer,\n ::-webkit-scrollbar-button,\n ::-webkit-scrollbar-corner {\n display: none;\n }\n ::-webkit-scrollbar-track {\n background: ", ";\n }\n\n ::-webkit-scrollbar-thumb {\n background: ", ";\n }\n"], ["\n width: 100%;\n max-height: 389px;\n box-sizing: border-box;\n z-index: 3;\n overflow: auto;\n -ms-overflow-style: none;\n overflow-y: scroll;\n overflow-x: hidden;\n user-select: none;\n ::-webkit-scrollbar {\n width: ", ";\n position: absolute;\n right: 8px;\n }\n ::-webkit-scrollbar-track,\n ::-webkit-scrollbar-thumb {\n border-radius: 4px;\n transition: all ease-out 0.3s;\n }\n\n ::-webkit-resizer,\n ::-webkit-scrollbar-button,\n ::-webkit-scrollbar-corner {\n display: none;\n }\n ::-webkit-scrollbar-track {\n background: ", ";\n }\n\n ::-webkit-scrollbar-thumb {\n background: ", ";\n }\n"])), function (_a) {
|
|
240
226
|
var isScrollable = _a.isScrollable;
|
|
241
227
|
return (isScrollable ? "4px" : "0px");
|
|
242
228
|
}, theme.palette.grey.fifteenB, theme.palette.grey.thirty);
|
|
243
|
-
var templateObject_1$D, templateObject_2$n, templateObject_3$a;
|
|
229
|
+
var templateObject_1$D, templateObject_2$n, templateObject_3$a, templateObject_4$7;
|
|
244
230
|
|
|
245
231
|
var InputSelectDropdown = forwardRef(function (_a, ref) {
|
|
246
|
-
var options = _a.options, inputRef = _a.inputRef, isOpenDropdown = _a.isOpenDropdown, handleCloseDropdown = _a.handleCloseDropdown, handleSelect = _a.handleSelect, selectedValue = _a.selectedValue, renderOption = _a.renderOption;
|
|
232
|
+
var input = _a.input, options = _a.options, inputRef = _a.inputRef, isOpenDropdown = _a.isOpenDropdown, handleCloseDropdown = _a.handleCloseDropdown, handleSelect = _a.handleSelect, selectedValue = _a.selectedValue, renderOption = _a.renderOption;
|
|
247
233
|
var handleClick = function (option) {
|
|
248
234
|
if (!option.disabled) {
|
|
249
235
|
handleSelect(option);
|
|
250
236
|
}
|
|
251
237
|
};
|
|
252
|
-
return (jsx(StyledDropdown$1, __assign({ buttonRef: inputRef, isOpen: isOpenDropdown, handleClose: handleCloseDropdown, ref: ref }, { children: options.map(function (option, key) { return (jsx(OptionWrapper, __assign({ disabled: option.disabled, onClick: function () { return handleClick(option); }, "data-value": "autocomplete_option_".concat(option.value), "data-testid": "autocomplete_option_".concat(key) }, { children: renderOption(option, selectedValue) }), option.label)); }) })));
|
|
238
|
+
return (jsx(StyledDropdown$1, __assign({ input: input, buttonRef: inputRef, isOpen: isOpenDropdown, handleClose: handleCloseDropdown, ref: ref }, { children: options.map(function (option, key) { return (jsx(OptionWrapper, __assign({ disabled: option.disabled, onClick: function () { return handleClick(option); }, "data-value": "autocomplete_option_".concat(option.value), "data-testid": "autocomplete_option_".concat(key) }, { children: renderOption(option, selectedValue) }), option.label)); }) })));
|
|
253
239
|
});
|
|
254
240
|
var OptionWrapper = styled.div(templateObject_1$C || (templateObject_1$C = __makeTemplateObject(["\n width: 100%;\n padding: 2px 0;\n cursor: ", ";\n p {\n color: ", ";\n }\n"], ["\n width: 100%;\n padding: 2px 0;\n cursor: ", ";\n p {\n color: ", ";\n }\n"])), function (_a) {
|
|
255
241
|
var disabled = _a.disabled;
|
|
@@ -282,12 +268,12 @@ var InputSelectBase = forwardRef(function (_a, ref) {
|
|
|
282
268
|
handleChange(option);
|
|
283
269
|
handleCloseDropdown();
|
|
284
270
|
};
|
|
285
|
-
return (jsxs(Wrapper$6, { children: [jsx$1("input", { name: name, autoComplete: "off", hidden: true }),
|
|
286
|
-
{ transition: "all linear .2s" },
|
|
287
|
-
isDropdownOpen && { transform: "rotate(180deg)" },
|
|
288
|
-
] }, iconProps))) })), options.length > 0 && !disabled && (jsx$1(InputSelectDropdown, { options: options, inputRef: {
|
|
271
|
+
return (jsxs(Wrapper$6, { children: [jsx$1("input", { name: name, autoComplete: "off", hidden: true }), options.length > 0 && !disabled && (jsx$1(InputSelectDropdown, { options: options, inputRef: {
|
|
289
272
|
current: (_b = inputRef === null || inputRef === void 0 ? void 0 : inputRef.current) === null || _b === void 0 ? void 0 : _b.parentElement,
|
|
290
|
-
}, isOpenDropdown: isDropdownOpen, handleCloseDropdown: handleCloseDropdown, handleSelect: handleSelect, selectedValue: selectedValue, renderOption: renderOption
|
|
273
|
+
}, isOpenDropdown: isDropdownOpen, handleCloseDropdown: handleCloseDropdown, handleSelect: handleSelect, selectedValue: selectedValue, renderOption: renderOption, input: jsx$1(StyledInput$3, __assign({ onClick: handleOpenDropdown, ref: forwardedRef, disabled: disabled, readOnly: true, value: selectedLabel, message: error, isDropdownOpen: isDropdownOpen, isLabelShrink: Boolean(selectedValue) || selectedValue === 0 }, inputProps, { endIcon: !disabled && (jsx$1(HalfArrowIcon, __assign({ width: 12, height: 13, css: [
|
|
274
|
+
{ transition: "all linear .2s" },
|
|
275
|
+
isDropdownOpen && { transform: "rotate(180deg)" },
|
|
276
|
+
] }, iconProps))) })) }))] }));
|
|
291
277
|
});
|
|
292
278
|
var Wrapper$6 = styled.div(templateObject_1$B || (templateObject_1$B = __makeTemplateObject(["\n position: relative;\n text-align: left;\n"], ["\n position: relative;\n text-align: left;\n"])));
|
|
293
279
|
var StyledInput$3 = styled(InputWithAdornments)(templateObject_2$l || (templateObject_2$l = __makeTemplateObject(["\n cursor: pointer;\n input,\n label {\n cursor: pointer !important;\n }\n .KUI-InputMessage {\n opacity: ", ";\n }\n"], ["\n cursor: pointer;\n input,\n label {\n cursor: pointer !important;\n }\n .KUI-InputMessage {\n opacity: ", ";\n }\n"])), function (_a) {
|
|
@@ -1313,7 +1299,7 @@ var templateObject_1$7;
|
|
|
1313
1299
|
|
|
1314
1300
|
function AutocompleteDropdown(props) {
|
|
1315
1301
|
var options = props.options, renderOption = props.renderOption, creatingLabel = props.creatingLabel, renderCreatingModal = props.renderCreatingModal;
|
|
1316
|
-
var inputRef = props.inputRef, isOpenDropdown = props.isOpenDropdown, isLoading = props.isLoading;
|
|
1302
|
+
var inputRef = props.inputRef, isOpenDropdown = props.isOpenDropdown, isLoading = props.isLoading, input = props.input;
|
|
1317
1303
|
var handleCloseDropdown = props.handleCloseDropdown, handleSelect = props.handleSelect, handleScrollEnd = props.handleScrollEnd;
|
|
1318
1304
|
var handleScroll = function (e) {
|
|
1319
1305
|
if (e.target.scrollHeight - (e.target.scrollTop + e.target.offsetHeight) <
|
|
@@ -1322,7 +1308,7 @@ function AutocompleteDropdown(props) {
|
|
|
1322
1308
|
handleScrollEnd();
|
|
1323
1309
|
}
|
|
1324
1310
|
};
|
|
1325
|
-
return (jsxs$1(StyledDropdown, __assign({ buttonRef: inputRef, isOpen: isOpenDropdown, handleClose: handleCloseDropdown, onScroll: handleScroll, endComponent: jsx(CreatingEntityFromDropdown, { creatingLabel: creatingLabel, renderCreatingModal: renderCreatingModal }) }, { children: [options.map(function (option, key) { return (jsx(AutocompleteOption$1, { option: option, renderOption: renderOption, handleSelect: handleSelect, index: key }, key)); }), isLoading && jsx(StyledLoading, { height: "auto" })] })));
|
|
1311
|
+
return (jsxs$1(StyledDropdown, __assign({ input: input, buttonRef: inputRef, isOpen: isOpenDropdown, handleClose: handleCloseDropdown, onScroll: handleScroll, endComponent: jsx(CreatingEntityFromDropdown, { creatingLabel: creatingLabel, renderCreatingModal: renderCreatingModal }) }, { children: [options.map(function (option, key) { return (jsx(AutocompleteOption$1, { option: option, renderOption: renderOption, handleSelect: handleSelect, index: key }, key)); }), isLoading && jsx(StyledLoading, { height: "auto" })] })));
|
|
1326
1312
|
}
|
|
1327
1313
|
var StyledDropdown = styled(InputDropdown)(templateObject_1$6 || (templateObject_1$6 = __makeTemplateObject(["\n .KUI-InputDropdown_scroll {\n max-height: 142px;\n padding: 0 4px;\n }\n"], ["\n .KUI-InputDropdown_scroll {\n max-height: 142px;\n padding: 0 4px;\n }\n"])));
|
|
1328
1314
|
var StyledLoading = styled(Loading)(templateObject_2$4 || (templateObject_2$4 = __makeTemplateObject(["\n position: sticky;\n bottom: 30px;\n"], ["\n position: sticky;\n bottom: 30px;\n"])));
|
|
@@ -1372,10 +1358,12 @@ function InputWithAutocomplete(_a) {
|
|
|
1372
1358
|
onOpen(isOpenDropdown);
|
|
1373
1359
|
}, [isOpenDropdown]);
|
|
1374
1360
|
var forwardRef = useForkRef(inputRef, inputRefProps);
|
|
1375
|
-
return (jsxs(StyledWrapper$3, { children: [isLabelLoading && (jsx$1(StyledLoadingWrapper, { children: jsx$1(Loading, { height: "100%" }) })), jsx$1(
|
|
1376
|
-
(!disabled && (jsx$1(StyledIcon, { width: 12, height: 13, css: [isOpenDropdown && { transform: "rotate(180deg)" }] })))] }))) })), jsx$1(AutocompleteDropdown, { renderOption: renderOption, options: options, inputRef: {
|
|
1361
|
+
return (jsxs(StyledWrapper$3, { children: [isLabelLoading && (jsx$1(StyledLoadingWrapper, { children: jsx$1(Loading, { height: "100%" }) })), jsx$1(AutocompleteDropdown, { renderOption: renderOption, options: options, inputRef: {
|
|
1377
1362
|
current: (_b = inputRef.current) === null || _b === void 0 ? void 0 : _b.parentElement,
|
|
1378
|
-
}, isOpenDropdown: isOpenDropdown, handleCloseDropdown: handleCloseDropdown, handleSelect: handleSelect, isLoading: isLoading, handleScrollEnd: handleScrollEnd, creatingLabel: creatingLabel, renderCreatingModal: renderCreatingModal }
|
|
1363
|
+
}, isOpenDropdown: isOpenDropdown, handleCloseDropdown: handleCloseDropdown, handleSelect: handleSelect, isLoading: isLoading, handleScrollEnd: handleScrollEnd, creatingLabel: creatingLabel, renderCreatingModal: renderCreatingModal, input: jsx$1(StyledInput$2, __assign({ form: form, onInput: handleSearch, onFocus: handleOpenDropdown, name: name, disabled: disabled, ref: forwardRef, isDropdownOpen: isOpenDropdown }, inputProps, { endIcon: !disabled && (jsxs(Grid, __assign({ container: true, alignItems: "center", onClick: handleDropdownToggle }, { children: [jsx$1(Box, __assign({ mr: 2 }, { children: endComponent })), inputProps.endIcon ||
|
|
1364
|
+
(!disabled && (jsx$1(StyledIcon, { width: 12, height: 13, css: [
|
|
1365
|
+
isOpenDropdown && { transform: "rotate(180deg)" },
|
|
1366
|
+
] })))] }))) })) })] }));
|
|
1379
1367
|
}
|
|
1380
1368
|
var StyledLoadingWrapper = styled.div(templateObject_1$5 || (templateObject_1$5 = __makeTemplateObject(["\n position: absolute;\n top: 0;\n left: 0;\n height: 100%;\n width: 100%;\n z-index: 1;\n"], ["\n position: absolute;\n top: 0;\n left: 0;\n height: 100%;\n width: 100%;\n z-index: 1;\n"])));
|
|
1381
1369
|
var StyledWrapper$3 = styled.div(templateObject_2$3 || (templateObject_2$3 = __makeTemplateObject(["\n position: relative;\n"], ["\n position: relative;\n"])));
|