@alfalab/core-components-with-suffix 4.0.10 → 4.0.12
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/Component.d.ts +4 -36
- package/Component.js +4 -4
- package/cssm/Component.d.ts +4 -36
- package/cssm/Component.js +3 -3
- package/cssm/index.js +1 -1
- package/esm/Component.d.ts +4 -36
- package/esm/Component.js +3 -3
- package/esm/index.css +9 -9
- package/esm/index.js +1 -1
- package/index.css +9 -9
- package/index.js +1 -1
- package/modern/Component.d.ts +4 -36
- package/modern/Component.js +5 -5
- package/modern/index.css +9 -9
- package/modern/index.js +1 -1
- package/package.json +2 -2
package/Component.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import { ReactNode } from "react";
|
|
3
|
+
import { FC, ReactNode, RefAttributes } from "react";
|
|
4
4
|
import { InputProps } from "@alfalab/core-components-input";
|
|
5
5
|
type withSuffixProps = InputProps & {
|
|
6
6
|
/**
|
|
@@ -13,7 +13,7 @@ type withSuffixProps = InputProps & {
|
|
|
13
13
|
*/
|
|
14
14
|
suffixContainerClassName?: string;
|
|
15
15
|
};
|
|
16
|
-
declare const withSuffix: (Input: React.
|
|
16
|
+
declare const withSuffix: (Input: FC<InputProps & RefAttributes<HTMLInputElement>>) => React.ForwardRefExoticComponent<Omit<React.InputHTMLAttributes<HTMLInputElement>, "size" | "type" | "defaultValue" | "onChange" | "onClick" | "onMouseDown" | "value" | "enterKeyHint"> & {
|
|
17
17
|
value?: string | undefined;
|
|
18
18
|
defaultValue?: string | undefined;
|
|
19
19
|
block?: boolean | undefined;
|
|
@@ -26,39 +26,7 @@ declare const withSuffix: (Input: React.FC<Pick<React.InputHTMLAttributes<HTMLIn
|
|
|
26
26
|
label?: React.ReactNode;
|
|
27
27
|
labelView?: "inner" | "outer" | undefined;
|
|
28
28
|
type?: "number" | "text" | "tel" | "email" | "card" | "money" | "password" | undefined;
|
|
29
|
-
wrapperRef?:
|
|
30
|
-
leftAddons?: React.ReactNode;
|
|
31
|
-
rightAddons?: React.ReactNode;
|
|
32
|
-
bottomAddons?: React.ReactNode;
|
|
33
|
-
className?: string | undefined;
|
|
34
|
-
fieldClassName?: string | undefined;
|
|
35
|
-
inputClassName?: string | undefined;
|
|
36
|
-
labelClassName?: string | undefined;
|
|
37
|
-
addonsClassName?: string | undefined;
|
|
38
|
-
focusedClassName?: string | undefined;
|
|
39
|
-
filledClassName?: string | undefined;
|
|
40
|
-
onChange?: ((event: React.ChangeEvent<HTMLInputElement>, payload: {
|
|
41
|
-
value: string;
|
|
42
|
-
}) => void) | undefined;
|
|
43
|
-
onClear?: ((event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void) | undefined;
|
|
44
|
-
onClick?: ((event: React.MouseEvent<HTMLDivElement, MouseEvent>) => void) | undefined;
|
|
45
|
-
onMouseDown?: ((event: React.MouseEvent<HTMLDivElement, MouseEvent>) => void) | undefined;
|
|
46
|
-
onMouseUp?: ((event: React.MouseEvent<HTMLDivElement, MouseEvent>) => void) | undefined;
|
|
47
|
-
dataTestId?: string | undefined;
|
|
48
|
-
} & React.RefAttributes<HTMLInputElement>>) => React.ForwardRefExoticComponent<Pick<React.InputHTMLAttributes<HTMLInputElement>, "dir" | "form" | "slot" | "style" | "title" | "pattern" | "children" | "className" | "defaultChecked" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "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" | "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" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "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" | "list" | "step" | "autoFocus" | "disabled" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "name" | "accept" | "alt" | "autoComplete" | "capture" | "checked" | "crossOrigin" | "height" | "max" | "maxLength" | "min" | "minLength" | "multiple" | "readOnly" | "required" | "src" | "width"> & {
|
|
49
|
-
value?: string | undefined;
|
|
50
|
-
defaultValue?: string | undefined;
|
|
51
|
-
block?: boolean | undefined;
|
|
52
|
-
clear?: boolean | undefined;
|
|
53
|
-
size?: "s" | "m" | "l" | "xl" | undefined;
|
|
54
|
-
colors?: "default" | "inverted" | undefined;
|
|
55
|
-
error?: React.ReactNode;
|
|
56
|
-
success?: boolean | undefined;
|
|
57
|
-
hint?: React.ReactNode;
|
|
58
|
-
label?: React.ReactNode;
|
|
59
|
-
labelView?: "inner" | "outer" | undefined;
|
|
60
|
-
type?: "number" | "text" | "tel" | "email" | "card" | "money" | "password" | undefined;
|
|
61
|
-
wrapperRef?: ((instance: HTMLDivElement | null) => void) | React.RefObject<HTMLDivElement> | null | undefined;
|
|
29
|
+
wrapperRef?: React.Ref<HTMLDivElement> | undefined;
|
|
62
30
|
leftAddons?: React.ReactNode;
|
|
63
31
|
rightAddons?: React.ReactNode;
|
|
64
32
|
bottomAddons?: React.ReactNode;
|
|
@@ -82,7 +50,7 @@ declare const withSuffix: (Input: React.FC<Pick<React.InputHTMLAttributes<HTMLIn
|
|
|
82
50
|
* Дополнительный закрепленный текст справа от основного значения.
|
|
83
51
|
* Например: value='85' suffix=' мес' -> 85 мес
|
|
84
52
|
*/
|
|
85
|
-
suffix?:
|
|
53
|
+
suffix?: ReactNode;
|
|
86
54
|
/**
|
|
87
55
|
* Дополнительный класс для контейнера с суффиксом
|
|
88
56
|
*/
|
package/Component.js
CHANGED
|
@@ -3,17 +3,17 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var React = require('react');
|
|
6
|
-
var cn = require('classnames');
|
|
7
6
|
var mergeRefs = require('react-merge-refs');
|
|
7
|
+
var cn = require('classnames');
|
|
8
8
|
var coreComponentsPortal = require('@alfalab/core-components-portal');
|
|
9
9
|
|
|
10
10
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
11
11
|
|
|
12
12
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
13
|
-
var cn__default = /*#__PURE__*/_interopDefaultLegacy(cn);
|
|
14
13
|
var mergeRefs__default = /*#__PURE__*/_interopDefaultLegacy(mergeRefs);
|
|
14
|
+
var cn__default = /*#__PURE__*/_interopDefaultLegacy(cn);
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
/******************************************************************************
|
|
17
17
|
Copyright (c) Microsoft Corporation.
|
|
18
18
|
|
|
19
19
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
@@ -52,7 +52,7 @@ function __rest(s, e) {
|
|
|
52
52
|
return t;
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
-
var styles = {"suffixContainer":"with-
|
|
55
|
+
var styles = {"suffixContainer":"with-suffix__suffixContainer_1l8bz","suffixVisible":"with-suffix__suffixVisible_1l8bz","hasSuffix":"with-suffix__hasSuffix_1l8bz","spacer":"with-suffix__spacer_1l8bz","suffix":"with-suffix__suffix_1l8bz","disabled":"with-suffix__disabled_1l8bz","readOnly":"with-suffix__readOnly_1l8bz"};
|
|
56
56
|
require('./index.css')
|
|
57
57
|
|
|
58
58
|
var withSuffix = function (Input) {
|
package/cssm/Component.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import { ReactNode } from "react";
|
|
3
|
+
import { FC, ReactNode, RefAttributes } from "react";
|
|
4
4
|
import { InputProps } from "@alfalab/core-components-input";
|
|
5
5
|
type withSuffixProps = InputProps & {
|
|
6
6
|
/**
|
|
@@ -13,7 +13,7 @@ type withSuffixProps = InputProps & {
|
|
|
13
13
|
*/
|
|
14
14
|
suffixContainerClassName?: string;
|
|
15
15
|
};
|
|
16
|
-
declare const withSuffix: (Input: React.
|
|
16
|
+
declare const withSuffix: (Input: FC<InputProps & RefAttributes<HTMLInputElement>>) => React.ForwardRefExoticComponent<Omit<React.InputHTMLAttributes<HTMLInputElement>, "size" | "type" | "defaultValue" | "onChange" | "onClick" | "onMouseDown" | "value" | "enterKeyHint"> & {
|
|
17
17
|
value?: string | undefined;
|
|
18
18
|
defaultValue?: string | undefined;
|
|
19
19
|
block?: boolean | undefined;
|
|
@@ -26,39 +26,7 @@ declare const withSuffix: (Input: React.FC<Pick<React.InputHTMLAttributes<HTMLIn
|
|
|
26
26
|
label?: React.ReactNode;
|
|
27
27
|
labelView?: "inner" | "outer" | undefined;
|
|
28
28
|
type?: "number" | "text" | "tel" | "email" | "card" | "money" | "password" | undefined;
|
|
29
|
-
wrapperRef?:
|
|
30
|
-
leftAddons?: React.ReactNode;
|
|
31
|
-
rightAddons?: React.ReactNode;
|
|
32
|
-
bottomAddons?: React.ReactNode;
|
|
33
|
-
className?: string | undefined;
|
|
34
|
-
fieldClassName?: string | undefined;
|
|
35
|
-
inputClassName?: string | undefined;
|
|
36
|
-
labelClassName?: string | undefined;
|
|
37
|
-
addonsClassName?: string | undefined;
|
|
38
|
-
focusedClassName?: string | undefined;
|
|
39
|
-
filledClassName?: string | undefined;
|
|
40
|
-
onChange?: ((event: React.ChangeEvent<HTMLInputElement>, payload: {
|
|
41
|
-
value: string;
|
|
42
|
-
}) => void) | undefined;
|
|
43
|
-
onClear?: ((event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void) | undefined;
|
|
44
|
-
onClick?: ((event: React.MouseEvent<HTMLDivElement, MouseEvent>) => void) | undefined;
|
|
45
|
-
onMouseDown?: ((event: React.MouseEvent<HTMLDivElement, MouseEvent>) => void) | undefined;
|
|
46
|
-
onMouseUp?: ((event: React.MouseEvent<HTMLDivElement, MouseEvent>) => void) | undefined;
|
|
47
|
-
dataTestId?: string | undefined;
|
|
48
|
-
} & React.RefAttributes<HTMLInputElement>>) => React.ForwardRefExoticComponent<Pick<React.InputHTMLAttributes<HTMLInputElement>, "dir" | "form" | "slot" | "style" | "title" | "pattern" | "children" | "className" | "defaultChecked" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "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" | "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" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "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" | "list" | "step" | "autoFocus" | "disabled" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "name" | "accept" | "alt" | "autoComplete" | "capture" | "checked" | "crossOrigin" | "height" | "max" | "maxLength" | "min" | "minLength" | "multiple" | "readOnly" | "required" | "src" | "width"> & {
|
|
49
|
-
value?: string | undefined;
|
|
50
|
-
defaultValue?: string | undefined;
|
|
51
|
-
block?: boolean | undefined;
|
|
52
|
-
clear?: boolean | undefined;
|
|
53
|
-
size?: "s" | "m" | "l" | "xl" | undefined;
|
|
54
|
-
colors?: "default" | "inverted" | undefined;
|
|
55
|
-
error?: React.ReactNode;
|
|
56
|
-
success?: boolean | undefined;
|
|
57
|
-
hint?: React.ReactNode;
|
|
58
|
-
label?: React.ReactNode;
|
|
59
|
-
labelView?: "inner" | "outer" | undefined;
|
|
60
|
-
type?: "number" | "text" | "tel" | "email" | "card" | "money" | "password" | undefined;
|
|
61
|
-
wrapperRef?: ((instance: HTMLDivElement | null) => void) | React.RefObject<HTMLDivElement> | null | undefined;
|
|
29
|
+
wrapperRef?: React.Ref<HTMLDivElement> | undefined;
|
|
62
30
|
leftAddons?: React.ReactNode;
|
|
63
31
|
rightAddons?: React.ReactNode;
|
|
64
32
|
bottomAddons?: React.ReactNode;
|
|
@@ -82,7 +50,7 @@ declare const withSuffix: (Input: React.FC<Pick<React.InputHTMLAttributes<HTMLIn
|
|
|
82
50
|
* Дополнительный закрепленный текст справа от основного значения.
|
|
83
51
|
* Например: value='85' suffix=' мес' -> 85 мес
|
|
84
52
|
*/
|
|
85
|
-
suffix?:
|
|
53
|
+
suffix?: ReactNode;
|
|
86
54
|
/**
|
|
87
55
|
* Дополнительный класс для контейнера с суффиксом
|
|
88
56
|
*/
|
package/cssm/Component.js
CHANGED
|
@@ -3,19 +3,19 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var React = require('react');
|
|
6
|
-
var cn = require('classnames');
|
|
7
6
|
var mergeRefs = require('react-merge-refs');
|
|
7
|
+
var cn = require('classnames');
|
|
8
8
|
var coreComponentsPortal = require('@alfalab/core-components-portal/cssm');
|
|
9
9
|
var styles = require('./index.module.css');
|
|
10
10
|
|
|
11
11
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
12
12
|
|
|
13
13
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
14
|
-
var cn__default = /*#__PURE__*/_interopDefaultLegacy(cn);
|
|
15
14
|
var mergeRefs__default = /*#__PURE__*/_interopDefaultLegacy(mergeRefs);
|
|
15
|
+
var cn__default = /*#__PURE__*/_interopDefaultLegacy(cn);
|
|
16
16
|
var styles__default = /*#__PURE__*/_interopDefaultLegacy(styles);
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
/******************************************************************************
|
|
19
19
|
Copyright (c) Microsoft Corporation.
|
|
20
20
|
|
|
21
21
|
Permission to use, copy, modify, and/or distribute this software for any
|
package/cssm/index.js
CHANGED
|
@@ -4,8 +4,8 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var Component = require('./Component.js');
|
|
6
6
|
require('react');
|
|
7
|
-
require('classnames');
|
|
8
7
|
require('react-merge-refs');
|
|
8
|
+
require('classnames');
|
|
9
9
|
require('@alfalab/core-components-portal/cssm');
|
|
10
10
|
require('./index.module.css');
|
|
11
11
|
|
package/esm/Component.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import { ReactNode } from "react";
|
|
3
|
+
import { FC, ReactNode, RefAttributes } from "react";
|
|
4
4
|
import { InputProps } from "@alfalab/core-components-input";
|
|
5
5
|
type withSuffixProps = InputProps & {
|
|
6
6
|
/**
|
|
@@ -13,7 +13,7 @@ type withSuffixProps = InputProps & {
|
|
|
13
13
|
*/
|
|
14
14
|
suffixContainerClassName?: string;
|
|
15
15
|
};
|
|
16
|
-
declare const withSuffix: (Input: React.
|
|
16
|
+
declare const withSuffix: (Input: FC<InputProps & RefAttributes<HTMLInputElement>>) => React.ForwardRefExoticComponent<Omit<React.InputHTMLAttributes<HTMLInputElement>, "size" | "type" | "defaultValue" | "onChange" | "onClick" | "onMouseDown" | "value" | "enterKeyHint"> & {
|
|
17
17
|
value?: string | undefined;
|
|
18
18
|
defaultValue?: string | undefined;
|
|
19
19
|
block?: boolean | undefined;
|
|
@@ -26,39 +26,7 @@ declare const withSuffix: (Input: React.FC<Pick<React.InputHTMLAttributes<HTMLIn
|
|
|
26
26
|
label?: React.ReactNode;
|
|
27
27
|
labelView?: "inner" | "outer" | undefined;
|
|
28
28
|
type?: "number" | "text" | "tel" | "email" | "card" | "money" | "password" | undefined;
|
|
29
|
-
wrapperRef?:
|
|
30
|
-
leftAddons?: React.ReactNode;
|
|
31
|
-
rightAddons?: React.ReactNode;
|
|
32
|
-
bottomAddons?: React.ReactNode;
|
|
33
|
-
className?: string | undefined;
|
|
34
|
-
fieldClassName?: string | undefined;
|
|
35
|
-
inputClassName?: string | undefined;
|
|
36
|
-
labelClassName?: string | undefined;
|
|
37
|
-
addonsClassName?: string | undefined;
|
|
38
|
-
focusedClassName?: string | undefined;
|
|
39
|
-
filledClassName?: string | undefined;
|
|
40
|
-
onChange?: ((event: React.ChangeEvent<HTMLInputElement>, payload: {
|
|
41
|
-
value: string;
|
|
42
|
-
}) => void) | undefined;
|
|
43
|
-
onClear?: ((event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void) | undefined;
|
|
44
|
-
onClick?: ((event: React.MouseEvent<HTMLDivElement, MouseEvent>) => void) | undefined;
|
|
45
|
-
onMouseDown?: ((event: React.MouseEvent<HTMLDivElement, MouseEvent>) => void) | undefined;
|
|
46
|
-
onMouseUp?: ((event: React.MouseEvent<HTMLDivElement, MouseEvent>) => void) | undefined;
|
|
47
|
-
dataTestId?: string | undefined;
|
|
48
|
-
} & React.RefAttributes<HTMLInputElement>>) => React.ForwardRefExoticComponent<Pick<React.InputHTMLAttributes<HTMLInputElement>, "dir" | "form" | "slot" | "style" | "title" | "pattern" | "children" | "className" | "defaultChecked" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "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" | "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" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "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" | "list" | "step" | "autoFocus" | "disabled" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "name" | "accept" | "alt" | "autoComplete" | "capture" | "checked" | "crossOrigin" | "height" | "max" | "maxLength" | "min" | "minLength" | "multiple" | "readOnly" | "required" | "src" | "width"> & {
|
|
49
|
-
value?: string | undefined;
|
|
50
|
-
defaultValue?: string | undefined;
|
|
51
|
-
block?: boolean | undefined;
|
|
52
|
-
clear?: boolean | undefined;
|
|
53
|
-
size?: "s" | "m" | "l" | "xl" | undefined;
|
|
54
|
-
colors?: "default" | "inverted" | undefined;
|
|
55
|
-
error?: React.ReactNode;
|
|
56
|
-
success?: boolean | undefined;
|
|
57
|
-
hint?: React.ReactNode;
|
|
58
|
-
label?: React.ReactNode;
|
|
59
|
-
labelView?: "inner" | "outer" | undefined;
|
|
60
|
-
type?: "number" | "text" | "tel" | "email" | "card" | "money" | "password" | undefined;
|
|
61
|
-
wrapperRef?: ((instance: HTMLDivElement | null) => void) | React.RefObject<HTMLDivElement> | null | undefined;
|
|
29
|
+
wrapperRef?: React.Ref<HTMLDivElement> | undefined;
|
|
62
30
|
leftAddons?: React.ReactNode;
|
|
63
31
|
rightAddons?: React.ReactNode;
|
|
64
32
|
bottomAddons?: React.ReactNode;
|
|
@@ -82,7 +50,7 @@ declare const withSuffix: (Input: React.FC<Pick<React.InputHTMLAttributes<HTMLIn
|
|
|
82
50
|
* Дополнительный закрепленный текст справа от основного значения.
|
|
83
51
|
* Например: value='85' suffix=' мес' -> 85 мес
|
|
84
52
|
*/
|
|
85
|
-
suffix?:
|
|
53
|
+
suffix?: ReactNode;
|
|
86
54
|
/**
|
|
87
55
|
* Дополнительный класс для контейнера с суффиксом
|
|
88
56
|
*/
|
package/esm/Component.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React, { forwardRef, useRef, useState, useCallback, Fragment } from 'react';
|
|
2
|
-
import cn from 'classnames';
|
|
3
2
|
import mergeRefs from 'react-merge-refs';
|
|
3
|
+
import cn from 'classnames';
|
|
4
4
|
import { Portal } from '@alfalab/core-components-portal/esm';
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
/******************************************************************************
|
|
7
7
|
Copyright (c) Microsoft Corporation.
|
|
8
8
|
|
|
9
9
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
@@ -42,7 +42,7 @@ function __rest(s, e) {
|
|
|
42
42
|
return t;
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
-
var styles = {"suffixContainer":"with-
|
|
45
|
+
var styles = {"suffixContainer":"with-suffix__suffixContainer_1l8bz","suffixVisible":"with-suffix__suffixVisible_1l8bz","hasSuffix":"with-suffix__hasSuffix_1l8bz","spacer":"with-suffix__spacer_1l8bz","suffix":"with-suffix__suffix_1l8bz","disabled":"with-suffix__disabled_1l8bz","readOnly":"with-suffix__readOnly_1l8bz"};
|
|
46
46
|
require('./index.css')
|
|
47
47
|
|
|
48
48
|
var withSuffix = function (Input) {
|
package/esm/index.css
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: h9ai2 */
|
|
2
2
|
:root {
|
|
3
3
|
--color-light-text-secondary: rgba(11, 31, 53, 0.7);
|
|
4
4
|
}
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
|
|
25
25
|
/* управляет видимостью иконки ошибки, если она стоит рядом с другой иконкой */
|
|
26
26
|
}
|
|
27
|
-
.with-
|
|
27
|
+
.with-suffix__suffixContainer_1l8bz {
|
|
28
28
|
font-size: 16px;
|
|
29
29
|
line-height: 20px;
|
|
30
30
|
font-weight: 400;
|
|
@@ -37,25 +37,25 @@
|
|
|
37
37
|
display: none;
|
|
38
38
|
pointer-events: none;
|
|
39
39
|
}
|
|
40
|
-
input:focus:not(:read-only) + .with-
|
|
41
|
-
.with-
|
|
40
|
+
input:focus:not(:read-only) + .with-suffix__suffixContainer_1l8bz,
|
|
41
|
+
.with-suffix__suffixVisible_1l8bz .with-suffix__suffixContainer_1l8bz {
|
|
42
42
|
display: inline-flex;
|
|
43
43
|
}
|
|
44
|
-
.with-
|
|
44
|
+
.with-suffix__hasSuffix_1l8bz input:focus::placeholder {
|
|
45
45
|
color: transparent;
|
|
46
46
|
transition: none;
|
|
47
47
|
}
|
|
48
|
-
.with-
|
|
48
|
+
.with-suffix__spacer_1l8bz {
|
|
49
49
|
visibility: hidden;
|
|
50
50
|
flex-shrink: 0;
|
|
51
51
|
white-space: pre;
|
|
52
52
|
}
|
|
53
|
-
.with-
|
|
53
|
+
.with-suffix__suffix_1l8bz {
|
|
54
54
|
white-space: pre;
|
|
55
55
|
}
|
|
56
|
-
.with-
|
|
56
|
+
.with-suffix__disabled_1l8bz {
|
|
57
57
|
color: var(--input-disabled-color);
|
|
58
58
|
}
|
|
59
|
-
.with-
|
|
59
|
+
.with-suffix__readOnly_1l8bz {
|
|
60
60
|
color: var(--input-read-only-color);
|
|
61
61
|
}
|
package/esm/index.js
CHANGED
package/index.css
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: h9ai2 */
|
|
2
2
|
:root {
|
|
3
3
|
--color-light-text-secondary: rgba(11, 31, 53, 0.7);
|
|
4
4
|
}
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
|
|
25
25
|
/* управляет видимостью иконки ошибки, если она стоит рядом с другой иконкой */
|
|
26
26
|
}
|
|
27
|
-
.with-
|
|
27
|
+
.with-suffix__suffixContainer_1l8bz {
|
|
28
28
|
font-size: 16px;
|
|
29
29
|
line-height: 20px;
|
|
30
30
|
font-weight: 400;
|
|
@@ -37,25 +37,25 @@
|
|
|
37
37
|
display: none;
|
|
38
38
|
pointer-events: none;
|
|
39
39
|
}
|
|
40
|
-
input:focus:not(:read-only) + .with-
|
|
41
|
-
.with-
|
|
40
|
+
input:focus:not(:read-only) + .with-suffix__suffixContainer_1l8bz,
|
|
41
|
+
.with-suffix__suffixVisible_1l8bz .with-suffix__suffixContainer_1l8bz {
|
|
42
42
|
display: inline-flex;
|
|
43
43
|
}
|
|
44
|
-
.with-
|
|
44
|
+
.with-suffix__hasSuffix_1l8bz input:focus::placeholder {
|
|
45
45
|
color: transparent;
|
|
46
46
|
transition: none;
|
|
47
47
|
}
|
|
48
|
-
.with-
|
|
48
|
+
.with-suffix__spacer_1l8bz {
|
|
49
49
|
visibility: hidden;
|
|
50
50
|
flex-shrink: 0;
|
|
51
51
|
white-space: pre;
|
|
52
52
|
}
|
|
53
|
-
.with-
|
|
53
|
+
.with-suffix__suffix_1l8bz {
|
|
54
54
|
white-space: pre;
|
|
55
55
|
}
|
|
56
|
-
.with-
|
|
56
|
+
.with-suffix__disabled_1l8bz {
|
|
57
57
|
color: var(--input-disabled-color);
|
|
58
58
|
}
|
|
59
|
-
.with-
|
|
59
|
+
.with-suffix__readOnly_1l8bz {
|
|
60
60
|
color: var(--input-read-only-color);
|
|
61
61
|
}
|
package/index.js
CHANGED
package/modern/Component.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import { ReactNode } from "react";
|
|
3
|
+
import { FC, ReactNode, RefAttributes } from "react";
|
|
4
4
|
import { InputProps } from "@alfalab/core-components-input";
|
|
5
5
|
type withSuffixProps = InputProps & {
|
|
6
6
|
/**
|
|
@@ -13,7 +13,7 @@ type withSuffixProps = InputProps & {
|
|
|
13
13
|
*/
|
|
14
14
|
suffixContainerClassName?: string;
|
|
15
15
|
};
|
|
16
|
-
declare const withSuffix: (Input: React.
|
|
16
|
+
declare const withSuffix: (Input: FC<InputProps & RefAttributes<HTMLInputElement>>) => React.ForwardRefExoticComponent<Omit<React.InputHTMLAttributes<HTMLInputElement>, "size" | "type" | "defaultValue" | "onChange" | "onClick" | "onMouseDown" | "value" | "enterKeyHint"> & {
|
|
17
17
|
value?: string | undefined;
|
|
18
18
|
defaultValue?: string | undefined;
|
|
19
19
|
block?: boolean | undefined;
|
|
@@ -26,39 +26,7 @@ declare const withSuffix: (Input: React.FC<Pick<React.InputHTMLAttributes<HTMLIn
|
|
|
26
26
|
label?: React.ReactNode;
|
|
27
27
|
labelView?: "inner" | "outer" | undefined;
|
|
28
28
|
type?: "number" | "text" | "tel" | "email" | "card" | "money" | "password" | undefined;
|
|
29
|
-
wrapperRef?:
|
|
30
|
-
leftAddons?: React.ReactNode;
|
|
31
|
-
rightAddons?: React.ReactNode;
|
|
32
|
-
bottomAddons?: React.ReactNode;
|
|
33
|
-
className?: string | undefined;
|
|
34
|
-
fieldClassName?: string | undefined;
|
|
35
|
-
inputClassName?: string | undefined;
|
|
36
|
-
labelClassName?: string | undefined;
|
|
37
|
-
addonsClassName?: string | undefined;
|
|
38
|
-
focusedClassName?: string | undefined;
|
|
39
|
-
filledClassName?: string | undefined;
|
|
40
|
-
onChange?: ((event: React.ChangeEvent<HTMLInputElement>, payload: {
|
|
41
|
-
value: string;
|
|
42
|
-
}) => void) | undefined;
|
|
43
|
-
onClear?: ((event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void) | undefined;
|
|
44
|
-
onClick?: ((event: React.MouseEvent<HTMLDivElement, MouseEvent>) => void) | undefined;
|
|
45
|
-
onMouseDown?: ((event: React.MouseEvent<HTMLDivElement, MouseEvent>) => void) | undefined;
|
|
46
|
-
onMouseUp?: ((event: React.MouseEvent<HTMLDivElement, MouseEvent>) => void) | undefined;
|
|
47
|
-
dataTestId?: string | undefined;
|
|
48
|
-
} & React.RefAttributes<HTMLInputElement>>) => React.ForwardRefExoticComponent<Pick<React.InputHTMLAttributes<HTMLInputElement>, "dir" | "form" | "slot" | "style" | "title" | "pattern" | "children" | "className" | "defaultChecked" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "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" | "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" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "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" | "list" | "step" | "autoFocus" | "disabled" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "name" | "accept" | "alt" | "autoComplete" | "capture" | "checked" | "crossOrigin" | "height" | "max" | "maxLength" | "min" | "minLength" | "multiple" | "readOnly" | "required" | "src" | "width"> & {
|
|
49
|
-
value?: string | undefined;
|
|
50
|
-
defaultValue?: string | undefined;
|
|
51
|
-
block?: boolean | undefined;
|
|
52
|
-
clear?: boolean | undefined;
|
|
53
|
-
size?: "s" | "m" | "l" | "xl" | undefined;
|
|
54
|
-
colors?: "default" | "inverted" | undefined;
|
|
55
|
-
error?: React.ReactNode;
|
|
56
|
-
success?: boolean | undefined;
|
|
57
|
-
hint?: React.ReactNode;
|
|
58
|
-
label?: React.ReactNode;
|
|
59
|
-
labelView?: "inner" | "outer" | undefined;
|
|
60
|
-
type?: "number" | "text" | "tel" | "email" | "card" | "money" | "password" | undefined;
|
|
61
|
-
wrapperRef?: ((instance: HTMLDivElement | null) => void) | React.RefObject<HTMLDivElement> | null | undefined;
|
|
29
|
+
wrapperRef?: React.Ref<HTMLDivElement> | undefined;
|
|
62
30
|
leftAddons?: React.ReactNode;
|
|
63
31
|
rightAddons?: React.ReactNode;
|
|
64
32
|
bottomAddons?: React.ReactNode;
|
|
@@ -82,7 +50,7 @@ declare const withSuffix: (Input: React.FC<Pick<React.InputHTMLAttributes<HTMLIn
|
|
|
82
50
|
* Дополнительный закрепленный текст справа от основного значения.
|
|
83
51
|
* Например: value='85' suffix=' мес' -> 85 мес
|
|
84
52
|
*/
|
|
85
|
-
suffix?:
|
|
53
|
+
suffix?: ReactNode;
|
|
86
54
|
/**
|
|
87
55
|
* Дополнительный класс для контейнера с суффиксом
|
|
88
56
|
*/
|
package/modern/Component.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React, { forwardRef, useRef, useState, useCallback, Fragment } from 'react';
|
|
2
|
-
import cn from 'classnames';
|
|
3
2
|
import mergeRefs from 'react-merge-refs';
|
|
3
|
+
import cn from 'classnames';
|
|
4
4
|
import { Portal } from '@alfalab/core-components-portal/modern';
|
|
5
5
|
|
|
6
|
-
var styles = {"suffixContainer":"with-
|
|
6
|
+
var styles = {"suffixContainer":"with-suffix__suffixContainer_1l8bz","suffixVisible":"with-suffix__suffixVisible_1l8bz","hasSuffix":"with-suffix__hasSuffix_1l8bz","spacer":"with-suffix__spacer_1l8bz","suffix":"with-suffix__suffix_1l8bz","disabled":"with-suffix__disabled_1l8bz","readOnly":"with-suffix__readOnly_1l8bz"};
|
|
7
7
|
require('./index.css')
|
|
8
8
|
|
|
9
9
|
const withSuffix = (Input) => forwardRef(({ value, defaultValue, onChange, onClear, suffix = '', placeholder, className, disabled, readOnly, suffixContainerClassName, ...restProps }, ref) => {
|
|
@@ -18,7 +18,7 @@ const withSuffix = (Input) => forwardRef(({ value, defaultValue, onChange, onCle
|
|
|
18
18
|
setStateValue(payload.value);
|
|
19
19
|
}
|
|
20
20
|
}, [onChange, uncontrolled]);
|
|
21
|
-
const handleClear = useCallback(event => {
|
|
21
|
+
const handleClear = useCallback((event) => {
|
|
22
22
|
if (uncontrolled) {
|
|
23
23
|
setStateValue('');
|
|
24
24
|
}
|
|
@@ -31,10 +31,10 @@ const withSuffix = (Input) => forwardRef(({ value, defaultValue, onChange, onCle
|
|
|
31
31
|
() => inputRef.current.parentElement, []);
|
|
32
32
|
const visibleValue = uncontrolled ? stateValue : value;
|
|
33
33
|
return (React.createElement(Fragment, null,
|
|
34
|
-
React.createElement(Input,
|
|
34
|
+
React.createElement(Input, { ref: mergeRefs([ref, inputRef]), value: visibleValue, disabled: disabled, readOnly: readOnly, onChange: handleInputChange, onClear: handleClear, placeholder: placeholder, className: cn(className, {
|
|
35
35
|
[styles.suffixVisible]: Boolean(visibleValue),
|
|
36
36
|
[styles.hasSuffix]: suffix,
|
|
37
|
-
})
|
|
37
|
+
}), ...restProps }),
|
|
38
38
|
React.createElement(Portal, { getPortalContainer: getPortalContainer },
|
|
39
39
|
React.createElement("div", { className: cn(styles.suffixContainer, suffixContainerClassName) },
|
|
40
40
|
React.createElement("span", { className: styles.spacer }, visibleValue),
|
package/modern/index.css
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: h9ai2 */
|
|
2
2
|
:root {
|
|
3
3
|
--color-light-text-secondary: rgba(11, 31, 53, 0.7);
|
|
4
4
|
}
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
|
|
25
25
|
/* управляет видимостью иконки ошибки, если она стоит рядом с другой иконкой */
|
|
26
26
|
}
|
|
27
|
-
.with-
|
|
27
|
+
.with-suffix__suffixContainer_1l8bz {
|
|
28
28
|
font-size: 16px;
|
|
29
29
|
line-height: 20px;
|
|
30
30
|
font-weight: 400;
|
|
@@ -37,25 +37,25 @@
|
|
|
37
37
|
display: none;
|
|
38
38
|
pointer-events: none;
|
|
39
39
|
}
|
|
40
|
-
input:focus:not(:read-only) + .with-
|
|
41
|
-
.with-
|
|
40
|
+
input:focus:not(:read-only) + .with-suffix__suffixContainer_1l8bz,
|
|
41
|
+
.with-suffix__suffixVisible_1l8bz .with-suffix__suffixContainer_1l8bz {
|
|
42
42
|
display: inline-flex;
|
|
43
43
|
}
|
|
44
|
-
.with-
|
|
44
|
+
.with-suffix__hasSuffix_1l8bz input:focus::placeholder {
|
|
45
45
|
color: transparent;
|
|
46
46
|
transition: none;
|
|
47
47
|
}
|
|
48
|
-
.with-
|
|
48
|
+
.with-suffix__spacer_1l8bz {
|
|
49
49
|
visibility: hidden;
|
|
50
50
|
flex-shrink: 0;
|
|
51
51
|
white-space: pre;
|
|
52
52
|
}
|
|
53
|
-
.with-
|
|
53
|
+
.with-suffix__suffix_1l8bz {
|
|
54
54
|
white-space: pre;
|
|
55
55
|
}
|
|
56
|
-
.with-
|
|
56
|
+
.with-suffix__disabled_1l8bz {
|
|
57
57
|
color: var(--input-disabled-color);
|
|
58
58
|
}
|
|
59
|
-
.with-
|
|
59
|
+
.with-suffix__readOnly_1l8bz {
|
|
60
60
|
color: var(--input-read-only-color);
|
|
61
61
|
}
|
package/modern/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alfalab/core-components-with-suffix",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.12",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"license": "MIT",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"react": "^16.9.0 || ^17.0.1 || ^18.0.0"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@alfalab/core-components-input": "^
|
|
20
|
+
"@alfalab/core-components-input": "^11.0.1",
|
|
21
21
|
"@alfalab/core-components-portal": "^3.1.0",
|
|
22
22
|
"classnames": "^2.3.1",
|
|
23
23
|
"react-merge-refs": "^1.1.0"
|