kui-complex 0.0.24 → 0.0.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +8 -10
- package/dist/index.es.js +25 -10
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +24 -9
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import * as _emotion_react_jsx_runtime from '@emotion/react/jsx-runtime';
|
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import React__default, { RefObject, SVGProps, ReactNode } from 'react';
|
|
4
4
|
import * as kui_basic from 'kui-basic';
|
|
5
|
-
import { InputWithAdornmentsProps,
|
|
5
|
+
import { InputWithAdornmentsProps, InputWithMaskProps as InputWithMaskProps$1, SwitchProps, CaptionProps, InputWithCountryDropdownProps } from 'kui-basic';
|
|
6
6
|
import { UseFormReturn, FieldValues } from 'react-hook-form';
|
|
7
7
|
import * as react_datepicker from 'react-datepicker';
|
|
8
8
|
import * as _emotion_styled from '@emotion/styled';
|
|
@@ -109,15 +109,13 @@ type DesktopMenuPanelProps = {
|
|
|
109
109
|
|
|
110
110
|
declare const DesktopMenuPanel: ({ tabs, variant, ...other }: DesktopMenuPanelProps) => _emotion_react_jsx_runtime.JSX.Element;
|
|
111
111
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
} & GridProps
|
|
119
|
-
|
|
120
|
-
declare const InputDropdown: ({ isOpen, handleClose, buttonRef, children, ...otherProps }: InputDropdownProps) => _emotion_react_jsx_runtime.JSX.Element | null;
|
|
112
|
+
declare const InputDropdown: React.ForwardRefExoticComponent<Pick<{
|
|
113
|
+
isOpen?: boolean | undefined;
|
|
114
|
+
handleClose: () => void;
|
|
115
|
+
buttonRef?: React.RefObject<HTMLDivElement> | undefined;
|
|
116
|
+
className?: string | undefined;
|
|
117
|
+
children: React.ReactNode | React.ReactNode[];
|
|
118
|
+
} & 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" | "lg" | "isOpen" | "handleClose" | "buttonRef" | "spacing" | "item" | "container" | "justify" | "wrap" | "md" | "xl"> & React.RefAttributes<HTMLDivElement>>;
|
|
121
119
|
|
|
122
120
|
interface InputWithMaskProps
|
|
123
121
|
extends Omit<InputWithMaskProps$1, "form"> {
|
package/dist/index.es.js
CHANGED
|
@@ -6,7 +6,7 @@ import { css, Global } from '@emotion/react';
|
|
|
6
6
|
import { jsx, jsxs as jsxs$1, Fragment as Fragment$1 } from 'react/jsx-runtime';
|
|
7
7
|
import { theme, Caption, Button, Container, Grid, InputWithAdornments, Heading, IconButton, InputWithMask as InputWithMask$1, LinearProgress, Divider, Modal, Switch as Switch$1, InputWithCountryDropdown } from 'kui-basic';
|
|
8
8
|
import * as React from 'react';
|
|
9
|
-
import { useEffect,
|
|
9
|
+
import { useEffect, forwardRef, useRef, useState } from 'react';
|
|
10
10
|
import { useHistory } from 'react-router-dom';
|
|
11
11
|
import { HalfArrowIcon, PrevArrowIcon, NextArrowIcon, CalendarIcon, ArrowBackIcon, ArrowNextIcon, ClosedEyeIcon, OpenEyeIcon, CheckIcon } from 'kui-icon';
|
|
12
12
|
import _ from 'lodash';
|
|
@@ -136,7 +136,7 @@ var dropdownStyles = function (_a) {
|
|
|
136
136
|
var isOpen = _a.isOpen;
|
|
137
137
|
return css(templateObject_1$p || (templateObject_1$p = __makeTemplateObject(["\n width: 100%;\n max-height: 389px;\n display: ", ";\n position: absolute;\n background: ", ";\n z-index: 3;\n border: 1px solid ", ";\n top: 64px;\n box-shadow: 0px 10px 20px rgba(0, 0, 0, 0.1);\n border-radius: 8px;\n overflow: auto;\n -ms-overflow-style: none;\n scrollbar-width: none;\n overflow-y: scroll;\n user-select: none;\n &::-webkit-scrollbar {\n width: 0px;\n },\n"], ["\n width: 100%;\n max-height: 389px;\n display: ", ";\n position: absolute;\n background: ", ";\n z-index: 3;\n border: 1px solid ", ";\n top: 64px;\n box-shadow: 0px 10px 20px rgba(0, 0, 0, 0.1);\n border-radius: 8px;\n overflow: auto;\n -ms-overflow-style: none;\n scrollbar-width: none;\n overflow-y: scroll;\n user-select: none;\n &::-webkit-scrollbar {\n width: 0px;\n },\n"])), isOpen ? "flex" : "none", theme.palette.grey.zero, theme.palette.grey.fifteenB);
|
|
138
138
|
};
|
|
139
|
-
var InputDropdown = function (_a) {
|
|
139
|
+
var InputDropdown = forwardRef(function (_a, ref) {
|
|
140
140
|
var isOpen = _a.isOpen, handleClose = _a.handleClose, buttonRef = _a.buttonRef, children = _a.children, otherProps = __rest(_a, ["isOpen", "handleClose", "buttonRef", "children"]);
|
|
141
141
|
var dropdownRef = useRef(null);
|
|
142
142
|
var closePopUp = function (e) {
|
|
@@ -156,20 +156,35 @@ var InputDropdown = function (_a) {
|
|
|
156
156
|
if (!isOpen) {
|
|
157
157
|
return null;
|
|
158
158
|
}
|
|
159
|
-
|
|
160
|
-
|
|
159
|
+
var forwardedRef = function (elem) {
|
|
160
|
+
if (typeof ref === "function")
|
|
161
|
+
ref(elem);
|
|
162
|
+
else if (ref)
|
|
163
|
+
ref.current = elem;
|
|
164
|
+
dropdownRef.current = elem;
|
|
165
|
+
};
|
|
166
|
+
return (jsx$1(Grid, __assign({ "data-testid": "input_dropdown", container: true, ref: forwardedRef, css: dropdownStyles({ isOpen: isOpen }) }, otherProps, { children: children })));
|
|
167
|
+
});
|
|
161
168
|
var templateObject_1$p;
|
|
162
169
|
|
|
163
170
|
var InputSelectDropdown = function (_a) {
|
|
164
171
|
var options = _a.options, inputRef = _a.inputRef, isOpenDropdown = _a.isOpenDropdown, handleCloseDropdown = _a.handleCloseDropdown, handleSelect = _a.handleSelect, selectedValue = _a.selectedValue;
|
|
172
|
+
var dropdownRef = useRef(null);
|
|
165
173
|
useEffect(function () {
|
|
166
174
|
var _a;
|
|
167
175
|
if (isOpenDropdown) {
|
|
168
|
-
|
|
169
|
-
|
|
176
|
+
var element = document.querySelector("[data-value=autocomplete_option_".concat(selectedValue, "]"));
|
|
177
|
+
var coordinates = element === null || element === void 0 ? void 0 : element.getBoundingClientRect();
|
|
178
|
+
if (coordinates && inputRef.current && element) {
|
|
179
|
+
(_a = dropdownRef.current) === null || _a === void 0 ? void 0 : _a.scrollTo({
|
|
180
|
+
top: coordinates.top -
|
|
181
|
+
inputRef.current.clientHeight -
|
|
182
|
+
element.clientHeight,
|
|
183
|
+
});
|
|
184
|
+
}
|
|
170
185
|
}
|
|
171
186
|
}, [isOpenDropdown]);
|
|
172
|
-
return (jsx$1(InputDropdown, __assign({ buttonRef: inputRef, isOpen: isOpenDropdown, handleClose: handleCloseDropdown, css: {
|
|
187
|
+
return (jsx$1(InputDropdown, __assign({ ref: dropdownRef, buttonRef: inputRef, isOpen: isOpenDropdown, handleClose: handleCloseDropdown, css: {
|
|
173
188
|
maxHeight: "142px",
|
|
174
189
|
padding: "4px",
|
|
175
190
|
} }, { children: options.map(function (option, key) { return (jsx$1(OptionWrapper, __assign({ onClick: function () { return handleSelect(option); }, "data-value": "autocomplete_option_".concat(option.value), "data-testid": "autocomplete_option_".concat(key) }, { children: jsx$1(StyledOption, __assign({ css: selectedValue === option.value && selectedStyles }, { children: jsx$1(Caption, __assign({ size: "sm", weight: 500 }, { children: option.label })) })) }), option.label)); }) })));
|
|
@@ -210,7 +225,6 @@ var InputSelect = forwardRef(function (props, ref) {
|
|
|
210
225
|
var inputRef = useRef(null);
|
|
211
226
|
var selectedLabel = (_a = options === null || options === void 0 ? void 0 : options.find(function (option) { return String(option.value) === String(value); })) === null || _a === void 0 ? void 0 : _a.label;
|
|
212
227
|
var register = form === null || form === void 0 ? void 0 : form.register(name);
|
|
213
|
-
console.log(value, selectedLabel, register, other);
|
|
214
228
|
var handleOpenDropdown = function () {
|
|
215
229
|
var _a, _b, _c, _d;
|
|
216
230
|
if ((_b = (_a = inputRef === null || inputRef === void 0 ? void 0 : inputRef.current) === null || _a === void 0 ? void 0 : _a.parentElement) === null || _b === void 0 ? void 0 : _b.parentElement) {
|
|
@@ -926,10 +940,11 @@ var StyledWrapper = styled.div(templateObject_1$1 || (templateObject_1$1 = __mak
|
|
|
926
940
|
var templateObject_1$1;
|
|
927
941
|
|
|
928
942
|
var ButtonSelect = forwardRef(function (props, ref) {
|
|
943
|
+
var _a;
|
|
929
944
|
var options = props.options, otherProps = __rest(props, ["options"]);
|
|
930
|
-
return (jsx(StyledInputSelect, __assign({ value: options === null || options === void 0 ? void 0 : options[0].value, options: options, iconProps: { width: 9, height: 5 } }, otherProps, { ref: ref })));
|
|
945
|
+
return (jsx(StyledInputSelect, __assign({ value: (_a = options === null || options === void 0 ? void 0 : options[0]) === null || _a === void 0 ? void 0 : _a.value, options: options, iconProps: { width: 9, height: 5 } }, otherProps, { ref: ref })));
|
|
931
946
|
});
|
|
932
|
-
var StyledInputSelect = styled(InputSelect)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n &.KUI-Input_container {\n height: 40px;\n width: fit-content;\n input {\n height: 40px;\n border-radius: 66px;\n padding: 0 12px;\n transform: none;\n font-size: 12px;\n line-height: 14px;\n margin: 0 !important;\n width: auto !important;\n }\n }\n & + div {\n top:
|
|
947
|
+
var StyledInputSelect = styled(InputSelect)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n &.KUI-Input_container {\n height: 40px;\n width: fit-content;\n input {\n height: 40px;\n border-radius: 66px;\n padding: 0 12px;\n transform: none;\n font-size: 12px;\n line-height: 14px;\n margin: 0 !important;\n width: auto !important;\n }\n }\n & + div {\n top: 48px;\n }\n"], ["\n &.KUI-Input_container {\n height: 40px;\n width: fit-content;\n input {\n height: 40px;\n border-radius: 66px;\n padding: 0 12px;\n transform: none;\n font-size: 12px;\n line-height: 14px;\n margin: 0 !important;\n width: auto !important;\n }\n }\n & + div {\n top: 48px;\n }\n"])));
|
|
933
948
|
var templateObject_1;
|
|
934
949
|
|
|
935
950
|
export { Avatar, ButtonSelect, ButtonTab, ButtonsPanel, CalendarHeaderWithSelect, CalendarStandardContainer, CalendarStandardHeader, DesktopInputWithMonthPicker, DesktopMenuPanel, InputDropdown, InputForDatepicker, InputPassword, InputPhoneWithForm, InputSelect, InputSelectDropdown, InputTextAreaMobile, InputWithController, InputWithDatePicker, InputWithMask, InputWithMonthPicker, MenuItem, MenuPanel, MobileInputWithMonthPicker, MobileMenuPanel, MonthPickerContainer, MonthPickerHeader, PassportStrengthBar, SelectMonth, SelectYear, Switch, Table, TableCell, TableHeadCell, TableRow, Tooltip, UndefinedAvatar };
|