@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/carousel/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.Carousel = void 0;
|
|
30
|
-
const
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const react_1 = require("react");
|
|
31
9
|
const draggable_1 = require("./draggable");
|
|
32
10
|
const lodash_1 = require("lodash");
|
|
33
11
|
const fp_1 = require("lodash/fp");
|
|
@@ -89,7 +67,7 @@ class Carousel extends react_1.Component {
|
|
|
89
67
|
* @return Элемент списка.
|
|
90
68
|
*/
|
|
91
69
|
static defaultRenderItem(item, index) {
|
|
92
|
-
return
|
|
70
|
+
return (0, jsx_runtime_1.jsx)("div", { children: String(item) }, index);
|
|
93
71
|
}
|
|
94
72
|
/**
|
|
95
73
|
* Возвращает кнопку управления.
|
|
@@ -102,7 +80,7 @@ class Carousel extends react_1.Component {
|
|
|
102
80
|
static defaultRenderControl({ canUse, onUse, type, vertical }, props = { size: 's' }) {
|
|
103
81
|
const forward = vertical ? 'down' : 'right';
|
|
104
82
|
const backward = vertical ? 'up' : 'left';
|
|
105
|
-
return (
|
|
83
|
+
return ((0, jsx_runtime_1.jsx)(arrow_button_1.ArrowButton, Object.assign({}, props, { className: cx('control', vertical && 'vertical', type, props.className), direction: type === 'forward' ? forward : backward, onClick: onUse, disabled: !canUse })));
|
|
106
84
|
}
|
|
107
85
|
/**
|
|
108
86
|
* Возвращает функцию для поиска наиболее отдаленного элемента карусели от стартовой границы viewport'а.
|
|
@@ -590,25 +568,21 @@ class Carousel extends react_1.Component {
|
|
|
590
568
|
const { currentOffset, isAllItemsVisible } = this.state;
|
|
591
569
|
const { autoplay, autoplayHoverPause, vertical, containerProps = {}, viewportElementProps = {}, withControls = 'auto', renderControl = Carousel.defaultRenderControl, controlProps, } = this.props;
|
|
592
570
|
const needShowControls = (isAuto(withControls) && !isAllItemsVisible) || withControls === true;
|
|
593
|
-
return (
|
|
571
|
+
return ((0, jsx_runtime_1.jsxs)("div", Object.assign({ ref: this.rootElementRef }, containerProps, { className: cx('carousel-wrapper', containerProps.className), onMouseEnter: () => {
|
|
594
572
|
autoplay && autoplayHoverPause && this.toggleAutoMove(false);
|
|
595
573
|
}, onMouseLeave: () => {
|
|
596
574
|
autoplay && autoplayHoverPause && !this.isGrabbed() && this.toggleAutoMove(true);
|
|
597
|
-
} }),
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
onUse: this.moveForward,
|
|
609
|
-
canUse: this.infinite || currentOffset > this.defineMinOffset(),
|
|
610
|
-
vertical,
|
|
611
|
-
}, controlProps)))));
|
|
575
|
+
} }, { children: [(0, jsx_runtime_1.jsx)(draggable_1.Draggable, { active: this.canDrag(), axis: vertical ? 'y' : 'x', transitionDuration: 320, containerProps: Object.assign(Object.assign({}, viewportElementProps), { ref: this.wrapperRef, className: cx('full-size', viewportElementProps.className) }), takeControl: this.takeDragControl, onDragStart: this.onDragStart, onDragMove: this.onDragMove, onDragEnd: this.onDragEnd, children: (0, jsx_runtime_1.jsx)("div", { className: cx(['carousel-items-container', vertical && 'vertical']), ref: this.containerRef, children: this.renderItems() }) }), needShowControls && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [renderControl({
|
|
576
|
+
type: 'backward',
|
|
577
|
+
onUse: this.moveBackward,
|
|
578
|
+
canUse: this.infinite || currentOffset < 0,
|
|
579
|
+
vertical,
|
|
580
|
+
}, controlProps), renderControl({
|
|
581
|
+
type: 'forward',
|
|
582
|
+
onUse: this.moveForward,
|
|
583
|
+
canUse: this.infinite || currentOffset > this.defineMinOffset(),
|
|
584
|
+
vertical,
|
|
585
|
+
}, controlProps)] }))] })));
|
|
612
586
|
}
|
|
613
587
|
/**
|
|
614
588
|
* Формирует список элементов карусели с учетом необходимости клонирования.
|
|
@@ -623,7 +597,7 @@ class Carousel extends react_1.Component {
|
|
|
623
597
|
const result = [];
|
|
624
598
|
for (let realIndex = 0; realIndex < loopLimit; realIndex++) {
|
|
625
599
|
const index = realIndex % realItemsCount;
|
|
626
|
-
result.push(
|
|
600
|
+
result.push((0, jsx_runtime_1.jsx)(react_1.Fragment, { children: renderItem(items[index], realIndex) }, realIndex));
|
|
627
601
|
}
|
|
628
602
|
return result;
|
|
629
603
|
}
|
package/checkbox/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
2
|
import { CheckboxInputProps } from '../types';
|
|
3
3
|
export type CheckboxProps = CheckboxInputProps;
|
|
4
4
|
/**
|
|
5
5
|
* Компонент стилизованного переключателя (input[type=checkbox]).
|
|
6
6
|
*/
|
|
7
|
-
export declare const Checkbox:
|
|
7
|
+
export declare const Checkbox: import("react").ForwardRefExoticComponent<CheckboxInputProps & import("react").RefAttributes<HTMLInputElement>>;
|
package/checkbox/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.Checkbox = 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 checkbox_module_scss_1 = __importDefault(require("./checkbox.module.scss"));
|
|
44
22
|
const cx = bind_1.default.bind(checkbox_module_scss_1.default);
|
|
@@ -49,10 +27,6 @@ exports.Checkbox = (0, react_1.forwardRef)((_a, ref) => {
|
|
|
49
27
|
var { className, style, 'data-testid': testId = 'checkbox' } = _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, { "data-testid": testId, ref: ref, type: 'checkbox', className: cx('input') })),
|
|
54
|
-
react_1.default.createElement("svg", { width: '16', height: '16', viewBox: '0 0 16 16', fill: 'none' },
|
|
55
|
-
react_1.default.createElement("rect", { x: '0.5', y: '0.5', width: '15', height: '15', rx: '1.5', className: cx('square') }),
|
|
56
|
-
react_1.default.createElement("path", { fillRule: 'evenodd', clipRule: 'evenodd', d: 'M10.8 5.21967L6.4 9.18934L5.36569 8.21967C5.05327 7.92678 4.54673 7.92678 4.23431 8.21967C3.9219 8.51256 3.9219 8.98744 4.23431 9.28033L5.83431 10.7803C6.14673 11.0732 6.65327 11.0732 6.96569 10.7803L11.7657 6.28033C12.0781 5.98744 12.0781 5.51256 11.7657 5.21967C11.4533 4.92678 11.1124 4.92678 10.8 5.21967Z', fill: 'white', className: cx('mark') }))));
|
|
30
|
+
return ((0, jsx_runtime_1.jsxs)("span", Object.assign({ className: cx('root', className), style: style }, { children: [(0, jsx_runtime_1.jsx)("input", Object.assign({}, restProps, { "data-testid": testId, ref: ref, type: 'checkbox', className: cx('input') })), (0, jsx_runtime_1.jsxs)("svg", Object.assign({ width: '16', height: '16', viewBox: '0 0 16 16', fill: 'none' }, { children: [(0, jsx_runtime_1.jsx)("rect", { x: '0.5', y: '0.5', width: '15', height: '15', rx: '1.5', className: cx('square') }), (0, jsx_runtime_1.jsx)("path", { fillRule: 'evenodd', clipRule: 'evenodd', d: 'M10.8 5.21967L6.4 9.18934L5.36569 8.21967C5.05327 7.92678 4.54673 7.92678 4.23431 8.21967C3.9219 8.51256 3.9219 8.98744 4.23431 9.28033L5.83431 10.7803C6.14673 11.0732 6.65327 11.0732 6.96569 10.7803L11.7657 6.28033C12.0781 5.98744 12.0781 5.51256 11.7657 5.21967C11.4533 4.92678 11.1124 4.92678 10.8 5.21967Z', fill: 'white', className: cx('mark') })] }))] })));
|
|
57
31
|
});
|
|
58
32
|
exports.Checkbox.displayName = 'Checkbox';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
2
|
export interface CheckboxFieldProps extends React.InputHTMLAttributes<HTMLInputElement> {
|
|
3
3
|
/** Содержимое ярлыка. */
|
|
4
4
|
label: string;
|
|
@@ -16,4 +16,4 @@ export interface CheckboxFieldProps extends React.InputHTMLAttributes<HTMLInputE
|
|
|
16
16
|
/**
|
|
17
17
|
* @deprecated Теперь можно использовать SwitcherRow.
|
|
18
18
|
*/
|
|
19
|
-
export declare const CheckboxField:
|
|
19
|
+
export declare const CheckboxField: import("react").ForwardRefExoticComponent<CheckboxFieldProps & import("react").RefAttributes<HTMLInputElement | null>>;
|
package/checkbox-field/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.CheckboxField = void 0;
|
|
41
|
-
const
|
|
18
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
19
|
+
const react_1 = require("react");
|
|
42
20
|
const checkbox_1 = require("../checkbox");
|
|
43
21
|
const toggle_1 = require("../toggle");
|
|
44
22
|
const bind_1 = __importDefault(require("classnames/bind"));
|
|
@@ -52,11 +30,5 @@ exports.CheckboxField = (0, react_1.forwardRef)(function CheckboxField(_a, ref)
|
|
|
52
30
|
// input props
|
|
53
31
|
id, disabled } = _a, restProps = __rest(_a, ["smallText", "fieldView", "label", "info", "failed", 'data-testid', "style", "className", "id", "disabled"]);
|
|
54
32
|
const inputProps = Object.assign({ id, disabled }, restProps);
|
|
55
|
-
return (
|
|
56
|
-
react_1.default.createElement("div", { className: cx('field-row') },
|
|
57
|
-
fieldView === 'checkbox' && react_1.default.createElement(checkbox_1.Checkbox, Object.assign({}, inputProps, { ref: ref })),
|
|
58
|
-
fieldView === 'toggle' && react_1.default.createElement(toggle_1.Toggle, Object.assign({}, inputProps, { ref: ref }))),
|
|
59
|
-
react_1.default.createElement("label", { htmlFor: id },
|
|
60
|
-
react_1.default.createElement("span", { className: cx('label'), "data-testid": 'checkbox-field:label' }, label),
|
|
61
|
-
info && react_1.default.createElement("span", { className: cx('info') }, info))));
|
|
33
|
+
return ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: cx('root', `field-${fieldView}`, { failed, disabled, 'small-text': smallText }, className), style: style, "data-testid": testId }, { children: [(0, jsx_runtime_1.jsxs)("div", Object.assign({ className: cx('field-row') }, { children: [fieldView === 'checkbox' && (0, jsx_runtime_1.jsx)(checkbox_1.Checkbox, Object.assign({}, inputProps, { ref: ref })), fieldView === 'toggle' && (0, jsx_runtime_1.jsx)(toggle_1.Toggle, Object.assign({}, inputProps, { ref: ref }))] })), (0, jsx_runtime_1.jsxs)("label", Object.assign({ htmlFor: id }, { children: [(0, jsx_runtime_1.jsx)("span", Object.assign({ className: cx('label'), "data-testid": 'checkbox-field:label' }, { children: label })), info && (0, jsx_runtime_1.jsx)("span", Object.assign({ className: cx('info') }, { children: info }))] }))] })));
|
|
62
34
|
});
|
package/chips/index.d.ts
CHANGED
package/chips/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.Chips = void 0;
|
|
41
|
-
const
|
|
18
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
19
|
+
const react_1 = require("react");
|
|
42
20
|
const item_1 = require("./item");
|
|
43
21
|
const bind_1 = __importDefault(require("classnames/bind"));
|
|
44
22
|
const chips_module_scss_1 = __importDefault(require("./chips.module.scss"));
|
|
@@ -50,7 +28,7 @@ const cx = bind_1.default.bind(chips_module_scss_1.default);
|
|
|
50
28
|
*/
|
|
51
29
|
const Chips = (_a) => {
|
|
52
30
|
var { children, className, 'data-testid': testId = 'chips' } = _a, restProps = __rest(_a, ["children", "className", 'data-testid']);
|
|
53
|
-
return (
|
|
31
|
+
return ((0, jsx_runtime_1.jsx)("div", Object.assign({}, restProps, { className: cx('list', className), "data-testid": testId }, { children: react_1.Children.toArray(children).filter(c => (0, react_1.isValidElement)(c) && c.type === item_1.ChipsItem) })));
|
|
54
32
|
};
|
|
55
33
|
exports.Chips = Chips;
|
|
56
34
|
exports.Chips.Item = item_1.ChipsItem;
|
package/chips/item.d.ts
CHANGED
package/chips/item.js
CHANGED
|
@@ -4,9 +4,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.ChipsItem = void 0;
|
|
7
|
-
const
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
8
|
const bind_1 = __importDefault(require("classnames/bind"));
|
|
9
|
-
const
|
|
9
|
+
const Cross_1 = __importDefault(require("@sima-land/ui-quarks/icons/16x16/Stroked/Cross"));
|
|
10
10
|
const chips_module_scss_1 = __importDefault(require("./chips.module.scss"));
|
|
11
11
|
const cx = bind_1.default.bind(chips_module_scss_1.default);
|
|
12
12
|
/**
|
|
@@ -14,7 +14,5 @@ const cx = bind_1.default.bind(chips_module_scss_1.default);
|
|
|
14
14
|
* @param props Свойства.
|
|
15
15
|
* @return Элемент.
|
|
16
16
|
*/
|
|
17
|
-
const ChipsItem = ({ href, children, withCross, target, onClick, checked, }) => (
|
|
18
|
-
react_1.default.createElement("span", { className: chips_module_scss_1.default.text }, children),
|
|
19
|
-
withCross && react_1.default.createElement(cross_1.default, { className: cx('cross-svg') })));
|
|
17
|
+
const ChipsItem = ({ href, children, withCross, target, onClick, checked, }) => ((0, jsx_runtime_1.jsxs)("a", Object.assign({ href: href, role: href ? undefined : 'button', className: cx('item', { checked }), target: target, onClick: onClick, "data-testid": 'chips:item' }, { children: [(0, jsx_runtime_1.jsx)("span", Object.assign({ className: chips_module_scss_1.default.text }, { children: children })), withCross && (0, jsx_runtime_1.jsx)(Cross_1.default, { className: cx('cross-svg') })] })));
|
|
20
18
|
exports.ChipsItem = ChipsItem;
|
package/clean-buttons/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.Clean = exports.CleanButton = exports.CleanGroup = void 0;
|
|
41
|
-
const
|
|
18
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
19
|
+
const react_1 = require("react");
|
|
42
20
|
const link_1 = require("../link");
|
|
43
21
|
const utils_1 = require("./utils");
|
|
44
22
|
const bind_1 = __importDefault(require("classnames/bind"));
|
|
@@ -53,9 +31,9 @@ function CleanGroup({ size: sizeFromProps, children }) {
|
|
|
53
31
|
const sizeFromContext = (0, react_1.useContext)(utils_1.CleanGroupSizeContext);
|
|
54
32
|
// значение из пропсов имеет приоритет
|
|
55
33
|
const size = sizeFromProps || sizeFromContext;
|
|
56
|
-
return (
|
|
57
|
-
|
|
58
|
-
|
|
34
|
+
return ((0, jsx_runtime_1.jsx)("div", Object.assign({ className: cx('group') }, { children: react_1.Children.toArray(children).map(item => (0, react_1.isValidElement)(item) && item.type === CleanButton
|
|
35
|
+
? (0, react_1.cloneElement)(item, { size })
|
|
36
|
+
: null) })));
|
|
59
37
|
}
|
|
60
38
|
exports.CleanGroup = CleanGroup;
|
|
61
39
|
/**
|
|
@@ -65,7 +43,7 @@ exports.CleanGroup = CleanGroup;
|
|
|
65
43
|
*/
|
|
66
44
|
function CleanButton(_a) {
|
|
67
45
|
var { size = 's', href, asLink = Boolean(href), 'data-testid': testId = 'clean-button', children, className } = _a, rest = __rest(_a, ["size", "href", "asLink", 'data-testid', "children", "className"]);
|
|
68
|
-
return (
|
|
46
|
+
return ((0, jsx_runtime_1.jsx)(link_1.Link, Object.assign({}, rest, { className: cx('button', `size-${size}`, className), pseudo: !asLink, href: href, "data-testid": testId }, { children: children })));
|
|
69
47
|
}
|
|
70
48
|
exports.CleanButton = CleanButton;
|
|
71
49
|
/**
|
package/dot-nav/index.d.ts
CHANGED
|
@@ -15,4 +15,4 @@ export interface DotNavProps {
|
|
|
15
15
|
* @param props Свойства.
|
|
16
16
|
* @return Элемент.
|
|
17
17
|
*/
|
|
18
|
-
export declare
|
|
18
|
+
export declare function DotNav({ size, current, total, onSelect }: DotNavProps): JSX.Element;
|
package/dot-nav/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.DotNav = void 0;
|
|
30
|
-
const
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const react_1 = require("react");
|
|
31
9
|
const lodash_1 = require("lodash");
|
|
32
10
|
const bind_1 = __importDefault(require("classnames/bind"));
|
|
33
11
|
const dot_nav_module_scss_1 = __importDefault(require("./dot-nav.module.scss"));
|
|
@@ -37,7 +15,7 @@ const cx = bind_1.default.bind(dot_nav_module_scss_1.default);
|
|
|
37
15
|
* @param props Свойства.
|
|
38
16
|
* @return Элемент.
|
|
39
17
|
*/
|
|
40
|
-
|
|
18
|
+
function DotNav({ size = 's', current = 0, total = 1, onSelect }) {
|
|
41
19
|
const withShift = total > 4;
|
|
42
20
|
const itemSize = 14;
|
|
43
21
|
const itemGutter = { s: 0, l: 6 }[size];
|
|
@@ -45,13 +23,13 @@ const DotNav = ({ size = 's', current = 0, total = 1, onSelect }) => {
|
|
|
45
23
|
const totalWidth = itemSize * total + itemGutter * (total - 1);
|
|
46
24
|
const shift = useShift(current, total);
|
|
47
25
|
const correction = withShift ? itemSize + itemGutter : (maxWidth - totalWidth) / 2;
|
|
48
|
-
return (
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
}
|
|
26
|
+
return ((0, jsx_runtime_1.jsx)("div", Object.assign({ className: cx('root', `size-${size}`), style: { width: maxWidth, height: itemSize } }, { children: (0, lodash_1.times)(total).map(index => {
|
|
27
|
+
const position = index - shift + 1;
|
|
28
|
+
return ((0, jsx_runtime_1.jsx)("div", { style: {
|
|
29
|
+
left: `${correction + (index - shift) * (itemSize + itemGutter)}px`,
|
|
30
|
+
}, onClick: () => onSelect === null || onSelect === void 0 ? void 0 : onSelect(index), className: cx('item', index === current && 'active', withShift && (position <= 0 || position >= 4) && 'distant') }, index));
|
|
31
|
+
}) })));
|
|
32
|
+
}
|
|
55
33
|
exports.DotNav = DotNav;
|
|
56
34
|
/**
|
|
57
35
|
* Определяет необходимое для точек навигации смещение.
|
|
@@ -59,7 +37,7 @@ exports.DotNav = DotNav;
|
|
|
59
37
|
* @param total Количество точек.
|
|
60
38
|
* @return Смещение.
|
|
61
39
|
*/
|
|
62
|
-
|
|
40
|
+
function useShift(current, total) {
|
|
63
41
|
const shiftRef = (0, react_1.useRef)(0);
|
|
64
42
|
const prevCurrentRef = (0, react_1.useRef)(0);
|
|
65
43
|
if (total > 4) {
|
|
@@ -79,4 +57,4 @@ const useShift = (current, total) => {
|
|
|
79
57
|
}
|
|
80
58
|
prevCurrentRef.current = current;
|
|
81
59
|
return shiftRef.current;
|
|
82
|
-
}
|
|
60
|
+
}
|
package/dropdown/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
2
|
import { CustomScrollbarProps } from '../_internal/custom-scrollbar';
|
|
3
3
|
interface DropdownStyle extends React.CSSProperties {
|
|
4
4
|
'--dropdown-max-height'?: string;
|
|
@@ -14,5 +14,5 @@ export interface DropdownProps extends Omit<React.HTMLAttributes<HTMLDivElement>
|
|
|
14
14
|
/**
|
|
15
15
|
* Компонент выпадающего блока с контентом, например списком.
|
|
16
16
|
*/
|
|
17
|
-
export declare const Dropdown:
|
|
17
|
+
export declare const Dropdown: import("react").ForwardRefExoticComponent<DropdownProps & import("react").RefAttributes<HTMLDivElement | null>>;
|
|
18
18
|
export {};
|
package/dropdown/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.Dropdown = 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 custom_scrollbar_1 = require("../_internal/custom-scrollbar");
|
|
@@ -50,6 +28,5 @@ const cx = bind_1.default.bind(dropdown_module_scss_1.default);
|
|
|
50
28
|
*/
|
|
51
29
|
exports.Dropdown = (0, react_1.forwardRef)(function Dropdown(_a, ref) {
|
|
52
30
|
var { className, children, 'data-testid': testId = 'dropdown', customScrollbarProps } = _a, restProps = __rest(_a, ["className", "children", 'data-testid', "customScrollbarProps"]);
|
|
53
|
-
return (
|
|
54
|
-
react_1.default.createElement(custom_scrollbar_1.CustomScrollbar, Object.assign({}, customScrollbarProps, { className: cx('inner'), overflow: { x: 'h', y: 's' } }), children)));
|
|
31
|
+
return ((0, jsx_runtime_1.jsx)("div", Object.assign({ ref: ref, className: cx('root', className, shadows_1.BoxShadow.z4, shapes_1.MediumRounds.all) }, restProps, { "data-testid": testId }, { children: (0, jsx_runtime_1.jsx)(custom_scrollbar_1.CustomScrollbar, Object.assign({}, customScrollbarProps, { className: cx('inner'), overflow: { x: 'h', y: 's' } }, { children: children })) })));
|
|
55
32
|
});
|
package/dropdown-item/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { ComponentType, ReactNode, SVGAttributes } from 'react';
|
|
2
2
|
export type DropdownItemSize = 's' | 'm' | 'l' | 'xl';
|
|
3
3
|
export interface DropdownItemProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'size'> {
|
|
4
4
|
/** Отображать элемент как отмеченный (активный) или нет. */
|
package/dropdown-item/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.DropdownItem = 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 dropdown_item_module_scss_1 = __importDefault(require("./dropdown-item.module.scss"));
|
|
21
21
|
const cx = bind_1.default.bind(dropdown_item_module_scss_1.default);
|
|
@@ -26,14 +26,9 @@ const cx = bind_1.default.bind(dropdown_item_module_scss_1.default);
|
|
|
26
26
|
*/
|
|
27
27
|
function DropdownItem(_a) {
|
|
28
28
|
var { size = 'm', children, className, selected, disabled, noHover, checked, startContent, startIcon: StartIcon, endContent, endIcon: EndIcon, comment, dangerouslySetInnerHTML, 'data-testid': testId = 'dropdown-item' } = _a, restProps = __rest(_a, ["size", "children", "className", "selected", "disabled", "noHover", "checked", "startContent", "startIcon", "endContent", "endIcon", "comment", "dangerouslySetInnerHTML", 'data-testid']);
|
|
29
|
-
const start = StartIcon ?
|
|
30
|
-
const end = EndIcon ?
|
|
29
|
+
const start = StartIcon ? (0, jsx_runtime_1.jsx)(StartIcon, { className: cx('icon') }) : startContent;
|
|
30
|
+
const end = EndIcon ? (0, jsx_runtime_1.jsx)(EndIcon, { className: cx('icon') }) : endContent;
|
|
31
31
|
const hasChildren = [start, children, end].some(item => typeof item !== 'undefined');
|
|
32
|
-
return (
|
|
33
|
-
start && react_1.default.createElement("div", { className: cx('col', 'col-start') }, start),
|
|
34
|
-
react_1.default.createElement("div", { className: cx('col', 'col-center') },
|
|
35
|
-
react_1.default.createElement("div", { className: cx('row-main') }, children),
|
|
36
|
-
size === 'xl' && comment && react_1.default.createElement("div", { className: cx('row-comment') }, comment)),
|
|
37
|
-
end && react_1.default.createElement("div", { className: cx('col', 'col-end') }, end))) : undefined));
|
|
32
|
+
return ((0, jsx_runtime_1.jsx)("div", Object.assign({}, restProps, { className: cx('root', `size-${size}`, selected && 'selected', checked && 'checked', disabled && 'disabled', noHover && 'no-hover', className), dangerouslySetInnerHTML: dangerouslySetInnerHTML, "data-testid": testId }, { children: hasChildren ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [start && (0, jsx_runtime_1.jsx)("div", Object.assign({ className: cx('col', 'col-start') }, { children: start })), (0, jsx_runtime_1.jsxs)("div", Object.assign({ className: cx('col', 'col-center') }, { children: [(0, jsx_runtime_1.jsx)("div", Object.assign({ className: cx('row-main') }, { children: children })), size === 'xl' && comment && (0, jsx_runtime_1.jsx)("div", Object.assign({ className: cx('row-comment') }, { children: comment }))] })), end && (0, jsx_runtime_1.jsx)("div", Object.assign({ className: cx('col', 'col-end') }, { children: end }))] })) : undefined })));
|
|
38
33
|
}
|
|
39
34
|
exports.DropdownItem = DropdownItem;
|
package/expandable/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { ReactNode, MouseEventHandler, CSSProperties } from 'react';
|
|
2
2
|
export interface ExpandableGroupProps {
|
|
3
3
|
/** Расстояние между элементами группы в пикселях. */
|
|
4
4
|
gap?: number;
|
|
@@ -38,5 +38,5 @@ export interface GroupItemProps {
|
|
|
38
38
|
export declare function ExpandableGroup({ gap, itemHeight, lineLimit, defaultExpanded, children, onExpand, opener, className, style, expanded: expandedProp, openerWidth, }: ExpandableGroupProps): JSX.Element;
|
|
39
39
|
export declare const Expandable: {
|
|
40
40
|
readonly Group: typeof ExpandableGroup;
|
|
41
|
-
readonly Item:
|
|
41
|
+
readonly Item: import("react").ForwardRefExoticComponent<GroupItemProps & import("react").RefAttributes<HTMLLIElement>>;
|
|
42
42
|
};
|