@megafon/ui-core 7.6.1 → 7.8.0
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/es/components/ErrorLoad/ErrorLoad.css +1 -0
- package/dist/es/components/ErrorLoad/ErrorLoad.d.ts +23 -0
- package/dist/es/components/ErrorLoad/ErrorLoad.js +59 -0
- package/dist/es/components/Search/Search.d.ts +6 -0
- package/dist/es/components/Search/Search.js +7 -2
- package/dist/es/components/Select/Select.d.ts +3 -1
- package/dist/es/components/Select/Select.js +9 -1
- package/dist/es/components/Sliders/Slider/Slider.css +1 -1
- package/dist/es/components/Sliders/Slider/Slider.d.ts +2 -4
- package/dist/es/components/Sliders/Slider/Slider.js +6 -5
- package/dist/es/components/Sliders/SliderRange/SliderRange.css +1 -1
- package/dist/es/components/Sliders/SliderRange/SliderRange.d.ts +2 -4
- package/dist/es/components/Sliders/SliderRange/SliderRange.js +13 -15
- package/dist/es/components/Sliders/SliderRatio/SliderRatio.css +1 -1
- package/dist/es/components/Sliders/SliderRatio/SliderRatio.d.ts +1 -2
- package/dist/es/components/Sliders/SliderRatio/SliderRatio.js +14 -16
- package/dist/es/index.d.ts +1 -1
- package/dist/es/index.js +1 -1
- package/dist/lib/components/ErrorLoad/ErrorLoad.css +1 -0
- package/dist/lib/components/ErrorLoad/ErrorLoad.d.ts +23 -0
- package/dist/lib/components/ErrorLoad/ErrorLoad.js +68 -0
- package/dist/lib/components/Search/Search.d.ts +6 -0
- package/dist/lib/components/Search/Search.js +7 -2
- package/dist/lib/components/Select/Select.d.ts +3 -1
- package/dist/lib/components/Select/Select.js +9 -1
- package/dist/lib/components/Sliders/Slider/Slider.css +1 -1
- package/dist/lib/components/Sliders/Slider/Slider.d.ts +2 -4
- package/dist/lib/components/Sliders/Slider/Slider.js +6 -5
- package/dist/lib/components/Sliders/SliderRange/SliderRange.css +1 -1
- package/dist/lib/components/Sliders/SliderRange/SliderRange.d.ts +2 -4
- package/dist/lib/components/Sliders/SliderRange/SliderRange.js +13 -15
- package/dist/lib/components/Sliders/SliderRatio/SliderRatio.css +1 -1
- package/dist/lib/components/Sliders/SliderRatio/SliderRatio.d.ts +1 -2
- package/dist/lib/components/Sliders/SliderRatio/SliderRatio.js +14 -16
- package/dist/lib/index.d.ts +1 -1
- package/dist/lib/index.js +7 -7
- package/package.json +3 -3
- package/dist/es/components/Sliders/components/SliderDisplayValue/SliderDisplayValue.css +0 -1
- package/dist/es/components/Sliders/components/SliderDisplayValue/SliderDisplayValue.d.ts +0 -23
- package/dist/es/components/Sliders/components/SliderDisplayValue/SliderDisplayValue.js +0 -78
- package/dist/lib/components/Sliders/components/SliderDisplayValue/SliderDisplayValue.css +0 -1
- package/dist/lib/components/Sliders/components/SliderDisplayValue/SliderDisplayValue.d.ts +0 -23
- package/dist/lib/components/Sliders/components/SliderDisplayValue/SliderDisplayValue.js +0 -86
|
@@ -0,0 +1 @@
|
|
|
1
|
+
h1,h2,h3,h4,h5{margin:0}.mfui-error-load{background:inherit}.mfui-error-load_cardinal_vertical{-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;gap:12px;-ms-flex-align:center;-ms-flex-item-align:stretch;align-self:stretch}.mfui-error-load_cardinal_horizontal,.mfui-error-load_cardinal_vertical{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;align-items:center}.mfui-error-load_cardinal_horizontal{gap:8px;-ms-flex-align:center;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.mfui-error-load__header{text-align:center}.mfui-error-load__text .mfui-error-load__caption_background_on-color,.mfui-error-load__text .mfui-error-load__header_background_on-color{color:var(--stcWhite)}.mfui-error-load__text .mfui-error-load__caption_background_on-base{color:var(--spbSky3)}.mfui-error-load__text{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;gap:4px}.mfui-error-load__text_cardinal_vertical{-webkit-box-align:center;-ms-flex-align:center;align-items:center;-ms-flex-item-align:stretch;align-self:stretch}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { IButtonProps } from '../Button/Button';
|
|
3
|
+
import './ErrorLoad.scss';
|
|
4
|
+
type ButtonProps = Pick<IButtonProps, 'disabled' | 'showLoader' | 'onClick'>;
|
|
5
|
+
export interface IErrorLoadProps {
|
|
6
|
+
/** Размер блока */
|
|
7
|
+
big?: boolean;
|
|
8
|
+
/** Цветовая тема */
|
|
9
|
+
background?: 'on-base' | 'on-color';
|
|
10
|
+
/** Ориентация блока */
|
|
11
|
+
cardinalDirection?: 'vertical' | 'horizontal';
|
|
12
|
+
/** Параметры кнопки */
|
|
13
|
+
buttonParams?: ButtonProps;
|
|
14
|
+
/** Дополнительный класс корневого элемента */
|
|
15
|
+
className?: string;
|
|
16
|
+
/** Дополнительные data атрибуты к внутренним элементам */
|
|
17
|
+
dataAttrs?: {
|
|
18
|
+
root?: Record<string, string>;
|
|
19
|
+
button?: Record<string, string>;
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
declare const ErrorLoad: React.FC<IErrorLoadProps>;
|
|
23
|
+
export default ErrorLoad;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import "core-js/modules/es.string.big.js";
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { cnCreate, filterDataAttrs } from '@megafon/ui-helpers';
|
|
5
|
+
import Button from "../Button/Button";
|
|
6
|
+
import Caption from "../Caption/Caption";
|
|
7
|
+
import Header from "../Header/Header";
|
|
8
|
+
import "./ErrorLoad.css";
|
|
9
|
+
var RefreshIcon24 = function RefreshIcon24(props) {
|
|
10
|
+
return /*#__PURE__*/React.createElement("svg", _extends({
|
|
11
|
+
viewBox: "0 0 32 32"
|
|
12
|
+
}, props), /*#__PURE__*/React.createElement("path", {
|
|
13
|
+
fillRule: "evenodd",
|
|
14
|
+
clipRule: "evenodd",
|
|
15
|
+
d: "M16.064 8C11.604 8 8 11.588 8 16s3.604 8 8.064 8c4.1 0 7.478-3.033 7.995-6.948l1.983.262C25.393 22.223 21.17 26 16.064 26 10.513 26 6 21.53 6 16S10.513 6 16.064 6c3.456 0 6.507 1.731 8.32 4.371l.704-2.345 1.915.575-1.419 4.726a1 1 0 01-1.228.675l-4.855-1.364.541-1.925 2.664.748A8.074 8.074 0 0016.064 8z"
|
|
16
|
+
}));
|
|
17
|
+
};
|
|
18
|
+
var cn = cnCreate('mfui-error-load');
|
|
19
|
+
var ErrorLoad = function ErrorLoad(_ref) {
|
|
20
|
+
var _ref$background = _ref.background,
|
|
21
|
+
background = _ref$background === void 0 ? 'on-base' : _ref$background,
|
|
22
|
+
_ref$big = _ref.big,
|
|
23
|
+
big = _ref$big === void 0 ? true : _ref$big,
|
|
24
|
+
_ref$cardinalDirectio = _ref.cardinalDirection,
|
|
25
|
+
cardinalDirection = _ref$cardinalDirectio === void 0 ? 'horizontal' : _ref$cardinalDirectio,
|
|
26
|
+
className = _ref.className,
|
|
27
|
+
dataAttrs = _ref.dataAttrs,
|
|
28
|
+
buttonParams = _ref.buttonParams;
|
|
29
|
+
var isBaseBackground = background === 'on-base';
|
|
30
|
+
var isSmallIconSize = cardinalDirection === 'horizontal' || !big;
|
|
31
|
+
return /*#__PURE__*/React.createElement("div", _extends({
|
|
32
|
+
className: cn({
|
|
33
|
+
cardinal: cardinalDirection
|
|
34
|
+
}, className)
|
|
35
|
+
}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root)), /*#__PURE__*/React.createElement("div", {
|
|
36
|
+
className: cn('text', {
|
|
37
|
+
cardinal: cardinalDirection
|
|
38
|
+
})
|
|
39
|
+
}, /*#__PURE__*/React.createElement(Header, {
|
|
40
|
+
as: big ? 'h3' : 'h5',
|
|
41
|
+
className: cn('header', {
|
|
42
|
+
background: background
|
|
43
|
+
})
|
|
44
|
+
}, "\u0414\u0430\u043D\u043D\u044B\u0435 \u043D\u0435 \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u043B\u0438\u0441\u044C"), big && /*#__PURE__*/React.createElement(Caption, {
|
|
45
|
+
hasMargin: false,
|
|
46
|
+
className: cn('caption', {
|
|
47
|
+
background: background
|
|
48
|
+
})
|
|
49
|
+
}, "\u041E\u0431\u043D\u043E\u0432\u0438\u0442\u0435 \u0438\u043B\u0438 \u0437\u0430\u0439\u0434\u0438\u0442\u0435 \u043F\u043E\u0437\u0436\u0435")), /*#__PURE__*/React.createElement(Button, _extends({
|
|
50
|
+
icon: /*#__PURE__*/React.createElement(RefreshIcon24, null),
|
|
51
|
+
theme: isBaseBackground ? 'green' : 'white',
|
|
52
|
+
sizeAll: isSmallIconSize ? 'small' : 'medium'
|
|
53
|
+
}, buttonParams, {
|
|
54
|
+
dataAttrs: {
|
|
55
|
+
root: dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.button
|
|
56
|
+
}
|
|
57
|
+
})));
|
|
58
|
+
};
|
|
59
|
+
export default ErrorLoad;
|
|
@@ -68,6 +68,8 @@ export interface ISearchProps {
|
|
|
68
68
|
verification?: VerificationType;
|
|
69
69
|
/** Дополнительный текст под полем. Свойство verification влияет на цвет текста. */
|
|
70
70
|
noticeText?: string | JSX.Element;
|
|
71
|
+
/** Максимальное вводимое количество текста */
|
|
72
|
+
maxLength?: number;
|
|
71
73
|
/** Отключение поля ввода */
|
|
72
74
|
disabled?: boolean;
|
|
73
75
|
/** Делает поле обязательным */
|
|
@@ -79,6 +81,8 @@ export interface ISearchProps {
|
|
|
79
81
|
label?: string;
|
|
80
82
|
input?: string;
|
|
81
83
|
listItemTitle?: string;
|
|
84
|
+
list?: string;
|
|
85
|
+
listInner?: string;
|
|
82
86
|
control?: string;
|
|
83
87
|
icon?: string;
|
|
84
88
|
submitButton?: string;
|
|
@@ -103,6 +107,8 @@ export interface ISearchProps {
|
|
|
103
107
|
minTextareaHeight?: MinTextareaHeightType;
|
|
104
108
|
/** Показать хендлер для ресайза текстового поля */
|
|
105
109
|
showResizer?: boolean;
|
|
110
|
+
/** Ref обработчик */
|
|
111
|
+
inputRef?: (node: HTMLInputElement | HTMLTextAreaElement) => void;
|
|
106
112
|
/** Обработчик изменения поля */
|
|
107
113
|
onChange?: (value: string) => void;
|
|
108
114
|
/** Обработчик нажатия на enter */
|
|
@@ -85,6 +85,7 @@ var Search = function Search(_ref) {
|
|
|
85
85
|
disabled = _ref.disabled,
|
|
86
86
|
required = _ref.required,
|
|
87
87
|
noticeText = _ref.noticeText,
|
|
88
|
+
maxLength = _ref.maxLength,
|
|
88
89
|
className = _ref.className,
|
|
89
90
|
classes = _ref.classes,
|
|
90
91
|
_ref$type = _ref.type,
|
|
@@ -100,6 +101,7 @@ var Search = function Search(_ref) {
|
|
|
100
101
|
_ref$minTextareaHeigh = _ref.minTextareaHeight,
|
|
101
102
|
minTextareaHeight = _ref$minTextareaHeigh === void 0 ? MinTextareaHeight.ONE_ROW : _ref$minTextareaHeigh,
|
|
102
103
|
showResizer = _ref.showResizer,
|
|
104
|
+
inputRef = _ref.inputRef,
|
|
103
105
|
onChange = _ref.onChange,
|
|
104
106
|
onSubmit = _ref.onSubmit,
|
|
105
107
|
onBlur = _ref.onBlur,
|
|
@@ -155,6 +157,7 @@ var Search = function Search(_ref) {
|
|
|
155
157
|
return;
|
|
156
158
|
}
|
|
157
159
|
fieldRef.current = node;
|
|
160
|
+
inputRef === null || inputRef === void 0 ? void 0 : inputRef(node);
|
|
158
161
|
};
|
|
159
162
|
var textareaResize = React.useCallback(function () {
|
|
160
163
|
if (!isTextarea || !fieldRef.current || !containerRef.current || isTextareaResized) {
|
|
@@ -415,10 +418,10 @@ var Search = function Search(_ref) {
|
|
|
415
418
|
};
|
|
416
419
|
var renderList = function renderList() {
|
|
417
420
|
return /*#__PURE__*/React.createElement("div", {
|
|
418
|
-
className: cn('list'),
|
|
421
|
+
className: cn('list', [classes === null || classes === void 0 ? void 0 : classes.list]),
|
|
419
422
|
ref: listRef
|
|
420
423
|
}, /*#__PURE__*/React.createElement("div", {
|
|
421
|
-
className: cn('list-inner')
|
|
424
|
+
className: cn('list-inner', [classes === null || classes === void 0 ? void 0 : classes.listInner])
|
|
422
425
|
}, items.map(function (_ref2, i) {
|
|
423
426
|
var itemValue = _ref2.value,
|
|
424
427
|
searchView = _ref2.searchView,
|
|
@@ -498,6 +501,7 @@ var Search = function Search(_ref) {
|
|
|
498
501
|
}, [classes === null || classes === void 0 ? void 0 : classes.input]),
|
|
499
502
|
placeholder: placeholder,
|
|
500
503
|
value: searchQuery,
|
|
504
|
+
maxLength: maxLength,
|
|
501
505
|
onChange: handleChange,
|
|
502
506
|
onFocus: handleFocus,
|
|
503
507
|
onBlur: handleBlur,
|
|
@@ -524,6 +528,7 @@ var Search = function Search(_ref) {
|
|
|
524
528
|
},
|
|
525
529
|
placeholder: placeholder,
|
|
526
530
|
value: searchQuery,
|
|
531
|
+
maxLength: maxLength,
|
|
527
532
|
onChange: handleChange,
|
|
528
533
|
onFocus: handleFocus,
|
|
529
534
|
onBlur: handleBlur,
|
|
@@ -84,6 +84,8 @@ export interface ISelectProps<T extends SelectItemValueType> {
|
|
|
84
84
|
listItemTitle?: Record<string, string>;
|
|
85
85
|
notFound?: Record<string, string>;
|
|
86
86
|
};
|
|
87
|
+
/** Ref обработчик */
|
|
88
|
+
inputRef?: (node: HTMLDivElement) => void;
|
|
87
89
|
/** Обработчик выбора элемента селекта */
|
|
88
90
|
onSelect?: (e: React.MouseEvent<HTMLDivElement> | React.KeyboardEvent<HTMLDivElement> | null, dataItem?: ISelectItem<T>) => void;
|
|
89
91
|
/** Обработчик при открытом селекте */
|
|
@@ -91,5 +93,5 @@ export interface ISelectProps<T extends SelectItemValueType> {
|
|
|
91
93
|
/** Обработчик при закрытом селекте */
|
|
92
94
|
onClosed?: () => void;
|
|
93
95
|
}
|
|
94
|
-
declare const Select: <T extends SelectItemValueType>({ type, disabled, verification, noticeText, label, labelId, required, className, classes, dataAttrs, notFoundText, items, placeholder, currentValue, shortList, onClosed, onOpened, onSelect, }: ISelectProps<T>) => JSX.Element;
|
|
96
|
+
declare const Select: <T extends SelectItemValueType>({ type, disabled, verification, noticeText, label, labelId, required, className, classes, dataAttrs, notFoundText, items, placeholder, currentValue, shortList, inputRef, onClosed, onOpened, onSelect, }: ISelectProps<T>) => JSX.Element;
|
|
95
97
|
export default Select;
|
|
@@ -75,6 +75,7 @@ var Select = function Select(_ref) {
|
|
|
75
75
|
currentValue = _ref.currentValue,
|
|
76
76
|
_ref$shortList = _ref.shortList,
|
|
77
77
|
shortList = _ref$shortList === void 0 ? false : _ref$shortList,
|
|
78
|
+
inputRef = _ref.inputRef,
|
|
78
79
|
onClosed = _ref.onClosed,
|
|
79
80
|
onOpened = _ref.onOpened,
|
|
80
81
|
onSelect = _ref.onSelect;
|
|
@@ -94,6 +95,13 @@ var Select = function Select(_ref) {
|
|
|
94
95
|
var currentIndex = itemsList.findIndex(function (elem) {
|
|
95
96
|
return elem.value === currentValue;
|
|
96
97
|
});
|
|
98
|
+
var getFieldNode = function getFieldNode(node) {
|
|
99
|
+
if (!node) {
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
selectNode.current = node;
|
|
103
|
+
inputRef === null || inputRef === void 0 ? void 0 : inputRef(node);
|
|
104
|
+
};
|
|
97
105
|
var handleClickOutside = useCallback(function (e) {
|
|
98
106
|
var _a;
|
|
99
107
|
if (e.target instanceof Node && ((_a = selectNode.current) === null || _a === void 0 ? void 0 : _a.contains(e.target)) || !isOpened) {
|
|
@@ -384,7 +392,7 @@ var Select = function Select(_ref) {
|
|
|
384
392
|
valid: verification === Verification.VALID,
|
|
385
393
|
error: verification === Verification.ERROR
|
|
386
394
|
}, [className, classes.root]),
|
|
387
|
-
ref:
|
|
395
|
+
ref: getFieldNode
|
|
388
396
|
}), /*#__PURE__*/React.createElement("div", {
|
|
389
397
|
className: cn('inner')
|
|
390
398
|
}, /*#__PURE__*/React.createElement("div", _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.control), {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
h1,h2,h3,h4,h5{margin:0}.mfui-slider{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}.mfui-slider__head{display:grid;font-size:15px;font-weight:500;grid-template-columns:auto 55%;line-height:24px;margin-bottom:8px}.mfui-
|
|
1
|
+
h1,h2,h3,h4,h5{margin:0}.mfui-slider{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}.mfui-slider__head{display:grid;font-size:15px;font-weight:500;grid-template-columns:auto 55%;line-height:24px;margin-bottom:8px}.mfui-slider__range-input{-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-appearance:none;-moz-appearance:none;appearance:none;background:var(--spbSky0);background-image:-webkit-gradient(linear,left top,left bottom,from(var(--brandGreen)),to(var(--brandGreen)));background-image:linear-gradient(var(--brandGreen),var(--brandGreen));background-repeat:no-repeat;border-radius:100px;cursor:pointer;height:12px;margin:6px 0;outline:none}.mfui-slider__range-input:focus{outline:none}.mfui-slider__range-input::-webkit-slider-thumb{-webkit-appearance:none;background-color:var(--stcWhite);border:none;border-radius:50%;-webkit-box-shadow:0 2px 6px rgba(0,0,0,.16);box-shadow:0 2px 6px rgba(0,0,0,.16);height:24px;width:24px}.mfui-slider__range-input::-moz-range-thumb{-webkit-appearance:none;background-color:var(--stcWhite);border:none;border-radius:50%;box-shadow:0 2px 6px rgba(0,0,0,.16);height:24px;width:24px}.mfui-slider__range-input::-ms-thumb{-webkit-appearance:none;background-color:var(--stcWhite);border:none;border-radius:50%;box-shadow:0 2px 6px rgba(0,0,0,.16);height:24px;width:24px}.mfui-slider__range-input::-webkit-slider-runnable-track{-webkit-appearance:none;background:transparent;border:none;-webkit-box-shadow:none;box-shadow:none}.mfui-slider__range-input::-moz-range-track{-webkit-appearance:none;background:transparent;border:none;box-shadow:none}.mfui-slider__range-input::-ms-track{-webkit-appearance:none;background:transparent;border:none;box-shadow:none}.mfui-slider_disabled .mfui-slider__head{color:var(--spbSky3)}.mfui-slider_disabled .mfui-slider__range-input{background-image:-webkit-gradient(linear,left top,left bottom,from(var(--spbSky1)),to(var(--spbSky1)));background-image:linear-gradient(var(--spbSky1),var(--spbSky1));cursor:default}.mfui-slider_disabled .mfui-slider__range-input::-webkit-slider-thumb{-webkit-appearance:none;background-color:var(--stcWhite);background-color:var(--spbSky2);border:none;border-radius:50%;-webkit-box-shadow:0 2px 6px rgba(0,0,0,.16);box-shadow:0 2px 6px rgba(0,0,0,.16);-webkit-box-shadow:none;box-shadow:none;height:24px;width:24px}.mfui-slider_disabled .mfui-slider__range-input::-moz-range-thumb{-webkit-appearance:none;background-color:var(--stcWhite);background-color:var(--spbSky2);border:none;border-radius:50%;box-shadow:0 2px 6px rgba(0,0,0,.16);box-shadow:none;height:24px;width:24px}.mfui-slider_disabled .mfui-slider__range-input::-ms-thumb{-webkit-appearance:none;background-color:var(--stcWhite);background-color:var(--spbSky2);border:none;border-radius:50%;box-shadow:0 2px 6px rgba(0,0,0,.16);box-shadow:none;height:24px;width:24px}
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { DisplayValueType } from '../components/SliderDisplayValue/SliderDisplayValue';
|
|
3
|
-
import { ScaleType } from '../components/SliderScale/SliderScale';
|
|
4
2
|
import './Slider.scss';
|
|
5
3
|
export interface ISlider {
|
|
6
4
|
/** Дополнительный класс корневого элемента */
|
|
@@ -14,7 +12,7 @@ export interface ISlider {
|
|
|
14
12
|
/** Лейбл */
|
|
15
13
|
label?: string;
|
|
16
14
|
/** Тип выводимого значения */
|
|
17
|
-
displayValueType?:
|
|
15
|
+
displayValueType?: 'input' | 'line';
|
|
18
16
|
/** Единица измерения выводимого значения */
|
|
19
17
|
displayValueUnit?: string;
|
|
20
18
|
/** Переводит компонент в контролируемое состояние */
|
|
@@ -22,7 +20,7 @@ export interface ISlider {
|
|
|
22
20
|
/** Шаг */
|
|
23
21
|
step?: number;
|
|
24
22
|
/** Тип встроенной шкалы */
|
|
25
|
-
scale?:
|
|
23
|
+
scale?: 'interval' | 'base';
|
|
26
24
|
/** Кастомная шкала */
|
|
27
25
|
customScale?: string[];
|
|
28
26
|
/** Переводит компонент в выключенное состояние */
|
|
@@ -2,7 +2,7 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
2
2
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import { cnCreate, filterDataAttrs } from '@megafon/ui-helpers';
|
|
5
|
-
import
|
|
5
|
+
import ValueField from "../../ValueField/ValueField";
|
|
6
6
|
import SliderScale from "../components/SliderScale/SliderScale";
|
|
7
7
|
import { getRangeValue, getTrackSize, removeFirstZeros } from "../helpers";
|
|
8
8
|
import "./Slider.css";
|
|
@@ -58,11 +58,12 @@ var Slider = function Slider(_ref) {
|
|
|
58
58
|
className: cn('head')
|
|
59
59
|
}, !!label && /*#__PURE__*/React.createElement("div", {
|
|
60
60
|
className: cn('label')
|
|
61
|
-
}, label), !!displayValueType && /*#__PURE__*/React.createElement(
|
|
62
|
-
|
|
61
|
+
}, label), !!displayValueType && /*#__PURE__*/React.createElement(ValueField, {
|
|
62
|
+
isControlled: true,
|
|
63
|
+
position: "right",
|
|
63
64
|
value: rawInputValue !== null && rawInputValue !== void 0 ? rawInputValue : rangeValue,
|
|
64
|
-
|
|
65
|
-
|
|
65
|
+
fieldType: displayValueType,
|
|
66
|
+
valueUnit: displayValueUnit,
|
|
66
67
|
disabled: disabled,
|
|
67
68
|
onChange: handleInputChange(false),
|
|
68
69
|
onBlur: handleInputBlur,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
h1,h2,h3,h4,h5{margin:0}.mfui-slider-range{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}.mfui-slider-range__head{font-size:15px;font-weight:500;line-height:24px;margin-bottom:8px}.mfui-slider-range__display-values{display:grid;grid-template-columns:45% 45%;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;margin-top:8px;width:100%}.mfui-slider-
|
|
1
|
+
h1,h2,h3,h4,h5{margin:0}.mfui-slider-range{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}.mfui-slider-range__head{font-size:15px;font-weight:500;line-height:24px;margin-bottom:8px}.mfui-slider-range__display-values{display:grid;grid-template-columns:45% 45%;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;margin-top:8px;width:100%}.mfui-slider-range__range-container{cursor:pointer;height:12px;margin:6px 0;position:relative}.mfui-slider-range__range-input{-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-appearance:none;-moz-appearance:none;appearance:none;background:none;border:none;cursor:pointer;height:0;margin:0;outline:none;pointer-events:none;position:absolute;top:50%;width:100%}.mfui-slider-range__range-input_left{z-index:1}.mfui-slider-range__range-input_left.mfui-slider-range__range-input_over{z-index:3}.mfui-slider-range__range-input_right{z-index:2}.mfui-slider-range__range-input:focus{outline:none}.mfui-slider-range__range-input::-webkit-slider-thumb{-webkit-appearance:none;background-color:var(--stcWhite);border:none;border-radius:50%;-webkit-box-shadow:0 2px 6px rgba(0,0,0,.16);box-shadow:0 2px 6px rgba(0,0,0,.16);height:var(--thumbSize);pointer-events:auto;width:var(--thumbSize)}.mfui-slider-range__range-input::-moz-range-thumb{-webkit-appearance:none;background-color:var(--stcWhite);border:none;border-radius:50%;box-shadow:0 2px 6px rgba(0,0,0,.16);height:var(--thumbSize);pointer-events:auto;width:var(--thumbSize)}.mfui-slider-range__range-input::-ms-thumb{-webkit-appearance:none;background-color:var(--stcWhite);border:none;border-radius:50%;box-shadow:0 2px 6px rgba(0,0,0,.16);height:var(--thumbSize);pointer-events:auto;width:var(--thumbSize)}.mfui-slider-range__range-track{background-color:var(--spbSky0);border-radius:100px;cursor:pointer;height:100%;left:0;padding:0 12px;position:absolute;right:0;z-index:0}.mfui-slider-range__range-track-inner{height:100%;position:relative;width:100%}.mfui-slider-range__range-track-segment{background-color:var(--brandGreen);border-radius:100px;height:100%;position:absolute}.mfui-slider-range_disabled .mfui-slider-range__head{color:var(--spbSky3)}.mfui-slider-range_disabled .mfui-slider-range__range-track{cursor:default}.mfui-slider-range_disabled .mfui-slider-range__range-input{background-image:-webkit-gradient(linear,left top,left bottom,from(var(--spbSky1)),to(var(--spbSky1)));background-image:linear-gradient(var(--spbSky1),var(--spbSky1));cursor:default}.mfui-slider-range_disabled .mfui-slider-range__range-track-segment{background-color:var(--spbSky1)}.mfui-slider-range_disabled .mfui-slider-range__range-input::-webkit-slider-thumb{-webkit-appearance:none;background-color:var(--stcWhite);background-color:var(--spbSky2);border:none;border-radius:50%;-webkit-box-shadow:0 2px 6px rgba(0,0,0,.16);box-shadow:0 2px 6px rgba(0,0,0,.16);-webkit-box-shadow:none;box-shadow:none;height:var(--thumbSize);pointer-events:auto;width:var(--thumbSize)}.mfui-slider-range_disabled .mfui-slider-range__range-input::-moz-range-thumb{-webkit-appearance:none;background-color:var(--stcWhite);background-color:var(--spbSky2);border:none;border-radius:50%;box-shadow:0 2px 6px rgba(0,0,0,.16);box-shadow:none;height:var(--thumbSize);pointer-events:auto;width:var(--thumbSize)}.mfui-slider-range_disabled .mfui-slider-range__range-input::-ms-thumb{-webkit-appearance:none;background-color:var(--stcWhite);background-color:var(--spbSky2);border:none;border-radius:50%;box-shadow:0 2px 6px rgba(0,0,0,.16);box-shadow:none;height:var(--thumbSize);pointer-events:auto;width:var(--thumbSize)}
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { DisplayValueType } from '../components/SliderDisplayValue/SliderDisplayValue';
|
|
3
|
-
import { ScaleType } from '../components/SliderScale/SliderScale';
|
|
4
2
|
import './SliderRange.scss';
|
|
5
3
|
export interface ISliderRange {
|
|
6
4
|
/** Дополнительный класс корневого элемента */
|
|
@@ -16,7 +14,7 @@ export interface ISliderRange {
|
|
|
16
14
|
/** Лейбл */
|
|
17
15
|
label?: string;
|
|
18
16
|
/** Тип выводимого значения */
|
|
19
|
-
displayValueType?:
|
|
17
|
+
displayValueType?: 'input' | 'line';
|
|
20
18
|
/** Префикс для выводимого значения слева */
|
|
21
19
|
displayLeftValuePrefix?: string;
|
|
22
20
|
/** Префикс для выводимого значения справа */
|
|
@@ -28,7 +26,7 @@ export interface ISliderRange {
|
|
|
28
26
|
/** Шаг */
|
|
29
27
|
step?: number;
|
|
30
28
|
/** Тип встроенной шкалы */
|
|
31
|
-
scale?:
|
|
29
|
+
scale?: 'interval' | 'base';
|
|
32
30
|
/** Кастомная шкала */
|
|
33
31
|
customScale?: string[];
|
|
34
32
|
/** Переводит компонент в выключенное состояние */
|
|
@@ -2,7 +2,7 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
2
2
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import { cnCreate, filterDataAttrs } from '@megafon/ui-helpers';
|
|
5
|
-
import
|
|
5
|
+
import ValueField from "../../ValueField/ValueField";
|
|
6
6
|
import SliderScale from "../components/SliderScale/SliderScale";
|
|
7
7
|
import { getRangeValue, removeFirstZeros } from "../helpers";
|
|
8
8
|
import { getTrackSize, getRangeValueByPageX, checkForThumbAtEndOfTrack } from "./helpers";
|
|
@@ -126,28 +126,26 @@ var SliderRange = function SliderRange(_ref) {
|
|
|
126
126
|
className: cn('label')
|
|
127
127
|
}, label), !!displayValueType && /*#__PURE__*/React.createElement("div", {
|
|
128
128
|
className: cn('display-values')
|
|
129
|
-
}, /*#__PURE__*/React.createElement(
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
}),
|
|
129
|
+
}, /*#__PURE__*/React.createElement(ValueField, {
|
|
130
|
+
isControlled: true,
|
|
131
|
+
position: "left",
|
|
133
132
|
value: rawLeftInputValue !== null && rawLeftInputValue !== void 0 ? rawLeftInputValue : leftRangeValue,
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
133
|
+
fieldType: displayValueType,
|
|
134
|
+
valuePrefix: displayLeftValuePrefix,
|
|
135
|
+
valueUnit: displayValueUnit,
|
|
137
136
|
disabled: disabled,
|
|
138
137
|
onChange: handleLeftInputChange(false),
|
|
139
138
|
onBlur: handleInputBlur(true),
|
|
140
139
|
dataAttrs: {
|
|
141
140
|
input: dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.leftInput
|
|
142
141
|
}
|
|
143
|
-
}), /*#__PURE__*/React.createElement(
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
}),
|
|
142
|
+
}), /*#__PURE__*/React.createElement(ValueField, {
|
|
143
|
+
isControlled: true,
|
|
144
|
+
position: "right",
|
|
147
145
|
value: rawRightInputValue !== null && rawRightInputValue !== void 0 ? rawRightInputValue : rightRangeValue,
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
146
|
+
fieldType: displayValueType,
|
|
147
|
+
valuePrefix: displayRightValuePrefix,
|
|
148
|
+
valueUnit: displayValueUnit,
|
|
151
149
|
disabled: disabled,
|
|
152
150
|
onChange: handleRightInputChange(false),
|
|
153
151
|
onBlur: handleInputBlur(false),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
h1,h2,h3,h4,h5{margin:0}.mfui-slider-ratio{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}.mfui-slider-ratio__head{font-size:15px;font-weight:500;line-height:24px;margin-bottom:8px}.mfui-slider-ratio__display-values{display:grid;grid-template-columns:45% 45%;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;margin-top:8px;width:100%}.mfui-slider-
|
|
1
|
+
h1,h2,h3,h4,h5{margin:0}.mfui-slider-ratio{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}.mfui-slider-ratio__head{font-size:15px;font-weight:500;line-height:24px;margin-bottom:8px}.mfui-slider-ratio__display-values{display:grid;grid-template-columns:45% 45%;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;margin-top:8px;width:100%}.mfui-slider-ratio__range-container{position:relative;width:100%}.mfui-slider-ratio__range-input{-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-appearance:none;-moz-appearance:none;appearance:none;background:var(--brandPurple);background-image:-webkit-gradient(linear,left top,left bottom,from(var(--brandGreen)),to(var(--brandGreen)));background-image:linear-gradient(var(--brandGreen),var(--brandGreen));background-repeat:no-repeat;border-radius:100px;cursor:pointer;display:block;height:12px;margin:6px 0;outline:none;pointer-events:none;position:relative;width:100%;z-index:1}.mfui-slider-ratio__range-input:focus{outline:none}.mfui-slider-ratio__range-input::-webkit-slider-thumb{-webkit-appearance:none;background-color:var(--stcWhite);background-image:url(i/thumb.png);background-repeat:no-repeat;background-size:100% 100%;border:none;border-radius:50%;-webkit-box-shadow:0 2px 6px rgba(0,0,0,.16);box-shadow:0 2px 6px rgba(0,0,0,.16);height:var(--thumbSize);pointer-events:auto;width:var(--thumbSize)}.mfui-slider-ratio__range-input::-moz-range-thumb{-webkit-appearance:none;background-color:var(--stcWhite);background-image:url(i/thumb.png);background-repeat:no-repeat;background-size:100% 100%;border:none;border-radius:50%;box-shadow:0 2px 6px rgba(0,0,0,.16);height:var(--thumbSize);pointer-events:auto;width:var(--thumbSize)}.mfui-slider-ratio__range-input::-ms-thumb{-webkit-appearance:none;background-color:var(--stcWhite);background-image:url(i/thumb.png);background-repeat:no-repeat;background-size:100% 100%;border:none;border-radius:50%;box-shadow:0 2px 6px rgba(0,0,0,.16);height:var(--thumbSize);pointer-events:auto;width:var(--thumbSize)}.mfui-slider-ratio__range-input::-webkit-slider-runnable-track{-webkit-appearance:none;background:transparent;border:none;-webkit-box-shadow:none;box-shadow:none}.mfui-slider-ratio__range-input::-moz-range-track{-webkit-appearance:none;background:transparent;border:none;box-shadow:none}.mfui-slider-ratio__range-input::-ms-track{-webkit-appearance:none;background:transparent;border:none;box-shadow:none}.mfui-slider-ratio__range-track{cursor:pointer;height:100%;position:absolute;top:0;width:100%;z-index:0}.mfui-slider-ratio__scale{bottom:0;display:-webkit-box;display:-ms-flexbox;display:flex;left:calc(var(--thumbSize)/2);position:absolute;right:calc(var(--thumbSize)/2);top:0;z-index:2;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;pointer-events:none}.mfui-slider-ratio__scale-item{background-color:var(--stcWhite);border-radius:50%;height:4px;width:4px}.mfui-slider-ratio__scale-item:first-child{margin-left:-2px}.mfui-slider-ratio__scale-item:last-child{margin-right:-2px}.mfui-slider-ratio_disabled .mfui-slider-ratio__head{color:var(--spbSky3)}.mfui-slider-ratio_disabled .mfui-slider-ratio__range-input{background-color:var(--spbSky1);background-image:-webkit-gradient(linear,left top,left bottom,from(var(--spbSky0)),to(var(--spbSky0)));background-image:linear-gradient(var(--spbSky0),var(--spbSky0));cursor:default}.mfui-slider-ratio_disabled .mfui-slider-ratio__range-input::-webkit-slider-thumb{-webkit-appearance:none;background-color:var(--stcWhite);background-color:var(--spbSky2);background-image:url(i/thumb.png);background-image:none;background-repeat:no-repeat;background-size:100% 100%;border:none;border-radius:50%;-webkit-box-shadow:0 2px 6px rgba(0,0,0,.16);box-shadow:0 2px 6px rgba(0,0,0,.16);-webkit-box-shadow:none;box-shadow:none;height:var(--thumbSize);pointer-events:auto;width:var(--thumbSize)}.mfui-slider-ratio_disabled .mfui-slider-ratio__range-input::-moz-range-thumb{-webkit-appearance:none;background-color:var(--stcWhite);background-color:var(--spbSky2);background-image:url(i/thumb.png);background-image:none;background-repeat:no-repeat;background-size:100% 100%;border:none;border-radius:50%;box-shadow:0 2px 6px rgba(0,0,0,.16);box-shadow:none;height:var(--thumbSize);pointer-events:auto;width:var(--thumbSize)}.mfui-slider-ratio_disabled .mfui-slider-ratio__range-input::-ms-thumb{-webkit-appearance:none;background-color:var(--stcWhite);background-color:var(--spbSky2);background-image:url(i/thumb.png);background-image:none;background-repeat:no-repeat;background-size:100% 100%;border:none;border-radius:50%;box-shadow:0 2px 6px rgba(0,0,0,.16);box-shadow:none;height:var(--thumbSize);pointer-events:auto;width:var(--thumbSize)}.mfui-slider-ratio_disabled .mfui-slider-ratio__range-track{cursor:default}.mfui-slider-ratio_disabled .mfui-slider-ratio__scale{display:none}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { DisplayValueType } from '../components/SliderDisplayValue/SliderDisplayValue';
|
|
3
2
|
import { ValueType } from './types';
|
|
4
3
|
import './SliderRatio.scss';
|
|
5
4
|
export interface ISliderRatio {
|
|
@@ -12,7 +11,7 @@ export interface ISliderRatio {
|
|
|
12
11
|
/** Лейбл */
|
|
13
12
|
label?: string;
|
|
14
13
|
/** Тип выводимого значения */
|
|
15
|
-
displayValueType?:
|
|
14
|
+
displayValueType?: 'input' | 'line';
|
|
16
15
|
/** Префикс для выводимого значения слева */
|
|
17
16
|
displayLeftValuePrefix?: string;
|
|
18
17
|
/** Префикс для выводимого значения справа */
|
|
@@ -8,7 +8,7 @@ import "core-js/modules/es.object.to-string.js";
|
|
|
8
8
|
import "core-js/modules/web.dom-collections.iterator.js";
|
|
9
9
|
import * as React from 'react';
|
|
10
10
|
import { cnCreate, filterDataAttrs } from '@megafon/ui-helpers';
|
|
11
|
-
import
|
|
11
|
+
import ValueField from "../../ValueField/ValueField";
|
|
12
12
|
import { getTrackSize, removeFirstZeros } from "../helpers";
|
|
13
13
|
import { findClosestValue, getIndexByRangeValue, getRangeStepValue, inputReducer, getRangeValueByPageX } from "./helpers";
|
|
14
14
|
import { KeyValueEnum } from "./types";
|
|
@@ -21,7 +21,7 @@ var SliderRatio = function SliderRatio(_ref) {
|
|
|
21
21
|
var className = _ref.className,
|
|
22
22
|
label = _ref.label,
|
|
23
23
|
_ref$displayValueType = _ref.displayValueType,
|
|
24
|
-
displayValueType = _ref$displayValueType === void 0 ?
|
|
24
|
+
displayValueType = _ref$displayValueType === void 0 ? 'line' : _ref$displayValueType,
|
|
25
25
|
displayLeftValuePrefix = _ref.displayLeftValuePrefix,
|
|
26
26
|
displayRightValuePrefix = _ref.displayRightValuePrefix,
|
|
27
27
|
displayLeftValueUnit = _ref.displayLeftValueUnit,
|
|
@@ -141,28 +141,26 @@ var SliderRatio = function SliderRatio(_ref) {
|
|
|
141
141
|
className: cn('label')
|
|
142
142
|
}, label), /*#__PURE__*/React.createElement("div", {
|
|
143
143
|
className: cn('display-values')
|
|
144
|
-
}, /*#__PURE__*/React.createElement(
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
}),
|
|
144
|
+
}, /*#__PURE__*/React.createElement(ValueField, {
|
|
145
|
+
isControlled: true,
|
|
146
|
+
position: "left",
|
|
148
147
|
value: leftInputValue,
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
148
|
+
fieldType: displayValueType,
|
|
149
|
+
valuePrefix: displayLeftValuePrefix,
|
|
150
|
+
valueUnit: displayLeftValueUnit,
|
|
152
151
|
disabled: disabled,
|
|
153
152
|
onChange: handleInputChange(KeyValueEnum.LEFT),
|
|
154
153
|
onBlur: handleInputBlur(KeyValueEnum.LEFT),
|
|
155
154
|
dataAttrs: {
|
|
156
155
|
input: dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.leftInput
|
|
157
156
|
}
|
|
158
|
-
}), /*#__PURE__*/React.createElement(
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
}),
|
|
157
|
+
}), /*#__PURE__*/React.createElement(ValueField, {
|
|
158
|
+
isControlled: true,
|
|
159
|
+
position: "right",
|
|
162
160
|
value: rightInputValue,
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
161
|
+
fieldType: displayValueType,
|
|
162
|
+
valuePrefix: displayRightValuePrefix,
|
|
163
|
+
valueUnit: displayRightValueUnit,
|
|
166
164
|
disabled: disabled,
|
|
167
165
|
onChange: handleInputChange(KeyValueEnum.RIGHT),
|
|
168
166
|
onBlur: handleInputBlur(KeyValueEnum.RIGHT),
|
package/dist/es/index.d.ts
CHANGED
|
@@ -18,6 +18,7 @@ export { default as Counter } from './components/Counter/Counter';
|
|
|
18
18
|
export { default as CounterBadge } from './components/Badges/CounterBadge/CounterBadge';
|
|
19
19
|
export { default as countGraphemes } from './components/TextField/utils/countGraphemes';
|
|
20
20
|
export { default as Day } from './components/Calendar/components/_Day/Day';
|
|
21
|
+
export { default as ErrorLoad } from './components/ErrorLoad/ErrorLoad';
|
|
21
22
|
export { default as Grid } from './components/Grid/Grid';
|
|
22
23
|
export { default as GridColumn } from './components/Grid/GridColumn';
|
|
23
24
|
export { default as Header } from './components/Header/Header';
|
|
@@ -53,7 +54,6 @@ export { default as Select } from './components/Select/Select';
|
|
|
53
54
|
export { default as Selector } from './components/Selector/Selector';
|
|
54
55
|
export { default as selectReducer } from './components/Select/reducer/selectReducer';
|
|
55
56
|
export { default as Slider } from './components/Sliders/Slider/Slider';
|
|
56
|
-
export { default as SliderDisplayValue } from './components/Sliders/components/SliderDisplayValue/SliderDisplayValue';
|
|
57
57
|
export { default as SliderRange } from './components/Sliders/SliderRange/SliderRange';
|
|
58
58
|
export { default as SliderRatio } from './components/Sliders/SliderRatio/SliderRatio';
|
|
59
59
|
export { default as SliderScale } from './components/Sliders/components/SliderScale/SliderScale';
|
package/dist/es/index.js
CHANGED
|
@@ -18,6 +18,7 @@ export { default as Counter } from "./components/Counter/Counter";
|
|
|
18
18
|
export { default as CounterBadge } from "./components/Badges/CounterBadge/CounterBadge";
|
|
19
19
|
export { default as countGraphemes } from "./components/TextField/utils/countGraphemes";
|
|
20
20
|
export { default as Day } from "./components/Calendar/components/_Day/Day";
|
|
21
|
+
export { default as ErrorLoad } from "./components/ErrorLoad/ErrorLoad";
|
|
21
22
|
export { default as Grid } from "./components/Grid/Grid";
|
|
22
23
|
export { default as GridColumn } from "./components/Grid/GridColumn";
|
|
23
24
|
export { default as Header } from "./components/Header/Header";
|
|
@@ -53,7 +54,6 @@ export { default as Select } from "./components/Select/Select";
|
|
|
53
54
|
export { default as Selector } from "./components/Selector/Selector";
|
|
54
55
|
export { default as selectReducer } from "./components/Select/reducer/selectReducer";
|
|
55
56
|
export { default as Slider } from "./components/Sliders/Slider/Slider";
|
|
56
|
-
export { default as SliderDisplayValue } from "./components/Sliders/components/SliderDisplayValue/SliderDisplayValue";
|
|
57
57
|
export { default as SliderRange } from "./components/Sliders/SliderRange/SliderRange";
|
|
58
58
|
export { default as SliderRatio } from "./components/Sliders/SliderRatio/SliderRatio";
|
|
59
59
|
export { default as SliderScale } from "./components/Sliders/components/SliderScale/SliderScale";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
h1,h2,h3,h4,h5{margin:0}.mfui-error-load{background:inherit}.mfui-error-load_cardinal_vertical{-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;gap:12px;-ms-flex-align:center;-ms-flex-item-align:stretch;align-self:stretch}.mfui-error-load_cardinal_horizontal,.mfui-error-load_cardinal_vertical{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;align-items:center}.mfui-error-load_cardinal_horizontal{gap:8px;-ms-flex-align:center;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.mfui-error-load__header{text-align:center}.mfui-error-load__text .mfui-error-load__caption_background_on-color,.mfui-error-load__text .mfui-error-load__header_background_on-color{color:var(--stcWhite)}.mfui-error-load__text .mfui-error-load__caption_background_on-base{color:var(--spbSky3)}.mfui-error-load__text{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;gap:4px}.mfui-error-load__text_cardinal_vertical{-webkit-box-align:center;-ms-flex-align:center;align-items:center;-ms-flex-item-align:stretch;align-self:stretch}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { IButtonProps } from '../Button/Button';
|
|
3
|
+
import './ErrorLoad.scss';
|
|
4
|
+
type ButtonProps = Pick<IButtonProps, 'disabled' | 'showLoader' | 'onClick'>;
|
|
5
|
+
export interface IErrorLoadProps {
|
|
6
|
+
/** Размер блока */
|
|
7
|
+
big?: boolean;
|
|
8
|
+
/** Цветовая тема */
|
|
9
|
+
background?: 'on-base' | 'on-color';
|
|
10
|
+
/** Ориентация блока */
|
|
11
|
+
cardinalDirection?: 'vertical' | 'horizontal';
|
|
12
|
+
/** Параметры кнопки */
|
|
13
|
+
buttonParams?: ButtonProps;
|
|
14
|
+
/** Дополнительный класс корневого элемента */
|
|
15
|
+
className?: string;
|
|
16
|
+
/** Дополнительные data атрибуты к внутренним элементам */
|
|
17
|
+
dataAttrs?: {
|
|
18
|
+
root?: Record<string, string>;
|
|
19
|
+
button?: Record<string, string>;
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
declare const ErrorLoad: React.FC<IErrorLoadProps>;
|
|
23
|
+
export default ErrorLoad;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports["default"] = void 0;
|
|
8
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
|
+
require("core-js/modules/es.string.big.js");
|
|
10
|
+
var React = _interopRequireWildcard(require("react"));
|
|
11
|
+
var _uiHelpers = require("@megafon/ui-helpers");
|
|
12
|
+
var _Button = _interopRequireDefault(require("../Button/Button"));
|
|
13
|
+
var _Caption = _interopRequireDefault(require("../Caption/Caption"));
|
|
14
|
+
var _Header = _interopRequireDefault(require("../Header/Header"));
|
|
15
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
16
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
|
|
17
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
18
|
+
var RefreshIcon24 = function RefreshIcon24(props) {
|
|
19
|
+
return /*#__PURE__*/React.createElement("svg", (0, _extends2["default"])({
|
|
20
|
+
viewBox: "0 0 32 32"
|
|
21
|
+
}, props), /*#__PURE__*/React.createElement("path", {
|
|
22
|
+
fillRule: "evenodd",
|
|
23
|
+
clipRule: "evenodd",
|
|
24
|
+
d: "M16.064 8C11.604 8 8 11.588 8 16s3.604 8 8.064 8c4.1 0 7.478-3.033 7.995-6.948l1.983.262C25.393 22.223 21.17 26 16.064 26 10.513 26 6 21.53 6 16S10.513 6 16.064 6c3.456 0 6.507 1.731 8.32 4.371l.704-2.345 1.915.575-1.419 4.726a1 1 0 01-1.228.675l-4.855-1.364.541-1.925 2.664.748A8.074 8.074 0 0016.064 8z"
|
|
25
|
+
}));
|
|
26
|
+
};
|
|
27
|
+
var cn = (0, _uiHelpers.cnCreate)('mfui-error-load');
|
|
28
|
+
var ErrorLoad = function ErrorLoad(_ref) {
|
|
29
|
+
var _ref$background = _ref.background,
|
|
30
|
+
background = _ref$background === void 0 ? 'on-base' : _ref$background,
|
|
31
|
+
_ref$big = _ref.big,
|
|
32
|
+
big = _ref$big === void 0 ? true : _ref$big,
|
|
33
|
+
_ref$cardinalDirectio = _ref.cardinalDirection,
|
|
34
|
+
cardinalDirection = _ref$cardinalDirectio === void 0 ? 'horizontal' : _ref$cardinalDirectio,
|
|
35
|
+
className = _ref.className,
|
|
36
|
+
dataAttrs = _ref.dataAttrs,
|
|
37
|
+
buttonParams = _ref.buttonParams;
|
|
38
|
+
var isBaseBackground = background === 'on-base';
|
|
39
|
+
var isSmallIconSize = cardinalDirection === 'horizontal' || !big;
|
|
40
|
+
return /*#__PURE__*/React.createElement("div", (0, _extends2["default"])({
|
|
41
|
+
className: cn({
|
|
42
|
+
cardinal: cardinalDirection
|
|
43
|
+
}, className)
|
|
44
|
+
}, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root)), /*#__PURE__*/React.createElement("div", {
|
|
45
|
+
className: cn('text', {
|
|
46
|
+
cardinal: cardinalDirection
|
|
47
|
+
})
|
|
48
|
+
}, /*#__PURE__*/React.createElement(_Header["default"], {
|
|
49
|
+
as: big ? 'h3' : 'h5',
|
|
50
|
+
className: cn('header', {
|
|
51
|
+
background: background
|
|
52
|
+
})
|
|
53
|
+
}, "\u0414\u0430\u043D\u043D\u044B\u0435 \u043D\u0435 \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u043B\u0438\u0441\u044C"), big && /*#__PURE__*/React.createElement(_Caption["default"], {
|
|
54
|
+
hasMargin: false,
|
|
55
|
+
className: cn('caption', {
|
|
56
|
+
background: background
|
|
57
|
+
})
|
|
58
|
+
}, "\u041E\u0431\u043D\u043E\u0432\u0438\u0442\u0435 \u0438\u043B\u0438 \u0437\u0430\u0439\u0434\u0438\u0442\u0435 \u043F\u043E\u0437\u0436\u0435")), /*#__PURE__*/React.createElement(_Button["default"], (0, _extends2["default"])({
|
|
59
|
+
icon: /*#__PURE__*/React.createElement(RefreshIcon24, null),
|
|
60
|
+
theme: isBaseBackground ? 'green' : 'white',
|
|
61
|
+
sizeAll: isSmallIconSize ? 'small' : 'medium'
|
|
62
|
+
}, buttonParams, {
|
|
63
|
+
dataAttrs: {
|
|
64
|
+
root: dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.button
|
|
65
|
+
}
|
|
66
|
+
})));
|
|
67
|
+
};
|
|
68
|
+
var _default = exports["default"] = ErrorLoad;
|