scorer-ui-kit 1.7.26 → 1.7.28
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.
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { InputHTMLAttributes } from 'react';
|
|
2
2
|
import { IFeedbackColor } from '../../index';
|
|
3
|
-
export declare type
|
|
3
|
+
export declare type IMarkAlignment = 'left' | 'center' | 'right';
|
|
4
4
|
export interface ISliderMark {
|
|
5
5
|
value: number;
|
|
6
6
|
label?: string;
|
|
@@ -14,8 +14,10 @@ interface ISliderOwnProps {
|
|
|
14
14
|
value?: number;
|
|
15
15
|
thumbColor?: IFeedbackColor;
|
|
16
16
|
onlyMarkSelect?: boolean;
|
|
17
|
+
showValue?: boolean;
|
|
17
18
|
inputCallback?: (value: number) => void;
|
|
18
19
|
onChangeCallback?: (value: number) => void;
|
|
20
|
+
allMarkCentered?: boolean;
|
|
19
21
|
}
|
|
20
22
|
export declare type ISlider = ISliderOwnProps & InputHTMLAttributes<HTMLInputElement>;
|
|
21
23
|
declare const SliderInput: React.FC<ISlider>;
|
|
@@ -6,9 +6,11 @@ interface IPercentageSliderProps {
|
|
|
6
6
|
marks?: ISliderMark[];
|
|
7
7
|
defaultValue?: number;
|
|
8
8
|
value?: number;
|
|
9
|
+
showValue?: boolean;
|
|
9
10
|
inputCallback?: (value: number) => void;
|
|
10
11
|
updateThumbColor?: (value: number) => IFeedbackColor;
|
|
11
12
|
updateTitle?: (value: number) => string;
|
|
13
|
+
allMarkCentered?: boolean;
|
|
12
14
|
}
|
|
13
15
|
declare type IPercentageSlider = IPercentageSliderProps & InputHTMLAttributes<HTMLInputElement>;
|
|
14
16
|
declare const PercentageSlider: React.FC<IPercentageSlider>;
|
package/dist/index.js
CHANGED
|
@@ -2991,7 +2991,7 @@ var getFormattedTime = function getFormattedTime(value) {
|
|
|
2991
2991
|
}
|
|
2992
2992
|
};
|
|
2993
2993
|
|
|
2994
|
-
var _excluded$9 = ["min", "max", "marks", "defaultValue", "thumbColor", "disabled", "onlyMarkSelect", "inputCallback", "onChangeCallback"];
|
|
2994
|
+
var _excluded$9 = ["min", "max", "marks", "defaultValue", "thumbColor", "disabled", "onlyMarkSelect", "inputCallback", "onChangeCallback", "allMarkCentered"];
|
|
2995
2995
|
|
|
2996
2996
|
var _templateObject$i, _templateObject2$h, _templateObject3$f, _templateObject4$e, _templateObject5$b, _templateObject6$a, _templateObject7$a, _templateObject8$9, _templateObject9$9, _templateObject10$8, _templateObject11$5, _templateObject12$2;
|
|
2997
2997
|
var ThumbDiameter = 16;
|
|
@@ -3090,7 +3090,7 @@ var getMarkAlignment = function getMarkAlignment(value, min, max) {
|
|
|
3090
3090
|
return 'center';
|
|
3091
3091
|
};
|
|
3092
3092
|
|
|
3093
|
-
var renderMarks = function renderMarks(markList, min, max, listTag) {
|
|
3093
|
+
var renderMarks = function renderMarks(markList, min, max, listTag, allMarkCentered) {
|
|
3094
3094
|
var listOptions = [];
|
|
3095
3095
|
var marksElements = markList.map(function (_ref11, index) {
|
|
3096
3096
|
var value = _ref11.value,
|
|
@@ -3106,7 +3106,7 @@ var renderMarks = function renderMarks(markList, min, max, listTag) {
|
|
|
3106
3106
|
leftValue: left
|
|
3107
3107
|
}), React__default.createElement(MarkLabel, {
|
|
3108
3108
|
leftValue: left,
|
|
3109
|
-
alignment: getMarkAlignment(value, min, max)
|
|
3109
|
+
alignment: allMarkCentered ? 'center' : getMarkAlignment(value, min, max)
|
|
3110
3110
|
}, label));
|
|
3111
3111
|
});
|
|
3112
3112
|
return React__default.createElement(React.Fragment, null, marksElements, React__default.createElement("datalist", {
|
|
@@ -3131,6 +3131,8 @@ var SliderInput = function SliderInput(_ref12) {
|
|
|
3131
3131
|
inputCallback = _ref12$inputCallback === void 0 ? function () {} : _ref12$inputCallback,
|
|
3132
3132
|
_ref12$onChangeCallba = _ref12.onChangeCallback,
|
|
3133
3133
|
onChangeCallback = _ref12$onChangeCallba === void 0 ? function () {} : _ref12$onChangeCallba,
|
|
3134
|
+
_ref12$allMarkCentere = _ref12.allMarkCentered,
|
|
3135
|
+
allMarkCentered = _ref12$allMarkCentere === void 0 ? false : _ref12$allMarkCentere,
|
|
3134
3136
|
props = _objectWithoutPropertiesLoose(_ref12, _excluded$9);
|
|
3135
3137
|
|
|
3136
3138
|
var maxValid = getValidMax(max, min);
|
|
@@ -3204,7 +3206,7 @@ var SliderInput = function SliderInput(_ref12) {
|
|
|
3204
3206
|
}, [defaultValue, maxValid, minValid]);
|
|
3205
3207
|
return React__default.createElement(SliderWrapper, {
|
|
3206
3208
|
disabled: disabled
|
|
3207
|
-
}, React__default.createElement(Rail, null), React__default.createElement(ThumbWrapper, null, marks && renderMarks(marks, minValid, maxValid, "sliderList-" + minValid + "-" + maxValid), isGhostActive && onlyMarkSelect ? React__default.createElement(GhostThumb, {
|
|
3209
|
+
}, React__default.createElement(Rail, null), React__default.createElement(ThumbWrapper, null, marks && renderMarks(marks, minValid, maxValid, "sliderList-" + minValid + "-" + maxValid, allMarkCentered), isGhostActive && onlyMarkSelect ? React__default.createElement(GhostThumb, {
|
|
3208
3210
|
"data-value": selectedValue,
|
|
3209
3211
|
leftValue: ghostThumbValue,
|
|
3210
3212
|
"data-percentage": ghostThumbValue,
|
|
@@ -3339,13 +3341,16 @@ var DurationSlider = function DurationSlider(_ref3) {
|
|
|
3339
3341
|
})));
|
|
3340
3342
|
};
|
|
3341
3343
|
|
|
3342
|
-
var _excluded$c = ["defaultValue", "inputCallback", "updateThumbColor", "updateTitle"];
|
|
3344
|
+
var _excluded$c = ["defaultValue", "inputCallback", "updateThumbColor", "updateTitle", "showValue", "allMarkCentered"];
|
|
3343
3345
|
|
|
3344
3346
|
var _templateObject$l, _templateObject2$k, _templateObject3$i;
|
|
3345
3347
|
var Container$b = styled__default.div(_templateObject$l || (_templateObject$l = _taggedTemplateLiteralLoose([""])));
|
|
3346
|
-
var Headers$1 = styled__default.div(_templateObject2$k || (_templateObject2$k = _taggedTemplateLiteralLoose(["\n font-size: 14px;\n color: hsl(207, 5%, 57%);\n display: flex;\n justify-content: space-between;\n margin-bottom: 20px;\n
|
|
3347
|
-
var
|
|
3348
|
-
|
|
3348
|
+
var Headers$1 = styled__default.div(_templateObject2$k || (_templateObject2$k = _taggedTemplateLiteralLoose(["\n font-size: 14px;\n color: hsl(207, 5%, 57%);\n display: flex;\n justify-content: space-between;\n margin-bottom: 20px;\n ", ";\n"])), function (_ref) {
|
|
3349
|
+
var allMarkCentered = _ref.allMarkCentered;
|
|
3350
|
+
return allMarkCentered ? "padding: 0;" : "padding: 0 6px;";
|
|
3351
|
+
});
|
|
3352
|
+
var ValueTitle$1 = styled__default(Label)(_templateObject3$i || (_templateObject3$i = _taggedTemplateLiteralLoose(["\n font-family: ", ";\n"])), function (_ref2) {
|
|
3353
|
+
var theme = _ref2.theme;
|
|
3349
3354
|
return theme.fontFamily.data;
|
|
3350
3355
|
});
|
|
3351
3356
|
|
|
@@ -3373,13 +3378,15 @@ var getTitleLevel = function getTitleLevel(value) {
|
|
|
3373
3378
|
return 'Safe Level';
|
|
3374
3379
|
};
|
|
3375
3380
|
|
|
3376
|
-
var PercentageSlider = function PercentageSlider(
|
|
3377
|
-
var
|
|
3378
|
-
defaultValue =
|
|
3379
|
-
inputCallback =
|
|
3380
|
-
updateThumbColor =
|
|
3381
|
-
updateTitle =
|
|
3382
|
-
|
|
3381
|
+
var PercentageSlider = function PercentageSlider(_ref3) {
|
|
3382
|
+
var _ref3$defaultValue = _ref3.defaultValue,
|
|
3383
|
+
defaultValue = _ref3$defaultValue === void 0 ? 0 : _ref3$defaultValue,
|
|
3384
|
+
inputCallback = _ref3.inputCallback,
|
|
3385
|
+
updateThumbColor = _ref3.updateThumbColor,
|
|
3386
|
+
updateTitle = _ref3.updateTitle,
|
|
3387
|
+
showValue = _ref3.showValue,
|
|
3388
|
+
allMarkCentered = _ref3.allMarkCentered,
|
|
3389
|
+
props = _objectWithoutPropertiesLoose(_ref3, _excluded$c);
|
|
3383
3390
|
|
|
3384
3391
|
var _useState = React.useState(defaultValue),
|
|
3385
3392
|
selectedValue = _useState[0],
|
|
@@ -3392,10 +3399,12 @@ var PercentageSlider = function PercentageSlider(_ref2) {
|
|
|
3392
3399
|
|
|
3393
3400
|
setSelectedValue(value);
|
|
3394
3401
|
}, [inputCallback]);
|
|
3395
|
-
return React__default.createElement(Container$b, null, React__default.createElement(Headers$1,
|
|
3402
|
+
return React__default.createElement(Container$b, null, React__default.createElement(Headers$1, {
|
|
3403
|
+
allMarkCentered: allMarkCentered
|
|
3404
|
+
}, React__default.createElement(Label, {
|
|
3396
3405
|
htmlFor: 'percentage-slider',
|
|
3397
3406
|
labelText: updateTitle ? updateTitle(selectedValue) : getTitleLevel(selectedValue)
|
|
3398
|
-
}), React__default.createElement(ValueTitle$1, {
|
|
3407
|
+
}), showValue && React__default.createElement(ValueTitle$1, {
|
|
3399
3408
|
htmlFor: 'percentage-slider',
|
|
3400
3409
|
labelText: selectedValue + "%"
|
|
3401
3410
|
})), React__default.createElement(SliderInput, Object.assign({}, props, {
|
|
@@ -3403,8 +3412,10 @@ var PercentageSlider = function PercentageSlider(_ref2) {
|
|
|
3403
3412
|
max: 100,
|
|
3404
3413
|
min: 0,
|
|
3405
3414
|
defaultValue: defaultValue,
|
|
3415
|
+
showValue: showValue,
|
|
3406
3416
|
onChangeCallback: handleSelectedValue,
|
|
3407
|
-
thumbColor: updateThumbColor ? updateThumbColor(selectedValue) : getThumbColor(selectedValue)
|
|
3417
|
+
thumbColor: updateThumbColor ? updateThumbColor(selectedValue) : getThumbColor(selectedValue),
|
|
3418
|
+
allMarkCentered: allMarkCentered
|
|
3408
3419
|
})));
|
|
3409
3420
|
};
|
|
3410
3421
|
|
|
@@ -5470,7 +5481,7 @@ var TopLine$1 = styled__default.div(_templateObject2$A || (_templateObject2$A =
|
|
|
5470
5481
|
});
|
|
5471
5482
|
var InnerBox = styled__default.div(_templateObject3$v || (_templateObject3$v = _taggedTemplateLiteralLoose(["\n border-bottom-left-radius: 3px;\n border-bottom-right-radius: 3px;\n box-shadow: 0 4px 9px 0 hsla(204, 22%, 67%, 0.07);\n border-right: solid 1px hsl(207, 16%, 86%);\n border-bottom: solid 1px hsl(207, 16%, 86%);\n border-left: solid 1px hsl(207, 16%, 86%);\n background-color: hsl(200, 23%, 97%);\n"])));
|
|
5472
5483
|
var StyledFilterOption = styled__default(FilterOption)(_templateObject4$q || (_templateObject4$q = _taggedTemplateLiteralLoose(["\n letter-spacing: 0.2px;\n"])));
|
|
5473
|
-
var OptionList = styled__default.div(_templateObject5$m || (_templateObject5$m = _taggedTemplateLiteralLoose(["\n max-height: ", ";\n min-height: 40px;\n position: relative;\n overflow-y: auto;\n margin-right: 2px;\n
|
|
5484
|
+
var OptionList = styled__default.div(_templateObject5$m || (_templateObject5$m = _taggedTemplateLiteralLoose(["\n max-height: ", ";\n min-height: 40px;\n position: relative;\n overflow-y: auto;\n margin-right: 2px;\n\n ", " {\n height: 35px;\n padding-left: 10px;\n }\n"])), function (_ref2) {
|
|
5474
5485
|
var moreItem = _ref2.moreItem;
|
|
5475
5486
|
return moreItem ? '168px' : '175px';
|
|
5476
5487
|
}, StyledFilterOption);
|
|
@@ -12878,7 +12889,7 @@ var LabelNotes = styled__default.div(_templateObject4$_ || (_templateObject4$_ =
|
|
|
12878
12889
|
var TitleContainer = styled__default.div(_templateObject6$G || (_templateObject6$G = _taggedTemplateLiteralLoose(["\n display: flex;\n gap:6px;\n flex-direction: row;\n align-items: center;\n margin-left: 10px;\n margin: 3px 0 5px 10px;\n"])));
|
|
12879
12890
|
var Container$U = styled__default.div(_templateObject7$B || (_templateObject7$B = _taggedTemplateLiteralLoose(["\n cursor: pointer;\n"])));
|
|
12880
12891
|
var TitleBox = styled__default.div(_templateObject8$y || (_templateObject8$y = _taggedTemplateLiteralLoose(["\n display: flex;\n justify-content: space-between;\n align-items: center;\n"])));
|
|
12881
|
-
var IconBox = styled__default.div(_templateObject9$t || (_templateObject9$t = _taggedTemplateLiteralLoose(["\n padding: 1px 5px 0 0;\n"])));
|
|
12892
|
+
var IconBox = styled__default.div(_templateObject9$t || (_templateObject9$t = _taggedTemplateLiteralLoose(["\n padding: 1px 5px 0 0;\n opacity: 0;\n ", ":hover & {\n opacity: 1;\n cursor: pointer;\n }\n"])), Container$U);
|
|
12882
12893
|
var CopyTextBox = styled__default.pre(_templateObject10$n || (_templateObject10$n = _taggedTemplateLiteralLoose(["\n padding: 5px;\n font-size: 10px;\n line-height: 1.2;\n box-shadow: 2px 2px 4px (195deg 16% 72% / 72%);\n border: 1px solid hsl(195deg 5% 60% / 72%);\n background-color: #f8f9fa;\n border-radius: 5px;\n opacity: 0.76;\n font-weight: 500;\n color: #575757;\n position: absolute; \n max-width: 170px;\n white-space: pre-wrap;\n font-family: ", ";\n right:10px;\n margin-top: -23px;\n"])), function (_ref3) {
|
|
12883
12894
|
var theme = _ref3.theme;
|
|
12884
12895
|
return theme.fontFamily.data;
|