@mw-kit/mw-ui 1.7.62 → 1.7.63
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/components/Input/components/Range/styles/Input/index.d.ts +4 -2
- package/dist/components/Input/components/Range/styles/NavBar/index.d.ts +2 -1
- package/dist/index.js +53 -56
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +53 -56
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
package/dist/index.modern.js
CHANGED
|
@@ -15602,18 +15602,21 @@ var Switch = function Switch(props) {
|
|
|
15602
15602
|
};
|
|
15603
15603
|
|
|
15604
15604
|
var _templateObject$q, _templateObject2$m;
|
|
15605
|
-
var bullet = css(_templateObject$q || (_templateObject$q = _taggedTemplateLiteralLoose(["\n appearance: none;\n width: ", ";\n height: ", ";\n border-radius: 100%;\n border-width: 1px;\n border-style: solid;\n box-shadow: 0px 1px 3px ", ";\n\n background-color: ", ";\n\n transition: background-color 0.2s ease-in-out;\n"])), function (_ref) {
|
|
15606
|
-
var
|
|
15607
|
-
return
|
|
15605
|
+
var bullet = css(_templateObject$q || (_templateObject$q = _taggedTemplateLiteralLoose(["\n appearance: none;\n width: ", "px;\n height: ", "px;\n border-radius: 100%;\n border-width: 1px;\n border-style: solid;\n border-color: ", ";\n\n box-shadow: 0px 1px 3px ", ";\n box-sizing: border-box;\n\n background-color: ", ";\n\n transition: background-color 0.2s ease-in-out;\n"])), function (_ref) {
|
|
15606
|
+
var bulletSize = _ref.$bulletSize;
|
|
15607
|
+
return bulletSize;
|
|
15608
15608
|
}, function (_ref2) {
|
|
15609
|
-
var
|
|
15610
|
-
return
|
|
15609
|
+
var bulletSize = _ref2.$bulletSize;
|
|
15610
|
+
return bulletSize;
|
|
15611
15611
|
}, function (_ref3) {
|
|
15612
15612
|
var theme = _ref3.theme;
|
|
15613
|
-
return theme.
|
|
15613
|
+
return theme.colors.platinum;
|
|
15614
15614
|
}, function (_ref4) {
|
|
15615
|
-
var theme = _ref4.theme
|
|
15616
|
-
|
|
15615
|
+
var theme = _ref4.theme;
|
|
15616
|
+
return theme.getColor('black', 10);
|
|
15617
|
+
}, function (_ref5) {
|
|
15618
|
+
var theme = _ref5.theme,
|
|
15619
|
+
activeBullet = _ref5.$activeBullet;
|
|
15617
15620
|
return theme.colors[activeBullet ? 'blue' : 'white'];
|
|
15618
15621
|
});
|
|
15619
15622
|
var Input$2 = styled.input(_templateObject2$m || (_templateObject2$m = _taggedTemplateLiteralLoose(["\n appearance: none;\n width: 100%;\n height: 10px;\n background-color: transparent;\n outline: none;\n position: relative;\n z-index: 3;\n margin: 0;\n\n :not(:disabled) {\n cursor: pointer;\n }\n\n /** firefox */\n ::-moz-range-thumb {\n ", "\n }\n /** ie */\n ::-ms-thumb {\n ", "\n }\n /** chrome */\n ::-webkit-slider-thumb {\n ", "\n }\n"])), bullet, bullet, bullet);
|
|
@@ -15646,47 +15649,26 @@ var LabelContainer$4 = styled.div(_templateObject$t || (_templateObject$t = _tag
|
|
|
15646
15649
|
});
|
|
15647
15650
|
|
|
15648
15651
|
var _templateObject$u, _templateObject2$o, _templateObject3$j;
|
|
15649
|
-
var NavBar = styled.div(_templateObject$u || (_templateObject$u = _taggedTemplateLiteralLoose(["\n position: absolute;\n z-index: 2;\n\n left: 0;\n width: 100%;\n height: calc(33px + ", ");\n transition: height 0.25s ease-in-out;\n overflow: hidden;\n\n ", "\n\n > div:nth-child(1) {\n position: absolute;\n z-index: 2;\n\n width:
|
|
15652
|
+
var NavBar = styled.div(_templateObject$u || (_templateObject$u = _taggedTemplateLiteralLoose(["\n position: absolute;\n z-index: 2;\n\n left: 0;\n width: 100%;\n height: calc(33px + ", ");\n transition: height 0.25s ease-in-out;\n overflow: hidden;\n\n ", "\n\n > div:nth-child(1) {\n position: absolute;\n z-index: 2;\n\n width: 93px;\n /* height: 30px; */\n padding: 9px 7px;\n font-size: 13px;\n line-height: 16px;\n border-radius: 1px;\n\n background-color: ", ";\n color: ", ";\n padding: ", ";\n\n display: flex;\n align-items: center;\n justify-content: space-between;\n }\n\n > div:nth-child(2) {\n position: absolute;\n width: 0px;\n height: 0px;\n border-left: 7px solid transparent;\n border-right: 7px solid transparent;\n border-top: 5px solid ", ";\n }\n"])), function (_ref) {
|
|
15650
15653
|
var theme = _ref.theme;
|
|
15651
15654
|
return theme.spacings.s3;
|
|
15652
15655
|
}, function (_ref2) {
|
|
15653
|
-
var
|
|
15654
|
-
|
|
15655
|
-
|
|
15656
|
-
|
|
15657
|
-
},
|
|
15658
|
-
|
|
15659
|
-
|
|
15660
|
-
}, function (_ref5) {
|
|
15661
|
-
var theme = _ref5.theme;
|
|
15662
|
-
return theme.spacings.s1;
|
|
15663
|
-
}) : css(_templateObject3$j || (_templateObject3$j = _taggedTemplateLiteralLoose(["\n top: calc(100% + ", ");\n > div:nth-child(1) {\n top: ", ";\n }\n\n > div:nth-child(2) {\n bottom: calc(\n (100% - 19.8px / 2) - ", "\n );\n }\n "])), function (_ref6) {
|
|
15664
|
-
var theme = _ref6.theme;
|
|
15665
|
-
return theme.spacings.s1;
|
|
15666
|
-
}, function (_ref7) {
|
|
15667
|
-
var theme = _ref7.theme;
|
|
15668
|
-
return theme.spacings.s1;
|
|
15669
|
-
}, function (_ref8) {
|
|
15670
|
-
var theme = _ref8.theme;
|
|
15671
|
-
return theme.spacings.s1;
|
|
15672
|
-
});
|
|
15673
|
-
}, function (_ref9) {
|
|
15674
|
-
var theme = _ref9.theme;
|
|
15656
|
+
var theme = _ref2.theme,
|
|
15657
|
+
position = _ref2.$position,
|
|
15658
|
+
strict = _ref2.$strict;
|
|
15659
|
+
var distance = strict ? "calc(" + theme.spacings.s1 + " / 2)" : '0px';
|
|
15660
|
+
return position === 'bottom' ? css(_templateObject2$o || (_templateObject2$o = _taggedTemplateLiteralLoose(["\n bottom: calc(100% + ", ");\n > div:nth-child(1) {\n bottom: ", ";\n }\n\n > div:nth-child(2) {\n top: calc(100% - 7px);\n }\n "])), distance, theme.spacings.s1) : css(_templateObject3$j || (_templateObject3$j = _taggedTemplateLiteralLoose(["\n top: calc(100% + ", ");\n > div:nth-child(1) {\n top: ", ";\n }\n\n > div:nth-child(2) {\n bottom: calc(100% - 7px);\n transform: rotate(180deg);\n }\n "])), distance, theme.spacings.s1);
|
|
15661
|
+
}, function (_ref3) {
|
|
15662
|
+
var theme = _ref3.theme;
|
|
15675
15663
|
return theme.colors.blue;
|
|
15676
|
-
}, function (
|
|
15677
|
-
var theme =
|
|
15664
|
+
}, function (_ref4) {
|
|
15665
|
+
var theme = _ref4.theme;
|
|
15678
15666
|
return theme.colors.white;
|
|
15679
|
-
}, function (
|
|
15680
|
-
var theme =
|
|
15667
|
+
}, function (_ref5) {
|
|
15668
|
+
var theme = _ref5.theme;
|
|
15681
15669
|
return theme.spacings.s1;
|
|
15682
|
-
}, function (
|
|
15683
|
-
var theme =
|
|
15684
|
-
return theme.spacings.s3;
|
|
15685
|
-
}, function (_ref13) {
|
|
15686
|
-
var theme = _ref13.theme;
|
|
15687
|
-
return theme.spacings.s3;
|
|
15688
|
-
}, function (_ref14) {
|
|
15689
|
-
var theme = _ref14.theme;
|
|
15670
|
+
}, function (_ref6) {
|
|
15671
|
+
var theme = _ref6.theme;
|
|
15690
15672
|
return theme.colors.blue;
|
|
15691
15673
|
});
|
|
15692
15674
|
|
|
@@ -15725,10 +15707,10 @@ var LabelsContainer = styled.div(_templateObject$y || (_templateObject$y = _tagg
|
|
|
15725
15707
|
var position = _ref.position;
|
|
15726
15708
|
|
|
15727
15709
|
if (position === 'bottom') {
|
|
15728
|
-
return css(_templateObject2$r || (_templateObject2$r = _taggedTemplateLiteralLoose(["\n ", " {\n flex-direction: column-reverse;\n }\n\n ", " {\n :after {\n bottom: calc(100% +
|
|
15710
|
+
return css(_templateObject2$r || (_templateObject2$r = _taggedTemplateLiteralLoose(["\n ", " {\n flex-direction: column-reverse;\n }\n\n ", " {\n :after {\n bottom: calc(100% + 10px);\n }\n }\n\n ", " {\n align-items: start;\n }\n "])), InputContainer$1, Marker, MinMaxLabelContainer);
|
|
15729
15711
|
}
|
|
15730
15712
|
|
|
15731
|
-
return css(_templateObject3$l || (_templateObject3$l = _taggedTemplateLiteralLoose(["\n ", " {\n flex-direction: column;\n }\n\n ", " {\n :after {\n top: calc(100% +
|
|
15713
|
+
return css(_templateObject3$l || (_templateObject3$l = _taggedTemplateLiteralLoose(["\n ", " {\n flex-direction: column;\n }\n\n ", " {\n :after {\n top: calc(100% + 9px);\n }\n }\n\n ", " {\n align-items: end;\n }\n "])), InputContainer$1, Marker, MinMaxLabelContainer);
|
|
15732
15714
|
});
|
|
15733
15715
|
|
|
15734
15716
|
var _templateObject$z;
|
|
@@ -15814,12 +15796,18 @@ var getMarkerLeft = function getMarkerLeft(markers, range, index, value, min, st
|
|
|
15814
15796
|
return left;
|
|
15815
15797
|
};
|
|
15816
15798
|
|
|
15817
|
-
var
|
|
15818
|
-
|
|
15799
|
+
var getLeftCalc = function getLeftCalc(size, bullet, value, min, max) {
|
|
15800
|
+
var percent = (value - min) * 100 / (max - min);
|
|
15801
|
+
var calc = "calc(" + percent + "% - " + bullet * percent / 100 + "px + " + (bullet - size) / 2 + "px)";
|
|
15802
|
+
return calc;
|
|
15819
15803
|
};
|
|
15820
15804
|
|
|
15821
|
-
var
|
|
15822
|
-
return "min(max(
|
|
15805
|
+
var getBarLeft = function getBarLeft(size, calc) {
|
|
15806
|
+
return "min(max(" + calc + ", 0%), calc(100% - " + size + "px))";
|
|
15807
|
+
};
|
|
15808
|
+
|
|
15809
|
+
var getIndicatorLeft = function getIndicatorLeft(size, calc) {
|
|
15810
|
+
return "min(max(" + calc + ", calc(0% - " + size + "px)), calc(100% - " + size + "px))";
|
|
15823
15811
|
};
|
|
15824
15812
|
|
|
15825
15813
|
var Range = React__default.forwardRef(function (props, ref) {
|
|
@@ -15920,6 +15908,7 @@ var Range = React__default.forwardRef(function (props, ref) {
|
|
|
15920
15908
|
onChange: onChange,
|
|
15921
15909
|
value: value
|
|
15922
15910
|
});
|
|
15911
|
+
var bulletSize = strict === true ? 22 : 14;
|
|
15923
15912
|
return React__default.createElement(Label$5, {
|
|
15924
15913
|
required: required ? 1 : 0,
|
|
15925
15914
|
disabled: disabled ? 1 : 0,
|
|
@@ -15932,7 +15921,7 @@ var Range = React__default.forwardRef(function (props, ref) {
|
|
|
15932
15921
|
invalid: invalid ? 1 : 0
|
|
15933
15922
|
}, markers.length > 0 && React__default.createElement(MarkersContainer, null, markers.map(function (marker, index) {
|
|
15934
15923
|
var left = getMarkerLeft(markers.length, range, index, marker.value, min, strict);
|
|
15935
|
-
var bullet = marker.value > currentValue ? 1 : 0;
|
|
15924
|
+
var bullet = strict || marker.value > currentValue && marker.value < max ? 1 : 0;
|
|
15936
15925
|
return React__default.createElement(Marker, {
|
|
15937
15926
|
key: index,
|
|
15938
15927
|
left: left,
|
|
@@ -15941,26 +15930,34 @@ var Range = React__default.forwardRef(function (props, ref) {
|
|
|
15941
15930
|
})), React__default.createElement("div", null, React__default.createElement(Input$2, Object.assign({
|
|
15942
15931
|
ref: ref
|
|
15943
15932
|
}, inputProps, {
|
|
15944
|
-
"$activeBullet": (strict === true ? markers[value].value : value) !== 0
|
|
15933
|
+
"$activeBullet": (strict === true ? markers[value].value : value) !== 0,
|
|
15934
|
+
"$bulletSize": bulletSize
|
|
15945
15935
|
})), React__default.createElement(NavBar, {
|
|
15946
|
-
position: position
|
|
15936
|
+
"$position": position,
|
|
15937
|
+
"$strict": strict
|
|
15947
15938
|
}, React__default.createElement("div", {
|
|
15948
15939
|
style: {
|
|
15949
|
-
left: getBarLeft(
|
|
15940
|
+
left: getBarLeft(93, getLeftCalc(93, bulletSize, value, min, max))
|
|
15950
15941
|
}
|
|
15951
15942
|
}, React__default.createElement(Icon, {
|
|
15952
15943
|
type: 'feather',
|
|
15953
15944
|
icon: 'minus_circle',
|
|
15954
15945
|
color: 'white',
|
|
15955
|
-
onClick: canDecrement ? decrement : undefined
|
|
15946
|
+
onClick: canDecrement ? decrement : undefined,
|
|
15947
|
+
width: '12px',
|
|
15948
|
+
height: '12px',
|
|
15949
|
+
strokeWidth: '2.5px'
|
|
15956
15950
|
}), currentValue, React__default.createElement(Icon, {
|
|
15957
15951
|
type: 'feather',
|
|
15958
15952
|
icon: 'plus_circle',
|
|
15959
15953
|
color: 'white',
|
|
15960
|
-
onClick: canIncrement ? increment : undefined
|
|
15954
|
+
onClick: canIncrement ? increment : undefined,
|
|
15955
|
+
width: '12px',
|
|
15956
|
+
height: '12px',
|
|
15957
|
+
strokeWidth: '2.5px'
|
|
15961
15958
|
})), React__default.createElement("div", {
|
|
15962
15959
|
style: {
|
|
15963
|
-
left: getIndicatorLeft(14, (value
|
|
15960
|
+
left: getIndicatorLeft(14, getLeftCalc(14, bulletSize, value, min, max))
|
|
15964
15961
|
}
|
|
15965
15962
|
})), React__default.createElement(SelectedArea, {
|
|
15966
15963
|
percent: percent
|