@designbasekorea/ui 0.2.13 → 0.2.14
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/dist/index.css +1 -1
- package/dist/index.css.map +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.esm.css +1 -1
- package/dist/index.esm.css.map +1 -1
- package/dist/index.esm.js +4 -2
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +4 -2
- package/dist/index.js.map +1 -1
- package/dist/index.umd.css +1 -1
- package/dist/index.umd.css.map +1 -1
- package/dist/index.umd.js +4 -2
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/index.umd.js
CHANGED
|
@@ -9363,7 +9363,7 @@
|
|
|
9363
9363
|
}) }));
|
|
9364
9364
|
};
|
|
9365
9365
|
|
|
9366
|
-
const RangeSlider = ({ value, range, min = 0, max = 100, step = 1, size = 'm', variant = 'default', showValue = false, showMarks = false, marks = [], markLabels = {}, disabled = false, readOnly = false, fullWidth = false, vertical = false, onChange, onRangeChange, className, ...props }) => {
|
|
9366
|
+
const RangeSlider = ({ value, range, min = 0, max = 100, step = 1, size = 'm', variant = 'default', showValue = false, valuePosition = 'top', showMarks = false, marks = [], markLabels = {}, disabled = false, readOnly = false, fullWidth = false, vertical = false, onChange, onRangeChange, className, ...props }) => {
|
|
9367
9367
|
const [internalValue, setInternalValue] = React.useState(value ?? min);
|
|
9368
9368
|
const [internalRange, setInternalRange] = React.useState(range ?? [min, max]);
|
|
9369
9369
|
const [isDragging, setIsDragging] = React.useState(false);
|
|
@@ -9374,6 +9374,8 @@
|
|
|
9374
9374
|
const isControlled = value !== undefined || range !== undefined;
|
|
9375
9375
|
const currentValue = isControlled ? (value ?? internalValue) : internalValue;
|
|
9376
9376
|
const currentRange = isControlled ? (range ?? internalRange) : internalRange;
|
|
9377
|
+
// 단일 값일 때 기본적으로 우측에 표시
|
|
9378
|
+
const effectiveValuePosition = valuePosition === 'top' && range === undefined ? 'right' : valuePosition;
|
|
9377
9379
|
// 값 정규화
|
|
9378
9380
|
const normalizeValue = React.useCallback((val) => {
|
|
9379
9381
|
return Math.max(min, Math.min(max, val));
|
|
@@ -9543,7 +9545,7 @@
|
|
|
9543
9545
|
}, "aria-hidden": "true", children: markLabels[mark] && (jsxRuntime.jsx("span", { className: "designbase-range-slider__mark-label", children: markLabels[mark] })) }, mark));
|
|
9544
9546
|
});
|
|
9545
9547
|
};
|
|
9546
|
-
const classes = clsx('designbase-range-slider', `designbase-range-slider--${size}`, `designbase-range-slider--${variant}`, {
|
|
9548
|
+
const classes = clsx('designbase-range-slider', `designbase-range-slider--${size}`, `designbase-range-slider--${variant}`, `designbase-range-slider--value-${effectiveValuePosition}`, {
|
|
9547
9549
|
'designbase-range-slider--disabled': disabled,
|
|
9548
9550
|
'designbase-range-slider--readonly': readOnly,
|
|
9549
9551
|
'designbase-range-slider--full-width': fullWidth,
|