@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/timer/index.js
CHANGED
|
@@ -1,30 +1,8 @@
|
|
|
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
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
3
|
exports.Timer = void 0;
|
|
27
|
-
const
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_1 = require("react");
|
|
28
6
|
const utils_1 = require("./utils");
|
|
29
7
|
/**
|
|
30
8
|
* Компонент для вывода оставшегося времени до целевой временной отметки.
|
|
@@ -40,6 +18,6 @@ const Timer = ({ date, format = utils_1.formatDistance, timeout = 1000 }) => {
|
|
|
40
18
|
setDistance((0, utils_1.getDistanceToNow)(date));
|
|
41
19
|
return () => clearInterval(timerId);
|
|
42
20
|
}, [timeout]);
|
|
43
|
-
return
|
|
21
|
+
return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: format(distance) });
|
|
44
22
|
};
|
|
45
23
|
exports.Timer = Timer;
|
package/toggle/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
2
|
import { CheckboxInputProps } from '../types';
|
|
3
3
|
export type ToggleProps = CheckboxInputProps;
|
|
4
4
|
/**
|
|
5
5
|
* Компонент стилизованного переключателя (input[type=checkbox]).
|
|
6
6
|
*/
|
|
7
|
-
export declare const Toggle:
|
|
7
|
+
export declare const Toggle: import("react").ForwardRefExoticComponent<CheckboxInputProps & import("react").RefAttributes<HTMLInputElement>>;
|
package/toggle/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.Toggle = void 0;
|
|
41
|
-
const
|
|
18
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
19
|
+
const react_1 = require("react");
|
|
42
20
|
const bind_1 = __importDefault(require("classnames/bind"));
|
|
43
21
|
const toggle_module_scss_1 = __importDefault(require("./toggle.module.scss"));
|
|
44
22
|
const cx = bind_1.default.bind(toggle_module_scss_1.default);
|
|
@@ -49,8 +27,6 @@ exports.Toggle = (0, react_1.forwardRef)((_a, ref) => {
|
|
|
49
27
|
var { className, style, 'data-testid': testId = 'toggle' } = _a,
|
|
50
28
|
// input props
|
|
51
29
|
restProps = __rest(_a, ["className", "style", 'data-testid']);
|
|
52
|
-
return (
|
|
53
|
-
react_1.default.createElement("input", Object.assign({}, restProps, { className: cx('input'), ref: ref, type: 'checkbox', "data-testid": testId })),
|
|
54
|
-
react_1.default.createElement("span", { className: cx('switch') })));
|
|
30
|
+
return ((0, jsx_runtime_1.jsxs)("label", Object.assign({ className: cx('root', className), style: style }, { children: [(0, jsx_runtime_1.jsx)("input", Object.assign({}, restProps, { className: cx('input'), ref: ref, type: 'checkbox', "data-testid": testId })), (0, jsx_runtime_1.jsx)("span", { className: cx('switch') })] })));
|
|
55
31
|
});
|
|
56
32
|
exports.Toggle.displayName = 'Toggle';
|
package/tooltip/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
2
|
export interface TooltipProps {
|
|
3
3
|
/** Содержимое. */
|
|
4
4
|
children?: React.ReactNode;
|
|
@@ -15,4 +15,4 @@ export interface TooltipProps {
|
|
|
15
15
|
* @param props Свойства.
|
|
16
16
|
* @return Элемент.
|
|
17
17
|
*/
|
|
18
|
-
export declare const Tooltip:
|
|
18
|
+
export declare const Tooltip: import("react").ForwardRefExoticComponent<TooltipProps & import("react").RefAttributes<HTMLDivElement | null>>;
|
package/tooltip/index.js
CHANGED
|
@@ -1,34 +1,12 @@
|
|
|
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.Tooltip = void 0;
|
|
30
|
-
const
|
|
31
|
-
const
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const react_1 = require("react");
|
|
9
|
+
const Cross_1 = __importDefault(require("@sima-land/ui-quarks/icons/16x16/Stroked/Cross"));
|
|
32
10
|
const bind_1 = __importDefault(require("classnames/bind"));
|
|
33
11
|
const tooltip_module_scss_1 = __importDefault(require("./tooltip.module.scss"));
|
|
34
12
|
const cx = bind_1.default.bind(tooltip_module_scss_1.default);
|
|
@@ -38,6 +16,4 @@ const cx = bind_1.default.bind(tooltip_module_scss_1.default);
|
|
|
38
16
|
* @param props Свойства.
|
|
39
17
|
* @return Элемент.
|
|
40
18
|
*/
|
|
41
|
-
exports.Tooltip = (0, react_1.forwardRef)(({ children, onClose, style, className }, ref) => (
|
|
42
|
-
react_1.default.createElement(cross_1.default, { className: cx('cross'), onClick: onClose, "data-testid": 'tooltip:cross' }),
|
|
43
|
-
react_1.default.createElement("div", { className: cx('content') }, children))));
|
|
19
|
+
exports.Tooltip = (0, react_1.forwardRef)(({ children, onClose, style, className }, ref) => ((0, jsx_runtime_1.jsxs)("div", Object.assign({ ref: ref, style: style, className: cx('root', className), "data-testid": 'tooltip' }, { children: [(0, jsx_runtime_1.jsx)(Cross_1.default, { className: cx('cross'), onClick: onClose, "data-testid": 'tooltip:cross' }), (0, jsx_runtime_1.jsx)("div", Object.assign({ className: cx('content') }, { children: children }))] }))));
|
package/top-bar/top-bar.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.TopBar = exports.TOP_BAR_HEIGHT = void 0;
|
|
41
|
-
const
|
|
18
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
19
|
+
const react_1 = require("react");
|
|
42
20
|
const utils_1 = require("./utils");
|
|
43
21
|
const borders_1 = require("../styling/borders");
|
|
44
22
|
const bind_1 = __importDefault(require("classnames/bind"));
|
|
@@ -60,24 +38,7 @@ function TopBar({ divided, size = 'm', title, subtitle, buttons: { start, startS
|
|
|
60
38
|
const hasEndButtons = end || endSecondary;
|
|
61
39
|
const hasButtons = hasStartButtons || hasEndButtons;
|
|
62
40
|
const rootClasses = cx('root', `size-${size}`, className, divided && borders_1.InnerBorder.bottom, !subtitle && 'no-subtitle');
|
|
63
|
-
return (
|
|
64
|
-
hasButtons && (react_1.default.createElement("div", { className: cx('side') },
|
|
65
|
-
hasStartButtons && (react_1.default.createElement(TopBarButtonGroup, null,
|
|
66
|
-
start && react_1.default.createElement(TopBarButton, Object.assign({}, start)),
|
|
67
|
-
startSecondary && react_1.default.createElement(TopBarButton, Object.assign({}, startSecondary)))),
|
|
68
|
-
hasEndButtons && (react_1.default.createElement(TopBarButtonGroup, { stub: true, end: true },
|
|
69
|
-
endSecondary && react_1.default.createElement(TopBarButton, Object.assign({}, endSecondary)),
|
|
70
|
-
end && react_1.default.createElement(TopBarButton, Object.assign({}, end)))))),
|
|
71
|
-
react_1.default.createElement("div", { className: cx('main') },
|
|
72
|
-
title && react_1.default.createElement("div", { className: cx('title') }, title),
|
|
73
|
-
subtitle && react_1.default.createElement("div", { className: cx('subtitle') }, subtitle)),
|
|
74
|
-
hasButtons && (react_1.default.createElement("div", { className: cx('side') },
|
|
75
|
-
hasEndButtons && (react_1.default.createElement(TopBarButtonGroup, { end: true },
|
|
76
|
-
endSecondary && react_1.default.createElement(TopBarButton, Object.assign({}, endSecondary)),
|
|
77
|
-
end && react_1.default.createElement(TopBarButton, Object.assign({}, end)))),
|
|
78
|
-
hasStartButtons && (react_1.default.createElement(TopBarButtonGroup, { stub: true },
|
|
79
|
-
start && react_1.default.createElement(TopBarButton, Object.assign({}, start)),
|
|
80
|
-
startSecondary && react_1.default.createElement(TopBarButton, Object.assign({}, startSecondary))))))));
|
|
41
|
+
return ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: rootClasses, "data-testid": testId }, { children: [hasButtons && ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: cx('side') }, { children: [hasStartButtons && ((0, jsx_runtime_1.jsxs)(TopBarButtonGroup, { children: [start && (0, jsx_runtime_1.jsx)(TopBarButton, Object.assign({}, start)), startSecondary && (0, jsx_runtime_1.jsx)(TopBarButton, Object.assign({}, startSecondary))] })), hasEndButtons && ((0, jsx_runtime_1.jsxs)(TopBarButtonGroup, Object.assign({ stub: true, end: true }, { children: [endSecondary && (0, jsx_runtime_1.jsx)(TopBarButton, Object.assign({}, endSecondary)), end && (0, jsx_runtime_1.jsx)(TopBarButton, Object.assign({}, end))] })))] }))), (0, jsx_runtime_1.jsxs)("div", Object.assign({ className: cx('main') }, { children: [title && (0, jsx_runtime_1.jsx)("div", Object.assign({ className: cx('title') }, { children: title })), subtitle && (0, jsx_runtime_1.jsx)("div", Object.assign({ className: cx('subtitle') }, { children: subtitle }))] })), hasButtons && ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: cx('side') }, { children: [hasEndButtons && ((0, jsx_runtime_1.jsxs)(TopBarButtonGroup, Object.assign({ end: true }, { children: [endSecondary && (0, jsx_runtime_1.jsx)(TopBarButton, Object.assign({}, endSecondary)), end && (0, jsx_runtime_1.jsx)(TopBarButton, Object.assign({}, end))] }))), hasStartButtons && ((0, jsx_runtime_1.jsxs)(TopBarButtonGroup, Object.assign({ stub: true }, { children: [start && (0, jsx_runtime_1.jsx)(TopBarButton, Object.assign({}, start)), startSecondary && (0, jsx_runtime_1.jsx)(TopBarButton, Object.assign({}, startSecondary))] })))] })))] })));
|
|
81
42
|
}
|
|
82
43
|
exports.TopBar = TopBar;
|
|
83
44
|
/**
|
|
@@ -86,8 +47,7 @@ exports.TopBar = TopBar;
|
|
|
86
47
|
* @return Элемент.
|
|
87
48
|
*/
|
|
88
49
|
function TopBarButtonGroup({ children, stub, end, }) {
|
|
89
|
-
return (
|
|
90
|
-
react_1.default.createElement("div", { className: cx('button-group', { stub, end }) }, children)));
|
|
50
|
+
return ((0, jsx_runtime_1.jsx)(utils_1.TopBarButtonGroupContext.Provider, Object.assign({ value: { stub } }, { children: (0, jsx_runtime_1.jsx)("div", Object.assign({ className: cx('button-group', { stub, end }) }, { children: children })) })));
|
|
91
51
|
}
|
|
92
52
|
/**
|
|
93
53
|
* Компонент кнопки-иконки.
|
|
@@ -97,5 +57,5 @@ function TopBarButtonGroup({ children, stub, end, }) {
|
|
|
97
57
|
function TopBarButton(_a) {
|
|
98
58
|
var { text, icon, className, 'data-testid': testId = 'top-bar:button' } = _a, buttonProps = __rest(_a, ["text", "icon", "className", 'data-testid']);
|
|
99
59
|
const { stub } = (0, react_1.useContext)(utils_1.TopBarButtonGroupContext);
|
|
100
|
-
return (
|
|
60
|
+
return ((0, jsx_runtime_1.jsx)("button", Object.assign({}, (!stub && Object.assign(Object.assign({}, buttonProps), { 'data-testid': testId })), { type: 'button', className: cx('button', icon && 'iconic', stub && 'stub', className), "aria-hidden": stub }, { children: icon && !stub ? icon : text })));
|
|
101
61
|
}
|
package/top-bar/utils.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
2
|
import { TopBarProps } from './types';
|
|
3
|
-
export declare const TopBarButtonGroupContext:
|
|
3
|
+
export declare const TopBarButtonGroupContext: import("react").Context<{
|
|
4
4
|
stub?: boolean | undefined;
|
|
5
5
|
}>;
|
|
6
6
|
/**
|
package/top-bar/utils.js
CHANGED
|
@@ -1,35 +1,13 @@
|
|
|
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.navigationButtons = exports.TopBarButtonGroupContext = void 0;
|
|
30
|
-
const
|
|
31
|
-
const
|
|
32
|
-
const
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const react_1 = require("react");
|
|
9
|
+
const Cross_1 = __importDefault(require("@sima-land/ui-quarks/icons/24x24/Stroked/Cross"));
|
|
10
|
+
const ArrowLeft_1 = __importDefault(require("@sima-land/ui-quarks/icons/24x24/Stroked/ArrowLeft"));
|
|
33
11
|
exports.TopBarButtonGroupContext = (0, react_1.createContext)({
|
|
34
12
|
stub: false,
|
|
35
13
|
});
|
|
@@ -43,13 +21,13 @@ function navigationButtons({ buttons, onBack, onClose, }) {
|
|
|
43
21
|
start: {
|
|
44
22
|
'data-testid': 'top-bar:back',
|
|
45
23
|
onClick: onBack,
|
|
46
|
-
icon:
|
|
24
|
+
icon: (0, jsx_runtime_1.jsx)(ArrowLeft_1.default, {}),
|
|
47
25
|
},
|
|
48
26
|
})), (onClose && {
|
|
49
27
|
end: {
|
|
50
28
|
'data-testid': 'top-bar:close',
|
|
51
29
|
onClick: onClose,
|
|
52
|
-
icon:
|
|
30
|
+
icon: (0, jsx_runtime_1.jsx)(Cross_1.default, {}),
|
|
53
31
|
},
|
|
54
32
|
}));
|
|
55
33
|
}
|
package/touch-slider/index.d.ts
CHANGED
package/touch-slider/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.TouchSlider = void 0;
|
|
7
|
-
const
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
8
|
const layout_1 = require("../layout");
|
|
9
9
|
const page_scroll_lock_1 = require("../_internal/page-scroll-lock");
|
|
10
10
|
const touch_slider_module_scss_1 = __importDefault(require("./touch-slider.module.scss"));
|
|
@@ -15,7 +15,5 @@ const touch_slider_module_scss_1 = __importDefault(require("./touch-slider.modul
|
|
|
15
15
|
* @param props Свойства.
|
|
16
16
|
* @return Элемент.
|
|
17
17
|
*/
|
|
18
|
-
const TouchSlider = ({ children }) => (
|
|
19
|
-
react_1.default.createElement("div", Object.assign({ className: touch_slider_module_scss_1.default.outer }, { [page_scroll_lock_1.BSL_IGNORE_ATTR]: true }),
|
|
20
|
-
react_1.default.createElement("div", { className: touch_slider_module_scss_1.default.inner }, children))));
|
|
18
|
+
const TouchSlider = ({ children }) => ((0, jsx_runtime_1.jsx)(layout_1.MobileLayout, { children: (0, jsx_runtime_1.jsx)("div", Object.assign({ className: touch_slider_module_scss_1.default.outer }, { [page_scroll_lock_1.BSL_IGNORE_ATTR]: true }, { children: (0, jsx_runtime_1.jsx)("div", Object.assign({ className: touch_slider_module_scss_1.default.inner }, { children: children })) })) }));
|
|
21
19
|
exports.TouchSlider = TouchSlider;
|
package/unknown-content/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.UnknownContent = void 0;
|
|
30
|
-
const
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const react_1 = require("react");
|
|
31
9
|
const utils_1 = require("./utils");
|
|
32
10
|
const classnames_1 = __importDefault(require("classnames"));
|
|
33
11
|
const unknown_content_module_scss_1 = __importDefault(require("./unknown-content.module.scss"));
|
|
@@ -41,6 +19,6 @@ function UnknownContent({ markup, children, className }) {
|
|
|
41
19
|
(0, react_1.useEffect)(() => {
|
|
42
20
|
ref.current && (0, utils_1.setTableRowLabels)(ref.current);
|
|
43
21
|
});
|
|
44
|
-
return (
|
|
22
|
+
return ((0, jsx_runtime_1.jsx)("div", Object.assign({ ref: ref, className: (0, classnames_1.default)(unknown_content_module_scss_1.default.root, className) }, (children ? { children } : { dangerouslySetInnerHTML: { __html: markup || '' } }))));
|
|
45
23
|
}
|
|
46
24
|
exports.UnknownContent = UnknownContent;
|
|
@@ -1,38 +1,16 @@
|
|
|
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.UploadArea = void 0;
|
|
30
|
-
const
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const react_1 = require("react");
|
|
31
9
|
const link_1 = require("../link");
|
|
32
10
|
const utils_1 = require("./utils");
|
|
33
11
|
const lodash_1 = require("lodash");
|
|
34
12
|
const get_declination_1 = require("../helpers/get-declination");
|
|
35
|
-
const
|
|
13
|
+
const Upload_1 = __importDefault(require("@sima-land/ui-quarks/icons/64x64/Stroked/Upload"));
|
|
36
14
|
const bind_1 = __importDefault(require("classnames/bind"));
|
|
37
15
|
const upload_area_module_scss_1 = __importDefault(require("./upload-area.module.scss"));
|
|
38
16
|
const cx = bind_1.default.bind(upload_area_module_scss_1.default);
|
|
@@ -68,7 +46,7 @@ function UploadArea({ className, style, size = 'm', multiple, disabled, failed,
|
|
|
68
46
|
onSelect === null || onSelect === void 0 ? void 0 : onSelect(filterFiles(event.dataTransfer.files), event);
|
|
69
47
|
});
|
|
70
48
|
const rootClassName = cx('root', size !== 'unset' && `size-${size}`, { active, failed, disabled }, className);
|
|
71
|
-
return (
|
|
49
|
+
return ((0, jsx_runtime_1.jsxs)("div", Object.assign({}, rootProps, bind, { "data-testid": testId, style: style, className: rootClassName, tabIndex: disabled ? -1 : 0, role: 'button', onFocus: event => {
|
|
72
50
|
var _a;
|
|
73
51
|
if (!disabled) {
|
|
74
52
|
(_a = rootProps === null || rootProps === void 0 ? void 0 : rootProps.onFocus) === null || _a === void 0 ? void 0 : _a.call(rootProps, event);
|
|
@@ -89,17 +67,9 @@ function UploadArea({ className, style, size = 'm', multiple, disabled, failed,
|
|
|
89
67
|
}, onBlur: event => {
|
|
90
68
|
var _a;
|
|
91
69
|
(_a = rootProps === null || rootProps === void 0 ? void 0 : rootProps.onBlur) === null || _a === void 0 ? void 0 : _a.call(rootProps, event);
|
|
92
|
-
} }),
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
react_1.default.createElement("input", Object.assign({}, inputProps, { ref: inputRef, type: 'file', multiple: multiple, className: cx('input'), onChange: onInputChange, onClick: e => {
|
|
97
|
-
// для того чтобы при клике на корневом элементе не вызывался второй клик
|
|
98
|
-
e.stopPropagation();
|
|
99
|
-
}, "data-testid": 'upload-area:input', disabled: disabled })),
|
|
100
|
-
react_1.default.createElement(link_1.Link, { pseudo: true, "data-testid": 'upload-area:anchor', disabled: disabled },
|
|
101
|
-
"\u0417\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u0435 ",
|
|
102
|
-
fileRole)),
|
|
103
|
-
secondaryInfo && react_1.default.createElement("div", { className: cx('text', 'secondary') }, secondaryInfo))));
|
|
70
|
+
} }, { children: [(0, jsx_runtime_1.jsx)(Upload_1.default, { className: cx('icon') }), (0, jsx_runtime_1.jsxs)("div", Object.assign({ className: cx('info') }, { children: [(0, jsx_runtime_1.jsxs)("div", Object.assign({ className: cx('text', 'primary') }, { children: [(0, jsx_runtime_1.jsx)("input", Object.assign({}, inputProps, { ref: inputRef, type: 'file', multiple: multiple, className: cx('input'), onChange: onInputChange, onClick: e => {
|
|
71
|
+
// для того чтобы при клике на корневом элементе не вызывался второй клик
|
|
72
|
+
e.stopPropagation();
|
|
73
|
+
}, "data-testid": 'upload-area:input', disabled: disabled })), (0, jsx_runtime_1.jsxs)(link_1.Link, Object.assign({ pseudo: true, "data-testid": 'upload-area:anchor', disabled: disabled }, { children: ["\u0417\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u0435 ", fileRole] }))] })), secondaryInfo && (0, jsx_runtime_1.jsx)("div", Object.assign({ className: cx('text', 'secondary') }, { children: secondaryInfo }))] }))] })));
|
|
104
74
|
}
|
|
105
75
|
exports.UploadArea = UploadArea;
|
package/with-hint/index.d.ts
CHANGED
package/with-hint/index.js
CHANGED
|
@@ -1,30 +1,8 @@
|
|
|
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
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
3
|
exports.useTempHint = exports.WithHint = void 0;
|
|
27
|
-
const
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_1 = require("react");
|
|
28
6
|
const portal_1 = require("../portal");
|
|
29
7
|
const positioning_hint_1 = require("./positioning-hint");
|
|
30
8
|
const utils_1 = require("./utils");
|
|
@@ -47,10 +25,7 @@ const WithHint = ({ children, direction = 'top', hint, onClose, shown: shownProp
|
|
|
47
25
|
});
|
|
48
26
|
}
|
|
49
27
|
}, [shown]);
|
|
50
|
-
return (
|
|
51
|
-
children(openerRef, toggle),
|
|
52
|
-
shown && hint && (react_1.default.createElement(portal_1.Portal, null,
|
|
53
|
-
react_1.default.createElement(positioning_hint_1.PositioningHint, { openerRef: openerRef, direction: direction, children: hint })))));
|
|
28
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [children(openerRef, toggle), shown && hint && ((0, jsx_runtime_1.jsx)(portal_1.Portal, { children: (0, jsx_runtime_1.jsx)(positioning_hint_1.PositioningHint, { openerRef: openerRef, direction: direction, children: hint }) }))] }));
|
|
54
29
|
};
|
|
55
30
|
exports.WithHint = WithHint;
|
|
56
31
|
/**
|
|
@@ -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.PositioningHint = void 0;
|
|
30
|
-
const
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const react_1 = require("react");
|
|
31
9
|
const hint_deprecated_1 = require("../hint-deprecated");
|
|
32
10
|
const utils_1 = require("./utils");
|
|
33
11
|
const bind_1 = __importDefault(require("classnames/bind"));
|
|
@@ -48,6 +26,6 @@ const PositioningHint = ({ children, direction, openerRef }) => {
|
|
|
48
26
|
utils_1.PlaceAt[direction](ref.current, openerRef.current);
|
|
49
27
|
}
|
|
50
28
|
}, [direction, children]);
|
|
51
|
-
return (
|
|
29
|
+
return ((0, jsx_runtime_1.jsx)(hint_deprecated_1.Hint, { ref: ref, direction: direction, className: cx('hint', 'hidden'), style: { zIndex: layer + 1 }, children: children }));
|
|
52
30
|
};
|
|
53
31
|
exports.PositioningHint = PositioningHint;
|
package/with-tooltip/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
2
|
type ChildrenFn = (ref: React.RefObject<HTMLElement>, toggle: (opened: boolean) => void, shown: boolean) => React.ReactNode;
|
|
3
3
|
export interface WithTooltipProps {
|
|
4
4
|
/** Сработает при клике вне подсказки или на крестик в ней. */
|
package/with-tooltip/index.js
CHANGED
|
@@ -1,30 +1,8 @@
|
|
|
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
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
3
|
exports.WithTooltip = void 0;
|
|
27
|
-
const
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_1 = require("react");
|
|
28
6
|
const get_scroll_parent_1 = require("../helpers/get-scroll-parent");
|
|
29
7
|
const portal_1 = require("../portal");
|
|
30
8
|
const positioning_tooltip_1 = require("./positioning-tooltip");
|
|
@@ -37,12 +15,9 @@ const positioning_tooltip_1 = require("./positioning-tooltip");
|
|
|
37
15
|
const WithTooltip = ({ onDismiss, children, tooltip }) => {
|
|
38
16
|
const openerRef = (0, react_1.useRef)(null);
|
|
39
17
|
const [shown, toggle] = (0, react_1.useState)(false);
|
|
40
|
-
return (
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
onDismiss && onDismiss();
|
|
45
|
-
toggle(false);
|
|
46
|
-
} })))));
|
|
18
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [children(openerRef, toggle, shown), shown && ((0, jsx_runtime_1.jsx)(portal_1.Portal, Object.assign({ defineRoot: () => (0, get_scroll_parent_1.getScrollParent)(openerRef.current) }, { children: (0, jsx_runtime_1.jsx)(positioning_tooltip_1.PositioningTooltip, { openerRef: openerRef, children: tooltip, onDismiss: () => {
|
|
19
|
+
onDismiss && onDismiss();
|
|
20
|
+
toggle(false);
|
|
21
|
+
} }) })))] }));
|
|
47
22
|
};
|
|
48
23
|
exports.WithTooltip = WithTooltip;
|