kui-complex 0.0.16 → 0.0.18
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 +10 -2
- package/dist/index.es.js +34 -4
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +33 -2
- 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, ReactNode } from 'react';
|
|
4
4
|
import * as kui_basic from 'kui-basic';
|
|
5
|
-
import { InputWithAdornmentsProps, GridProps, SwitchProps, CaptionProps, InputWithCountryDropdownProps } from 'kui-basic';
|
|
5
|
+
import { InputWithAdornmentsProps, GridProps, 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';
|
|
@@ -115,6 +115,14 @@ type InputDropdownProps = {
|
|
|
115
115
|
|
|
116
116
|
declare const InputDropdown: ({ isOpen, handleClose, buttonRef, children, ...otherProps }: InputDropdownProps) => _emotion_react_jsx_runtime.JSX.Element | null;
|
|
117
117
|
|
|
118
|
+
interface InputWithMaskProps
|
|
119
|
+
extends Omit<InputWithMaskProps$1, "form"> {
|
|
120
|
+
form: UseFormReturn<any>
|
|
121
|
+
error?: string | null
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
declare const InputWithMask: React.ForwardRefExoticComponent<Pick<InputWithMaskProps, "label" | "size" | "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" | "form" | "mask" | "pattern" | "height" | "width" | "list" | "step" | "alt" | "crossOrigin" | "src" | "type" | "endIcon" | "startIcon" | "disabled" | "autoFocus" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "name" | "value" | "error" | "inputRef" | "cornerLabel" | "isTextArea" | "inputStyles" | "labelStyles" | "messageClassName" | "labelInlineStyles" | "errorMessage" | "inputValue" | "accept" | "autoComplete" | "capture" | "checked" | "enterKeyHint" | "max" | "maxLength" | "min" | "minLength" | "multiple" | "readOnly" | "required"> & React.RefAttributes<HTMLInputElement>>;
|
|
125
|
+
|
|
118
126
|
declare const InputForDatepicker: React.ForwardRefExoticComponent<Pick<any, string | number | symbol> & React.RefAttributes<HTMLInputElement>>;
|
|
119
127
|
|
|
120
128
|
interface InputWithControllerProps
|
|
@@ -281,4 +289,4 @@ declare const Tooltip: React.ForwardRefExoticComponent<{
|
|
|
281
289
|
withArrow?: boolean | undefined;
|
|
282
290
|
} & React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<unknown>>;
|
|
283
291
|
|
|
284
|
-
export { Avatar, ButtonTab, ButtonsPanel, CalendarHeaderWithSelect, CalendarStandardContainer, CalendarStandardHeader, DesktopInputWithMonthPicker, DesktopMenuPanel, InputDropdown, InputForDatepicker, InputPassword, InputPhoneWithForm, InputSelect, InputSelectDropdown, InputTextAreaMobile, InputWithController, InputWithDatePicker, InputWithMonthPicker, MenuItem, MenuPanel, MobileInputWithMonthPicker, MobileMenuPanel, MonthPickerContainer, MonthPickerHeader, PassportStrengthBar, SelectMonth, SelectYear, Switch, Table, TableCell, TableHeadCell, TableRow, Tooltip, UndefinedAvatar };
|
|
292
|
+
export { Avatar, 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 };
|
package/dist/index.es.js
CHANGED
|
@@ -4,7 +4,7 @@ import { jsx as jsx$1, jsxs, Fragment } from '@emotion/react/jsx-runtime';
|
|
|
4
4
|
import styled from '@emotion/styled';
|
|
5
5
|
import { css, Global } from '@emotion/react';
|
|
6
6
|
import { jsx, jsxs as jsxs$1, Fragment as Fragment$1 } from 'react/jsx-runtime';
|
|
7
|
-
import { theme, Caption, Button, Container, Grid, InputWithAdornments, Heading, IconButton, LinearProgress, Divider, Modal, Switch as Switch$1, InputWithCountryDropdown } from 'kui-basic';
|
|
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
9
|
import { useEffect, useRef, forwardRef, useState } from 'react';
|
|
10
10
|
import { useHistory } from 'react-router-dom';
|
|
@@ -397,6 +397,36 @@ var DesktopMenuPanel = function (_a) {
|
|
|
397
397
|
var Wrapper$3 = styled(Grid)(templateObject_1$d || (templateObject_1$d = __makeTemplateObject(["\n position: sticky;\n top: 49px;\n left: 0;\n z-index: 11;\n background-color: ", ";\n padding: 16px 16px 24px;\n @media (max-width: 900px) {\n justify-content: space-between;\n }\n @media (max-width: 765px) {\n display: none;\n }\n"], ["\n position: sticky;\n top: 49px;\n left: 0;\n z-index: 11;\n background-color: ", ";\n padding: 16px 16px 24px;\n @media (max-width: 900px) {\n justify-content: space-between;\n }\n @media (max-width: 765px) {\n display: none;\n }\n"])), theme.palette.background.light1);
|
|
398
398
|
var templateObject_1$d;
|
|
399
399
|
|
|
400
|
+
var InputWithMask = forwardRef(function (_a, ref) {
|
|
401
|
+
var form = _a.form, name = _a.name, error = _a.error, inputProps = __rest(_a, ["form", "name", "error"]);
|
|
402
|
+
var handleChange = function (e, field) {
|
|
403
|
+
field.onChange(e);
|
|
404
|
+
if (inputProps.onChange) {
|
|
405
|
+
inputProps.onChange(e);
|
|
406
|
+
}
|
|
407
|
+
};
|
|
408
|
+
var forwardedRef = function (elem, field) {
|
|
409
|
+
if (ref) {
|
|
410
|
+
// eslint-disable-next-line no-param-reassign
|
|
411
|
+
// @ts-ignore
|
|
412
|
+
ref.current = elem;
|
|
413
|
+
}
|
|
414
|
+
field.ref(elem);
|
|
415
|
+
};
|
|
416
|
+
var getError = function (fieldState) {
|
|
417
|
+
var _a;
|
|
418
|
+
return typeof error !== "undefined" && String(error).length > 0
|
|
419
|
+
? error
|
|
420
|
+
: (_a = fieldState.error) === null || _a === void 0 ? void 0 : _a.message;
|
|
421
|
+
};
|
|
422
|
+
return (jsx(Controller, { control: form === null || form === void 0 ? void 0 : form.control, name: name, render: function (_a) {
|
|
423
|
+
var field = _a.field, fieldState = _a.fieldState;
|
|
424
|
+
return (jsx(InputWithMask$1, __assign({ errorMessage: getError(fieldState) }, field, inputProps, { onChange: function (e) {
|
|
425
|
+
return handleChange(e, field);
|
|
426
|
+
}, value: field.value || "", ref: function (e) { return forwardedRef(e, field); } })));
|
|
427
|
+
} }));
|
|
428
|
+
});
|
|
429
|
+
|
|
400
430
|
var InputWithController = forwardRef(function (_a, ref) {
|
|
401
431
|
var form = _a.form, name = _a.name, error = _a.error, inputProps = __rest(_a, ["form", "name", "error"]);
|
|
402
432
|
var handleChange = function (e, field) {
|
|
@@ -865,10 +895,10 @@ var Popper = forwardRef(function (props, ref) {
|
|
|
865
895
|
// Распожить стрелочку к контенту посередине контента
|
|
866
896
|
return ReactDOM.createPortal(jsxs$1(Fragment$1, { children: [jsx(Global, { styles: css(templateObject_1$1 || (templateObject_1$1 = __makeTemplateObject(["\n body {\n position: relative;\n }\n "], ["\n body {\n position: relative;\n }\n "]))) }), jsx(StyledPopper, __assign({ ref: forwardedRef, style: position, open: !!open }, other, { children: children }))] }), document.body);
|
|
867
897
|
});
|
|
868
|
-
var StyledPopper = styled.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n padding: 16px;\n border-radius: 12px;\n background: white;\n box-shadow: 0px 10px 20px rgba(0, 0, 0, 0.1);\n max-width: 215px;\n position: absolute;\n transition: opacity 0.3s ease-out;\n opacity: ", ";\n"], ["\n padding: 16px;\n border-radius: 12px;\n background: white;\n box-shadow: 0px 10px 20px rgba(0, 0, 0, 0.1);\n max-width: 215px;\n position: absolute;\n transition: opacity 0.3s ease-out;\n opacity: ", ";\n"])), function (_a) {
|
|
898
|
+
var StyledPopper = styled.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n padding: 16px;\n border-radius: 12px;\n background: white;\n box-shadow: 0px 10px 20px rgba(0, 0, 0, 0.1);\n max-width: 215px;\n position: absolute;\n transition: opacity 0.3s ease-out;\n opacity: ", ";\n @media (max-width: ", "px) {\n position: fixed;\n bottom: 24px;\n top: auto !important;\n left: 16px !important;\n width: calc(100vw - 32px);\n max-width: unset;\n }\n"], ["\n padding: 16px;\n border-radius: 12px;\n background: white;\n box-shadow: 0px 10px 20px rgba(0, 0, 0, 0.1);\n max-width: 215px;\n position: absolute;\n transition: opacity 0.3s ease-out;\n opacity: ", ";\n @media (max-width: ", "px) {\n position: fixed;\n bottom: 24px;\n top: auto !important;\n left: 16px !important;\n width: calc(100vw - 32px);\n max-width: unset;\n }\n"])), function (_a) {
|
|
869
899
|
var open = _a.open;
|
|
870
900
|
return (open ? 1 : 0);
|
|
871
|
-
});
|
|
901
|
+
}, theme.breakpoints.xxs);
|
|
872
902
|
var templateObject_1$1, templateObject_2;
|
|
873
903
|
|
|
874
904
|
var Tooltip = forwardRef(function (props, ref) {
|
|
@@ -896,5 +926,5 @@ var Tooltip = forwardRef(function (props, ref) {
|
|
|
896
926
|
var StyledWrapper = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: inline-flex;\n cursor: pointer;\n width: fit-content;\n height: fit-content;\n"], ["\n display: inline-flex;\n cursor: pointer;\n width: fit-content;\n height: fit-content;\n"])));
|
|
897
927
|
var templateObject_1;
|
|
898
928
|
|
|
899
|
-
export { Avatar, ButtonTab, ButtonsPanel, CalendarHeaderWithSelect, CalendarStandardContainer, CalendarStandardHeader, DesktopInputWithMonthPicker, DesktopMenuPanel, InputDropdown, InputForDatepicker, InputPassword, InputPhoneWithForm, InputSelect, InputSelectDropdown, InputTextAreaMobile, InputWithController, InputWithDatePicker, InputWithMonthPicker, MenuItem, MenuPanel, MobileInputWithMonthPicker, MobileMenuPanel, MonthPickerContainer, MonthPickerHeader, PassportStrengthBar, SelectMonth, SelectYear, Switch, Table, TableCell, TableHeadCell, TableRow, Tooltip, UndefinedAvatar };
|
|
929
|
+
export { Avatar, 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 };
|
|
900
930
|
//# sourceMappingURL=index.es.js.map
|