@consta/uikit 3.12.0 → 3.12.4
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/Attach/package.json +1 -1
- package/Attachment/package.json +1 -1
- package/Avatar/package.json +1 -1
- package/Badge/package.json +1 -1
- package/BasicSelectDeprecated/package.json +1 -1
- package/Breadcrumbs/package.json +1 -1
- package/Button/package.json +1 -1
- package/CHANGELOG.md +41 -43
- package/Calendar/package.json +1 -1
- package/Card/package.json +1 -1
- package/Checkbox/package.json +1 -1
- package/CheckboxGroup/package.json +1 -1
- package/ChoiceGroup/package.json +1 -1
- package/Collapse/package.json +1 -1
- package/CollapseGroup/package.json +1 -1
- package/Combobox/package.json +1 -1
- package/ComboboxDeprecated/package.json +1 -1
- package/ContextMenu/package.json +1 -1
- package/DatePickerCanary/package.json +1 -1
- package/DateTimeCanary/package.json +1 -1
- package/DragNDropField/package.json +1 -1
- package/EventInterceptor/package.json +1 -1
- package/FieldCaption/package.json +1 -1
- package/FieldLabel/package.json +1 -1
- package/File/package.json +1 -1
- package/FileField/package.json +1 -1
- package/FileIcon/package.json +1 -1
- package/FileIconAvi/package.json +1 -1
- package/FileIconBmp/package.json +1 -1
- package/FileIconCsv/package.json +1 -1
- package/FileIconDoc/package.json +1 -1
- package/FileIconExe/package.json +1 -1
- package/FileIconGif/package.json +1 -1
- package/FileIconJpg/package.json +1 -1
- package/FileIconJson/package.json +1 -1
- package/FileIconLoading/package.json +1 -1
- package/FileIconMov/package.json +1 -1
- package/FileIconMp3/package.json +1 -1
- package/FileIconMp4/package.json +1 -1
- package/FileIconPdf/package.json +1 -1
- package/FileIconPng/package.json +1 -1
- package/FileIconPtt/package.json +1 -1
- package/FileIconRar/package.json +1 -1
- package/FileIconRtf/package.json +1 -1
- package/FileIconTiff/package.json +1 -1
- package/FileIconTxt/package.json +1 -1
- package/FileIconUndefined/package.json +1 -1
- package/FileIconWav/package.json +1 -1
- package/FileIconXls/package.json +1 -1
- package/FileIconZip/package.json +1 -1
- package/Grid/package.json +1 -1
- package/Header/package.json +1 -1
- package/Icon/package.json +1 -1
- package/IconAdd/package.json +1 -1
- package/IconAddToComparison/package.json +1 -1
- package/IconAlert/package.json +1 -1
- package/IconAlignBlocksLeft/package.json +1 -1
- package/IconAlignBlocksRight/package.json +1 -1
- package/IconAlignCenter/package.json +1 -1
- package/IconAlignJustify/package.json +1 -1
- package/IconAlignLeft/package.json +1 -1
- package/IconAlignRight/package.json +1 -1
- package/IconAllDone/package.json +1 -1
- package/IconArrowDown/package.json +1 -1
- package/IconArrowLeft/package.json +1 -1
- package/IconArrowRight/package.json +1 -1
- package/IconArrowUp/package.json +1 -1
- package/IconArtBrush/package.json +1 -1
- package/IconAttach/package.json +1 -1
- package/IconBackward/package.json +1 -1
- package/IconBag/package.json +1 -1
- package/IconBarrier/package.json +1 -1
- package/IconBento/package.json +1 -1
- package/IconBold/package.json +1 -1
- package/IconBook/package.json +1 -1
- package/IconBookmarkFilled/package.json +1 -1
- package/IconBookmarkStroked/package.json +1 -1
- package/IconCalculator/package.json +1 -1
- package/IconCalendar/package.json +1 -1
- package/IconCamera/package.json +1 -1
- package/IconCancel/package.json +1 -1
- package/IconCards/package.json +1 -1
- package/IconChat/package.json +1 -1
- package/IconCheck/package.json +1 -1
- package/IconClose/package.json +1 -1
- package/IconCollapse/package.json +1 -1
- package/IconColorFill/package.json +1 -1
- package/IconColorText/package.json +1 -1
- package/IconColumns/package.json +1 -1
- package/IconComment/package.json +1 -1
- package/IconConnection/package.json +1 -1
- package/IconCopy/package.json +1 -1
- package/IconCrown/package.json +1 -1
- package/IconCursorMouse/package.json +1 -1
- package/IconDataNull/package.json +1 -1
- package/IconDiamond/package.json +1 -1
- package/IconDinosaur/package.json +1 -1
- package/IconDisconnection/package.json +1 -1
- package/IconDocAdd/package.json +1 -1
- package/IconDocBlank/package.json +1 -1
- package/IconDocDelete/package.json +1 -1
- package/IconDocExport/package.json +1 -1
- package/IconDocFilled/package.json +1 -1
- package/IconDown/package.json +1 -1
- package/IconDownload/package.json +1 -1
- package/IconDrag/package.json +1 -1
- package/IconDraggable/package.json +1 -1
- package/IconDrillingRig/package.json +1 -1
- package/IconDrop/package.json +1 -1
- package/IconEdit/package.json +1 -1
- package/IconExit/package.json +1 -1
- package/IconExpand/package.json +1 -1
- package/IconEye/package.json +1 -1
- package/IconEyeClose/package.json +1 -1
- package/IconFavorite/package.json +1 -1
- package/IconFilter/package.json +1 -1
- package/IconFitToDefault/package.json +1 -1
- package/IconFlagFilled/package.json +1 -1
- package/IconFlagStroked/package.json +1 -1
- package/IconFolders/package.json +1 -1
- package/IconForward/package.json +1 -1
- package/IconFunnel/package.json +1 -1
- package/IconGas/package.json +1 -1
- package/IconGeo/package.json +1 -1
- package/IconGrouping/package.json +1 -1
- package/IconHamburger/package.json +1 -1
- package/IconHand/package.json +1 -1
- package/IconHealth/package.json +1 -1
- package/IconInComparison/package.json +1 -1
- package/IconInfo/package.json +1 -1
- package/IconIntroduction/package.json +1 -1
- package/IconIpad/package.json +1 -1
- package/IconItalic/package.json +1 -1
- package/IconKebab/package.json +1 -1
- package/IconLaptop/package.json +1 -1
- package/IconLayers/package.json +1 -1
- package/IconLeaf/package.json +1 -1
- package/IconLightningBolt/package.json +1 -1
- package/IconLineAndBarChart/package.json +1 -1
- package/IconLink/package.json +1 -1
- package/IconList/package.json +1 -1
- package/IconListNumbered/package.json +1 -1
- package/IconLock/package.json +1 -1
- package/IconLogicalElement/package.json +1 -1
- package/IconMBU/package.json +1 -1
- package/IconMGRP/package.json +1 -1
- package/IconMLSP/package.json +1 -1
- package/IconMMP/package.json +1 -1
- package/IconMail/package.json +1 -1
- package/IconMap/package.json +1 -1
- package/IconMaxHeight/package.json +1 -1
- package/IconMaxWidth/package.json +1 -1
- package/IconMeatball/package.json +1 -1
- package/IconMic/package.json +1 -1
- package/IconMolecules/package.json +1 -1
- package/IconMoon/package.json +1 -1
- package/IconNodeEnd/package.json +1 -1
- package/IconNodeStart/package.json +1 -1
- package/IconNodeStep/package.json +1 -1
- package/IconNodes/package.json +1 -1
- package/IconOpenInNew/package.json +1 -1
- package/IconPanelBottom/package.json +1 -1
- package/IconPanelLeft/package.json +1 -1
- package/IconPanelRight/package.json +1 -1
- package/IconPanelTop/package.json +1 -1
- package/IconPaste/package.json +1 -1
- package/IconPause/package.json +1 -1
- package/IconPhone/package.json +1 -1
- package/IconPhoto/package.json +1 -1
- package/IconPlay/package.json +1 -1
- package/IconPressure/package.json +1 -1
- package/IconProcessing/package.json +1 -1
- package/IconQuestion/package.json +1 -1
- package/IconQuote/package.json +1 -1
- package/IconRUO/package.json +1 -1
- package/IconRUS/package.json +1 -1
- package/IconRecord/package.json +1 -1
- package/IconRemove/package.json +1 -1
- package/IconRemoveFromComparison/package.json +1 -1
- package/IconReply/package.json +1 -1
- package/IconResize/package.json +1 -1
- package/IconRestart/package.json +1 -1
- package/IconRevert/package.json +1 -1
- package/IconRing/package.json +1 -1
- package/IconRouble/package.json +1 -1
- package/IconRuler/package.json +1 -1
- package/IconScreen/package.json +1 -1
- package/IconSearch/package.json +1 -1
- package/IconSelect/package.json +1 -1
- package/IconSelectOpen/package.json +1 -1
- package/IconSettings/package.json +1 -1
- package/IconShape/package.json +1 -1
- package/IconShuffle/package.json +1 -1
- package/IconSmile/package.json +1 -1
- package/IconSortDown/package.json +1 -1
- package/IconSortDownCenter/package.json +1 -1
- package/IconSortUp/package.json +1 -1
- package/IconSortUpCenter/package.json +1 -1
- package/IconStop/package.json +1 -1
- package/IconStorage/package.json +1 -1
- package/IconStrikethrough/package.json +1 -1
- package/IconSun/package.json +1 -1
- package/IconTable/package.json +1 -1
- package/IconTarget/package.json +1 -1
- package/IconTeam/package.json +1 -1
- package/IconTest/package.json +1 -1
- package/IconThumbUp/package.json +1 -1
- package/IconTie/package.json +1 -1
- package/IconTop/package.json +1 -1
- package/IconTrash/package.json +1 -1
- package/IconType/package.json +1 -1
- package/IconUnderline/package.json +1 -1
- package/IconUnlock/package.json +1 -1
- package/IconUnsort/package.json +1 -1
- package/IconUnsortCenter/package.json +1 -1
- package/IconUpload/package.json +1 -1
- package/IconUser/package.json +1 -1
- package/IconVZD/package.json +1 -1
- package/IconVideo/package.json +1 -1
- package/IconWarning/package.json +1 -1
- package/IconWatch/package.json +1 -1
- package/IconWideScreen/package.json +1 -1
- package/IconWorld/package.json +1 -1
- package/Informer/package.json +1 -1
- package/LayoutCanary/package.json +1 -1
- package/Loader/package.json +1 -1
- package/MixCard/package.json +1 -1
- package/MixFocus/package.json +1 -1
- package/MixSpace/package.json +1 -1
- package/MixVisuallyHidden/package.json +1 -1
- package/Modal/package.json +1 -1
- package/MultiComboboxDeprecated/package.json +1 -1
- package/Pagination/package.json +1 -1
- package/Popover/package.json +1 -1
- package/PortalWithTheme/package.json +1 -1
- package/ProgressSpin/package.json +1 -1
- package/ProgressStepBarCanary/package.json +1 -1
- package/Radio/package.json +1 -1
- package/RadioGroup/package.json +1 -1
- package/Responses/package.json +1 -1
- package/Responses403/package.json +1 -1
- package/Responses404/package.json +1 -1
- package/Responses500/package.json +1 -1
- package/Responses503/package.json +1 -1
- package/ResponsesConnectionError/package.json +1 -1
- package/ResponsesDeleted/package.json +1 -1
- package/ResponsesEmptyBox/package.json +1 -1
- package/ResponsesEmptyPockets/package.json +1 -1
- package/ResponsesImage/package.json +1 -1
- package/ResponsesImage403/package.json +1 -1
- package/ResponsesImage404/package.json +1 -1
- package/ResponsesImage500/package.json +1 -1
- package/ResponsesImage503/package.json +1 -1
- package/ResponsesImageConnectionError/package.json +1 -1
- package/ResponsesImageDeleted/package.json +1 -1
- package/ResponsesImageEmptyBox/package.json +1 -1
- package/ResponsesImageEmptyPockets/package.json +1 -1
- package/ResponsesImageNothingFound/package.json +1 -1
- package/ResponsesImageSuccess/package.json +1 -1
- package/ResponsesNothingFound/package.json +1 -1
- package/ResponsesSuccess/package.json +1 -1
- package/Select/package.json +1 -1
- package/Sidebar/package.json +1 -1
- package/Skeleton/package.json +1 -1
- package/SliderCanary/package.json +1 -1
- package/SnackBar/package.json +1 -1
- package/Steps/package.json +1 -1
- package/Switch/package.json +1 -1
- package/SwitchGroup/package.json +1 -1
- package/Table/package.json +1 -1
- package/Tabs/package.json +1 -1
- package/Tag/package.json +1 -1
- package/TagBase/package.json +1 -1
- package/Text/package.json +1 -1
- package/TextField/package.json +1 -1
- package/Theme/package.json +1 -1
- package/ThemeToggler/package.json +1 -1
- package/Timer/package.json +1 -1
- package/Tooltip/package.json +1 -1
- package/User/package.json +1 -1
- package/UserSelect/package.json +1 -1
- package/UserSelectDeprecated/package.json +1 -1
- package/__internal__/cjs-src/components/Checkbox/Checkbox.css +74 -80
- package/__internal__/cjs-src/components/DatePickerCanary/helpers.d.ts +9 -0
- package/__internal__/cjs-src/components/ProgressStepBarCanary/ProgressStepBarCanary.js +2 -1
- package/__internal__/cjs-src/components/ProgressStepBarCanary/ProgressStepBarItem/ProgressStepBarItem.js +4 -4
- package/__internal__/cjs-src/components/SliderCanary/Slider.css +4 -0
- package/__internal__/cjs-src/components/SliderCanary/SliderCanary.js +9 -11
- package/__internal__/cjs-src/components/SliderCanary/SliderPoint/SliderPoint.css +1 -0
- package/__internal__/cjs-src/components/SliderCanary/SliderPoint/SliderPoint.js +3 -5
- package/__internal__/cjs-src/components/SliderCanary/helper.d.ts +4 -2
- package/__internal__/cjs-src/components/SliderCanary/useSlider/helper.d.ts +4 -4
- package/__internal__/cjs-src/components/SliderCanary/useSlider/helper.js +8 -7
- package/__internal__/cjs-src/components/SliderCanary/useSlider/useSlider.js +53 -66
- package/__internal__/cjs-src/components/SliderCanary/useSliderStationing.js +10 -13
- package/__internal__/cjs-src/components/SnackBar/Item/SnackBar-Item.d.ts +4 -1
- package/__internal__/cjs-src/components/SnackBar/Item/SnackBar-Item.js +9 -8
- package/__internal__/cjs-src/components/SnackBar/SnackBar.js +11 -4
- package/__internal__/cjs-src/components/Theme/_size/Theme_size_gpnDefault.css +1 -1
- package/__internal__/cjs-src/mixs/MixCard/MixCard.css +4 -4
- package/__internal__/src/components/Checkbox/Checkbox.css +74 -80
- package/__internal__/src/components/DatePickerCanary/helpers.d.ts +9 -0
- package/__internal__/src/components/ProgressStepBarCanary/ProgressStepBarCanary.js +2 -1
- package/__internal__/src/components/ProgressStepBarCanary/ProgressStepBarItem/ProgressStepBarItem.js +4 -4
- package/__internal__/src/components/SliderCanary/Slider.css +4 -0
- package/__internal__/src/components/SliderCanary/SliderCanary.js +5 -7
- package/__internal__/src/components/SliderCanary/SliderPoint/SliderPoint.css +1 -0
- package/__internal__/src/components/SliderCanary/SliderPoint/SliderPoint.js +3 -5
- package/__internal__/src/components/SliderCanary/helper.d.ts +4 -2
- package/__internal__/src/components/SliderCanary/useSlider/helper.d.ts +4 -4
- package/__internal__/src/components/SliderCanary/useSlider/helper.js +8 -7
- package/__internal__/src/components/SliderCanary/useSlider/useSlider.js +53 -66
- package/__internal__/src/components/SliderCanary/useSliderStationing.js +11 -14
- package/__internal__/src/components/SnackBar/Item/SnackBar-Item.d.ts +4 -1
- package/__internal__/src/components/SnackBar/Item/SnackBar-Item.js +9 -8
- package/__internal__/src/components/SnackBar/SnackBar.js +11 -4
- package/__internal__/src/components/Theme/_size/Theme_size_gpnDefault.css +1 -1
- package/__internal__/src/mixs/MixCard/MixCard.css +4 -4
- package/createIcon/package.json +1 -1
- package/createResponsesImage/package.json +1 -1
- package/package.json +1 -1
- package/useBreakpoints/package.json +1 -1
- package/useChoiceGroup/package.json +1 -1
- package/useChoiceGroupIndexed/package.json +1 -1
- package/useClickOutside/package.json +1 -1
- package/useComponentSize/package.json +1 -1
- package/useDebounce/package.json +1 -1
- package/useFlag/package.json +1 -1
- package/useForkRef/package.json +1 -1
- package/useGlobalKeys/package.json +1 -1
- package/useKeys/package.json +1 -1
- package/useMutableRef/package.json +1 -1
- package/useOverflow/package.json +1 -1
- package/usePrevious/package.json +1 -1
- package/useResizeObserved/package.json +1 -1
- package/useScrollElements/package.json +1 -1
- package/useScrollPosition/package.json +1 -1
- package/useSelect/package.json +1 -1
- package/useThemeVars/package.json +1 -1
- package/useTimer/package.json +1 -1
- package/withTooltip/package.json +1 -1
package/Sidebar/package.json
CHANGED
package/Skeleton/package.json
CHANGED
package/SnackBar/package.json
CHANGED
package/Steps/package.json
CHANGED
package/Switch/package.json
CHANGED
package/SwitchGroup/package.json
CHANGED
package/Table/package.json
CHANGED
package/Tabs/package.json
CHANGED
package/Tag/package.json
CHANGED
package/TagBase/package.json
CHANGED
package/Text/package.json
CHANGED
package/TextField/package.json
CHANGED
package/Theme/package.json
CHANGED
package/Timer/package.json
CHANGED
package/Tooltip/package.json
CHANGED
package/User/package.json
CHANGED
package/UserSelect/package.json
CHANGED
|
@@ -7,74 +7,18 @@
|
|
|
7
7
|
cursor: pointer;
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
-
.Checkbox-Input {
|
|
11
|
-
position: relative;
|
|
12
|
-
-webkit-box-sizing: border-box;
|
|
13
|
-
box-sizing: border-box;
|
|
14
|
-
width: var(--box-size);
|
|
15
|
-
height: var(--box-size);
|
|
16
|
-
margin: 0;
|
|
17
|
-
background-color: transparent;
|
|
18
|
-
border: var(--control-border-width) solid var(--color-control-bg-border-default);
|
|
19
|
-
border-radius: var(--control-radius);
|
|
20
|
-
cursor: pointer;
|
|
21
|
-
-webkit-transition: border-color 0.15s, background-color 0.15s;
|
|
22
|
-
transition: border-color 0.15s, background-color 0.15s;
|
|
23
|
-
-ms-flex-negative: 0;
|
|
24
|
-
flex-shrink: 0;
|
|
25
|
-
-webkit-appearance: none;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
.Checkbox-Input::before {
|
|
29
|
-
content: '';
|
|
30
|
-
position: absolute;
|
|
31
|
-
z-index: 1;
|
|
32
|
-
-webkit-box-sizing: border-box;
|
|
33
|
-
box-sizing: border-box;
|
|
34
|
-
width: calc(var(--box-size) * 0.6);
|
|
35
|
-
height: calc(var(--box-size) * 0.35);
|
|
36
|
-
background-color: var(--color-control-bg-affect);
|
|
37
|
-
border-left: 2px solid var(--checkbox-checked-check);
|
|
38
|
-
border-bottom: 2px solid var(--checkbox-checked-check);
|
|
39
|
-
opacity: 0;
|
|
40
|
-
-webkit-transition: opacity 0.15s, background-color 0.08s, -webkit-transform 0.15s;
|
|
41
|
-
transition: opacity 0.15s, background-color 0.08s, -webkit-transform 0.15s;
|
|
42
|
-
transition: opacity 0.15s, transform 0.15s, background-color 0.08s;
|
|
43
|
-
transition: opacity 0.15s, transform 0.15s, background-color 0.08s, -webkit-transform 0.15s;
|
|
44
|
-
-webkit-transform: rotate(-50deg) scale(0, 1);
|
|
45
|
-
transform: rotate(-50deg) scale(0, 1);
|
|
46
|
-
-webkit-transform-origin: 0 0;
|
|
47
|
-
transform-origin: 0 0;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
.Checkbox-Label {
|
|
51
|
-
margin-left: var(--offset);
|
|
52
|
-
color: var(--color-control-typo-default);
|
|
53
|
-
font-size: var(--checkbox-font-size);
|
|
54
|
-
}
|
|
55
|
-
|
|
56
10
|
.Checkbox_size_m {
|
|
57
11
|
--checkbox-font-size: var(--control-text-size-m);
|
|
58
|
-
--
|
|
59
|
-
--offset: var(--space-xs);
|
|
12
|
+
--checkbox-size: var(--control-box-size-m);
|
|
13
|
+
--checkbox-offset: var(--space-xs);
|
|
60
14
|
}
|
|
61
15
|
|
|
62
|
-
.Checkbox_size_m .Checkbox-Input::before {
|
|
63
|
-
top: 0.55em;
|
|
64
|
-
left: 0.15em;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
16
|
.Checkbox_size_l {
|
|
68
17
|
--checkbox-font-size: var(--control-text-size-l);
|
|
69
|
-
--
|
|
70
|
-
--offset: var(--space-s);
|
|
18
|
+
--checkbox-size: var(--control-box-size-l);
|
|
19
|
+
--checkbox-offset: var(--space-s);
|
|
71
20
|
}
|
|
72
21
|
|
|
73
|
-
.Checkbox_size_l .Checkbox-Input::before {
|
|
74
|
-
top: 0.7em;
|
|
75
|
-
left: 0.2em;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
22
|
.Checkbox_view_primary {
|
|
79
23
|
--checkbox-checked-border: var(--color-control-bg-primary);
|
|
80
24
|
--checkbox-checked-background: var(--color-control-bg-primary);
|
|
@@ -91,26 +35,6 @@
|
|
|
91
35
|
--checkbox-checked-background-hover: var(--color-control-bg-ghost-hover);
|
|
92
36
|
}
|
|
93
37
|
|
|
94
|
-
.Checkbox-Input:checked {
|
|
95
|
-
background-color: var(--checkbox-checked-background);
|
|
96
|
-
border-color: var(--checkbox-checked-border);
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
.Checkbox-Input:checked::before {
|
|
100
|
-
opacity: 1;
|
|
101
|
-
-webkit-transform: rotate(-50deg) scale(1, 1);
|
|
102
|
-
transform: rotate(-50deg) scale(1, 1);
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
.Checkbox:hover .Checkbox-Input {
|
|
106
|
-
border-color: var(--color-control-bg-border-default-hover);
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
.Checkbox:hover .Checkbox-Input:checked {
|
|
110
|
-
background-color: var(--checkbox-checked-background-hover);
|
|
111
|
-
border-color: var(--checkbox-checked-border-hover);
|
|
112
|
-
}
|
|
113
|
-
|
|
114
38
|
.Checkbox_intermediate .Checkbox-Input,
|
|
115
39
|
.Checkbox_intermediate .Checkbox-Input:checked,
|
|
116
40
|
.Checkbox_intermediate:hover .Checkbox-Input,
|
|
@@ -121,6 +45,7 @@
|
|
|
121
45
|
|
|
122
46
|
.Checkbox_intermediate .Checkbox-Input::before, .Checkbox_intermediate .Checkbox-Input:checked::before, .Checkbox_intermediate:hover .Checkbox-Input::before, .Checkbox_intermediate:hover .Checkbox-Input:checked::before {
|
|
123
47
|
background-color: var(--checkbox-checked-check);
|
|
48
|
+
border: none;
|
|
124
49
|
opacity: 1;
|
|
125
50
|
-webkit-transition: opacity 0.15s, background-color 0.08s 0.04s, -webkit-transform 0.15s;
|
|
126
51
|
transition: opacity 0.15s, background-color 0.08s 0.04s, -webkit-transform 0.15s;
|
|
@@ -166,3 +91,72 @@
|
|
|
166
91
|
.Checkbox_align_top .Checkbox-Input {
|
|
167
92
|
margin-top: var(--space-3xs);
|
|
168
93
|
}
|
|
94
|
+
|
|
95
|
+
.Checkbox-Label {
|
|
96
|
+
margin-left: var(--checkbox-offset);
|
|
97
|
+
color: var(--color-control-typo-default);
|
|
98
|
+
font-size: var(--checkbox-font-size);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.Checkbox-Input {
|
|
102
|
+
position: relative;
|
|
103
|
+
-webkit-box-sizing: border-box;
|
|
104
|
+
box-sizing: border-box;
|
|
105
|
+
width: var(--checkbox-size);
|
|
106
|
+
height: var(--checkbox-size);
|
|
107
|
+
margin: 0;
|
|
108
|
+
padding: 0;
|
|
109
|
+
background-color: transparent;
|
|
110
|
+
border: var(--control-border-width) solid var(--color-control-bg-border-default);
|
|
111
|
+
border-radius: var(--control-radius);
|
|
112
|
+
cursor: pointer;
|
|
113
|
+
-webkit-transition: border-color 0.15s, background-color 0.15s;
|
|
114
|
+
transition: border-color 0.15s, background-color 0.15s;
|
|
115
|
+
-ms-flex-negative: 0;
|
|
116
|
+
flex-shrink: 0;
|
|
117
|
+
-webkit-appearance: none;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.Checkbox-Input::before {
|
|
121
|
+
content: '';
|
|
122
|
+
position: absolute;
|
|
123
|
+
z-index: 1;
|
|
124
|
+
top: calc(var(--checkbox-size) / 2 - 1px);
|
|
125
|
+
left: calc(var(--checkbox-size) / 5 - 1px);
|
|
126
|
+
-webkit-box-sizing: border-box;
|
|
127
|
+
box-sizing: border-box;
|
|
128
|
+
width: calc(var(--checkbox-size) * 0.6);
|
|
129
|
+
height: calc(var(--checkbox-size) * 0.35);
|
|
130
|
+
background-color: var(--color-control-bg-affect);
|
|
131
|
+
border-left: 2px solid var(--checkbox-checked-check);
|
|
132
|
+
border-bottom: 2px solid var(--checkbox-checked-check);
|
|
133
|
+
opacity: 0;
|
|
134
|
+
-webkit-transition: opacity 0.15s, background-color 0.08s, -webkit-transform 0.15s;
|
|
135
|
+
transition: opacity 0.15s, background-color 0.08s, -webkit-transform 0.15s;
|
|
136
|
+
transition: opacity 0.15s, transform 0.15s, background-color 0.08s;
|
|
137
|
+
transition: opacity 0.15s, transform 0.15s, background-color 0.08s, -webkit-transform 0.15s;
|
|
138
|
+
-webkit-transform: rotate(-50deg) scale(0, 1);
|
|
139
|
+
transform: rotate(-50deg) scale(0, 1);
|
|
140
|
+
-webkit-transform-origin: 0 0;
|
|
141
|
+
transform-origin: 0 0;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
.Checkbox-Input:checked {
|
|
145
|
+
background-color: var(--checkbox-checked-background);
|
|
146
|
+
border-color: var(--checkbox-checked-border);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
.Checkbox-Input:checked::before {
|
|
150
|
+
opacity: 1;
|
|
151
|
+
-webkit-transform: rotate(-50deg) scale(1, 1);
|
|
152
|
+
transform: rotate(-50deg) scale(1, 1);
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
.Checkbox:hover .Checkbox-Input {
|
|
156
|
+
border-color: var(--color-control-bg-border-default-hover);
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
.Checkbox:hover .Checkbox-Input:checked {
|
|
160
|
+
background-color: var(--checkbox-checked-background-hover);
|
|
161
|
+
border-color: var(--checkbox-checked-border-hover);
|
|
162
|
+
}
|
|
@@ -67,6 +67,9 @@ export declare type DatePickerProps<TYPE extends DatePickerPropType = 'date'> =
|
|
|
67
67
|
endFieldOnFocus?: DatePickerPropCalendarStartOnFocus<TYPE>;
|
|
68
68
|
startFieldOnBlur?: DatePickerPropCalendarStartOnFocus<TYPE>;
|
|
69
69
|
endFieldOnBlur?: DatePickerPropCalendarStartOnFocus<TYPE>;
|
|
70
|
+
label?: string;
|
|
71
|
+
caption?: string;
|
|
72
|
+
labelPosition?: 'top' | 'left';
|
|
70
73
|
}, HTMLDivElement>;
|
|
71
74
|
export declare type DatePickerComponent = <TYPE extends DatePickerPropType = 'date'>(props: DatePickerProps<TYPE>) => React.ReactElement | null;
|
|
72
75
|
export declare type DatePickerTypeDateComponent = (props: DatePickerProps<'date'>) => React.ReactElement | null;
|
|
@@ -150,6 +153,9 @@ export declare const isDateRangeParams: (params: DatePickerProps<DatePickerPropT
|
|
|
150
153
|
endFieldOnFocus?: ((event: import("react").FocusEvent<HTMLElement>) => void) | undefined;
|
|
151
154
|
startFieldOnBlur?: ((event: import("react").FocusEvent<HTMLElement>) => void) | undefined;
|
|
152
155
|
endFieldOnBlur?: ((event: import("react").FocusEvent<HTMLElement>) => void) | undefined;
|
|
156
|
+
label?: string | undefined;
|
|
157
|
+
caption?: string | undefined;
|
|
158
|
+
labelPosition?: "left" | "top" | undefined;
|
|
153
159
|
}, HTMLDivElement>;
|
|
154
160
|
export declare const isNotDateRangeParams: (params: DatePickerProps<DatePickerPropType>) => params is PropsWithHTMLAttributesAndRef<{
|
|
155
161
|
type?: "date" | undefined;
|
|
@@ -201,6 +207,9 @@ export declare const isNotDateRangeParams: (params: DatePickerProps<DatePickerPr
|
|
|
201
207
|
endFieldOnFocus?: undefined;
|
|
202
208
|
startFieldOnBlur?: undefined;
|
|
203
209
|
endFieldOnBlur?: undefined;
|
|
210
|
+
label?: string | undefined;
|
|
211
|
+
caption?: string | undefined;
|
|
212
|
+
labelPosition?: "left" | "top" | undefined;
|
|
204
213
|
}, HTMLDivElement>;
|
|
205
214
|
export declare const datePickerPropSeparatorDefault = ".";
|
|
206
215
|
export declare const datePickerPropFormatDefault: string;
|
|
@@ -71,7 +71,8 @@ function ProgressStepBarRender(props, ref) {
|
|
|
71
71
|
position: helpers_1.getItemPosition(index, steps.length),
|
|
72
72
|
pointRef: stepsRef[index],
|
|
73
73
|
direction: direction,
|
|
74
|
-
onClick: onClick || onItemClickHandler
|
|
74
|
+
onClick: onClick || onItemClickHandler,
|
|
75
|
+
key: helpers_1.cnProgressStepBar({ index: index })
|
|
75
76
|
};
|
|
76
77
|
};
|
|
77
78
|
var isOverflow = useOverflow_1.useOverflow({ currentRef: listRef });
|
|
@@ -29,11 +29,11 @@ var renderPointContent = function (point, size, progress) {
|
|
|
29
29
|
return react_1["default"].createElement(ProgressSpin_1.ProgressSpin, { size: size });
|
|
30
30
|
if (!point)
|
|
31
31
|
return null;
|
|
32
|
-
if (typeof point === '
|
|
33
|
-
|
|
34
|
-
return react_1["default"].createElement(Icon, { size: "xs" });
|
|
32
|
+
if (typeof point === 'number') {
|
|
33
|
+
return (react_1["default"].createElement(Text_1.Text, { className: cnProgressStepBarItem('PointText'), size: size === 's' ? '2xs' : 'xs', weight: "bold" }, point));
|
|
35
34
|
}
|
|
36
|
-
|
|
35
|
+
var Icon = point;
|
|
36
|
+
return react_1["default"].createElement(Icon, { size: "xs" });
|
|
37
37
|
};
|
|
38
38
|
exports.ProgressStepBarItem = react_1["default"].forwardRef(function (props, ref) {
|
|
39
39
|
var content = props.content, tooltipContent = props.tooltipContent, label = props.label, point = props.point, status = props.status, progress = props.progress, direction = props.direction, size = props.size, pointRef = props.pointRef, onClick = props.onClick, _a = props.position, position = _a === void 0 ? helpers_1.propPositionDefault : _a, otherProps = tslib_1.__rest(props, ["content", "tooltipContent", "label", "point", "status", "progress", "direction", "size", "pointRef", "onClick", "position"]);
|
|
@@ -12,9 +12,8 @@ var FieldLabel_1 = require("../FieldLabel/FieldLabel");
|
|
|
12
12
|
var SliderInput_1 = require("./SliderInput/SliderInput");
|
|
13
13
|
var SliderLine_1 = require("./SliderLine/SliderLine");
|
|
14
14
|
var SliderPoint_1 = require("./SliderPoint/SliderPoint");
|
|
15
|
-
var helper_1 = require("./useSlider/helper");
|
|
16
15
|
var useSlider_1 = require("./useSlider/useSlider");
|
|
17
|
-
var
|
|
16
|
+
var helper_1 = require("./helper");
|
|
18
17
|
var useSliderStationing_1 = require("./useSliderStationing");
|
|
19
18
|
var cnSlider = bem_1.cn('Slider');
|
|
20
19
|
var sizeMap = {
|
|
@@ -24,13 +23,13 @@ var sizeMap = {
|
|
|
24
23
|
l: 'm'
|
|
25
24
|
};
|
|
26
25
|
function SliderRender(props, ref) {
|
|
27
|
-
var _a = props.min, min = _a === void 0 ? 0 : _a, _b = props.max, max = _b === void 0 ? 100 : _b, onChange = props.onChange, onAfterChange = props.onAfterChange, value = props.value, _c = props.step, step = _c === void 0 ? 1 : _c, _d = props.disabled, disabled = _d === void 0 ? false : _d, _e = props.size, size = _e === void 0 ?
|
|
26
|
+
var _a = props.min, min = _a === void 0 ? 0 : _a, _b = props.max, max = _b === void 0 ? 100 : _b, onChange = props.onChange, onAfterChange = props.onAfterChange, value = props.value, _c = props.step, step = _c === void 0 ? 1 : _c, _d = props.disabled, disabled = _d === void 0 ? false : _d, _e = props.size, size = _e === void 0 ? helper_1.defaultPropSize : _e, _f = props.view, view = _f === void 0 ? 'default' : _f, leftSide = props.leftSide, rightSide = props.rightSide, withTooltip = props.withTooltip, _g = props.range, range = _g === void 0 ? false : _g, label = props.label, status = props.status, caption = props.caption, _h = props.tooltipFormatter, tooltipFormatter = _h === void 0 ? helper_1.defaultTooltipFormatter : _h, className = props.className, otherProps = tslib_1.__rest(props, ["min", "max", "onChange", "onAfterChange", "value", "step", "disabled", "size", "view", "leftSide", "rightSide", "withTooltip", "range", "label", "status", "caption", "tooltipFormatter", "className"]);
|
|
28
27
|
var _j = tslib_1.__read(useFlag_1.useFlag(false), 2), isHovered = _j[0], _k = _j[1], on = _k.on, off = _k.off;
|
|
29
28
|
var leftButtonRef = react_1.useRef(null);
|
|
30
29
|
var rightButtonRef = react_1.useRef(null);
|
|
31
30
|
var sliderRef = react_1.useRef(null);
|
|
32
31
|
var IconRight = rightSide;
|
|
33
|
-
var IconLeft =
|
|
32
|
+
var IconLeft = helper_1.isNotRangeParams && props.leftSide && props.leftSide !== 'input' ? props.leftSide : undefined;
|
|
34
33
|
var iconSize = getByMap_1.getByMap(sizeMap, size);
|
|
35
34
|
var _l = useSlider_1.useSlider({
|
|
36
35
|
disabled: disabled,
|
|
@@ -43,8 +42,8 @@ function SliderRender(props, ref) {
|
|
|
43
42
|
onAfterChange: onAfterChange,
|
|
44
43
|
sliderRef: sliderRef,
|
|
45
44
|
buttonRefs: [leftButtonRef, rightButtonRef]
|
|
46
|
-
}), onKeyPress = _l.onKeyPress, onFocus = _l.onFocus,
|
|
47
|
-
var _m = useSliderStationing_1.useSliderStationing(currentValue, min, max, view, range, step, [leftButtonRef, rightButtonRef], sliderRef), lineSizes = _m.lineSizes, buttonPositions = _m.buttonPositions;
|
|
45
|
+
}), onKeyPress = _l.onKeyPress, onFocus = _l.onFocus, handlePress = _l.handlePress, popoverPosition = _l.popoverPosition, activeButton = _l.activeButton, currentValue = _l.currentValue;
|
|
46
|
+
var _m = useSliderStationing_1.useSliderStationing(currentValue.length === 1 ? currentValue[0] : currentValue, min, max, view, range, step, [leftButtonRef, rightButtonRef], sliderRef), lineSizes = _m.lineSizes, buttonPositions = _m.buttonPositions;
|
|
48
47
|
var changeHovered = function (status) {
|
|
49
48
|
if (status)
|
|
50
49
|
on();
|
|
@@ -54,14 +53,13 @@ function SliderRender(props, ref) {
|
|
|
54
53
|
return (react_1["default"].createElement("div", tslib_1.__assign({ ref: ref, className: cnSlider({ size: size }, [className]) }, otherProps),
|
|
55
54
|
label && (react_1["default"].createElement(FieldLabel_1.FieldLabel, { className: cnSlider('Label'), size: size }, label)),
|
|
56
55
|
react_1["default"].createElement("div", { className: cnSlider('Container') },
|
|
57
|
-
leftSide === 'input' &&
|
|
58
|
-
react_1["default"].createElement(SliderInput_1.SliderInput, { value: props.value, onChange: function (params) { var _a; return
|
|
56
|
+
leftSide === 'input' && helper_1.isNotRangeParams(props) && (react_1["default"].createElement("div", { className: cnSlider('Side', { position: 'left' }) },
|
|
57
|
+
react_1["default"].createElement(SliderInput_1.SliderInput, { value: props.value, onChange: function (params) { var _a; return helper_1.isNotRangeParams(props) && ((_a = props.onChange) === null || _a === void 0 ? void 0 : _a.call(props, params)); }, size: size, min: min, max: max, status: status, step: step, disabled: disabled }))),
|
|
59
58
|
IconLeft && (react_1["default"].createElement("div", { className: cnSlider('Side', { position: 'left' }) },
|
|
60
59
|
react_1["default"].createElement(IconLeft, { size: iconSize, view: "secondary" }))),
|
|
61
60
|
react_1["default"].createElement("div", { className: cnSlider('Control'), ref: sliderRef },
|
|
62
|
-
react_1["default"].createElement(SliderLine_1.SliderLine, { hovered: isHovered, onHover: changeHovered, lines: lineSizes, disabled: disabled, view: view }),
|
|
63
|
-
react_1["default"].createElement(SliderPoint_1.SliderPoint, { hovered: isHovered, buttonRef: leftButtonRef, popoverPosition: popoverPosition[
|
|
64
|
-
helper_2.isRangeParams(props) && (react_1["default"].createElement(SliderPoint_1.SliderPoint, { hovered: isHovered, buttonRef: rightButtonRef, onFocus: onFocus, popoverPosition: popoverPosition[1], onKeyPress: onKeyPress, disabled: disabled, onMouseDown: dragPoint, focused: activeButton === 'right', withTooltip: withTooltip, position: buttonPositions[1], buttonLabel: "right", onHover: changeHovered, value: tooltipFormatter(helper_1.getActiveValue(currentValue, 'right')) }))),
|
|
61
|
+
react_1["default"].createElement(SliderLine_1.SliderLine, { hovered: isHovered || typeof activeButton === 'number', onHover: changeHovered, lines: lineSizes, disabled: disabled, view: view }),
|
|
62
|
+
currentValue.map(function (val, index) { return (react_1["default"].createElement(SliderPoint_1.SliderPoint, { hovered: isHovered || typeof activeButton === 'number', buttonRef: leftButtonRef, popoverPosition: popoverPosition[index], onKeyPress: onKeyPress, onFocus: onFocus, handlePress: handlePress, disabled: disabled, position: buttonPositions[index], focused: activeButton === index, buttonLabel: index, withTooltip: withTooltip, onHover: changeHovered, tooltipFormatter: tooltipFormatter, value: val, role: "slider", "aria-valuemin": min, "aria-valuemax": max, "aria-valuenow": val })); })),
|
|
65
63
|
IconRight && (react_1["default"].createElement("div", { className: cnSlider('Side', { position: 'right' }) },
|
|
66
64
|
react_1["default"].createElement(IconRight, { size: iconSize, view: "secondary" })))),
|
|
67
65
|
caption && (react_1["default"].createElement(FieldCaption_1.FieldCaption, { className: cnSlider('Caption'), status: status }, caption))));
|
|
@@ -23,7 +23,7 @@ var getTooltipPosition = function (popoverPosition, buttonRef) {
|
|
|
23
23
|
};
|
|
24
24
|
exports.SliderPoint = function (props) {
|
|
25
25
|
var _a;
|
|
26
|
-
var hovered = props.hovered, onHover = props.onHover, value = props.value, position = props.position, disabled = props.disabled, withTooltip = props.withTooltip, focused = props.focused, popoverPosition = props.popoverPosition, buttonRef = props.buttonRef, onKeyPress = props.onKeyPress, buttonLabel = props.buttonLabel, onFocus = props.onFocus, otherProps = tslib_1.__rest(props, ["hovered", "onHover", "value", "position", "disabled", "withTooltip", "focused", "popoverPosition", "buttonRef", "onKeyPress", "buttonLabel", "onFocus"]);
|
|
26
|
+
var hovered = props.hovered, onHover = props.onHover, value = props.value, position = props.position, disabled = props.disabled, withTooltip = props.withTooltip, focused = props.focused, popoverPosition = props.popoverPosition, buttonRef = props.buttonRef, handlePress = props.handlePress, onKeyPress = props.onKeyPress, tooltipFormatter = props.tooltipFormatter, buttonLabel = props.buttonLabel, onFocus = props.onFocus, otherProps = tslib_1.__rest(props, ["hovered", "onHover", "value", "position", "disabled", "withTooltip", "focused", "popoverPosition", "buttonRef", "handlePress", "onKeyPress", "tooltipFormatter", "buttonLabel", "onFocus"]);
|
|
27
27
|
var _b = tslib_1.__read(useFlag_1.useFlag(false), 2), tooltipVisible = _b[0], _c = _b[1], on = _c.on, off = _c.off;
|
|
28
28
|
var theme = Theme_1.useTheme().theme;
|
|
29
29
|
var tooltipTheme = tslib_1.__assign(tslib_1.__assign({}, theme), { color: {
|
|
@@ -59,11 +59,9 @@ exports.SliderPoint = function (props) {
|
|
|
59
59
|
};
|
|
60
60
|
var pointRef = react_1.useRef(null);
|
|
61
61
|
return (react_1["default"].createElement(react_1["default"].Fragment, null,
|
|
62
|
-
react_1["default"].createElement("button", tslib_1.__assign({ type: "button", "aria-label": buttonLabel + "-button", className: cnSliderPoint({ hovered: hovered, disabled: disabled }, [!disabled ? MixFocus_1.cnMixFocus() : '']), onMouseOver: function () { return handleMouseAction(true); }, onMouseOut: function () { return handleMouseAction(false); }, onKeyDown: function (e) { return onKeyPress === null || onKeyPress === void 0 ? void 0 : onKeyPress(e, buttonLabel); }, onFocus: handleFocus, onBlur: handleBlur, onClick: handleFocus,
|
|
63
|
-
// onMouseUp={handleBlur}
|
|
64
|
-
ref: useForkRef_1.useForkRef([buttonRef, pointRef]), tabIndex: 0, style: (_a = {},
|
|
62
|
+
react_1["default"].createElement("button", tslib_1.__assign({ type: "button", "aria-label": buttonLabel + "-button", className: cnSliderPoint({ hovered: hovered, disabled: disabled }, [!disabled ? MixFocus_1.cnMixFocus() : '']), onMouseOver: function () { return handleMouseAction(true); }, onMouseOut: function () { return handleMouseAction(false); }, onMouseDown: function () { return handlePress === null || handlePress === void 0 ? void 0 : handlePress(buttonLabel); }, onTouchStart: function () { return handlePress === null || handlePress === void 0 ? void 0 : handlePress(buttonLabel); }, onKeyDown: function (e) { return onKeyPress === null || onKeyPress === void 0 ? void 0 : onKeyPress(e, buttonLabel); }, onFocus: handleFocus, onBlur: handleBlur, onClick: handleFocus, ref: useForkRef_1.useForkRef([buttonRef, pointRef]), tabIndex: 0, style: (_a = {},
|
|
65
63
|
_a['--slider-button-left'] = position + "%",
|
|
66
64
|
_a) }, otherProps)),
|
|
67
65
|
tooltipVisible && withTooltip && popoverPosition && (react_1["default"].createElement(Theme_1.ThemeContext.Provider, { value: { theme: tooltipTheme, themeClassNames: tooltipThemeClassNames } },
|
|
68
|
-
react_1["default"].createElement(Tooltip_1.Tooltip, { position: getTooltipPosition(popoverPosition, buttonRef || pointRef), className: cnSliderPoint('Tooltip'), direction: "downCenter", possibleDirections: ['downCenter', 'leftDown', 'rightDown'] }, value)))));
|
|
66
|
+
react_1["default"].createElement(Tooltip_1.Tooltip, { position: getTooltipPosition(popoverPosition, buttonRef || pointRef), className: cnSliderPoint('Tooltip'), direction: "downCenter", possibleDirections: ['downCenter', 'leftDown', 'rightDown'] }, tooltipFormatter ? tooltipFormatter(value) : value)))));
|
|
69
67
|
};
|
|
@@ -48,16 +48,18 @@ export declare type SliderLineProps = {
|
|
|
48
48
|
onHover?: (hovered: boolean) => void;
|
|
49
49
|
};
|
|
50
50
|
export declare type SliderPointProps = PropsWithHTMLAttributes<{
|
|
51
|
-
value?: number
|
|
51
|
+
value?: number;
|
|
52
52
|
disabled?: boolean;
|
|
53
53
|
focused?: boolean;
|
|
54
54
|
hovered?: boolean;
|
|
55
55
|
withTooltip?: boolean;
|
|
56
|
+
handlePress?: (typeButton: ActiveButton) => void;
|
|
56
57
|
buttonLabel?: ActiveButton;
|
|
57
58
|
buttonRef?: React.RefObject<HTMLButtonElement>;
|
|
58
59
|
popoverPosition?: TrackPosition;
|
|
60
|
+
tooltipFormatter?: PropToolipFormatter;
|
|
59
61
|
onFocus?: (e: React.FocusEvent<HTMLButtonElement> | React.MouseEvent, button: ActiveButton) => void;
|
|
60
|
-
onKeyPress?: (e: React.KeyboardEvent, typeButton
|
|
62
|
+
onKeyPress?: (e: React.KeyboardEvent, typeButton?: ActiveButton) => void;
|
|
61
63
|
onHover?: (hovered: boolean) => void;
|
|
62
64
|
position: number;
|
|
63
65
|
}, HTMLButtonElement>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { PropOnChange, SliderValue, TrackPosition } from '../helper';
|
|
3
|
-
export declare type ActiveButton =
|
|
3
|
+
export declare type ActiveButton = 0 | 1 | null | undefined;
|
|
4
4
|
export declare type Stationing = {
|
|
5
5
|
x: number;
|
|
6
6
|
y: number;
|
|
@@ -22,14 +22,14 @@ export declare type UseSliderProps<RANGE extends boolean = false> = {
|
|
|
22
22
|
export declare type UseSliderValues = {
|
|
23
23
|
onKeyPress: (e: React.KeyboardEvent, typeButton: ActiveButton) => void;
|
|
24
24
|
onFocus: (e: React.FocusEvent<HTMLButtonElement> | React.MouseEvent, button: ActiveButton) => void;
|
|
25
|
+
handlePress: (typeButton: ActiveButton) => void;
|
|
25
26
|
activeButton: ActiveButton;
|
|
26
|
-
|
|
27
|
-
currentValue: number | [number, number];
|
|
27
|
+
currentValue: [number] | [number, number];
|
|
28
28
|
popoverPosition: TrackPosition[];
|
|
29
29
|
};
|
|
30
30
|
export declare const isRangeParams: (params: UseSliderProps<boolean>) => params is UseSliderProps<true>;
|
|
31
31
|
export declare const isNotRangeParams: (params: UseSliderProps<boolean>) => params is UseSliderProps<false>;
|
|
32
|
-
export declare const trackPosition: (event:
|
|
32
|
+
export declare const trackPosition: (event: TouchEvent | MouseEvent) => TrackPosition;
|
|
33
33
|
export declare const getActiveValue: (value: number | [number, number], active: ActiveButton) => number;
|
|
34
34
|
export declare const detectActiveButton: (posittion: TrackPosition, buttons: React.RefObject<HTMLButtonElement>[]) => ActiveButton;
|
|
35
35
|
export declare const getValidValue: (value: number, min: number, max: number, step?: number | number[] | undefined) => number;
|
|
@@ -16,11 +16,14 @@ exports.trackPosition = function (event) {
|
|
|
16
16
|
y: event.clientY
|
|
17
17
|
};
|
|
18
18
|
}
|
|
19
|
-
return
|
|
19
|
+
return {
|
|
20
|
+
x: event.changedTouches[0].clientX,
|
|
21
|
+
y: event.changedTouches[0].clientY
|
|
22
|
+
};
|
|
20
23
|
};
|
|
21
24
|
exports.getActiveValue = function (value, active) {
|
|
22
25
|
if (Array.isArray(value)) {
|
|
23
|
-
return active === '
|
|
26
|
+
return value[typeof active === 'number' ? active : 0];
|
|
24
27
|
}
|
|
25
28
|
return value;
|
|
26
29
|
};
|
|
@@ -34,7 +37,7 @@ exports.detectActiveButton = function (position, buttons) {
|
|
|
34
37
|
x + width >= position.x &&
|
|
35
38
|
y <= position.y &&
|
|
36
39
|
y + height >= position.y) {
|
|
37
|
-
activeButton = index
|
|
40
|
+
activeButton = index;
|
|
38
41
|
button.focus();
|
|
39
42
|
}
|
|
40
43
|
}
|
|
@@ -104,7 +107,7 @@ exports.getNewValue = function (changedValue, currentValue, step, min, max, acti
|
|
|
104
107
|
var minRangeValue = min;
|
|
105
108
|
if (Array.isArray(currentValue)) {
|
|
106
109
|
var _a = tslib_1.__read(currentValue, 2), left = _a[0], right = _a[1];
|
|
107
|
-
if (activeButton ===
|
|
110
|
+
if (activeButton === 1) {
|
|
108
111
|
minRangeValue = left;
|
|
109
112
|
}
|
|
110
113
|
else {
|
|
@@ -113,9 +116,7 @@ exports.getNewValue = function (changedValue, currentValue, step, min, max, acti
|
|
|
113
116
|
}
|
|
114
117
|
var analyzedValue = exports.getValidValue(exports.analyzeDivisionValue(changedValue, step, min, max), minRangeValue, maxRangeValue, step);
|
|
115
118
|
if (Array.isArray(currentValue)) {
|
|
116
|
-
return activeButton ===
|
|
117
|
-
? [currentValue[0], analyzedValue]
|
|
118
|
-
: [analyzedValue, currentValue[1]];
|
|
119
|
+
return activeButton === 1 ? [currentValue[0], analyzedValue] : [analyzedValue, currentValue[1]];
|
|
119
120
|
}
|
|
120
121
|
return analyzedValue;
|
|
121
122
|
};
|