@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
|
@@ -4,7 +4,7 @@ exports.useSlider = void 0;
|
|
|
4
4
|
var tslib_1 = require("tslib");
|
|
5
5
|
var react_1 = require("react");
|
|
6
6
|
var useComponentSize_1 = require("../../../hooks/useComponentSize/useComponentSize");
|
|
7
|
-
var
|
|
7
|
+
var useMutableRef_1 = require("../../../hooks/useMutableRef/useMutableRef");
|
|
8
8
|
var helper_1 = require("./helper");
|
|
9
9
|
function useSlider(props) {
|
|
10
10
|
var disabled = props.disabled, range = props.range, value = props.value, min = props.min, max = props.max, _a = props.step, step = _a === void 0 ? 1 : _a, onChange = props.onChange, onAfterChange = props.onAfterChange, sliderRef = props.sliderRef, buttonRefs = props.buttonRefs;
|
|
@@ -13,51 +13,34 @@ function useSlider(props) {
|
|
|
13
13
|
var _b = tslib_1.__read(react_1.useState(value), 2), currentValue = _b[0], setCurrentValue = _b[1];
|
|
14
14
|
var _c = tslib_1.__read(react_1.useState(null), 2), leftPopover = _c[0], setLeftPopover = _c[1];
|
|
15
15
|
var _d = tslib_1.__read(react_1.useState(null), 2), rightPopover = _d[0], setRightPopover = _d[1];
|
|
16
|
-
var _e = tslib_1.__read(useFlag_1.useFlag(false), 2), draggable = _e[0], _f = _e[1], on = _f.on, off = _f.off;
|
|
17
16
|
var activeButton = react_1.useRef(null);
|
|
18
17
|
var sizeSlider = useComponentSize_1.useComponentSize(sliderRef);
|
|
19
|
-
var
|
|
20
|
-
document.addEventListener('mouseup', handleTouchEnd);
|
|
21
|
-
document.addEventListener('touchend', handleTouchEnd);
|
|
22
|
-
document.addEventListener('mousemove', handleTouchMove);
|
|
23
|
-
document.addEventListener('touchmove', handleTouchMove);
|
|
24
|
-
};
|
|
25
|
-
var removeListeners = function () {
|
|
26
|
-
document.removeEventListener('mouseup', handleTouchEnd);
|
|
27
|
-
document.removeEventListener('touchend', handleTouchEnd);
|
|
28
|
-
document.removeEventListener('mousemove', handleTouchMove);
|
|
29
|
-
document.removeEventListener('touchmove', handleTouchMove);
|
|
30
|
-
};
|
|
18
|
+
var lastValue = useMutableRef_1.useMutableRef(currentValue);
|
|
31
19
|
react_1.useEffect(function () {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
sliderRef.current,
|
|
44
|
-
buttonRefs,
|
|
45
|
-
disabled,
|
|
46
|
-
draggable,
|
|
47
|
-
]);
|
|
20
|
+
if (disabled) {
|
|
21
|
+
controlListeners('remove');
|
|
22
|
+
}
|
|
23
|
+
}, [disabled]);
|
|
24
|
+
var controlListeners = function (type) {
|
|
25
|
+
var method = type === 'add' ? 'addEventListener' : 'removeEventListener';
|
|
26
|
+
document[method]('mouseup', handleRelease);
|
|
27
|
+
document[method]('touchend', handleRelease);
|
|
28
|
+
document[method]('mousemove', handleTouchMove);
|
|
29
|
+
document[method]('touchmove', handleTouchMove);
|
|
30
|
+
};
|
|
48
31
|
react_1.useEffect(function () {
|
|
49
32
|
if (Array.isArray(currentValue)) {
|
|
50
|
-
setTooltipPosition(currentValue[0],
|
|
51
|
-
setTooltipPosition(currentValue[1],
|
|
33
|
+
setTooltipPosition(currentValue[0], 0);
|
|
34
|
+
setTooltipPosition(currentValue[1], 1);
|
|
52
35
|
}
|
|
53
36
|
else {
|
|
54
|
-
setTooltipPosition(currentValue,
|
|
37
|
+
setTooltipPosition(currentValue, 0);
|
|
55
38
|
}
|
|
56
39
|
}, [currentValue]);
|
|
57
40
|
react_1.useEffect(function () {
|
|
58
41
|
if (JSON.stringify(value) !== JSON.stringify(currentValue)) {
|
|
59
42
|
setCurrentValue(value);
|
|
60
|
-
setTooltipPosition(helper_1.getActiveValue(value, activeButton.current),
|
|
43
|
+
setTooltipPosition(helper_1.getActiveValue(value, activeButton.current), 0);
|
|
61
44
|
activeButton.current = null;
|
|
62
45
|
}
|
|
63
46
|
}, [value]);
|
|
@@ -65,10 +48,10 @@ function useSlider(props) {
|
|
|
65
48
|
onChange === null || onChange === void 0 ? void 0 : onChange({
|
|
66
49
|
value: Array.isArray(currentValue)
|
|
67
50
|
? [
|
|
68
|
-
helper_1.getNewValue(currentValue[0], currentValue[0], step, min, max,
|
|
69
|
-
helper_1.getNewValue(currentValue[1], currentValue[1], step, min, max,
|
|
51
|
+
helper_1.getNewValue(currentValue[0], currentValue[0], step, min, max, 0),
|
|
52
|
+
helper_1.getNewValue(currentValue[1], currentValue[1], step, min, max, 1),
|
|
70
53
|
]
|
|
71
|
-
: helper_1.getNewValue(currentValue, currentValue, step, min, max,
|
|
54
|
+
: helper_1.getNewValue(currentValue, currentValue, step, min, max, 0)
|
|
72
55
|
});
|
|
73
56
|
}, [step]);
|
|
74
57
|
react_1.useEffect(function () {
|
|
@@ -92,7 +75,7 @@ function useSlider(props) {
|
|
|
92
75
|
}
|
|
93
76
|
}, []);
|
|
94
77
|
var onKeyPress = react_1.useCallback(function (event, typeButton) {
|
|
95
|
-
if (!disabled && typeof typeButton === '
|
|
78
|
+
if (!disabled && typeof typeButton === 'number' && typeof currentValue !== 'undefined') {
|
|
96
79
|
var stepIncrement_1 = !Array.isArray(step) ? step || 1 : 1;
|
|
97
80
|
var validKeyCode = false;
|
|
98
81
|
var changedValue_1 = helper_1.getActiveValue(currentValue, typeButton);
|
|
@@ -121,7 +104,7 @@ function useSlider(props) {
|
|
|
121
104
|
stepsArr_1 = tslib_1.__spread(stepsArr_1, [maxValue]);
|
|
122
105
|
}
|
|
123
106
|
stepsArr_1.forEach(function (stepPoint, index) {
|
|
124
|
-
if (typeof typeButton === '
|
|
107
|
+
if (typeof typeButton === 'number' && changedValue_1 === stepPoint) {
|
|
125
108
|
if (stepIncrement_1 >= 0) {
|
|
126
109
|
if (index === 0) {
|
|
127
110
|
stepIncrement_1 = stepsArr_1[1] - minValue;
|
|
@@ -155,14 +138,14 @@ function useSlider(props) {
|
|
|
155
138
|
}
|
|
156
139
|
}, [currentValue, step, min, max]);
|
|
157
140
|
var setTooltipPosition = function (value, position) {
|
|
158
|
-
if (sliderRef.current && position) {
|
|
159
|
-
var button = buttonRefs[position
|
|
141
|
+
if (sliderRef.current && typeof position === 'number') {
|
|
142
|
+
var button = buttonRefs[position].current || sliderRef.current;
|
|
160
143
|
var _a = sliderRef.current.getBoundingClientRect(), x = _a.x, width = _a.width;
|
|
161
144
|
var newPosition = {
|
|
162
145
|
y: button.offsetTop + button.offsetHeight + 50,
|
|
163
146
|
x: x + Math.abs((value - minValue) / (maxValue - minValue)) * width
|
|
164
147
|
};
|
|
165
|
-
if (position ===
|
|
148
|
+
if (position === 0) {
|
|
166
149
|
setLeftPopover(newPosition);
|
|
167
150
|
}
|
|
168
151
|
else {
|
|
@@ -172,7 +155,7 @@ function useSlider(props) {
|
|
|
172
155
|
};
|
|
173
156
|
var changePosition = function (event) {
|
|
174
157
|
var nativeEvent = event;
|
|
175
|
-
if (typeof activeButton.current !== '
|
|
158
|
+
if (typeof activeButton.current !== 'number') {
|
|
176
159
|
return value;
|
|
177
160
|
}
|
|
178
161
|
var position = helper_1.trackPosition(nativeEvent);
|
|
@@ -182,50 +165,54 @@ function useSlider(props) {
|
|
|
182
165
|
var onFocus = function (e, button) {
|
|
183
166
|
activeButton.current = button;
|
|
184
167
|
};
|
|
185
|
-
var handleTouchMove = function (event) {
|
|
186
|
-
|
|
168
|
+
var handleTouchMove = function (event, typeButton) {
|
|
169
|
+
var button = typeButton || activeButton.current;
|
|
170
|
+
if (typeof button === 'number') {
|
|
187
171
|
var position = changePosition(event);
|
|
188
|
-
var oldValue = helper_1.getActiveValue(currentValue,
|
|
189
|
-
var newValue = helper_1.getActiveValue(position,
|
|
172
|
+
var oldValue = helper_1.getActiveValue(currentValue, button);
|
|
173
|
+
var newValue = helper_1.getActiveValue(position, button);
|
|
190
174
|
if (oldValue !== newValue) {
|
|
191
175
|
setCurrentValue(position);
|
|
192
176
|
onAfterChange === null || onAfterChange === void 0 ? void 0 : onAfterChange({ e: event, value: position });
|
|
193
177
|
}
|
|
194
178
|
}
|
|
195
179
|
};
|
|
196
|
-
var handleTouchEnd = function (event) {
|
|
197
|
-
var position = changePosition(event);
|
|
198
|
-
if (typeof position !== 'undefined') {
|
|
199
|
-
setCurrentValue(position);
|
|
200
|
-
onChange === null || onChange === void 0 ? void 0 : onChange({ e: event, value: position });
|
|
201
|
-
}
|
|
202
|
-
off();
|
|
203
|
-
if (JSON.stringify(position) !== JSON.stringify(currentValue)) {
|
|
204
|
-
buttonRefs.forEach(function (button) {
|
|
205
|
-
var _a;
|
|
206
|
-
(_a = button.current) === null || _a === void 0 ? void 0 : _a.blur();
|
|
207
|
-
});
|
|
208
|
-
activeButton.current = null;
|
|
209
|
-
}
|
|
210
|
-
};
|
|
211
180
|
react_1.useEffect(function () {
|
|
212
181
|
if (helper_1.isRangeParams(props)) {
|
|
213
182
|
props.value.forEach(function (val, index) {
|
|
214
|
-
setTooltipPosition(helper_1.getActiveValue(val, activeButton.current), index === 0 ?
|
|
183
|
+
setTooltipPosition(helper_1.getActiveValue(val, activeButton.current), index === 0 ? 0 : 1);
|
|
215
184
|
});
|
|
216
185
|
}
|
|
217
186
|
if (helper_1.isNotRangeParams(props)) {
|
|
218
|
-
setTooltipPosition(helper_1.getActiveValue(value, activeButton.current),
|
|
187
|
+
setTooltipPosition(helper_1.getActiveValue(value, activeButton.current), 0);
|
|
219
188
|
}
|
|
220
189
|
activeButton.current = null;
|
|
221
190
|
}, [sizeSlider, typeof value]);
|
|
191
|
+
var handleRelease = react_1.useCallback(function (e) {
|
|
192
|
+
var _a, _b;
|
|
193
|
+
controlListeners('remove');
|
|
194
|
+
if (helper_1.isRangeParams(props) && Array.isArray(lastValue.current)) {
|
|
195
|
+
var copyValues = tslib_1.__spread(lastValue.current).sort(function (a, b) { return Number(a) - Number(b); });
|
|
196
|
+
(_a = props.onChange) === null || _a === void 0 ? void 0 : _a.call(props, { e: e, value: copyValues });
|
|
197
|
+
}
|
|
198
|
+
if (helper_1.isNotRangeParams(props) && typeof lastValue.current === 'number') {
|
|
199
|
+
(_b = props.onChange) === null || _b === void 0 ? void 0 : _b.call(props, { e: e, value: lastValue.current });
|
|
200
|
+
}
|
|
201
|
+
activeButton.current = null;
|
|
202
|
+
}, [lastValue, value, onChange, handleTouchMove]);
|
|
203
|
+
var handlePress = react_1.useCallback(function (typeButton) {
|
|
204
|
+
if (!disabled) {
|
|
205
|
+
activeButton.current = typeButton;
|
|
206
|
+
controlListeners('add');
|
|
207
|
+
}
|
|
208
|
+
}, [currentValue, value, onChange, handleTouchMove, disabled]);
|
|
222
209
|
return {
|
|
223
210
|
onKeyPress: onKeyPress,
|
|
224
211
|
onFocus: onFocus,
|
|
225
|
-
|
|
212
|
+
handlePress: handlePress,
|
|
226
213
|
activeButton: activeButton.current,
|
|
227
214
|
popoverPosition: [leftPopover, rightPopover],
|
|
228
|
-
currentValue: currentValue
|
|
215
|
+
currentValue: Array.isArray(currentValue) ? currentValue : [currentValue]
|
|
229
216
|
};
|
|
230
217
|
}
|
|
231
218
|
exports.useSlider = useSlider;
|
|
@@ -51,18 +51,15 @@ exports.useSliderStationing = function (value, min, max, view, range, step, butt
|
|
|
51
51
|
});
|
|
52
52
|
}
|
|
53
53
|
else if (Array.isArray(value) && value) {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
width: ((max - value[1]) / absoluteSize) * 100,
|
|
64
|
-
active: false
|
|
65
|
-
});
|
|
54
|
+
var endPointArray = tslib_1.__spread(value);
|
|
55
|
+
endPointArray.unshift(min);
|
|
56
|
+
endPointArray.push(max);
|
|
57
|
+
for (var i = 0; i < endPointArray.length - 1; i++) {
|
|
58
|
+
sizesArray.push({
|
|
59
|
+
width: ((endPointArray[i + 1] - endPointArray[i]) / absoluteSize) * 100,
|
|
60
|
+
active: endPointArray[i] !== min && endPointArray[i + 1] !== max
|
|
61
|
+
});
|
|
62
|
+
}
|
|
66
63
|
}
|
|
67
64
|
else {
|
|
68
65
|
sizesArray.push({
|
|
@@ -77,7 +74,7 @@ exports.useSliderStationing = function (value, min, max, view, range, step, butt
|
|
|
77
74
|
width: (Math.abs(stepSize.max - stepSize.min) * 100) / absoluteSize,
|
|
78
75
|
active: (typeof value === 'number' || Array.isArray(value)) &&
|
|
79
76
|
(range && Array.isArray(value)
|
|
80
|
-
? stepSize.max > value[0] && stepSize.min < value[1]
|
|
77
|
+
? stepSize.max > value[0] && stepSize.min < value[value.length - 1]
|
|
81
78
|
: stepSize.max <= value)
|
|
82
79
|
});
|
|
83
80
|
});
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import '../../Theme/_color/Theme_color_gpnDark.css';
|
|
2
2
|
import './SnackBar-Item.css';
|
|
3
3
|
import React from 'react';
|
|
4
|
+
import { PropsWithHTMLAttributesAndRef } from '../../../utils/types/PropsWithHTMLAttributes';
|
|
4
5
|
import { Item } from '../SnackBar';
|
|
5
6
|
export declare type SnackBarItemProps = {
|
|
6
7
|
item: Item;
|
|
7
8
|
};
|
|
8
|
-
|
|
9
|
+
declare type SnackBarItemComponent = (props: PropsWithHTMLAttributesAndRef<SnackBarItemProps, HTMLDivElement>) => React.ReactElement | null;
|
|
10
|
+
export declare const SnackBarItem: SnackBarItemComponent;
|
|
11
|
+
export {};
|
|
@@ -5,6 +5,7 @@ var tslib_1 = require("tslib");
|
|
|
5
5
|
require("../../Theme/_color/Theme_color_gpnDark.css");
|
|
6
6
|
require("./SnackBar-Item.css");
|
|
7
7
|
var react_1 = tslib_1.__importStar(require("react"));
|
|
8
|
+
var useFlag_1 = require("../../../hooks/useFlag/useFlag");
|
|
8
9
|
var IconClose_1 = require("../../../icons/IconClose/IconClose");
|
|
9
10
|
var type_guards_1 = require("../../../utils/type-guards");
|
|
10
11
|
var Button_1 = require("../../Button/Button");
|
|
@@ -23,17 +24,17 @@ var getAutoCloseTime = function (autoClose) {
|
|
|
23
24
|
}
|
|
24
25
|
return false;
|
|
25
26
|
};
|
|
26
|
-
exports.SnackBarItem = function (props) {
|
|
27
|
+
exports.SnackBarItem = react_1["default"].forwardRef(function (props, ref) {
|
|
27
28
|
var item = props.item;
|
|
28
29
|
var onClose = item.onClose, autoClose = item.autoClose, showProgress = item.showProgress, Icon = item.icon, message = item.message, actions = item.actions, _a = item.status, status = _a === void 0 ? SnackBar_1.snackBarItemStatusDefault : _a, onAutoCloseProp = item.onAutoClose;
|
|
29
30
|
var _b = tslib_1.__read(react_1.useState(null), 2), timerFunctions = _b[0], setTimerFunctions = _b[1];
|
|
30
|
-
var _c = tslib_1.__read(
|
|
31
|
-
var
|
|
31
|
+
var _c = tslib_1.__read(useFlag_1.useFlag(false), 2), hover = _c[0], _d = _c[1], onHover = _d.on, offHover = _d.off;
|
|
32
|
+
var _e = tslib_1.__read(useFlag_1.useFlag(false), 2), timeIsOver = _e[0], onTimeIsOver = _e[1].on;
|
|
32
33
|
var handleMountTimer = function (timerFunctions) {
|
|
33
34
|
return setTimerFunctions(timerFunctions);
|
|
34
35
|
};
|
|
35
|
-
var handleMouseEnter = function () { return
|
|
36
|
-
var handleMouseLeave = function () { return
|
|
36
|
+
var handleMouseEnter = function () { return onHover(); };
|
|
37
|
+
var handleMouseLeave = function () { return offHover(); };
|
|
37
38
|
var autoCloseTime = getAutoCloseTime(autoClose);
|
|
38
39
|
var hideAutoCloseTimer = showProgress === undefined || !(type_guards_1.isNumber(autoCloseTime) && autoCloseTime > 0);
|
|
39
40
|
var onAutoClose = function (item) {
|
|
@@ -55,15 +56,15 @@ exports.SnackBarItem = function (props) {
|
|
|
55
56
|
}
|
|
56
57
|
}, [hover, timeIsOver, timerFunctions]);
|
|
57
58
|
var handleTimeIsOver = function () {
|
|
58
|
-
|
|
59
|
+
onTimeIsOver();
|
|
59
60
|
onAutoClose(item);
|
|
60
61
|
};
|
|
61
62
|
var handleClose = onClose ? function () { return onClose(item); } : undefined;
|
|
62
|
-
return (react_1["default"].createElement("div", { className: SnackBar_1.cnSnackBarItem({ status: status }, [Theme_1.cnTheme({ color: 'gpnDark' })]), onMouseEnter: autoCloseTime ? handleMouseEnter : undefined, onMouseLeave: autoCloseTime ? handleMouseLeave : undefined },
|
|
63
|
+
return (react_1["default"].createElement("div", { ref: ref, className: SnackBar_1.cnSnackBarItem({ status: status }, [Theme_1.cnTheme({ color: 'gpnDark' })]), onMouseEnter: autoCloseTime ? handleMouseEnter : undefined, onMouseLeave: autoCloseTime ? handleMouseLeave : undefined },
|
|
63
64
|
autoCloseTime && (react_1["default"].createElement(SnackBar_Timer_1.SnackBarTimer, { onMount: handleMountTimer, onTimeIsOver: handleTimeIsOver, startTime: autoCloseTime, hidden: hideAutoCloseTimer })),
|
|
64
65
|
hideAutoCloseTimer && Icon && react_1["default"].createElement(Icon, { className: SnackBar_1.cnSnackBar('Icon'), size: "m" }),
|
|
65
66
|
react_1["default"].createElement("div", { className: SnackBar_1.cnSnackBar('Content') },
|
|
66
67
|
type_guards_1.isString(message) || type_guards_1.isNumber(message) ? (react_1["default"].createElement(Text_1.Text, { className: SnackBar_1.cnSnackBar('Message'), lineHeight: "s" }, message)) : (react_1["default"].createElement(react_1["default"].Fragment, null, message)),
|
|
67
68
|
actions && react_1["default"].createElement(SnackBar_ActionButton_1.SnackBarActionButton, { actions: actions })),
|
|
68
69
|
onClose && (react_1["default"].createElement(Button_1.Button, { className: SnackBar_1.cnSnackBar('CloseButton'), view: "clear", iconLeft: IconClose_1.IconClose, form: "round", size: "xs", onClick: handleClose }))));
|
|
69
|
-
};
|
|
70
|
+
});
|
|
@@ -3,7 +3,7 @@ exports.__esModule = true;
|
|
|
3
3
|
exports.SnackBar = exports.cnSnackBarItem = exports.cnSnackBar = exports.COMPONENT_NAME = exports.snackBarItemStatusDefault = exports.snackBarItemStatus = void 0;
|
|
4
4
|
var tslib_1 = require("tslib");
|
|
5
5
|
require("./SnackBar.css");
|
|
6
|
-
var react_1 = tslib_1.
|
|
6
|
+
var react_1 = tslib_1.__importStar(require("react"));
|
|
7
7
|
var react_transition_group_1 = require("react-transition-group");
|
|
8
8
|
var bem_1 = require("../../utils/bem");
|
|
9
9
|
var cnForCssTransition_1 = require("../../utils/cnForCssTransition");
|
|
@@ -17,8 +17,15 @@ exports.cnSnackBarItem = bem_1.cn(exports.COMPONENT_NAME, 'Item');
|
|
|
17
17
|
var cssTransitionClassNames = cnForCssTransition_1.cnForCssTransition(exports.cnSnackBarItem);
|
|
18
18
|
exports.SnackBar = function (props) {
|
|
19
19
|
var _a = usePropsHandler_1.usePropsHandler(exports.COMPONENT_NAME, props), items = _a.items, className = _a.className, otherProps = tslib_1.__rest(_a, ["items", "className"]);
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
var refs = react_1.useMemo(function () {
|
|
21
|
+
var refArray = [];
|
|
22
|
+
for (var i = 0; i < items.length; i++) {
|
|
23
|
+
refArray[i] = react_1.createRef();
|
|
24
|
+
}
|
|
25
|
+
return refArray;
|
|
26
|
+
}, [items]);
|
|
27
|
+
return (react_1["default"].createElement(react_transition_group_1.TransitionGroup, tslib_1.__assign({}, otherProps, { className: exports.cnSnackBar(null, [className]), appear: true, enter: true, exit: true }), items.map(function (item, index) {
|
|
28
|
+
return (react_1["default"].createElement(react_transition_group_1.CSSTransition, { nodeRef: refs[index], classNames: cssTransitionClassNames, key: item.key, timeout: 200 },
|
|
29
|
+
react_1["default"].createElement(SnackBar_Item_1.SnackBarItem, { item: item, ref: refs[index] })));
|
|
23
30
|
})));
|
|
24
31
|
};
|
|
@@ -17,8 +17,8 @@
|
|
|
17
17
|
.MixCard_verticalSpace_3xl,
|
|
18
18
|
.MixCard_verticalSpace_4xl,
|
|
19
19
|
.MixCard_verticalSpace_5xl {
|
|
20
|
-
padding-
|
|
21
|
-
padding-
|
|
20
|
+
padding-top: var(--vertical-space);
|
|
21
|
+
padding-bottom: var(--vertical-space);
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
.MixCard_verticalSpace_xs {
|
|
@@ -66,8 +66,8 @@
|
|
|
66
66
|
.MixCard_horizontalSpace_3xl,
|
|
67
67
|
.MixCard_horizontalSpace_4xl,
|
|
68
68
|
.MixCard_horizontalSpace_5xl {
|
|
69
|
-
padding-
|
|
70
|
-
padding-
|
|
69
|
+
padding-right: var(--horizontal-space);
|
|
70
|
+
padding-left: var(--horizontal-space);
|
|
71
71
|
}
|
|
72
72
|
|
|
73
73
|
.MixCard_horizontalSpace_xs {
|
|
@@ -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;
|
|
@@ -68,7 +68,8 @@ function ProgressStepBarRender(props, ref) {
|
|
|
68
68
|
position: getItemPosition(index, steps.length),
|
|
69
69
|
pointRef: stepsRef[index],
|
|
70
70
|
direction: direction,
|
|
71
|
-
onClick: onClick || onItemClickHandler
|
|
71
|
+
onClick: onClick || onItemClickHandler,
|
|
72
|
+
key: cnProgressStepBar({ index: index })
|
|
72
73
|
};
|
|
73
74
|
};
|
|
74
75
|
var isOverflow = useOverflow({ currentRef: listRef });
|
package/__internal__/src/components/ProgressStepBarCanary/ProgressStepBarItem/ProgressStepBarItem.js
CHANGED
|
@@ -26,11 +26,11 @@ var renderPointContent = function (point, size, progress) {
|
|
|
26
26
|
return React.createElement(ProgressSpin, { size: size });
|
|
27
27
|
if (!point)
|
|
28
28
|
return null;
|
|
29
|
-
if (typeof point === '
|
|
30
|
-
|
|
31
|
-
return React.createElement(Icon, { size: "xs" });
|
|
29
|
+
if (typeof point === 'number') {
|
|
30
|
+
return (React.createElement(Text, { className: cnProgressStepBarItem('PointText'), size: size === 's' ? '2xs' : 'xs', weight: "bold" }, point));
|
|
32
31
|
}
|
|
33
|
-
|
|
32
|
+
var Icon = point;
|
|
33
|
+
return React.createElement(Icon, { size: "xs" });
|
|
34
34
|
};
|
|
35
35
|
export var ProgressStepBarItem = React.forwardRef(function (props, ref) {
|
|
36
36
|
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 ? propPositionDefault : _a, otherProps = __rest(props, ["content", "tooltipContent", "label", "point", "status", "progress", "direction", "size", "pointRef", "onClick", "position"]);
|