@cloud-ru/ds-fields 3.0.8 → 3.0.9
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/CHANGELOG.md +8 -0
- package/dist/cjs/components/FieldSlider/FieldSlider.js +1 -0
- package/dist/cjs/components/FieldStepper/FieldStepper.js +9 -1
- package/dist/esm/components/FieldSlider/FieldSlider.js +1 -0
- package/dist/esm/components/FieldStepper/FieldStepper.js +9 -1
- package/dist/tsconfig.cjs.tsbuildinfo +1 -1
- package/dist/tsconfig.esm.tsbuildinfo +1 -1
- package/package.json +11 -11
- package/src/components/FieldSlider/FieldSlider.tsx +1 -0
- package/src/components/FieldStepper/FieldStepper.tsx +14 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,14 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## 3.0.9 (2026-11-03)
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
- **FF-9113:** add focus on input area click ([88e5eae](https://github.com/cloud-ru-tech/snack-v2/commit/88e5eae962eb608b4e65f972cfd28353632b9fc3))
|
|
11
|
+
- **FF-9113:** clear focus state on blur ([e295f82](https://github.com/cloud-ru-tech/snack-v2/commit/e295f82a21b09f5fe58d58f5ebc01d8d52df2f85))
|
|
12
|
+
- **FF-9113:** set one digit value to zero with backspace ([ed300f5](https://github.com/cloud-ru-tech/snack-v2/commit/ed300f52c4e9a128e927b38176301bc5ddec443e))
|
|
13
|
+
|
|
6
14
|
## 3.0.8 (2026-11-03)
|
|
7
15
|
|
|
8
16
|
### Bug Fixes
|
|
@@ -114,6 +114,7 @@ exports.FieldSlider = (0, react_1.forwardRef)(function FieldSlider({ label = '',
|
|
|
114
114
|
setInputValue(raw);
|
|
115
115
|
}, [range]);
|
|
116
116
|
const handleInputBlur = (0, react_1.useCallback)((event) => {
|
|
117
|
+
setFocusVisible(false);
|
|
117
118
|
snapAndCommit(inputValue);
|
|
118
119
|
onBlur?.(event);
|
|
119
120
|
}, [inputValue, onBlur, snapAndCommit]);
|
|
@@ -156,6 +156,14 @@ exports.FieldStepper = (0, react_1.forwardRef)(function FieldStepper({ label = '
|
|
|
156
156
|
readonly: readOnly,
|
|
157
157
|
hover,
|
|
158
158
|
focusVisible,
|
|
159
|
-
}), children: (0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.acrylicBg, "aria-hidden": true }) }), (0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.borderStateLayer, "data-state": 'borderOnBackground' }), (0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.focusLayer })] }), (0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.elementWrapperBefore, children: [renderStepButton('minus'), (0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.lineWrapper, "data-outline": background || undefined, children: (0, jsx_runtime_1.jsx)(divider_1.Divider, { orientation: 'vertical', variant: 'regular' }) })] }), (0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.fieldContainer,
|
|
159
|
+
}), children: (0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.acrylicBg, "aria-hidden": true }) }), (0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.borderStateLayer, "data-state": 'borderOnBackground' }), (0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.focusLayer })] }), (0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.elementWrapperBefore, children: [renderStepButton('minus'), (0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.lineWrapper, "data-outline": background || undefined, children: (0, jsx_runtime_1.jsx)(divider_1.Divider, { orientation: 'vertical', variant: 'regular' }) })] }), (0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.fieldContainer, onClick: () => {
|
|
160
|
+
if (!disabled && !readOnly && localRef.current) {
|
|
161
|
+
localRef.current.focus();
|
|
162
|
+
}
|
|
163
|
+
}, onMouseDown: event => {
|
|
164
|
+
if (focusVisible) {
|
|
165
|
+
event.preventDefault();
|
|
166
|
+
}
|
|
167
|
+
}, children: (0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.contentWrapper, children: (0, jsx_runtime_1.jsxs)("div", { className: (0, classnames_1.default)(styles_module_scss_1.default.inputLine, styles_module_scss_2.default.inputLine), children: [prefix && (0, jsx_runtime_1.jsx)("span", { className: styles_module_scss_1.default.prefix, children: prefix }), (0, jsx_runtime_1.jsx)("div", { className: (0, classnames_1.default)(styles_module_scss_1.default.inputArea, styles_module_scss_2.default.inputArea), children: (0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_2.default.inputWrapper, style: { '--field-stepper-input-ch': inputWidthCh }, children: (0, jsx_runtime_1.jsx)(input_private_1.InputPrivate, { ref: (0, merge_refs_1.default)(ref, localRef), className: (0, classnames_1.default)(styles_module_scss_1.default.fieldInput, styles_module_scss_2.default.input), value: String(value), type: input_private_1.TYPE.Number, disabled: disabled, readonly: readOnly, onChange: handleInputChange, onFocus: handleFocus, onBlur: handleBlur, onKeyDown: handleInputKeyDown, id: id, name: name, min: min, max: max, step: step, autoFocus: resolvedAutoFocus, "data-test-id": constants_1.TEST_IDS.fieldStepperInput, ...(0, utils_1.extractSupportProps)(rest) }) }) }), postfix && (0, jsx_runtime_1.jsx)("span", { className: styles_module_scss_1.default.postfix, children: postfix }), showCopyUi && ((0, jsx_runtime_1.jsx)("span", { className: styles_module_scss_1.default.postfixButtonsSlot, children: (0, jsx_runtime_1.jsx)(button_1.Button, { innerRef: copyButtonRef, type: 'button', view: 'function', appearance: 'neutral', size: input_private_1.BUTTON_SIZE_MAP[size], icon: copied ? (0, jsx_runtime_1.jsx)(system_1.CheckSVG, {}) : (0, jsx_runtime_1.jsx)(system_1.CopySVG, {}), onClick: handleCopy, onKeyDown: handleCopyButtonKeyDown, tabIndex: -1, "data-test-id": constants_1.TEST_IDS.fieldStepperCopyButton }) }))] }) }) }), (0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.elementWrapperAfter, children: [(0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.lineWrapper, "data-outline": background || undefined, children: (0, jsx_runtime_1.jsx)(divider_1.Divider, { orientation: 'vertical', variant: 'regular' }) }), renderStepButton('plus')] })] }));
|
|
160
168
|
return ((0, jsx_runtime_1.jsx)(field_decorator_1.FieldDecorator, { className: className, label: label, labelTooltip: labelTooltip, caption: caption, hint: hint, error: error, validationState: effectiveValidationState, showHintIcon: showHintIcon, length: length, required: required, labelFor: id, disabled: disabled, readonly: readOnly, size: size, "data-test-id": dataTestId, children: clampTooltip ? ((0, jsx_runtime_1.jsx)(tooltip_1.Tooltip, { tip: clampTooltip, open: true, "data-test-id": constants_1.TEST_IDS.fieldStepperLimitTooltip, children: shell })) : (shell) }));
|
|
161
169
|
});
|
|
@@ -108,6 +108,7 @@ export const FieldSlider = forwardRef(function FieldSlider({ label = '', labelTo
|
|
|
108
108
|
setInputValue(raw);
|
|
109
109
|
}, [range]);
|
|
110
110
|
const handleInputBlur = useCallback((event) => {
|
|
111
|
+
setFocusVisible(false);
|
|
111
112
|
snapAndCommit(inputValue);
|
|
112
113
|
onBlur?.(event);
|
|
113
114
|
}, [inputValue, onBlur, snapAndCommit]);
|
|
@@ -150,6 +150,14 @@ export const FieldStepper = forwardRef(function FieldStepper({ label = '', label
|
|
|
150
150
|
readonly: readOnly,
|
|
151
151
|
hover,
|
|
152
152
|
focusVisible,
|
|
153
|
-
}), children: _jsx("div", { className: fieldStyles.acrylicBg, "aria-hidden": true }) }), _jsx("div", { className: fieldStyles.borderStateLayer, "data-state": 'borderOnBackground' }), _jsx("div", { className: fieldStyles.focusLayer })] }), _jsxs("div", { className: fieldStyles.elementWrapperBefore, children: [renderStepButton('minus'), _jsx("div", { className: fieldStyles.lineWrapper, "data-outline": background || undefined, children: _jsx(Divider, { orientation: 'vertical', variant: 'regular' }) })] }), _jsx("div", { className: fieldStyles.fieldContainer,
|
|
153
|
+
}), children: _jsx("div", { className: fieldStyles.acrylicBg, "aria-hidden": true }) }), _jsx("div", { className: fieldStyles.borderStateLayer, "data-state": 'borderOnBackground' }), _jsx("div", { className: fieldStyles.focusLayer })] }), _jsxs("div", { className: fieldStyles.elementWrapperBefore, children: [renderStepButton('minus'), _jsx("div", { className: fieldStyles.lineWrapper, "data-outline": background || undefined, children: _jsx(Divider, { orientation: 'vertical', variant: 'regular' }) })] }), _jsx("div", { className: fieldStyles.fieldContainer, onClick: () => {
|
|
154
|
+
if (!disabled && !readOnly && localRef.current) {
|
|
155
|
+
localRef.current.focus();
|
|
156
|
+
}
|
|
157
|
+
}, onMouseDown: event => {
|
|
158
|
+
if (focusVisible) {
|
|
159
|
+
event.preventDefault();
|
|
160
|
+
}
|
|
161
|
+
}, children: _jsx("div", { className: fieldStyles.contentWrapper, children: _jsxs("div", { className: cn(fieldStyles.inputLine, styles.inputLine), children: [prefix && _jsx("span", { className: fieldStyles.prefix, children: prefix }), _jsx("div", { className: cn(fieldStyles.inputArea, styles.inputArea), children: _jsx("div", { className: styles.inputWrapper, style: { '--field-stepper-input-ch': inputWidthCh }, children: _jsx(InputPrivate, { ref: mergeRefs(ref, localRef), className: cn(fieldStyles.fieldInput, styles.input), value: String(value), type: TYPE.Number, disabled: disabled, readonly: readOnly, onChange: handleInputChange, onFocus: handleFocus, onBlur: handleBlur, onKeyDown: handleInputKeyDown, id: id, name: name, min: min, max: max, step: step, autoFocus: resolvedAutoFocus, "data-test-id": TEST_IDS.fieldStepperInput, ...extractSupportProps(rest) }) }) }), postfix && _jsx("span", { className: fieldStyles.postfix, children: postfix }), showCopyUi && (_jsx("span", { className: fieldStyles.postfixButtonsSlot, children: _jsx(Button, { innerRef: copyButtonRef, type: 'button', view: 'function', appearance: 'neutral', size: BUTTON_SIZE_MAP[size], icon: copied ? _jsx(CheckSVG, {}) : _jsx(CopySVG, {}), onClick: handleCopy, onKeyDown: handleCopyButtonKeyDown, tabIndex: -1, "data-test-id": TEST_IDS.fieldStepperCopyButton }) }))] }) }) }), _jsxs("div", { className: fieldStyles.elementWrapperAfter, children: [_jsx("div", { className: fieldStyles.lineWrapper, "data-outline": background || undefined, children: _jsx(Divider, { orientation: 'vertical', variant: 'regular' }) }), renderStepButton('plus')] })] }));
|
|
154
162
|
return (_jsx(FieldDecorator, { className: className, label: label, labelTooltip: labelTooltip, caption: caption, hint: hint, error: error, validationState: effectiveValidationState, showHintIcon: showHintIcon, length: length, required: required, labelFor: id, disabled: disabled, readonly: readOnly, size: size, "data-test-id": dataTestId, children: clampTooltip ? (_jsx(Tooltip, { tip: clampTooltip, open: true, "data-test-id": TEST_IDS.fieldStepperLimitTooltip, children: shell })) : (shell) }));
|
|
155
163
|
});
|