@sima-land/ui-nucleons 45.0.0-alpha.4 → 45.0.0-alpha.5
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/_internal/custom-scrollbar/index.js +5 -27
- package/_internal/dropdown-loading/index.js +2 -3
- package/_internal/page-scroll-lock/context.js +3 -25
- package/alert/index.d.ts +2 -2
- package/alert/index.js +4 -30
- package/arrow-button/index.js +18 -19
- package/autocomplete/autocomplete.js +49 -76
- package/autocomplete-deprecated/index.d.ts +1 -1
- package/autocomplete-deprecated/index.js +43 -67
- package/avatar/avatar.module.scss +3 -1
- package/avatar/index.d.ts +1 -1
- package/avatar/index.js +7 -33
- package/avatar/user.d.ts +1 -1
- package/avatar/user.js +8 -29
- package/base-input/base-input.js +5 -31
- package/base-input-deprecated/index.d.ts +2 -2
- package/base-input-deprecated/index.js +8 -34
- package/bordered-layout/index.d.ts +1 -1
- package/bordered-layout/index.js +2 -3
- package/bottom-bar/bottom-bar.js +2 -3
- package/box/index.d.ts +1 -1
- package/box/index.js +2 -2
- package/button/index.d.ts +2 -2
- package/button/index.js +6 -32
- package/card/index.js +2 -8
- package/card/slots.d.ts +1 -1
- package/card/slots.js +9 -31
- package/carousel/draggable.d.ts +1 -1
- package/carousel/draggable.js +5 -28
- package/carousel/index.d.ts +1 -1
- package/carousel/index.js +17 -43
- package/checkbox/index.d.ts +2 -2
- package/checkbox/index.js +3 -29
- package/checkbox-field/index.d.ts +2 -2
- package/checkbox-field/index.js +3 -31
- package/chips/index.d.ts +1 -1
- package/chips/index.js +3 -25
- package/chips/item.d.ts +1 -1
- package/chips/item.js +3 -5
- package/clean-buttons/index.js +6 -28
- package/dot-nav/index.d.ts +1 -1
- package/dot-nav/index.js +12 -34
- package/dropdown/index.d.ts +2 -2
- package/dropdown/index.js +3 -26
- package/dropdown-item/index.d.ts +1 -1
- package/dropdown-item/index.js +4 -9
- package/expandable/index.d.ts +2 -2
- package/expandable/index.js +8 -36
- package/field-block/index.js +2 -9
- package/field-grid/index.d.ts +1 -1
- package/field-grid/index.js +43 -65
- package/file-icon/index.d.ts +1 -1
- package/file-icon/index.js +5 -10
- package/group-overflow/index.js +6 -30
- package/helpers/define-slots.d.ts +1 -1
- package/helpers/events.d.ts +1 -1
- package/helpers/on.d.ts +1 -1
- package/hint/hint-view.js +3 -3
- package/hint/hint.js +3 -8
- package/hint-deprecated/index.d.ts +2 -2
- package/hint-deprecated/index.js +3 -26
- package/hooks/breakpoint/index.js +3 -25
- package/info-text/index.js +15 -42
- package/input/index.js +8 -30
- package/layout/layout.js +2 -2
- package/layout/legacy.d.ts +5 -5
- package/layout/legacy.js +3 -25
- package/link/index.d.ts +6 -3
- package/link/index.js +3 -25
- package/loading-overlay/index.d.ts +1 -1
- package/loading-overlay/index.js +2 -3
- package/masked-field/index.d.ts +2 -2
- package/masked-field/index.js +3 -25
- package/masked-input/masked-input.js +3 -25
- package/modal/index.d.ts +1 -1
- package/modal/index.js +3 -10
- package/modal/slots.js +6 -29
- package/modal-overlay/index.js +3 -26
- package/no-index/index.d.ts +3 -3
- package/no-index/index.js +4 -8
- package/no-index-mark/index.d.ts +2 -2
- package/no-index-mark/index.js +7 -6
- package/package.json +6 -11
- package/pagination/index.d.ts +4 -20
- package/pagination/index.js +8 -15
- package/pagination/pagination-item.d.ts +8 -0
- package/pagination/pagination-item.js +31 -0
- package/pagination/pagination-item.module.scss +49 -0
- package/pagination/pagination.d.ts +8 -0
- package/pagination/pagination.js +78 -0
- package/pagination/pagination.module.scss +14 -70
- package/pagination/types.d.ts +28 -0
- package/pagination/types.js +2 -0
- package/pagination/utils.d.ts +15 -43
- package/pagination/utils.js +38 -87
- package/{pagination → pagination-deprecated}/base-pagination.d.ts +6 -1
- package/{pagination → pagination-deprecated}/base-pagination.js +33 -33
- package/pagination-deprecated/index.d.ts +22 -0
- package/pagination-deprecated/index.js +15 -0
- package/{pagination → pagination-deprecated}/page-button.d.ts +2 -1
- package/{pagination → pagination-deprecated}/page-button.js +3 -5
- package/pagination-deprecated/pagination.module.scss +76 -0
- package/pagination-deprecated/utils.d.ts +58 -0
- package/pagination-deprecated/utils.js +124 -0
- package/panel/index.js +3 -6
- package/phone-input/images/armenia.png +0 -0
- package/phone-input/images/azerbaijan.png +0 -0
- package/phone-input/images/belarus.png +0 -0
- package/phone-input/images/georgia.png +0 -0
- package/phone-input/images/kazakhstan.png +0 -0
- package/phone-input/images/kyrgyzstan.png +0 -0
- package/phone-input/images/moldova.png +0 -0
- package/phone-input/images/other.png +0 -0
- package/phone-input/images/russia.png +0 -0
- package/phone-input/images/tajikistan.png +0 -0
- package/phone-input/images/turkmenistan.png +0 -0
- package/phone-input/images/ukraine.png +0 -0
- package/phone-input/images/uzbekistan.png +0 -0
- package/phone-input/phone-input.js +13 -37
- package/phone-input/presets.js +2 -0
- package/phone-input-deprecated/index.d.ts +1 -1
- package/phone-input-deprecated/index.js +31 -57
- package/plate/index.d.ts +2 -2
- package/plate/index.js +3 -25
- package/popup/popup-view.js +3 -6
- package/popup/popup.js +4 -26
- package/portal/index.d.ts +1 -1
- package/price/index.js +2 -2
- package/radio-button/index.js +2 -4
- package/range/index.d.ts +1 -1
- package/range/index.js +6 -33
- package/rating/index.d.ts +1 -1
- package/rating/index.js +4 -9
- package/readme.md +4 -67
- package/screen/index.d.ts +5 -5
- package/screen/index.js +11 -37
- package/screen/slots.d.ts +3 -3
- package/screen/slots.js +9 -31
- package/select/parts/block.js +6 -28
- package/select/parts/button.js +7 -29
- package/select/parts/menu.js +12 -33
- package/select/select.js +4 -28
- package/select-deprecated/index.d.ts +1 -1
- package/select-deprecated/index.js +32 -56
- package/side-page/index.js +4 -30
- package/side-page/slots.js +4 -4
- package/spinner/index.d.ts +1 -1
- package/spinner/index.js +3 -5
- package/spinner/spinner.module.scss +3 -1
- package/stepper/index.d.ts +2 -2
- package/stepper/index.js +11 -38
- package/stroked-svg/index.d.ts +2 -2
- package/stroked-svg/index.js +3 -27
- package/styling/sizes.module.scss +3 -1
- package/super-ellipse-clip-path/index.js +2 -8
- package/switcher-row/index.js +5 -10
- package/tabs/index.d.ts +1 -1
- package/tabs/index.js +4 -26
- package/text/index.d.ts +2 -2
- package/text/index.js +3 -25
- package/text-button/index.d.ts +2 -2
- package/text-button/index.js +4 -7
- package/text-field/index.d.ts +2 -2
- package/text-field/index.js +25 -55
- package/textarea/index.js +4 -26
- package/timer/index.d.ts +1 -1
- package/timer/index.js +3 -25
- package/toggle/index.d.ts +2 -2
- package/toggle/index.js +3 -27
- package/tooltip/index.d.ts +2 -2
- package/tooltip/index.js +4 -28
- package/top-bar/top-bar.js +5 -45
- package/top-bar/utils.d.ts +2 -2
- package/top-bar/utils.js +6 -28
- package/touch-slider/index.d.ts +1 -1
- package/touch-slider/index.js +2 -4
- package/unknown-content/index.d.ts +1 -1
- package/unknown-content/index.js +3 -25
- package/upload-area/upload-area.js +8 -38
- package/with-hint/index.d.ts +1 -1
- package/with-hint/index.js +3 -28
- package/with-hint/positioning-hint.d.ts +1 -1
- package/with-hint/positioning-hint.js +3 -25
- package/with-tooltip/index.d.ts +1 -1
- package/with-tooltip/index.js +6 -31
- package/with-tooltip/positioning-tooltip.d.ts +1 -1
- package/with-tooltip/positioning-tooltip.js +4 -26
- package/file-icon/unknown.svg +0 -9
- package/rating/star.svg +0 -3
- package/upload-area/upload.svg +0 -6
package/phone-input/presets.js
CHANGED
|
@@ -77,6 +77,8 @@ const IMAGES = {
|
|
|
77
77
|
[exports.IDS.ukraine]: ukraine_png_1.default,
|
|
78
78
|
[exports.IDS.other]: other_png_1.default,
|
|
79
79
|
};
|
|
80
|
+
// @todo <Flag country='russia' /> под капотом оптимизация для флагов состоящих только из полос
|
|
81
|
+
// (простые флаги можно сделать на css чтобы не хранить лишние png)
|
|
80
82
|
const CODES = {
|
|
81
83
|
[exports.IDS.russia]: '+7',
|
|
82
84
|
[exports.IDS.kazakhstan]: '+7',
|
|
@@ -1,27 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
2
|
var __rest = (this && this.__rest) || function (s, e) {
|
|
26
3
|
var t = {};
|
|
27
4
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
@@ -38,9 +15,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
38
15
|
};
|
|
39
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
17
|
exports.PhoneInput = void 0;
|
|
41
|
-
const
|
|
42
|
-
const
|
|
43
|
-
const
|
|
18
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
19
|
+
const react_1 = require("react");
|
|
20
|
+
const Down_1 = __importDefault(require("@sima-land/ui-quarks/icons/16x16/Stroked/Arrows/Down"));
|
|
21
|
+
const Up_1 = __importDefault(require("@sima-land/ui-quarks/icons/16x16/Stroked/Arrows/Up"));
|
|
44
22
|
const dropdown_1 = require("../dropdown");
|
|
45
23
|
const dropdown_item_1 = require("../dropdown-item");
|
|
46
24
|
const text_field_1 = require("../text-field");
|
|
@@ -78,12 +56,10 @@ const PhoneInput = (_a) => {
|
|
|
78
56
|
(0, hooks_1.useOutsideClick)(rootRef, () => {
|
|
79
57
|
toggleMenu(false);
|
|
80
58
|
});
|
|
81
|
-
const AdornmentSVG = withMenu ?
|
|
82
|
-
const commonFieldProps = Object.assign(Object.assign({}, restProps), { label, multiline: false, className: cx('field'), endAdornment: (
|
|
59
|
+
const AdornmentSVG = withMenu ? Up_1.default : Down_1.default;
|
|
60
|
+
const commonFieldProps = Object.assign(Object.assign({}, restProps), { label, multiline: false, className: cx('field'), endAdornment: ((0, jsx_runtime_1.jsxs)("div", Object.assign({ ref: openerRef, className: cx('adornment'), "data-testid": 'phone-input:dropdown-opener', onClick: () => {
|
|
83
61
|
toggleMenu(a => !a);
|
|
84
|
-
} },
|
|
85
|
-
react_1.default.createElement("img", { alt: '', width: 24, height: 24, src: country.imageSrc }),
|
|
86
|
-
react_1.default.createElement(AdornmentSVG, { className: cx('arrow') }))), onClick: event => {
|
|
62
|
+
} }, { children: [(0, jsx_runtime_1.jsx)("img", { alt: '', width: 24, height: 24, src: country.imageSrc }), (0, jsx_runtime_1.jsx)(AdornmentSVG, { className: cx('arrow') })] }))), onClick: event => {
|
|
87
63
|
const opener = openerRef.current;
|
|
88
64
|
if (opener instanceof Node &&
|
|
89
65
|
event.target instanceof Node &&
|
|
@@ -94,31 +70,29 @@ const PhoneInput = (_a) => {
|
|
|
94
70
|
toggleMenu(false);
|
|
95
71
|
}
|
|
96
72
|
} });
|
|
97
|
-
return (
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
onCountrySelect && onCountrySelect(item);
|
|
122
|
-
}, startContent: react_1.default.createElement("img", { alt: '', width: 24, height: 24, src: item.imageSrc, className: cx('country-icon') }), endContent: item.code }, item.name)))))));
|
|
73
|
+
return ((0, jsx_runtime_1.jsxs)("div", Object.assign({ ref: rootRef, "data-testid": testId, style: style, className: cx('root', className) }, { children: [country.id === presets_1.IDS.other ? ((0, jsx_runtime_1.jsx)(text_field_1.TextField, Object.assign({}, commonFieldProps, { value: cleanValue, onChange: (e) => {
|
|
74
|
+
const nextValue = e.target.value.replace(/\D/g, '').slice(0, 20);
|
|
75
|
+
e.target.value = nextValue;
|
|
76
|
+
setCleanValue(nextValue);
|
|
77
|
+
onChange && onChange(e);
|
|
78
|
+
}, onBlur: e => {
|
|
79
|
+
onBlur &&
|
|
80
|
+
onBlur(e, {
|
|
81
|
+
value: e.target.value,
|
|
82
|
+
cleanValue: e.target.value,
|
|
83
|
+
ready: e.target.value.length > 0,
|
|
84
|
+
});
|
|
85
|
+
} }))) : ((0, jsx_runtime_1.jsx)(masked_field_1.MaskedField, Object.assign({}, commonFieldProps, {
|
|
86
|
+
// убираем код страны, так как он уже зашит в маску
|
|
87
|
+
value: cleanValue, mask: country.mask, onBlur: (event, state) => {
|
|
88
|
+
onBlur &&
|
|
89
|
+
onBlur(event, Object.assign(Object.assign({}, state), {
|
|
90
|
+
// вставляем код страны обратно в чистое значение
|
|
91
|
+
cleanValue: `${country.codeChars}${state.cleanValue}` }));
|
|
92
|
+
} }))), withMenu && ((0, jsx_runtime_1.jsx)(dropdown_1.Dropdown, Object.assign({ role: 'menu', className: cx('menu'), "data-testid": 'phone-input:dropdown' }, { children: presets_1.countriesList.map((item, index) => item.id === country.id ? null : ((0, jsx_runtime_1.jsx)(dropdown_item_1.DropdownItem, Object.assign({ size: 'm', role: 'menuitem', className: cx('menu-item'), onClick: () => {
|
|
93
|
+
toggleMenu(false);
|
|
94
|
+
setCountry(item);
|
|
95
|
+
onCountrySelect && onCountrySelect(item);
|
|
96
|
+
}, startContent: (0, jsx_runtime_1.jsx)("img", { alt: '', width: 24, height: 24, src: item.imageSrc, className: cx('country-icon') }), endContent: item.code }, { children: item.name }), index))) })))] })));
|
|
123
97
|
};
|
|
124
98
|
exports.PhoneInput = PhoneInput;
|
package/plate/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
2
|
import { BoxShadow } from '../styling/shadows';
|
|
3
3
|
export interface PlateProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
4
4
|
/** Тень. */
|
|
@@ -12,4 +12,4 @@ export interface PlateProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
12
12
|
* Plate это просто div с возможностью легко задавать тень и скругления.
|
|
13
13
|
* И он должен оставаться компонентом, который только задает оформление обычного div.
|
|
14
14
|
*/
|
|
15
|
-
export declare const Plate:
|
|
15
|
+
export declare const Plate: import("react").ForwardRefExoticComponent<PlateProps & import("react").RefAttributes<HTMLDivElement | null>>;
|
package/plate/index.js
CHANGED
|
@@ -1,27 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
2
|
var __rest = (this && this.__rest) || function (s, e) {
|
|
26
3
|
var t = {};
|
|
27
4
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
@@ -38,7 +15,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
38
15
|
};
|
|
39
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
17
|
exports.Plate = void 0;
|
|
41
|
-
const
|
|
18
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
19
|
+
const react_1 = require("react");
|
|
42
20
|
const shadows_1 = require("../styling/shadows");
|
|
43
21
|
const shapes_1 = require("../styling/shapes");
|
|
44
22
|
const classnames_1 = __importDefault(require("classnames"));
|
|
@@ -49,5 +27,5 @@ const plate_module_scss_1 = __importDefault(require("./plate.module.scss"));
|
|
|
49
27
|
*/
|
|
50
28
|
exports.Plate = (0, react_1.forwardRef)(function Plate(_a, ref) {
|
|
51
29
|
var { className, children, rounds = 's', shadow = 'z1', 'data-testid': testId = 'plate' } = _a, restProps = __rest(_a, ["className", "children", "rounds", "shadow", 'data-testid']);
|
|
52
|
-
return (
|
|
30
|
+
return ((0, jsx_runtime_1.jsx)("div", Object.assign({ ref: ref, className: (0, classnames_1.default)(plate_module_scss_1.default.root, className, shadow && shadows_1.BoxShadow[shadow], rounds === 's' && shapes_1.SmallRounds.all, rounds === 'm' && shapes_1.MediumRounds.all), "data-testid": testId, children: children }, restProps)));
|
|
53
31
|
});
|
package/popup/popup-view.js
CHANGED
|
@@ -15,8 +15,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
exports.PopupView = void 0;
|
|
18
|
-
const
|
|
19
|
-
const
|
|
18
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
19
|
+
const Cross_1 = __importDefault(require("@sima-land/ui-quarks/icons/16x16/Stroked/Cross"));
|
|
20
20
|
const bind_1 = __importDefault(require("classnames/bind"));
|
|
21
21
|
const popup_view_module_scss_1 = __importDefault(require("./popup-view.module.scss"));
|
|
22
22
|
const cx = bind_1.default.bind(popup_view_module_scss_1.default);
|
|
@@ -27,9 +27,6 @@ const cx = bind_1.default.bind(popup_view_module_scss_1.default);
|
|
|
27
27
|
*/
|
|
28
28
|
function PopupView(_a) {
|
|
29
29
|
var { children, onClose, popupRef, className, 'data-testid': testId = 'popup' } = _a, rest = __rest(_a, ["children", "onClose", "popupRef", "className", 'data-testid']);
|
|
30
|
-
return (
|
|
31
|
-
onClose && (react_1.default.createElement("button", { "aria-label": '\u0417\u0430\u043A\u0440\u044B\u0442\u044C', className: cx('close'), onClick: onClose, "data-testid": 'popup:close' },
|
|
32
|
-
react_1.default.createElement(cross_1.default, null))),
|
|
33
|
-
react_1.default.createElement("div", { className: cx('content') }, children)));
|
|
30
|
+
return ((0, jsx_runtime_1.jsxs)("div", Object.assign({}, rest, { className: cx('root', className), ref: popupRef, "data-testid": testId }, { children: [onClose && ((0, jsx_runtime_1.jsx)("button", Object.assign({ "aria-label": '\u0417\u0430\u043A\u0440\u044B\u0442\u044C', className: cx('close'), onClick: onClose, "data-testid": 'popup:close' }, { children: (0, jsx_runtime_1.jsx)(Cross_1.default, {}) }))), (0, jsx_runtime_1.jsx)("div", Object.assign({ className: cx('content') }, { children: children }))] })));
|
|
34
31
|
}
|
|
35
32
|
exports.PopupView = PopupView;
|
package/popup/popup.js
CHANGED
|
@@ -1,27 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
2
|
var __rest = (this && this.__rest) || function (s, e) {
|
|
26
3
|
var t = {};
|
|
27
4
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
@@ -35,7 +12,8 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
35
12
|
};
|
|
36
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
14
|
exports.Popup = void 0;
|
|
38
|
-
const
|
|
15
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
16
|
+
const react_1 = require("react");
|
|
39
17
|
const popup_view_1 = require("./popup-view");
|
|
40
18
|
const react_2 = require("@floating-ui/react");
|
|
41
19
|
const hooks_1 = require("../hooks");
|
|
@@ -49,7 +27,7 @@ const portal_1 = require("../portal");
|
|
|
49
27
|
*/
|
|
50
28
|
function Popup(_a) {
|
|
51
29
|
var { showFor } = _a, rest = __rest(_a, ["showFor"]);
|
|
52
|
-
return
|
|
30
|
+
return (0, jsx_runtime_1.jsx)(portal_1.Portal, { children: showFor && (0, jsx_runtime_1.jsx)(PopupInner, Object.assign({ showFor: showFor }, rest)) });
|
|
53
31
|
}
|
|
54
32
|
exports.Popup = Popup;
|
|
55
33
|
/**
|
|
@@ -69,5 +47,5 @@ function PopupInner(_a) {
|
|
|
69
47
|
enabled: floating.isPositioned,
|
|
70
48
|
afterDeactivate: onDismiss,
|
|
71
49
|
});
|
|
72
|
-
return (
|
|
50
|
+
return ((0, jsx_runtime_1.jsx)(popup_view_1.PopupView, Object.assign({}, rest, { popupRef: refs.setFloating, style: Object.assign(Object.assign({}, style), floatingStyle), onClose: onDismiss }, { children: children })));
|
|
73
51
|
}
|
package/portal/index.d.ts
CHANGED
package/price/index.js
CHANGED
|
@@ -4,7 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.Price = void 0;
|
|
7
|
-
const
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
8
|
const utils_1 = require("./utils");
|
|
9
9
|
const bind_1 = __importDefault(require("classnames/bind"));
|
|
10
10
|
const price_module_scss_1 = __importDefault(require("./price.module.scss"));
|
|
@@ -18,6 +18,6 @@ function Price({ className, currencyGrapheme: grapheme, graphemeBefore, crossedO
|
|
|
18
18
|
const content = (0, utils_1.formatPrice)(value, grapheme, {
|
|
19
19
|
graphemeBefore,
|
|
20
20
|
});
|
|
21
|
-
return (
|
|
21
|
+
return ((0, jsx_runtime_1.jsx)("span", Object.assign({ className: cx('root', className, crossedOut && 'crossed-out'), "data-testid": testId }, { children: content })));
|
|
22
22
|
}
|
|
23
23
|
exports.Price = Price;
|
package/radio-button/index.js
CHANGED
|
@@ -15,7 +15,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
exports.RadioButton = void 0;
|
|
18
|
-
const
|
|
18
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
19
19
|
const bind_1 = __importDefault(require("classnames/bind"));
|
|
20
20
|
const radio_button_module_scss_1 = __importDefault(require("./radio-button.module.scss"));
|
|
21
21
|
const cx = bind_1.default.bind(radio_button_module_scss_1.default);
|
|
@@ -26,8 +26,6 @@ const cx = bind_1.default.bind(radio_button_module_scss_1.default);
|
|
|
26
26
|
*/
|
|
27
27
|
function RadioButton(_a) {
|
|
28
28
|
var { style, className, 'data-testid': testId = 'radio-button' } = _a, restProps = __rest(_a, ["style", "className", 'data-testid']);
|
|
29
|
-
return (
|
|
30
|
-
react_1.default.createElement("input", Object.assign({}, restProps, { type: 'radio', className: cx('input'), "data-testid": testId })),
|
|
31
|
-
react_1.default.createElement("div", { className: cx('circle') })));
|
|
29
|
+
return ((0, jsx_runtime_1.jsxs)("div", Object.assign({ style: style, className: cx('root', className) }, { children: [(0, jsx_runtime_1.jsx)("input", Object.assign({}, restProps, { type: 'radio', className: cx('input'), "data-testid": testId })), (0, jsx_runtime_1.jsx)("div", { className: cx('circle') })] })));
|
|
32
30
|
}
|
|
33
31
|
exports.RadioButton = RadioButton;
|
package/range/index.d.ts
CHANGED
package/range/index.js
CHANGED
|
@@ -1,33 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
4
|
};
|
|
28
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
6
|
exports.Range = void 0;
|
|
30
|
-
const
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const react_1 = require("react");
|
|
31
9
|
const with_prevent_1 = __importDefault(require("../helpers/with-prevent"));
|
|
32
10
|
const bounds_of_1 = __importDefault(require("../helpers/bounds-of"));
|
|
33
11
|
const create_container_1 = __importDefault(require("../helpers/create-container"));
|
|
@@ -273,15 +251,10 @@ class Range extends react_1.Component {
|
|
|
273
251
|
render() {
|
|
274
252
|
var _a;
|
|
275
253
|
const [start, finish] = this.getPercents();
|
|
276
|
-
return (
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
left: `${start}
|
|
280
|
-
width: `${finish - start}%`,
|
|
281
|
-
} }),
|
|
282
|
-
react_1.default.createElement("div", { ref: this.containerRef, className: cx('range-container-base', 'range-container-styled') },
|
|
283
|
-
react_1.default.createElement("button", { type: 'button', "aria-label": '\u041D\u0430\u0447\u0430\u043B\u044C\u043D\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D\u0430', ref: this.startThumbRef, className: cx('thumb-base', 'thumb-styled'), style: { left: `${start}%` }, "data-testid": 'range:thumb-start' }),
|
|
284
|
-
react_1.default.createElement("button", { type: 'button', "aria-label": '\u041A\u043E\u043D\u0435\u0447\u043D\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D\u0430', ref: this.finishThumbRef, className: cx('thumb-base', 'thumb-styled'), style: { left: `${finish}%` }, "data-testid": 'range:thumb-end' }))));
|
|
254
|
+
return ((0, jsx_runtime_1.jsxs)("div", Object.assign({}, this.props.wrapperProps, { className: cx('range-wrapper-base', 'range-wrapper-styled', this.props.disabled && 'disabled', (_a = this.props.wrapperProps) === null || _a === void 0 ? void 0 : _a.className) }, { children: [(0, jsx_runtime_1.jsx)("div", { className: cx('track-base', 'available-base', 'available-styled') }), (0, jsx_runtime_1.jsx)("div", { ref: this.rangeRef, className: cx('track-base', 'selected-base', 'selected-styled'), style: {
|
|
255
|
+
left: `${start}%`,
|
|
256
|
+
width: `${finish - start}%`,
|
|
257
|
+
} }), (0, jsx_runtime_1.jsxs)("div", Object.assign({ ref: this.containerRef, className: cx('range-container-base', 'range-container-styled') }, { children: [(0, jsx_runtime_1.jsx)("button", { type: 'button', "aria-label": '\u041D\u0430\u0447\u0430\u043B\u044C\u043D\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D\u0430', ref: this.startThumbRef, className: cx('thumb-base', 'thumb-styled'), style: { left: `${start}%` }, "data-testid": 'range:thumb-start' }), (0, jsx_runtime_1.jsx)("button", { type: 'button', "aria-label": '\u041A\u043E\u043D\u0435\u0447\u043D\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D\u0430', ref: this.finishThumbRef, className: cx('thumb-base', 'thumb-styled'), style: { left: `${finish}%` }, "data-testid": 'range:thumb-end' })] }))] })));
|
|
285
258
|
}
|
|
286
259
|
}
|
|
287
260
|
exports.Range = Range;
|
package/rating/index.d.ts
CHANGED
package/rating/index.js
CHANGED
|
@@ -15,10 +15,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
exports.Rating = void 0;
|
|
18
|
-
const
|
|
18
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
19
19
|
const utils_1 = require("./utils");
|
|
20
20
|
const bind_1 = __importDefault(require("classnames/bind"));
|
|
21
|
-
const
|
|
21
|
+
const Star_1 = __importDefault(require("@sima-land/ui-quarks/icons/16x16/Filled/Star"));
|
|
22
22
|
const rating_module_scss_1 = __importDefault(require("./rating.module.scss"));
|
|
23
23
|
const cx = bind_1.default.bind(rating_module_scss_1.default);
|
|
24
24
|
/**
|
|
@@ -28,7 +28,7 @@ const cx = bind_1.default.bind(rating_module_scss_1.default);
|
|
|
28
28
|
*/
|
|
29
29
|
const Rating = (_a) => {
|
|
30
30
|
var { size = 's', value, className, 'data-testid': testId = 'rating' } = _a, restProps = __rest(_a, ["size", "value", "className", 'data-testid']);
|
|
31
|
-
return (
|
|
31
|
+
return ((0, jsx_runtime_1.jsx)("div", Object.assign({}, restProps, { className: cx('root', className), "data-testid": testId, "data-rating": value }, { children: (0, utils_1.getStars)(Math.min(5, value), 5).map((type, index) => ((0, jsx_runtime_1.jsx)(Star, { type: type, size: size }, index))) })));
|
|
32
32
|
};
|
|
33
33
|
exports.Rating = Rating;
|
|
34
34
|
/**
|
|
@@ -36,9 +36,4 @@ exports.Rating = Rating;
|
|
|
36
36
|
* @param props Свойства.
|
|
37
37
|
* @return Элемент.
|
|
38
38
|
*/
|
|
39
|
-
const Star = ({ type, size }) => (
|
|
40
|
-
type === 'empty' && react_1.default.createElement(star_svg_1.default, { className: cx('svg') }),
|
|
41
|
-
type === 'half' && (react_1.default.createElement(react_1.default.Fragment, null,
|
|
42
|
-
react_1.default.createElement(star_svg_1.default, { className: cx('svg') }),
|
|
43
|
-
react_1.default.createElement(star_svg_1.default, { className: cx('svg', 'half'), preserveAspectRatio: 'xMinYMin slice' }))),
|
|
44
|
-
type === 'full' && react_1.default.createElement(star_svg_1.default, { className: cx('svg', 'full') })));
|
|
39
|
+
const Star = ({ type, size }) => ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: cx('star', `size-${size}`) }, { children: [type === 'empty' && (0, jsx_runtime_1.jsx)(Star_1.default, { className: cx('svg') }), type === 'half' && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(Star_1.default, { className: cx('svg') }), (0, jsx_runtime_1.jsx)(Star_1.default, { className: cx('svg', 'half'), preserveAspectRatio: 'xMinYMin slice' })] })), type === 'full' && (0, jsx_runtime_1.jsx)(Star_1.default, { className: cx('svg', 'full') })] })));
|
package/readme.md
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
### Установка
|
|
8
8
|
|
|
9
|
-
```
|
|
9
|
+
```sh
|
|
10
10
|
# npm
|
|
11
11
|
npm i -S @sima-land/ui-nucleons
|
|
12
12
|
|
|
@@ -18,42 +18,21 @@ yarn add @sima-land/ui-nucleons
|
|
|
18
18
|
|
|
19
19
|
Компоненты библиотеки используют:
|
|
20
20
|
|
|
21
|
-
- импорты изображений (jpg, png
|
|
21
|
+
- импорты изображений (jpg, png...) как url/base64
|
|
22
22
|
- импорты стилей
|
|
23
23
|
- импорты стилей как css-модулей (каждый такой файл промаркирован в виде `%filename%.module.scss`)
|
|
24
|
-
- импорты svg-файлов как react-компоненты
|
|
25
24
|
|
|
26
25
|
#### Для работы с Webpack необходимо (как вариант):
|
|
27
26
|
|
|
28
|
-
-
|
|
29
|
-
- сконфигурировать обработку svg, css, scss файлов
|
|
30
|
-
|
|
31
|
-
##### Зависимости
|
|
32
|
-
|
|
33
|
-
```bash
|
|
34
|
-
npm install --save-dev @svgr/core @svgr/plugin-jsx @svgr/plugin-svgo @svgr/webpack
|
|
35
|
-
```
|
|
27
|
+
- сконфигурировать обработку импортов css, scss файлов
|
|
36
28
|
|
|
37
29
|
##### Конфигурация
|
|
38
30
|
|
|
39
31
|
```js
|
|
40
32
|
// webpack.config.js
|
|
41
|
-
const svgrOptions = require('../../svgr.config'); // опции SVGR (скопировать из данного проекта)
|
|
42
|
-
|
|
43
33
|
module.exports = {
|
|
44
34
|
module: {
|
|
45
35
|
rules: [
|
|
46
|
-
// svg
|
|
47
|
-
{
|
|
48
|
-
test: /\.svg$/,
|
|
49
|
-
use: [
|
|
50
|
-
{
|
|
51
|
-
loader: '@svgr/webpack',
|
|
52
|
-
options: svgrOptions,
|
|
53
|
-
},
|
|
54
|
-
],
|
|
55
|
-
},
|
|
56
|
-
|
|
57
36
|
// стилей
|
|
58
37
|
{
|
|
59
38
|
test: /\.(css|scss)$/,
|
|
@@ -78,29 +57,7 @@ module.exports = {
|
|
|
78
57
|
|
|
79
58
|
#### Для работы с Jest необходимо (как вариант):
|
|
80
59
|
|
|
81
|
-
-
|
|
82
|
-
- сконфигурировать обработку svg, css, scss файлов
|
|
83
|
-
|
|
84
|
-
##### Добавить обработку SVG
|
|
85
|
-
|
|
86
|
-
- добавить файл "трансформера" вида:
|
|
87
|
-
|
|
88
|
-
```js
|
|
89
|
-
const babel = require('@babel/core');
|
|
90
|
-
const babelConfig = require('../../babel.config');
|
|
91
|
-
const svgr = require('@svgr/core');
|
|
92
|
-
const svgrConfig = require('../../svgr.config');
|
|
93
|
-
|
|
94
|
-
module.exports = {
|
|
95
|
-
process(sourceText, sourcePath) {
|
|
96
|
-
const code = svgr.transform.sync(sourceText, svgrConfig, { filePath: sourcePath });
|
|
97
|
-
|
|
98
|
-
return babel.transformSync(code, { filename: sourcePath, ...babelConfig });
|
|
99
|
-
},
|
|
100
|
-
};
|
|
101
|
-
```
|
|
102
|
-
|
|
103
|
-
- задействовать его в конфигурации Jest
|
|
60
|
+
- сконфигурировать обработку css, scss файлов
|
|
104
61
|
|
|
105
62
|
##### Добавить поддержку стилей
|
|
106
63
|
|
|
@@ -109,9 +66,6 @@ module.exports = {
|
|
|
109
66
|
```js
|
|
110
67
|
module.exports = {
|
|
111
68
|
transform: {
|
|
112
|
-
// svg как react-компоненты
|
|
113
|
-
'\\.svg$': '<rootDir>/.jest/transforms/svg.js',
|
|
114
|
-
|
|
115
69
|
// обычный css
|
|
116
70
|
'(?<!(\\.module))\\.(css|scss)$': './transformer/empty.js',
|
|
117
71
|
|
|
@@ -142,12 +96,6 @@ declare module '*.module.scss' {
|
|
|
142
96
|
const classes: { [key: string]: string };
|
|
143
97
|
export default classes;
|
|
144
98
|
}
|
|
145
|
-
|
|
146
|
-
// svg как React-компоненты
|
|
147
|
-
declare module '*.svg' {
|
|
148
|
-
const content: React.FunctionComponent<React.SVGProps<SVGSVGElement>>;
|
|
149
|
-
export default content;
|
|
150
|
-
}
|
|
151
99
|
```
|
|
152
100
|
|
|
153
101
|
## Разработка и поддержка
|
|
@@ -170,14 +118,3 @@ declare module '*.svg' {
|
|
|
170
118
|
- `helpers/` - общие вспомогательные функции (для использования вне библиотеки)
|
|
171
119
|
- `hooks/` - общие react-хуки (для использования вне библиотеки)
|
|
172
120
|
- `_internal/` - внутренние скрипты для использования только в рамках данной библиотеки
|
|
173
|
-
|
|
174
|
-
### Тестирование
|
|
175
|
-
|
|
176
|
-
Локально E2E-тесты должны запускаться через docker, пример:
|
|
177
|
-
|
|
178
|
-
```bash
|
|
179
|
-
docker run --rm --network host -v $(pwd):/work/ -w /work/ -it mcr.microsoft.com/playwright:v1.29.2-focal /bin/bash
|
|
180
|
-
npx playwright test
|
|
181
|
-
```
|
|
182
|
-
|
|
183
|
-
В противном случае скриншотные тесты не будут совпадать из-за разницы окружения запуска.
|
package/screen/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
2
|
import { ScreenInnerProps } from './utils';
|
|
3
3
|
import { WithPageScrollLock } from '../_internal/page-scroll-lock';
|
|
4
4
|
export interface ScreenProps extends ScreenInnerProps, WithPageScrollLock {
|
|
@@ -18,8 +18,8 @@ export interface ScreenProps extends ScreenInnerProps, WithPageScrollLock {
|
|
|
18
18
|
export declare const Screen: {
|
|
19
19
|
({ children, loading, loadingArea, loadingOverlayProps, onFullScroll, fullScrollThreshold, withScrollDisable, scrollDisableOptions, "data-testid": testId, }: ScreenProps): JSX.Element;
|
|
20
20
|
Header: ({ divided, title, subtitle, buttons, onBack, onClose, ...restProps }: import("./slots").HeaderSlotProps) => JSX.Element;
|
|
21
|
-
Body:
|
|
22
|
-
children?:
|
|
23
|
-
} &
|
|
24
|
-
Footer:
|
|
21
|
+
Body: import("react").ForwardRefExoticComponent<{
|
|
22
|
+
children?: import("react").ReactNode;
|
|
23
|
+
} & import("react").RefAttributes<HTMLDivElement | null>>;
|
|
24
|
+
Footer: import("react").FC<{}>;
|
|
25
25
|
};
|
package/screen/index.js
CHANGED
|
@@ -1,33 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
4
|
};
|
|
28
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
6
|
exports.Screen = void 0;
|
|
30
|
-
const
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const react_1 = require("react");
|
|
31
9
|
const slots_1 = require("./slots");
|
|
32
10
|
const layer_1 = require("../helpers/layer");
|
|
33
11
|
const define_slots_1 = require("../helpers/define-slots");
|
|
@@ -53,20 +31,16 @@ const Screen = ({ children, loading, loadingArea = 'full', loadingOverlayProps,
|
|
|
53
31
|
if (!body) {
|
|
54
32
|
throw Error('Looks like you are trying to render <Screen /> without <Screen.Body /> slot, but it is required');
|
|
55
33
|
}
|
|
56
|
-
return (
|
|
34
|
+
return ((0, jsx_runtime_1.jsx)("div", Object.assign({ ref: rootRef, className: screen_module_scss_1.default.root, style: {
|
|
57
35
|
zIndex: layer, // z-index именно здесь из-за position: fixed
|
|
58
|
-
}, "data-testid": testId },
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
withScrollDisable,
|
|
67
|
-
scrollDisableOptions,
|
|
68
|
-
} }, body),
|
|
69
|
-
!fullLoading && footer && (react_1.default.createElement("div", { className: screen_module_scss_1.default.footer, "data-testid": 'screen:footer' }, footer)))));
|
|
36
|
+
}, "data-testid": testId }, { children: (0, jsx_runtime_1.jsxs)(layer_1.LayerProvider, Object.assign({ value: layer }, { children: [!fullLoading && header, (0, jsx_runtime_1.jsx)(utils_1.ScreenContext.Provider, Object.assign({ value: {
|
|
37
|
+
loading,
|
|
38
|
+
loadingOverlayProps,
|
|
39
|
+
onFullScroll,
|
|
40
|
+
fullScrollThreshold,
|
|
41
|
+
withScrollDisable,
|
|
42
|
+
scrollDisableOptions,
|
|
43
|
+
} }, { children: body })), !fullLoading && footer && ((0, jsx_runtime_1.jsx)("div", Object.assign({ className: screen_module_scss_1.default.footer, "data-testid": 'screen:footer' }, { children: footer })))] })) })));
|
|
70
44
|
};
|
|
71
45
|
exports.Screen = Screen;
|
|
72
46
|
exports.Screen.Header = slots_1.HeaderSlot;
|