@alfalab/core-components-slider-input 6.0.3 → 6.2.2
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 +21 -2
- package/Component.js +7 -3
- package/cssm/Component.d.ts +21 -2
- package/cssm/Component.js +6 -2
- package/esm/Component.d.ts +21 -2
- package/esm/Component.js +8 -4
- package/esm/index.css +17 -17
- package/index.css +17 -17
- package/modern/Component.d.ts +21 -2
- package/modern/Component.js +6 -4
- package/modern/index.css +17 -17
- package/package.json +3 -3
package/Component.d.ts
CHANGED
|
@@ -12,6 +12,10 @@ type SliderInputProps = Omit<InputProps, 'min' | 'max' | 'step' | 'value' | 'typ
|
|
|
12
12
|
* Макс. допустимое число
|
|
13
13
|
*/
|
|
14
14
|
max?: number;
|
|
15
|
+
/**
|
|
16
|
+
* Массив подписей к слайдеру
|
|
17
|
+
*/
|
|
18
|
+
steps?: ReactNode[];
|
|
15
19
|
/**
|
|
16
20
|
* Шаг (должен нацело делить отрезок между мин и макс)
|
|
17
21
|
*/
|
|
@@ -54,6 +58,10 @@ type SliderInputProps = Omit<InputProps, 'min' | 'max' | 'step' | 'value' | 'typ
|
|
|
54
58
|
* Класс для слайдера
|
|
55
59
|
*/
|
|
56
60
|
sliderClassName?: string;
|
|
61
|
+
/**
|
|
62
|
+
* Класс для шагов
|
|
63
|
+
*/
|
|
64
|
+
stepsClassName?: string;
|
|
57
65
|
/**
|
|
58
66
|
* Обработчик изменения значения через слайдер или поле ввода
|
|
59
67
|
*/
|
|
@@ -77,7 +85,7 @@ type SliderInputProps = Omit<InputProps, 'min' | 'max' | 'step' | 'value' | 'typ
|
|
|
77
85
|
*/
|
|
78
86
|
dataTestId?: string;
|
|
79
87
|
};
|
|
80
|
-
declare const SliderInput: React.ForwardRefExoticComponent<Pick<InputProps, "disabled" | "size" | "className" | "dataTestId" | "form" | "label" | "slot" | "style" | "title" | "pattern" | "leftAddons" | "rightAddons" | "block" | "colors" | "children" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "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" | "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" | "list" | "autoFocus" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "name" | "fieldClassName" | "labelClassName" | "addonsClassName" | "error" | "hint" | "accept" | "alt" | "autoComplete" | "capture" | "checked" | "crossOrigin" | "height" | "maxLength" | "minLength" | "multiple" | "readOnly" | "required" | "src" | "width" | "clear" | "success" | "inputClassName" | "focusedClassName" | "filledClassName" | "onClear" | "wrapperRef"> & {
|
|
88
|
+
declare const SliderInput: React.ForwardRefExoticComponent<Pick<InputProps, "disabled" | "size" | "className" | "dataTestId" | "form" | "label" | "slot" | "style" | "title" | "pattern" | "leftAddons" | "rightAddons" | "block" | "colors" | "children" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "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" | "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" | "list" | "autoFocus" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "name" | "fieldClassName" | "labelClassName" | "addonsClassName" | "error" | "hint" | "labelView" | "accept" | "alt" | "autoComplete" | "capture" | "checked" | "crossOrigin" | "height" | "maxLength" | "minLength" | "multiple" | "readOnly" | "required" | "src" | "width" | "clear" | "success" | "inputClassName" | "focusedClassName" | "filledClassName" | "onClear" | "wrapperRef"> & {
|
|
81
89
|
/**
|
|
82
90
|
* Мин. допустимое число
|
|
83
91
|
*/
|
|
@@ -86,6 +94,10 @@ declare const SliderInput: React.ForwardRefExoticComponent<Pick<InputProps, "dis
|
|
|
86
94
|
* Макс. допустимое число
|
|
87
95
|
*/
|
|
88
96
|
max?: number | undefined;
|
|
97
|
+
/**
|
|
98
|
+
* Массив подписей к слайдеру
|
|
99
|
+
*/
|
|
100
|
+
steps?: React.ReactNode[] | undefined;
|
|
89
101
|
/**
|
|
90
102
|
* Шаг (должен нацело делить отрезок между мин и макс)
|
|
91
103
|
*/
|
|
@@ -102,6 +114,9 @@ declare const SliderInput: React.ForwardRefExoticComponent<Pick<InputProps, "dis
|
|
|
102
114
|
to: (value: number) => React.Key;
|
|
103
115
|
from?: ((value: string) => number | false) | undefined;
|
|
104
116
|
} | undefined;
|
|
117
|
+
/**
|
|
118
|
+
* Массив подписей к слайдеру
|
|
119
|
+
*/
|
|
105
120
|
stepped?: boolean | undefined;
|
|
106
121
|
} | undefined;
|
|
107
122
|
/**
|
|
@@ -128,7 +143,7 @@ declare const SliderInput: React.ForwardRefExoticComponent<Pick<InputProps, "dis
|
|
|
128
143
|
/**
|
|
129
144
|
* Компонент поля ввода
|
|
130
145
|
*/
|
|
131
|
-
Input?: React.FC<Pick<InputProps, "min" | "max" | "step" | "disabled" | "size" | "className" | "dataTestId" | "form" | "label" | "slot" | "style" | "title" | "pattern" | "leftAddons" | "rightAddons" | "block" | "colors" | "children" | "type" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "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" | "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" | "list" | "autoFocus" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "name" | "fieldClassName" | "labelClassName" | "addonsClassName" | "error" | "hint" | "bottomAddons" | "accept" | "alt" | "autoComplete" | "capture" | "checked" | "crossOrigin" | "height" | "maxLength" | "minLength" | "multiple" | "readOnly" | "required" | "src" | "width" | "clear" | "success" | "inputClassName" | "focusedClassName" | "filledClassName" | "onClear" | "wrapperRef">> | undefined;
|
|
146
|
+
Input?: React.FC<Pick<InputProps, "min" | "max" | "step" | "disabled" | "size" | "className" | "dataTestId" | "form" | "label" | "slot" | "style" | "title" | "pattern" | "leftAddons" | "rightAddons" | "block" | "colors" | "children" | "type" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "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" | "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" | "list" | "autoFocus" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "name" | "fieldClassName" | "labelClassName" | "addonsClassName" | "error" | "hint" | "labelView" | "bottomAddons" | "accept" | "alt" | "autoComplete" | "capture" | "checked" | "crossOrigin" | "height" | "maxLength" | "minLength" | "multiple" | "readOnly" | "required" | "src" | "width" | "clear" | "success" | "inputClassName" | "focusedClassName" | "filledClassName" | "onClear" | "wrapperRef">> | undefined;
|
|
132
147
|
/**
|
|
133
148
|
* Кастомные пропсы для поля ввода
|
|
134
149
|
*/
|
|
@@ -141,6 +156,10 @@ declare const SliderInput: React.ForwardRefExoticComponent<Pick<InputProps, "dis
|
|
|
141
156
|
* Класс для слайдера
|
|
142
157
|
*/
|
|
143
158
|
sliderClassName?: string | undefined;
|
|
159
|
+
/**
|
|
160
|
+
* Класс для шагов
|
|
161
|
+
*/
|
|
162
|
+
stepsClassName?: string | undefined;
|
|
144
163
|
/**
|
|
145
164
|
* Обработчик изменения значения через слайдер или поле ввода
|
|
146
165
|
*/
|
package/Component.js
CHANGED
|
@@ -51,12 +51,12 @@ function __rest(s, e) {
|
|
|
51
51
|
return t;
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
-
var styles = {"component":"slider-
|
|
54
|
+
var styles = {"component":"slider-input__component_x201f","block":"slider-input__block_x201f","slider":"slider-input__slider_x201f","field":"slider-input__field_x201f","input":"slider-input__input_x201f","steps":"slider-input__steps_x201f","info":"slider-input__info_x201f","s":"slider-input__s_x201f","hasLabel":"slider-input__hasLabel_x201f","m":"slider-input__m_x201f","l":"slider-input__l_x201f","xl":"slider-input__xl_x201f","focused":"slider-input__focused_x201f","filled":"slider-input__filled_x201f"};
|
|
55
55
|
require('./index.css')
|
|
56
56
|
|
|
57
57
|
var SliderInput = React.forwardRef(function (_a, ref) {
|
|
58
58
|
var _b;
|
|
59
|
-
var className = _a.className, inputClassName = _a.inputClassName, sliderClassName = _a.sliderClassName, focusedClassName = _a.focusedClassName, fieldClassName = _a.fieldClassName, _c = _a.value, value = _c === void 0 ? '' : _c, _d = _a.min, min = _d === void 0 ? 0 : _d, _e = _a.max, max = _e === void 0 ? 100 : _e, _f = _a.step, step = _f === void 0 ? 1 : _f, block = _a.block, _g = _a.sliderValue, sliderValue =
|
|
59
|
+
var className = _a.className, inputClassName = _a.inputClassName, sliderClassName = _a.sliderClassName, stepsClassName = _a.stepsClassName, focusedClassName = _a.focusedClassName, fieldClassName = _a.fieldClassName, _c = _a.value, value = _c === void 0 ? '' : _c, _d = _a.min, min = _d === void 0 ? 0 : _d, _e = _a.max, max = _e === void 0 ? 100 : _e, _f = _a.step, step = _f === void 0 ? 1 : _f, block = _a.block, _g = _a.steps, steps = _g === void 0 ? [] : _g, _h = _a.sliderValue, sliderValue = _h === void 0 ? +value : _h, _j = _a.size, size = _j === void 0 ? 's' : _j, label = _a.label, info = _a.info, disabled = _a.disabled, readOnly = _a.readOnly, onChange = _a.onChange, onInputChange = _a.onInputChange, onSliderChange = _a.onSliderChange, rightAddons = _a.rightAddons, _k = _a.Input, Input = _k === void 0 ? coreComponentsInput.Input : _k, _l = _a.customInputProps, customInputProps = _l === void 0 ? {} : _l, error = _a.error, hint = _a.hint, pips = _a.pips, range = _a.range, dataTestId = _a.dataTestId, restProps = __rest(_a, ["className", "inputClassName", "sliderClassName", "stepsClassName", "focusedClassName", "fieldClassName", "value", "min", "max", "step", "block", "steps", "sliderValue", "size", "label", "info", "disabled", "readOnly", "onChange", "onInputChange", "onSliderChange", "rightAddons", "Input", "customInputProps", "error", "hint", "pips", "range", "dataTestId"]);
|
|
60
60
|
var getValidInputValue = React.useCallback(function (inputValue) {
|
|
61
61
|
var number = parseInt(inputValue, 10);
|
|
62
62
|
return inputValue === '' || Number.isNaN(number) ? '' : Math.abs(number);
|
|
@@ -81,7 +81,10 @@ var SliderInput = React.forwardRef(function (_a, ref) {
|
|
|
81
81
|
_b), styles[size], className), "data-test-id": dataTestId },
|
|
82
82
|
React__default['default'].createElement(Input, __assign({}, restProps, customInputProps, { ref: ref, value: value.toString(), onChange: handleInputChange, block: true, size: size, label: label, disabled: disabled, readOnly: readOnly, className: cn__default['default'](inputClassName, styles.input), focusedClassName: cn__default['default'](focusedClassName, styles.focused), fieldClassName: cn__default['default'](fieldClassName, styles.field), inputMode: 'numeric', pattern: '[0-9]*', error: error, hint: hint, bottomAddons: !disabled && (React__default['default'].createElement(coreComponentsSlider.Slider, { min: min, max: max, step: step, onChange: handleSliderChange, value: Number.isNaN(sliderValue) || !sliderValue ? min : sliderValue, disabled: disabled || readOnly, className: cn__default['default'](styles.slider, sliderClassName), pips: !error && !hint ? pips : undefined, range: range })), rightAddons: (info || rightAddons) && (React__default['default'].createElement(React.Fragment, null,
|
|
83
83
|
info && React__default['default'].createElement("span", { className: styles.info }, info),
|
|
84
|
-
rightAddons)) }))
|
|
84
|
+
rightAddons)) })),
|
|
85
|
+
steps.length > 0 && !error && (React__default['default'].createElement("div", { className: cn__default['default'](styles.steps, stepsClassName) }, steps.map(function (stepLabel, i) {
|
|
86
|
+
return React.isValidElement(stepLabel) ? (React.cloneElement(stepLabel, { key: i })) : (React__default['default'].createElement("span", { key: i.toString() }, stepLabel));
|
|
87
|
+
})))));
|
|
85
88
|
});
|
|
86
89
|
/**
|
|
87
90
|
* Для отображения в сторибуке
|
|
@@ -93,6 +96,7 @@ SliderInput.defaultProps = {
|
|
|
93
96
|
step: 1,
|
|
94
97
|
size: 's',
|
|
95
98
|
Input: coreComponentsInput.Input,
|
|
99
|
+
steps: [],
|
|
96
100
|
customInputProps: {},
|
|
97
101
|
};
|
|
98
102
|
|
package/cssm/Component.d.ts
CHANGED
|
@@ -12,6 +12,10 @@ type SliderInputProps = Omit<InputProps, 'min' | 'max' | 'step' | 'value' | 'typ
|
|
|
12
12
|
* Макс. допустимое число
|
|
13
13
|
*/
|
|
14
14
|
max?: number;
|
|
15
|
+
/**
|
|
16
|
+
* Массив подписей к слайдеру
|
|
17
|
+
*/
|
|
18
|
+
steps?: ReactNode[];
|
|
15
19
|
/**
|
|
16
20
|
* Шаг (должен нацело делить отрезок между мин и макс)
|
|
17
21
|
*/
|
|
@@ -54,6 +58,10 @@ type SliderInputProps = Omit<InputProps, 'min' | 'max' | 'step' | 'value' | 'typ
|
|
|
54
58
|
* Класс для слайдера
|
|
55
59
|
*/
|
|
56
60
|
sliderClassName?: string;
|
|
61
|
+
/**
|
|
62
|
+
* Класс для шагов
|
|
63
|
+
*/
|
|
64
|
+
stepsClassName?: string;
|
|
57
65
|
/**
|
|
58
66
|
* Обработчик изменения значения через слайдер или поле ввода
|
|
59
67
|
*/
|
|
@@ -77,7 +85,7 @@ type SliderInputProps = Omit<InputProps, 'min' | 'max' | 'step' | 'value' | 'typ
|
|
|
77
85
|
*/
|
|
78
86
|
dataTestId?: string;
|
|
79
87
|
};
|
|
80
|
-
declare const SliderInput: React.ForwardRefExoticComponent<Pick<InputProps, "disabled" | "size" | "className" | "dataTestId" | "form" | "label" | "slot" | "style" | "title" | "pattern" | "leftAddons" | "rightAddons" | "block" | "colors" | "children" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "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" | "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" | "list" | "autoFocus" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "name" | "fieldClassName" | "labelClassName" | "addonsClassName" | "error" | "hint" | "accept" | "alt" | "autoComplete" | "capture" | "checked" | "crossOrigin" | "height" | "maxLength" | "minLength" | "multiple" | "readOnly" | "required" | "src" | "width" | "clear" | "success" | "inputClassName" | "focusedClassName" | "filledClassName" | "onClear" | "wrapperRef"> & {
|
|
88
|
+
declare const SliderInput: React.ForwardRefExoticComponent<Pick<InputProps, "disabled" | "size" | "className" | "dataTestId" | "form" | "label" | "slot" | "style" | "title" | "pattern" | "leftAddons" | "rightAddons" | "block" | "colors" | "children" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "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" | "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" | "list" | "autoFocus" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "name" | "fieldClassName" | "labelClassName" | "addonsClassName" | "error" | "hint" | "labelView" | "accept" | "alt" | "autoComplete" | "capture" | "checked" | "crossOrigin" | "height" | "maxLength" | "minLength" | "multiple" | "readOnly" | "required" | "src" | "width" | "clear" | "success" | "inputClassName" | "focusedClassName" | "filledClassName" | "onClear" | "wrapperRef"> & {
|
|
81
89
|
/**
|
|
82
90
|
* Мин. допустимое число
|
|
83
91
|
*/
|
|
@@ -86,6 +94,10 @@ declare const SliderInput: React.ForwardRefExoticComponent<Pick<InputProps, "dis
|
|
|
86
94
|
* Макс. допустимое число
|
|
87
95
|
*/
|
|
88
96
|
max?: number | undefined;
|
|
97
|
+
/**
|
|
98
|
+
* Массив подписей к слайдеру
|
|
99
|
+
*/
|
|
100
|
+
steps?: React.ReactNode[] | undefined;
|
|
89
101
|
/**
|
|
90
102
|
* Шаг (должен нацело делить отрезок между мин и макс)
|
|
91
103
|
*/
|
|
@@ -102,6 +114,9 @@ declare const SliderInput: React.ForwardRefExoticComponent<Pick<InputProps, "dis
|
|
|
102
114
|
to: (value: number) => React.Key;
|
|
103
115
|
from?: ((value: string) => number | false) | undefined;
|
|
104
116
|
} | undefined;
|
|
117
|
+
/**
|
|
118
|
+
* Массив подписей к слайдеру
|
|
119
|
+
*/
|
|
105
120
|
stepped?: boolean | undefined;
|
|
106
121
|
} | undefined;
|
|
107
122
|
/**
|
|
@@ -128,7 +143,7 @@ declare const SliderInput: React.ForwardRefExoticComponent<Pick<InputProps, "dis
|
|
|
128
143
|
/**
|
|
129
144
|
* Компонент поля ввода
|
|
130
145
|
*/
|
|
131
|
-
Input?: React.FC<Pick<InputProps, "min" | "max" | "step" | "disabled" | "size" | "className" | "dataTestId" | "form" | "label" | "slot" | "style" | "title" | "pattern" | "leftAddons" | "rightAddons" | "block" | "colors" | "children" | "type" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "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" | "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" | "list" | "autoFocus" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "name" | "fieldClassName" | "labelClassName" | "addonsClassName" | "error" | "hint" | "bottomAddons" | "accept" | "alt" | "autoComplete" | "capture" | "checked" | "crossOrigin" | "height" | "maxLength" | "minLength" | "multiple" | "readOnly" | "required" | "src" | "width" | "clear" | "success" | "inputClassName" | "focusedClassName" | "filledClassName" | "onClear" | "wrapperRef">> | undefined;
|
|
146
|
+
Input?: React.FC<Pick<InputProps, "min" | "max" | "step" | "disabled" | "size" | "className" | "dataTestId" | "form" | "label" | "slot" | "style" | "title" | "pattern" | "leftAddons" | "rightAddons" | "block" | "colors" | "children" | "type" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "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" | "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" | "list" | "autoFocus" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "name" | "fieldClassName" | "labelClassName" | "addonsClassName" | "error" | "hint" | "labelView" | "bottomAddons" | "accept" | "alt" | "autoComplete" | "capture" | "checked" | "crossOrigin" | "height" | "maxLength" | "minLength" | "multiple" | "readOnly" | "required" | "src" | "width" | "clear" | "success" | "inputClassName" | "focusedClassName" | "filledClassName" | "onClear" | "wrapperRef">> | undefined;
|
|
132
147
|
/**
|
|
133
148
|
* Кастомные пропсы для поля ввода
|
|
134
149
|
*/
|
|
@@ -141,6 +156,10 @@ declare const SliderInput: React.ForwardRefExoticComponent<Pick<InputProps, "dis
|
|
|
141
156
|
* Класс для слайдера
|
|
142
157
|
*/
|
|
143
158
|
sliderClassName?: string | undefined;
|
|
159
|
+
/**
|
|
160
|
+
* Класс для шагов
|
|
161
|
+
*/
|
|
162
|
+
stepsClassName?: string | undefined;
|
|
144
163
|
/**
|
|
145
164
|
* Обработчик изменения значения через слайдер или поле ввода
|
|
146
165
|
*/
|
package/cssm/Component.js
CHANGED
|
@@ -55,7 +55,7 @@ function __rest(s, e) {
|
|
|
55
55
|
|
|
56
56
|
var SliderInput = React.forwardRef(function (_a, ref) {
|
|
57
57
|
var _b;
|
|
58
|
-
var className = _a.className, inputClassName = _a.inputClassName, sliderClassName = _a.sliderClassName, focusedClassName = _a.focusedClassName, fieldClassName = _a.fieldClassName, _c = _a.value, value = _c === void 0 ? '' : _c, _d = _a.min, min = _d === void 0 ? 0 : _d, _e = _a.max, max = _e === void 0 ? 100 : _e, _f = _a.step, step = _f === void 0 ? 1 : _f, block = _a.block, _g = _a.sliderValue, sliderValue =
|
|
58
|
+
var className = _a.className, inputClassName = _a.inputClassName, sliderClassName = _a.sliderClassName, stepsClassName = _a.stepsClassName, focusedClassName = _a.focusedClassName, fieldClassName = _a.fieldClassName, _c = _a.value, value = _c === void 0 ? '' : _c, _d = _a.min, min = _d === void 0 ? 0 : _d, _e = _a.max, max = _e === void 0 ? 100 : _e, _f = _a.step, step = _f === void 0 ? 1 : _f, block = _a.block, _g = _a.steps, steps = _g === void 0 ? [] : _g, _h = _a.sliderValue, sliderValue = _h === void 0 ? +value : _h, _j = _a.size, size = _j === void 0 ? 's' : _j, label = _a.label, info = _a.info, disabled = _a.disabled, readOnly = _a.readOnly, onChange = _a.onChange, onInputChange = _a.onInputChange, onSliderChange = _a.onSliderChange, rightAddons = _a.rightAddons, _k = _a.Input, Input = _k === void 0 ? coreComponentsInput.Input : _k, _l = _a.customInputProps, customInputProps = _l === void 0 ? {} : _l, error = _a.error, hint = _a.hint, pips = _a.pips, range = _a.range, dataTestId = _a.dataTestId, restProps = __rest(_a, ["className", "inputClassName", "sliderClassName", "stepsClassName", "focusedClassName", "fieldClassName", "value", "min", "max", "step", "block", "steps", "sliderValue", "size", "label", "info", "disabled", "readOnly", "onChange", "onInputChange", "onSliderChange", "rightAddons", "Input", "customInputProps", "error", "hint", "pips", "range", "dataTestId"]);
|
|
59
59
|
var getValidInputValue = React.useCallback(function (inputValue) {
|
|
60
60
|
var number = parseInt(inputValue, 10);
|
|
61
61
|
return inputValue === '' || Number.isNaN(number) ? '' : Math.abs(number);
|
|
@@ -80,7 +80,10 @@ var SliderInput = React.forwardRef(function (_a, ref) {
|
|
|
80
80
|
_b), styles__default['default'][size], className), "data-test-id": dataTestId },
|
|
81
81
|
React__default['default'].createElement(Input, __assign({}, restProps, customInputProps, { ref: ref, value: value.toString(), onChange: handleInputChange, block: true, size: size, label: label, disabled: disabled, readOnly: readOnly, className: cn__default['default'](inputClassName, styles__default['default'].input), focusedClassName: cn__default['default'](focusedClassName, styles__default['default'].focused), fieldClassName: cn__default['default'](fieldClassName, styles__default['default'].field), inputMode: 'numeric', pattern: '[0-9]*', error: error, hint: hint, bottomAddons: !disabled && (React__default['default'].createElement(coreComponentsSlider.Slider, { min: min, max: max, step: step, onChange: handleSliderChange, value: Number.isNaN(sliderValue) || !sliderValue ? min : sliderValue, disabled: disabled || readOnly, className: cn__default['default'](styles__default['default'].slider, sliderClassName), pips: !error && !hint ? pips : undefined, range: range })), rightAddons: (info || rightAddons) && (React__default['default'].createElement(React.Fragment, null,
|
|
82
82
|
info && React__default['default'].createElement("span", { className: styles__default['default'].info }, info),
|
|
83
|
-
rightAddons)) }))
|
|
83
|
+
rightAddons)) })),
|
|
84
|
+
steps.length > 0 && !error && (React__default['default'].createElement("div", { className: cn__default['default'](styles__default['default'].steps, stepsClassName) }, steps.map(function (stepLabel, i) {
|
|
85
|
+
return React.isValidElement(stepLabel) ? (React.cloneElement(stepLabel, { key: i })) : (React__default['default'].createElement("span", { key: i.toString() }, stepLabel));
|
|
86
|
+
})))));
|
|
84
87
|
});
|
|
85
88
|
/**
|
|
86
89
|
* Для отображения в сторибуке
|
|
@@ -92,6 +95,7 @@ SliderInput.defaultProps = {
|
|
|
92
95
|
step: 1,
|
|
93
96
|
size: 's',
|
|
94
97
|
Input: coreComponentsInput.Input,
|
|
98
|
+
steps: [],
|
|
95
99
|
customInputProps: {},
|
|
96
100
|
};
|
|
97
101
|
|
package/esm/Component.d.ts
CHANGED
|
@@ -12,6 +12,10 @@ type SliderInputProps = Omit<InputProps, 'min' | 'max' | 'step' | 'value' | 'typ
|
|
|
12
12
|
* Макс. допустимое число
|
|
13
13
|
*/
|
|
14
14
|
max?: number;
|
|
15
|
+
/**
|
|
16
|
+
* Массив подписей к слайдеру
|
|
17
|
+
*/
|
|
18
|
+
steps?: ReactNode[];
|
|
15
19
|
/**
|
|
16
20
|
* Шаг (должен нацело делить отрезок между мин и макс)
|
|
17
21
|
*/
|
|
@@ -54,6 +58,10 @@ type SliderInputProps = Omit<InputProps, 'min' | 'max' | 'step' | 'value' | 'typ
|
|
|
54
58
|
* Класс для слайдера
|
|
55
59
|
*/
|
|
56
60
|
sliderClassName?: string;
|
|
61
|
+
/**
|
|
62
|
+
* Класс для шагов
|
|
63
|
+
*/
|
|
64
|
+
stepsClassName?: string;
|
|
57
65
|
/**
|
|
58
66
|
* Обработчик изменения значения через слайдер или поле ввода
|
|
59
67
|
*/
|
|
@@ -77,7 +85,7 @@ type SliderInputProps = Omit<InputProps, 'min' | 'max' | 'step' | 'value' | 'typ
|
|
|
77
85
|
*/
|
|
78
86
|
dataTestId?: string;
|
|
79
87
|
};
|
|
80
|
-
declare const SliderInput: React.ForwardRefExoticComponent<Pick<InputProps, "disabled" | "size" | "className" | "dataTestId" | "form" | "label" | "slot" | "style" | "title" | "pattern" | "leftAddons" | "rightAddons" | "block" | "colors" | "children" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "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" | "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" | "list" | "autoFocus" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "name" | "fieldClassName" | "labelClassName" | "addonsClassName" | "error" | "hint" | "accept" | "alt" | "autoComplete" | "capture" | "checked" | "crossOrigin" | "height" | "maxLength" | "minLength" | "multiple" | "readOnly" | "required" | "src" | "width" | "clear" | "success" | "inputClassName" | "focusedClassName" | "filledClassName" | "onClear" | "wrapperRef"> & {
|
|
88
|
+
declare const SliderInput: React.ForwardRefExoticComponent<Pick<InputProps, "disabled" | "size" | "className" | "dataTestId" | "form" | "label" | "slot" | "style" | "title" | "pattern" | "leftAddons" | "rightAddons" | "block" | "colors" | "children" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "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" | "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" | "list" | "autoFocus" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "name" | "fieldClassName" | "labelClassName" | "addonsClassName" | "error" | "hint" | "labelView" | "accept" | "alt" | "autoComplete" | "capture" | "checked" | "crossOrigin" | "height" | "maxLength" | "minLength" | "multiple" | "readOnly" | "required" | "src" | "width" | "clear" | "success" | "inputClassName" | "focusedClassName" | "filledClassName" | "onClear" | "wrapperRef"> & {
|
|
81
89
|
/**
|
|
82
90
|
* Мин. допустимое число
|
|
83
91
|
*/
|
|
@@ -86,6 +94,10 @@ declare const SliderInput: React.ForwardRefExoticComponent<Pick<InputProps, "dis
|
|
|
86
94
|
* Макс. допустимое число
|
|
87
95
|
*/
|
|
88
96
|
max?: number | undefined;
|
|
97
|
+
/**
|
|
98
|
+
* Массив подписей к слайдеру
|
|
99
|
+
*/
|
|
100
|
+
steps?: React.ReactNode[] | undefined;
|
|
89
101
|
/**
|
|
90
102
|
* Шаг (должен нацело делить отрезок между мин и макс)
|
|
91
103
|
*/
|
|
@@ -102,6 +114,9 @@ declare const SliderInput: React.ForwardRefExoticComponent<Pick<InputProps, "dis
|
|
|
102
114
|
to: (value: number) => React.Key;
|
|
103
115
|
from?: ((value: string) => number | false) | undefined;
|
|
104
116
|
} | undefined;
|
|
117
|
+
/**
|
|
118
|
+
* Массив подписей к слайдеру
|
|
119
|
+
*/
|
|
105
120
|
stepped?: boolean | undefined;
|
|
106
121
|
} | undefined;
|
|
107
122
|
/**
|
|
@@ -128,7 +143,7 @@ declare const SliderInput: React.ForwardRefExoticComponent<Pick<InputProps, "dis
|
|
|
128
143
|
/**
|
|
129
144
|
* Компонент поля ввода
|
|
130
145
|
*/
|
|
131
|
-
Input?: React.FC<Pick<InputProps, "min" | "max" | "step" | "disabled" | "size" | "className" | "dataTestId" | "form" | "label" | "slot" | "style" | "title" | "pattern" | "leftAddons" | "rightAddons" | "block" | "colors" | "children" | "type" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "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" | "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" | "list" | "autoFocus" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "name" | "fieldClassName" | "labelClassName" | "addonsClassName" | "error" | "hint" | "bottomAddons" | "accept" | "alt" | "autoComplete" | "capture" | "checked" | "crossOrigin" | "height" | "maxLength" | "minLength" | "multiple" | "readOnly" | "required" | "src" | "width" | "clear" | "success" | "inputClassName" | "focusedClassName" | "filledClassName" | "onClear" | "wrapperRef">> | undefined;
|
|
146
|
+
Input?: React.FC<Pick<InputProps, "min" | "max" | "step" | "disabled" | "size" | "className" | "dataTestId" | "form" | "label" | "slot" | "style" | "title" | "pattern" | "leftAddons" | "rightAddons" | "block" | "colors" | "children" | "type" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "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" | "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" | "list" | "autoFocus" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "name" | "fieldClassName" | "labelClassName" | "addonsClassName" | "error" | "hint" | "labelView" | "bottomAddons" | "accept" | "alt" | "autoComplete" | "capture" | "checked" | "crossOrigin" | "height" | "maxLength" | "minLength" | "multiple" | "readOnly" | "required" | "src" | "width" | "clear" | "success" | "inputClassName" | "focusedClassName" | "filledClassName" | "onClear" | "wrapperRef">> | undefined;
|
|
132
147
|
/**
|
|
133
148
|
* Кастомные пропсы для поля ввода
|
|
134
149
|
*/
|
|
@@ -141,6 +156,10 @@ declare const SliderInput: React.ForwardRefExoticComponent<Pick<InputProps, "dis
|
|
|
141
156
|
* Класс для слайдера
|
|
142
157
|
*/
|
|
143
158
|
sliderClassName?: string | undefined;
|
|
159
|
+
/**
|
|
160
|
+
* Класс для шагов
|
|
161
|
+
*/
|
|
162
|
+
stepsClassName?: string | undefined;
|
|
144
163
|
/**
|
|
145
164
|
* Обработчик изменения значения через слайдер или поле ввода
|
|
146
165
|
*/
|
package/esm/Component.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { forwardRef, useCallback, Fragment } from 'react';
|
|
1
|
+
import React, { forwardRef, useCallback, Fragment, isValidElement, cloneElement } from 'react';
|
|
2
2
|
import cn from 'classnames';
|
|
3
3
|
import { Slider } from '@alfalab/core-components-slider/esm';
|
|
4
4
|
import { Input } from '@alfalab/core-components-input/esm';
|
|
@@ -42,12 +42,12 @@ function __rest(s, e) {
|
|
|
42
42
|
return t;
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
-
var styles = {"component":"slider-
|
|
45
|
+
var styles = {"component":"slider-input__component_x201f","block":"slider-input__block_x201f","slider":"slider-input__slider_x201f","field":"slider-input__field_x201f","input":"slider-input__input_x201f","steps":"slider-input__steps_x201f","info":"slider-input__info_x201f","s":"slider-input__s_x201f","hasLabel":"slider-input__hasLabel_x201f","m":"slider-input__m_x201f","l":"slider-input__l_x201f","xl":"slider-input__xl_x201f","focused":"slider-input__focused_x201f","filled":"slider-input__filled_x201f"};
|
|
46
46
|
require('./index.css')
|
|
47
47
|
|
|
48
48
|
var SliderInput = forwardRef(function (_a, ref) {
|
|
49
49
|
var _b;
|
|
50
|
-
var className = _a.className, inputClassName = _a.inputClassName, sliderClassName = _a.sliderClassName, focusedClassName = _a.focusedClassName, fieldClassName = _a.fieldClassName, _c = _a.value, value = _c === void 0 ? '' : _c, _d = _a.min, min = _d === void 0 ? 0 : _d, _e = _a.max, max = _e === void 0 ? 100 : _e, _f = _a.step, step = _f === void 0 ? 1 : _f, block = _a.block, _g = _a.sliderValue, sliderValue =
|
|
50
|
+
var className = _a.className, inputClassName = _a.inputClassName, sliderClassName = _a.sliderClassName, stepsClassName = _a.stepsClassName, focusedClassName = _a.focusedClassName, fieldClassName = _a.fieldClassName, _c = _a.value, value = _c === void 0 ? '' : _c, _d = _a.min, min = _d === void 0 ? 0 : _d, _e = _a.max, max = _e === void 0 ? 100 : _e, _f = _a.step, step = _f === void 0 ? 1 : _f, block = _a.block, _g = _a.steps, steps = _g === void 0 ? [] : _g, _h = _a.sliderValue, sliderValue = _h === void 0 ? +value : _h, _j = _a.size, size = _j === void 0 ? 's' : _j, label = _a.label, info = _a.info, disabled = _a.disabled, readOnly = _a.readOnly, onChange = _a.onChange, onInputChange = _a.onInputChange, onSliderChange = _a.onSliderChange, rightAddons = _a.rightAddons, _k = _a.Input, Input$1 = _k === void 0 ? Input : _k, _l = _a.customInputProps, customInputProps = _l === void 0 ? {} : _l, error = _a.error, hint = _a.hint, pips = _a.pips, range = _a.range, dataTestId = _a.dataTestId, restProps = __rest(_a, ["className", "inputClassName", "sliderClassName", "stepsClassName", "focusedClassName", "fieldClassName", "value", "min", "max", "step", "block", "steps", "sliderValue", "size", "label", "info", "disabled", "readOnly", "onChange", "onInputChange", "onSliderChange", "rightAddons", "Input", "customInputProps", "error", "hint", "pips", "range", "dataTestId"]);
|
|
51
51
|
var getValidInputValue = useCallback(function (inputValue) {
|
|
52
52
|
var number = parseInt(inputValue, 10);
|
|
53
53
|
return inputValue === '' || Number.isNaN(number) ? '' : Math.abs(number);
|
|
@@ -72,7 +72,10 @@ var SliderInput = forwardRef(function (_a, ref) {
|
|
|
72
72
|
_b), styles[size], className), "data-test-id": dataTestId },
|
|
73
73
|
React.createElement(Input$1, __assign({}, restProps, customInputProps, { ref: ref, value: value.toString(), onChange: handleInputChange, block: true, size: size, label: label, disabled: disabled, readOnly: readOnly, className: cn(inputClassName, styles.input), focusedClassName: cn(focusedClassName, styles.focused), fieldClassName: cn(fieldClassName, styles.field), inputMode: 'numeric', pattern: '[0-9]*', error: error, hint: hint, bottomAddons: !disabled && (React.createElement(Slider, { min: min, max: max, step: step, onChange: handleSliderChange, value: Number.isNaN(sliderValue) || !sliderValue ? min : sliderValue, disabled: disabled || readOnly, className: cn(styles.slider, sliderClassName), pips: !error && !hint ? pips : undefined, range: range })), rightAddons: (info || rightAddons) && (React.createElement(Fragment, null,
|
|
74
74
|
info && React.createElement("span", { className: styles.info }, info),
|
|
75
|
-
rightAddons)) }))
|
|
75
|
+
rightAddons)) })),
|
|
76
|
+
steps.length > 0 && !error && (React.createElement("div", { className: cn(styles.steps, stepsClassName) }, steps.map(function (stepLabel, i) {
|
|
77
|
+
return isValidElement(stepLabel) ? (cloneElement(stepLabel, { key: i })) : (React.createElement("span", { key: i.toString() }, stepLabel));
|
|
78
|
+
})))));
|
|
76
79
|
});
|
|
77
80
|
/**
|
|
78
81
|
* Для отображения в сторибуке
|
|
@@ -84,6 +87,7 @@ SliderInput.defaultProps = {
|
|
|
84
87
|
step: 1,
|
|
85
88
|
size: 's',
|
|
86
89
|
Input: Input,
|
|
90
|
+
steps: [],
|
|
87
91
|
customInputProps: {},
|
|
88
92
|
};
|
|
89
93
|
|
package/esm/index.css
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: 1p40g */
|
|
2
2
|
:root {
|
|
3
3
|
--color-light-text-secondary: #546272;
|
|
4
4
|
}
|
|
@@ -47,34 +47,34 @@
|
|
|
47
47
|
--slider-input-info-color: var(--color-light-text-secondary);
|
|
48
48
|
--slider-input-font-weight: 700;
|
|
49
49
|
}
|
|
50
|
-
.slider-
|
|
50
|
+
.slider-input__component_x201f {
|
|
51
51
|
position: relative;
|
|
52
52
|
display: inline-block;
|
|
53
53
|
}
|
|
54
|
-
.slider-
|
|
54
|
+
.slider-input__block_x201f {
|
|
55
55
|
display: block;
|
|
56
56
|
}
|
|
57
|
-
.slider-
|
|
57
|
+
.slider-input__slider_x201f {
|
|
58
58
|
margin-top: calc(var(--slider-progress-s-height) / -2);
|
|
59
59
|
transform: translateY(-1px)
|
|
60
60
|
}
|
|
61
|
-
.slider-
|
|
61
|
+
.slider-input__slider_x201f + * {
|
|
62
62
|
margin-top: var(--gap-xs);
|
|
63
63
|
}
|
|
64
|
-
.slider-
|
|
64
|
+
.slider-input__field_x201f {
|
|
65
65
|
border-bottom-left-radius: 0;
|
|
66
66
|
border-bottom-right-radius: 0;
|
|
67
67
|
}
|
|
68
|
-
.slider-
|
|
69
|
-
.slider-
|
|
68
|
+
.slider-input__input_x201f input,
|
|
69
|
+
.slider-input__input_x201f input + div {
|
|
70
70
|
font-weight: var(--slider-input-font-weight);
|
|
71
71
|
font-feature-settings: "tnum";
|
|
72
72
|
font-variant-numeric: tabular-nums;
|
|
73
73
|
}
|
|
74
|
-
.slider-
|
|
74
|
+
.slider-input__input_x201f input::placeholder {
|
|
75
75
|
font-weight: 400;
|
|
76
76
|
}
|
|
77
|
-
.slider-
|
|
77
|
+
.slider-input__steps_x201f {
|
|
78
78
|
font-size: 14px;
|
|
79
79
|
line-height: 18px;
|
|
80
80
|
font-weight: 400;
|
|
@@ -84,7 +84,7 @@
|
|
|
84
84
|
margin-top: var(--gap-xs);
|
|
85
85
|
color: var(--slider-input-steps-color);
|
|
86
86
|
}
|
|
87
|
-
.slider-
|
|
87
|
+
.slider-input__info_x201f {
|
|
88
88
|
font-size: 16px;
|
|
89
89
|
line-height: 20px;
|
|
90
90
|
font-weight: 400;
|
|
@@ -95,28 +95,28 @@
|
|
|
95
95
|
transition: 0.2s ease;
|
|
96
96
|
visibility: hidden;
|
|
97
97
|
}
|
|
98
|
-
.slider-
|
|
98
|
+
.slider-input__s_x201f.slider-input__hasLabel_x201f .slider-input__info_x201f:first-child {
|
|
99
99
|
padding: var(--form-control-labeled-s-paddings);
|
|
100
100
|
padding-left: 0;
|
|
101
101
|
padding-right: 0;
|
|
102
102
|
}
|
|
103
|
-
.slider-
|
|
103
|
+
.slider-input__m_x201f.slider-input__hasLabel_x201f .slider-input__info_x201f:first-child {
|
|
104
104
|
padding: var(--form-control-labeled-m-paddings);
|
|
105
105
|
padding-left: 0;
|
|
106
106
|
padding-right: 0;
|
|
107
107
|
}
|
|
108
|
-
.slider-
|
|
108
|
+
.slider-input__l_x201f.slider-input__hasLabel_x201f .slider-input__info_x201f:first-child {
|
|
109
109
|
padding: var(--form-control-labeled-l-paddings);
|
|
110
110
|
padding-left: 0;
|
|
111
111
|
padding-right: 0;
|
|
112
112
|
}
|
|
113
|
-
.slider-
|
|
113
|
+
.slider-input__xl_x201f.slider-input__hasLabel_x201f .slider-input__info_x201f:first-child {
|
|
114
114
|
padding: var(--form-control-labeled-xl-paddings);
|
|
115
115
|
padding-left: 0;
|
|
116
116
|
padding-right: 0;
|
|
117
117
|
}
|
|
118
|
-
.slider-
|
|
119
|
-
.slider-
|
|
118
|
+
.slider-input__focused_x201f .slider-input__info_x201f,
|
|
119
|
+
.slider-input__filled_x201f .slider-input__info_x201f {
|
|
120
120
|
visibility: visible;
|
|
121
121
|
opacity: 1;
|
|
122
122
|
}
|
package/index.css
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: 1p40g */
|
|
2
2
|
:root {
|
|
3
3
|
--color-light-text-secondary: #546272;
|
|
4
4
|
}
|
|
@@ -47,34 +47,34 @@
|
|
|
47
47
|
--slider-input-info-color: var(--color-light-text-secondary);
|
|
48
48
|
--slider-input-font-weight: 700;
|
|
49
49
|
}
|
|
50
|
-
.slider-
|
|
50
|
+
.slider-input__component_x201f {
|
|
51
51
|
position: relative;
|
|
52
52
|
display: inline-block;
|
|
53
53
|
}
|
|
54
|
-
.slider-
|
|
54
|
+
.slider-input__block_x201f {
|
|
55
55
|
display: block;
|
|
56
56
|
}
|
|
57
|
-
.slider-
|
|
57
|
+
.slider-input__slider_x201f {
|
|
58
58
|
margin-top: calc(var(--slider-progress-s-height) / -2);
|
|
59
59
|
transform: translateY(-1px)
|
|
60
60
|
}
|
|
61
|
-
.slider-
|
|
61
|
+
.slider-input__slider_x201f + * {
|
|
62
62
|
margin-top: var(--gap-xs);
|
|
63
63
|
}
|
|
64
|
-
.slider-
|
|
64
|
+
.slider-input__field_x201f {
|
|
65
65
|
border-bottom-left-radius: 0;
|
|
66
66
|
border-bottom-right-radius: 0;
|
|
67
67
|
}
|
|
68
|
-
.slider-
|
|
69
|
-
.slider-
|
|
68
|
+
.slider-input__input_x201f input,
|
|
69
|
+
.slider-input__input_x201f input + div {
|
|
70
70
|
font-weight: var(--slider-input-font-weight);
|
|
71
71
|
font-feature-settings: "tnum";
|
|
72
72
|
font-variant-numeric: tabular-nums;
|
|
73
73
|
}
|
|
74
|
-
.slider-
|
|
74
|
+
.slider-input__input_x201f input::placeholder {
|
|
75
75
|
font-weight: 400;
|
|
76
76
|
}
|
|
77
|
-
.slider-
|
|
77
|
+
.slider-input__steps_x201f {
|
|
78
78
|
font-size: 14px;
|
|
79
79
|
line-height: 18px;
|
|
80
80
|
font-weight: 400;
|
|
@@ -84,7 +84,7 @@
|
|
|
84
84
|
margin-top: var(--gap-xs);
|
|
85
85
|
color: var(--slider-input-steps-color);
|
|
86
86
|
}
|
|
87
|
-
.slider-
|
|
87
|
+
.slider-input__info_x201f {
|
|
88
88
|
font-size: 16px;
|
|
89
89
|
line-height: 20px;
|
|
90
90
|
font-weight: 400;
|
|
@@ -95,28 +95,28 @@
|
|
|
95
95
|
transition: 0.2s ease;
|
|
96
96
|
visibility: hidden;
|
|
97
97
|
}
|
|
98
|
-
.slider-
|
|
98
|
+
.slider-input__s_x201f.slider-input__hasLabel_x201f .slider-input__info_x201f:first-child {
|
|
99
99
|
padding: var(--form-control-labeled-s-paddings);
|
|
100
100
|
padding-left: 0;
|
|
101
101
|
padding-right: 0;
|
|
102
102
|
}
|
|
103
|
-
.slider-
|
|
103
|
+
.slider-input__m_x201f.slider-input__hasLabel_x201f .slider-input__info_x201f:first-child {
|
|
104
104
|
padding: var(--form-control-labeled-m-paddings);
|
|
105
105
|
padding-left: 0;
|
|
106
106
|
padding-right: 0;
|
|
107
107
|
}
|
|
108
|
-
.slider-
|
|
108
|
+
.slider-input__l_x201f.slider-input__hasLabel_x201f .slider-input__info_x201f:first-child {
|
|
109
109
|
padding: var(--form-control-labeled-l-paddings);
|
|
110
110
|
padding-left: 0;
|
|
111
111
|
padding-right: 0;
|
|
112
112
|
}
|
|
113
|
-
.slider-
|
|
113
|
+
.slider-input__xl_x201f.slider-input__hasLabel_x201f .slider-input__info_x201f:first-child {
|
|
114
114
|
padding: var(--form-control-labeled-xl-paddings);
|
|
115
115
|
padding-left: 0;
|
|
116
116
|
padding-right: 0;
|
|
117
117
|
}
|
|
118
|
-
.slider-
|
|
119
|
-
.slider-
|
|
118
|
+
.slider-input__focused_x201f .slider-input__info_x201f,
|
|
119
|
+
.slider-input__filled_x201f .slider-input__info_x201f {
|
|
120
120
|
visibility: visible;
|
|
121
121
|
opacity: 1;
|
|
122
122
|
}
|
package/modern/Component.d.ts
CHANGED
|
@@ -12,6 +12,10 @@ type SliderInputProps = Omit<InputProps, 'min' | 'max' | 'step' | 'value' | 'typ
|
|
|
12
12
|
* Макс. допустимое число
|
|
13
13
|
*/
|
|
14
14
|
max?: number;
|
|
15
|
+
/**
|
|
16
|
+
* Массив подписей к слайдеру
|
|
17
|
+
*/
|
|
18
|
+
steps?: ReactNode[];
|
|
15
19
|
/**
|
|
16
20
|
* Шаг (должен нацело делить отрезок между мин и макс)
|
|
17
21
|
*/
|
|
@@ -54,6 +58,10 @@ type SliderInputProps = Omit<InputProps, 'min' | 'max' | 'step' | 'value' | 'typ
|
|
|
54
58
|
* Класс для слайдера
|
|
55
59
|
*/
|
|
56
60
|
sliderClassName?: string;
|
|
61
|
+
/**
|
|
62
|
+
* Класс для шагов
|
|
63
|
+
*/
|
|
64
|
+
stepsClassName?: string;
|
|
57
65
|
/**
|
|
58
66
|
* Обработчик изменения значения через слайдер или поле ввода
|
|
59
67
|
*/
|
|
@@ -77,7 +85,7 @@ type SliderInputProps = Omit<InputProps, 'min' | 'max' | 'step' | 'value' | 'typ
|
|
|
77
85
|
*/
|
|
78
86
|
dataTestId?: string;
|
|
79
87
|
};
|
|
80
|
-
declare const SliderInput: React.ForwardRefExoticComponent<Pick<InputProps, "disabled" | "size" | "className" | "dataTestId" | "form" | "label" | "slot" | "style" | "title" | "pattern" | "leftAddons" | "rightAddons" | "block" | "colors" | "children" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "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" | "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" | "list" | "autoFocus" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "name" | "fieldClassName" | "labelClassName" | "addonsClassName" | "error" | "hint" | "accept" | "alt" | "autoComplete" | "capture" | "checked" | "crossOrigin" | "height" | "maxLength" | "minLength" | "multiple" | "readOnly" | "required" | "src" | "width" | "clear" | "success" | "inputClassName" | "focusedClassName" | "filledClassName" | "onClear" | "wrapperRef"> & {
|
|
88
|
+
declare const SliderInput: React.ForwardRefExoticComponent<Pick<InputProps, "disabled" | "size" | "className" | "dataTestId" | "form" | "label" | "slot" | "style" | "title" | "pattern" | "leftAddons" | "rightAddons" | "block" | "colors" | "children" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "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" | "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" | "list" | "autoFocus" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "name" | "fieldClassName" | "labelClassName" | "addonsClassName" | "error" | "hint" | "labelView" | "accept" | "alt" | "autoComplete" | "capture" | "checked" | "crossOrigin" | "height" | "maxLength" | "minLength" | "multiple" | "readOnly" | "required" | "src" | "width" | "clear" | "success" | "inputClassName" | "focusedClassName" | "filledClassName" | "onClear" | "wrapperRef"> & {
|
|
81
89
|
/**
|
|
82
90
|
* Мин. допустимое число
|
|
83
91
|
*/
|
|
@@ -86,6 +94,10 @@ declare const SliderInput: React.ForwardRefExoticComponent<Pick<InputProps, "dis
|
|
|
86
94
|
* Макс. допустимое число
|
|
87
95
|
*/
|
|
88
96
|
max?: number | undefined;
|
|
97
|
+
/**
|
|
98
|
+
* Массив подписей к слайдеру
|
|
99
|
+
*/
|
|
100
|
+
steps?: React.ReactNode[] | undefined;
|
|
89
101
|
/**
|
|
90
102
|
* Шаг (должен нацело делить отрезок между мин и макс)
|
|
91
103
|
*/
|
|
@@ -102,6 +114,9 @@ declare const SliderInput: React.ForwardRefExoticComponent<Pick<InputProps, "dis
|
|
|
102
114
|
to: (value: number) => React.Key;
|
|
103
115
|
from?: ((value: string) => number | false) | undefined;
|
|
104
116
|
} | undefined;
|
|
117
|
+
/**
|
|
118
|
+
* Массив подписей к слайдеру
|
|
119
|
+
*/
|
|
105
120
|
stepped?: boolean | undefined;
|
|
106
121
|
} | undefined;
|
|
107
122
|
/**
|
|
@@ -128,7 +143,7 @@ declare const SliderInput: React.ForwardRefExoticComponent<Pick<InputProps, "dis
|
|
|
128
143
|
/**
|
|
129
144
|
* Компонент поля ввода
|
|
130
145
|
*/
|
|
131
|
-
Input?: React.FC<Pick<InputProps, "min" | "max" | "step" | "disabled" | "size" | "className" | "dataTestId" | "form" | "label" | "slot" | "style" | "title" | "pattern" | "leftAddons" | "rightAddons" | "block" | "colors" | "children" | "type" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "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" | "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" | "list" | "autoFocus" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "name" | "fieldClassName" | "labelClassName" | "addonsClassName" | "error" | "hint" | "bottomAddons" | "accept" | "alt" | "autoComplete" | "capture" | "checked" | "crossOrigin" | "height" | "maxLength" | "minLength" | "multiple" | "readOnly" | "required" | "src" | "width" | "clear" | "success" | "inputClassName" | "focusedClassName" | "filledClassName" | "onClear" | "wrapperRef">> | undefined;
|
|
146
|
+
Input?: React.FC<Pick<InputProps, "min" | "max" | "step" | "disabled" | "size" | "className" | "dataTestId" | "form" | "label" | "slot" | "style" | "title" | "pattern" | "leftAddons" | "rightAddons" | "block" | "colors" | "children" | "type" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "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" | "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" | "list" | "autoFocus" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "name" | "fieldClassName" | "labelClassName" | "addonsClassName" | "error" | "hint" | "labelView" | "bottomAddons" | "accept" | "alt" | "autoComplete" | "capture" | "checked" | "crossOrigin" | "height" | "maxLength" | "minLength" | "multiple" | "readOnly" | "required" | "src" | "width" | "clear" | "success" | "inputClassName" | "focusedClassName" | "filledClassName" | "onClear" | "wrapperRef">> | undefined;
|
|
132
147
|
/**
|
|
133
148
|
* Кастомные пропсы для поля ввода
|
|
134
149
|
*/
|
|
@@ -141,6 +156,10 @@ declare const SliderInput: React.ForwardRefExoticComponent<Pick<InputProps, "dis
|
|
|
141
156
|
* Класс для слайдера
|
|
142
157
|
*/
|
|
143
158
|
sliderClassName?: string | undefined;
|
|
159
|
+
/**
|
|
160
|
+
* Класс для шагов
|
|
161
|
+
*/
|
|
162
|
+
stepsClassName?: string | undefined;
|
|
144
163
|
/**
|
|
145
164
|
* Обработчик изменения значения через слайдер или поле ввода
|
|
146
165
|
*/
|
package/modern/Component.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import React, { forwardRef, useCallback, Fragment } from 'react';
|
|
1
|
+
import React, { forwardRef, useCallback, Fragment, isValidElement, cloneElement } from 'react';
|
|
2
2
|
import cn from 'classnames';
|
|
3
3
|
import { Slider } from '@alfalab/core-components-slider/modern';
|
|
4
4
|
import { Input } from '@alfalab/core-components-input/modern';
|
|
5
5
|
|
|
6
|
-
var styles = {"component":"slider-
|
|
6
|
+
var styles = {"component":"slider-input__component_x201f","block":"slider-input__block_x201f","slider":"slider-input__slider_x201f","field":"slider-input__field_x201f","input":"slider-input__input_x201f","steps":"slider-input__steps_x201f","info":"slider-input__info_x201f","s":"slider-input__s_x201f","hasLabel":"slider-input__hasLabel_x201f","m":"slider-input__m_x201f","l":"slider-input__l_x201f","xl":"slider-input__xl_x201f","focused":"slider-input__focused_x201f","filled":"slider-input__filled_x201f"};
|
|
7
7
|
require('./index.css')
|
|
8
8
|
|
|
9
|
-
const SliderInput = forwardRef(({ className, inputClassName, sliderClassName, focusedClassName, fieldClassName, value = '', min = 0, max = 100, step = 1, block, sliderValue = +value, size = 's', label, info, disabled, readOnly, onChange, onInputChange, onSliderChange, rightAddons, Input: Input$1 = Input, customInputProps = {}, error, hint, pips, range, dataTestId, ...restProps }, ref) => {
|
|
9
|
+
const SliderInput = forwardRef(({ className, inputClassName, sliderClassName, stepsClassName, focusedClassName, fieldClassName, value = '', min = 0, max = 100, step = 1, block, steps = [], sliderValue = +value, size = 's', label, info, disabled, readOnly, onChange, onInputChange, onSliderChange, rightAddons, Input: Input$1 = Input, customInputProps = {}, error, hint, pips, range, dataTestId, ...restProps }, ref) => {
|
|
10
10
|
const getValidInputValue = useCallback((inputValue) => {
|
|
11
11
|
const number = parseInt(inputValue, 10);
|
|
12
12
|
return inputValue === '' || Number.isNaN(number) ? '' : Math.abs(number);
|
|
@@ -31,7 +31,8 @@ const SliderInput = forwardRef(({ className, inputClassName, sliderClassName, fo
|
|
|
31
31
|
}, styles[size], className), "data-test-id": dataTestId },
|
|
32
32
|
React.createElement(Input$1, Object.assign({}, restProps, customInputProps, { ref: ref, value: value.toString(), onChange: handleInputChange, block: true, size: size, label: label, disabled: disabled, readOnly: readOnly, className: cn(inputClassName, styles.input), focusedClassName: cn(focusedClassName, styles.focused), fieldClassName: cn(fieldClassName, styles.field), inputMode: 'numeric', pattern: '[0-9]*', error: error, hint: hint, bottomAddons: !disabled && (React.createElement(Slider, { min: min, max: max, step: step, onChange: handleSliderChange, value: Number.isNaN(sliderValue) || !sliderValue ? min : sliderValue, disabled: disabled || readOnly, className: cn(styles.slider, sliderClassName), pips: !error && !hint ? pips : undefined, range: range })), rightAddons: (info || rightAddons) && (React.createElement(Fragment, null,
|
|
33
33
|
info && React.createElement("span", { className: styles.info }, info),
|
|
34
|
-
rightAddons)) }))
|
|
34
|
+
rightAddons)) })),
|
|
35
|
+
steps.length > 0 && !error && (React.createElement("div", { className: cn(styles.steps, stepsClassName) }, steps.map((stepLabel, i) => isValidElement(stepLabel) ? (cloneElement(stepLabel, { key: i })) : (React.createElement("span", { key: i.toString() }, stepLabel)))))));
|
|
35
36
|
});
|
|
36
37
|
/**
|
|
37
38
|
* Для отображения в сторибуке
|
|
@@ -43,6 +44,7 @@ SliderInput.defaultProps = {
|
|
|
43
44
|
step: 1,
|
|
44
45
|
size: 's',
|
|
45
46
|
Input: Input,
|
|
47
|
+
steps: [],
|
|
46
48
|
customInputProps: {},
|
|
47
49
|
};
|
|
48
50
|
|
package/modern/index.css
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: 1p40g */
|
|
2
2
|
:root {
|
|
3
3
|
--color-light-text-secondary: #546272;
|
|
4
4
|
}
|
|
@@ -47,34 +47,34 @@
|
|
|
47
47
|
--slider-input-info-color: var(--color-light-text-secondary);
|
|
48
48
|
--slider-input-font-weight: 700;
|
|
49
49
|
}
|
|
50
|
-
.slider-
|
|
50
|
+
.slider-input__component_x201f {
|
|
51
51
|
position: relative;
|
|
52
52
|
display: inline-block;
|
|
53
53
|
}
|
|
54
|
-
.slider-
|
|
54
|
+
.slider-input__block_x201f {
|
|
55
55
|
display: block;
|
|
56
56
|
}
|
|
57
|
-
.slider-
|
|
57
|
+
.slider-input__slider_x201f {
|
|
58
58
|
margin-top: calc(var(--slider-progress-s-height) / -2);
|
|
59
59
|
transform: translateY(-1px)
|
|
60
60
|
}
|
|
61
|
-
.slider-
|
|
61
|
+
.slider-input__slider_x201f + * {
|
|
62
62
|
margin-top: var(--gap-xs);
|
|
63
63
|
}
|
|
64
|
-
.slider-
|
|
64
|
+
.slider-input__field_x201f {
|
|
65
65
|
border-bottom-left-radius: 0;
|
|
66
66
|
border-bottom-right-radius: 0;
|
|
67
67
|
}
|
|
68
|
-
.slider-
|
|
69
|
-
.slider-
|
|
68
|
+
.slider-input__input_x201f input,
|
|
69
|
+
.slider-input__input_x201f input + div {
|
|
70
70
|
font-weight: var(--slider-input-font-weight);
|
|
71
71
|
font-feature-settings: "tnum";
|
|
72
72
|
font-variant-numeric: tabular-nums;
|
|
73
73
|
}
|
|
74
|
-
.slider-
|
|
74
|
+
.slider-input__input_x201f input::placeholder {
|
|
75
75
|
font-weight: 400;
|
|
76
76
|
}
|
|
77
|
-
.slider-
|
|
77
|
+
.slider-input__steps_x201f {
|
|
78
78
|
font-size: 14px;
|
|
79
79
|
line-height: 18px;
|
|
80
80
|
font-weight: 400;
|
|
@@ -84,7 +84,7 @@
|
|
|
84
84
|
margin-top: var(--gap-xs);
|
|
85
85
|
color: var(--slider-input-steps-color);
|
|
86
86
|
}
|
|
87
|
-
.slider-
|
|
87
|
+
.slider-input__info_x201f {
|
|
88
88
|
font-size: 16px;
|
|
89
89
|
line-height: 20px;
|
|
90
90
|
font-weight: 400;
|
|
@@ -95,28 +95,28 @@
|
|
|
95
95
|
transition: 0.2s ease;
|
|
96
96
|
visibility: hidden;
|
|
97
97
|
}
|
|
98
|
-
.slider-
|
|
98
|
+
.slider-input__s_x201f.slider-input__hasLabel_x201f .slider-input__info_x201f:first-child {
|
|
99
99
|
padding: var(--form-control-labeled-s-paddings);
|
|
100
100
|
padding-left: 0;
|
|
101
101
|
padding-right: 0;
|
|
102
102
|
}
|
|
103
|
-
.slider-
|
|
103
|
+
.slider-input__m_x201f.slider-input__hasLabel_x201f .slider-input__info_x201f:first-child {
|
|
104
104
|
padding: var(--form-control-labeled-m-paddings);
|
|
105
105
|
padding-left: 0;
|
|
106
106
|
padding-right: 0;
|
|
107
107
|
}
|
|
108
|
-
.slider-
|
|
108
|
+
.slider-input__l_x201f.slider-input__hasLabel_x201f .slider-input__info_x201f:first-child {
|
|
109
109
|
padding: var(--form-control-labeled-l-paddings);
|
|
110
110
|
padding-left: 0;
|
|
111
111
|
padding-right: 0;
|
|
112
112
|
}
|
|
113
|
-
.slider-
|
|
113
|
+
.slider-input__xl_x201f.slider-input__hasLabel_x201f .slider-input__info_x201f:first-child {
|
|
114
114
|
padding: var(--form-control-labeled-xl-paddings);
|
|
115
115
|
padding-left: 0;
|
|
116
116
|
padding-right: 0;
|
|
117
117
|
}
|
|
118
|
-
.slider-
|
|
119
|
-
.slider-
|
|
118
|
+
.slider-input__focused_x201f .slider-input__info_x201f,
|
|
119
|
+
.slider-input__filled_x201f .slider-input__info_x201f {
|
|
120
120
|
visibility: visible;
|
|
121
121
|
opacity: 1;
|
|
122
122
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alfalab/core-components-slider-input",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.2.2",
|
|
4
4
|
"description": "Slider input component",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"license": "MIT",
|
|
@@ -18,8 +18,8 @@
|
|
|
18
18
|
"react-dom": "^16.9.0 || ^17.0.1 || ^18.0.0"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@alfalab/core-components-input": "^10.
|
|
22
|
-
"@alfalab/core-components-slider": "^4.0
|
|
21
|
+
"@alfalab/core-components-input": "^10.2.1",
|
|
22
|
+
"@alfalab/core-components-slider": "^4.1.0",
|
|
23
23
|
"classnames": "^2.3.1",
|
|
24
24
|
"react-merge-refs": "^1.1.0"
|
|
25
25
|
}
|