@shoplflow/base 0.24.26 → 0.24.27
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.cjs +24 -31
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +24 -31
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -1862,27 +1862,16 @@ var getBorderColorByStatus = ({ isFocused, isError, isHovered, disabled }) => {
|
|
|
1862
1862
|
var InputWrapper = styled5__default.default.label`
|
|
1863
1863
|
display: flex;
|
|
1864
1864
|
align-items: center;
|
|
1865
|
-
width: ${({ width }) => {
|
|
1866
|
-
var _a;
|
|
1867
|
-
return (_a = `calc(${width} - 2px)`) != null ? _a : "calc(100% - 2px)";
|
|
1868
|
-
}};
|
|
1869
|
-
min-width: ${({ minWidth }) => {
|
|
1870
|
-
var _a;
|
|
1871
|
-
return (_a = `calc(${minWidth} - 2px)`) != null ? _a : "fit-content";
|
|
1872
|
-
}};
|
|
1873
|
-
height: ${({ height }) => {
|
|
1874
|
-
var _a;
|
|
1875
|
-
return (_a = `calc(${height} - 2px)`) != null ? _a : "fit-content";
|
|
1876
|
-
}};
|
|
1877
1865
|
flex-direction: ${({ direction }) => direction || "row"};
|
|
1866
|
+
width: ${({ width }) => width != null ? width : "100%"};
|
|
1867
|
+
min-width: ${({ minWidth }) => minWidth != null ? minWidth : "initial"};
|
|
1868
|
+
max-width: ${({ maxWidth }) => maxWidth != null ? maxWidth : "initial"};
|
|
1869
|
+
min-height: ${({ minHeight }) => minHeight != null ? minHeight : "initial"};
|
|
1870
|
+
max-height: ${({ maxHeight }) => maxHeight != null ? maxHeight : "initial"};
|
|
1871
|
+
height: ${({ height }) => height != null ? height : "initial"};
|
|
1878
1872
|
justify-content: space-between;
|
|
1879
|
-
min-height: ${({ minHeight }) => {
|
|
1880
|
-
var _a;
|
|
1881
|
-
return (_a = `calc(${minHeight} - 2px)`) != null ? _a : "fit-content";
|
|
1882
|
-
}};
|
|
1883
|
-
margin: 1px;
|
|
1884
1873
|
gap: 8px;
|
|
1885
|
-
|
|
1874
|
+
border: 1px solid ${(props) => getBorderColorByStatus(props)};
|
|
1886
1875
|
border-radius: 6px;
|
|
1887
1876
|
background-color: ${exports.colorTokens.neutral0};
|
|
1888
1877
|
overflow: hidden;
|
|
@@ -2670,6 +2659,17 @@ var assetFunction = (iconName, domainProps) => {
|
|
|
2670
2659
|
const ShoplIcon = ShoplAssets__namespace[iconName];
|
|
2671
2660
|
return domain === "hada" ? HadaIcon : ShoplIcon;
|
|
2672
2661
|
};
|
|
2662
|
+
|
|
2663
|
+
// src/components/Inputs/Input/utils/getNumberLimiteRange.ts
|
|
2664
|
+
var getNumberLimitRange = (value, min, max) => {
|
|
2665
|
+
if (min && value < min) {
|
|
2666
|
+
return String(min);
|
|
2667
|
+
}
|
|
2668
|
+
if (max && value > max) {
|
|
2669
|
+
return String(max);
|
|
2670
|
+
}
|
|
2671
|
+
return String(value);
|
|
2672
|
+
};
|
|
2673
2673
|
var Input = React2.forwardRef(
|
|
2674
2674
|
(_a, ref) => {
|
|
2675
2675
|
var _b = _a, {
|
|
@@ -2725,18 +2725,6 @@ var Input = React2.forwardRef(
|
|
|
2725
2725
|
},
|
|
2726
2726
|
[maxLength]
|
|
2727
2727
|
);
|
|
2728
|
-
const limitRange = React2.useCallback(
|
|
2729
|
-
(value2) => {
|
|
2730
|
-
if (min && Number(value2) < Number(min)) {
|
|
2731
|
-
return String(min);
|
|
2732
|
-
}
|
|
2733
|
-
if (max && Number(value2) > Number(max)) {
|
|
2734
|
-
return String(max);
|
|
2735
|
-
}
|
|
2736
|
-
return value2;
|
|
2737
|
-
},
|
|
2738
|
-
[max, min]
|
|
2739
|
-
);
|
|
2740
2728
|
const handleOnMouseEnter = () => {
|
|
2741
2729
|
setIsHovered(true);
|
|
2742
2730
|
};
|
|
@@ -2755,7 +2743,10 @@ var Input = React2.forwardRef(
|
|
|
2755
2743
|
onChange && onChange(event);
|
|
2756
2744
|
const slicedText = sliceText(event.target.value);
|
|
2757
2745
|
if (type === "number") {
|
|
2758
|
-
const
|
|
2746
|
+
const numberValue = Number(slicedText);
|
|
2747
|
+
const numberMin = Number(min);
|
|
2748
|
+
const numberMax = Number(max);
|
|
2749
|
+
const limitedText = getNumberLimitRange(numberValue, numberMin, numberMax);
|
|
2759
2750
|
setText(limitedText);
|
|
2760
2751
|
return;
|
|
2761
2752
|
}
|
|
@@ -2813,6 +2804,7 @@ var Input = React2.forwardRef(
|
|
|
2813
2804
|
onMouseLeave: handleOnMouseLeave,
|
|
2814
2805
|
width: getWidth(),
|
|
2815
2806
|
height: type === "number" ? "32px" : "40px",
|
|
2807
|
+
maxHeight: type === "number" ? "32px" : "40px",
|
|
2816
2808
|
"data-shoplflow": "input",
|
|
2817
2809
|
children: [
|
|
2818
2810
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -2952,6 +2944,7 @@ var InputButton = React2.forwardRef(
|
|
|
2952
2944
|
isFocused: isSelected,
|
|
2953
2945
|
disabled,
|
|
2954
2946
|
minHeight: "40px",
|
|
2947
|
+
maxHeight: "40px",
|
|
2955
2948
|
width,
|
|
2956
2949
|
children: /* @__PURE__ */ jsxRuntime.jsxs(exports.StyledInputButton, { onClick: handleOnClick, disabled, children: [
|
|
2957
2950
|
/* @__PURE__ */ jsxRuntime.jsx(exports.StyledInputButtonContent, __spreadValues({ className: "body1_400", defaultValue: text, ref }, rest)),
|