@designbasekorea/ui 0.2.13 → 0.2.16
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 +5 -3
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +5 -3
- 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 +5 -3
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -9364,7 +9364,7 @@ const ProgressStep = ({ items, size = 'm', layout = 'vertical', currentStep = 0,
|
|
|
9364
9364
|
}) }));
|
|
9365
9365
|
};
|
|
9366
9366
|
|
|
9367
|
-
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 }) => {
|
|
9367
|
+
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 }) => {
|
|
9368
9368
|
const [internalValue, setInternalValue] = React.useState(value ?? min);
|
|
9369
9369
|
const [internalRange, setInternalRange] = React.useState(range ?? [min, max]);
|
|
9370
9370
|
const [isDragging, setIsDragging] = React.useState(false);
|
|
@@ -9375,6 +9375,8 @@ const RangeSlider = ({ value, range, min = 0, max = 100, step = 1, size = 'm', v
|
|
|
9375
9375
|
const isControlled = value !== undefined || range !== undefined;
|
|
9376
9376
|
const currentValue = isControlled ? (value ?? internalValue) : internalValue;
|
|
9377
9377
|
const currentRange = isControlled ? (range ?? internalRange) : internalRange;
|
|
9378
|
+
// 범위 슬라이더는 기본적으로 양끝에 값 표시, 단일 슬라이더는 우측에 표시
|
|
9379
|
+
const effectiveValuePosition = range !== undefined ? 'top' : (valuePosition === 'top' ? 'right' : valuePosition);
|
|
9378
9380
|
// 값 정규화
|
|
9379
9381
|
const normalizeValue = React.useCallback((val) => {
|
|
9380
9382
|
return Math.max(min, Math.min(max, val));
|
|
@@ -9544,7 +9546,7 @@ const RangeSlider = ({ value, range, min = 0, max = 100, step = 1, size = 'm', v
|
|
|
9544
9546
|
}, "aria-hidden": "true", children: markLabels[mark] && (jsxRuntime.jsx("span", { className: "designbase-range-slider__mark-label", children: markLabels[mark] })) }, mark));
|
|
9545
9547
|
});
|
|
9546
9548
|
};
|
|
9547
|
-
const classes = clsx('designbase-range-slider', `designbase-range-slider--${size}`, `designbase-range-slider--${variant}`, {
|
|
9549
|
+
const classes = clsx('designbase-range-slider', `designbase-range-slider--${size}`, `designbase-range-slider--${variant}`, `designbase-range-slider--value-${effectiveValuePosition}`, {
|
|
9548
9550
|
'designbase-range-slider--disabled': disabled,
|
|
9549
9551
|
'designbase-range-slider--readonly': readOnly,
|
|
9550
9552
|
'designbase-range-slider--full-width': fullWidth,
|
|
@@ -9563,7 +9565,7 @@ const RangeSlider = ({ value, range, min = 0, max = 100, step = 1, size = 'm', v
|
|
|
9563
9565
|
: {
|
|
9564
9566
|
[vertical ? 'height' : 'width']: `${getPercentage(currentValue)}%`,
|
|
9565
9567
|
};
|
|
9566
|
-
return (jsxRuntime.jsxs("div", { className: classes, ...props, children: [showValue && (jsxRuntime.jsx("div", { className: "designbase-range-slider__values", children: range !== undefined ? (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("span", { className: "designbase-range-slider__value", children: currentRange[0] }), jsxRuntime.jsx("span", { className: "designbase-range-slider__value", children: currentRange[1] })] })) : (jsxRuntime.jsx("span", { className: "designbase-range-slider__value", children: currentValue })) })), jsxRuntime.jsx("div", { ref: containerRef, className: "designbase-range-slider__container", role: "slider", "aria-valuemin": min, "aria-valuemax": max, "aria-valuenow": range !== undefined ? currentRange[0] : currentValue, "aria-valuetext": range !== undefined ? `${currentRange[0]} to ${currentRange[1]}` : currentValue.toString(), "aria-disabled": disabled, "aria-readonly": readOnly, tabIndex: disabled || readOnly ? -1 : 0, onKeyDown: (e) => handleKeyDown(e), children: jsxRuntime.jsxs("div", { ref: trackRef, className: trackClasses, onClick: handleTrackClick, children: [jsxRuntime.jsx("div", { className: "designbase-range-slider__fill", style: fillStyle }), renderMarks(), range !== undefined ? (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("div", { className: clsx('designbase-range-slider__thumb', {
|
|
9568
|
+
return (jsxRuntime.jsxs("div", { className: classes, ...props, children: [showValue && (jsxRuntime.jsx("div", { className: "designbase-range-slider__values", children: range !== undefined ? (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("span", { className: "designbase-range-slider__value designbase-range-slider__value--min", children: currentRange[0] }), jsxRuntime.jsx("span", { className: "designbase-range-slider__value designbase-range-slider__value--max", children: currentRange[1] })] })) : (jsxRuntime.jsx("span", { className: "designbase-range-slider__value designbase-range-slider__value--single", children: currentValue })) })), jsxRuntime.jsx("div", { ref: containerRef, className: "designbase-range-slider__container", role: "slider", "aria-valuemin": min, "aria-valuemax": max, "aria-valuenow": range !== undefined ? currentRange[0] : currentValue, "aria-valuetext": range !== undefined ? `${currentRange[0]} to ${currentRange[1]}` : currentValue.toString(), "aria-disabled": disabled, "aria-readonly": readOnly, tabIndex: disabled || readOnly ? -1 : 0, onKeyDown: (e) => handleKeyDown(e), children: jsxRuntime.jsxs("div", { ref: trackRef, className: trackClasses, onClick: handleTrackClick, children: [jsxRuntime.jsx("div", { className: "designbase-range-slider__fill", style: fillStyle }), renderMarks(), range !== undefined ? (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("div", { className: clsx('designbase-range-slider__thumb', {
|
|
9567
9569
|
'designbase-range-slider__thumb--active': activeThumb === 'min',
|
|
9568
9570
|
}), style: {
|
|
9569
9571
|
[vertical ? 'bottom' : 'left']: `${getPercentage(currentRange[0])}%`,
|