@sima-land/moleculas 16.0.0-alpha.10 → 16.0.0-alpha.11
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/common/components/pagination-controls/index.d.ts +1 -1
- package/common/components/pagination-controls/index.js +1 -2
- package/common/components/pagination-controls/index.js.map +1 -1
- package/common/components/pagination-controls/pagination-controls.d.ts +0 -7
- package/common/components/pagination-controls/pagination-controls.js +4 -14
- package/common/components/pagination-controls/pagination-controls.js.map +1 -1
- package/common/components/pagination-controls/pagination-controls.module.scss +39 -3
- package/common/components/pagination-controls/types.d.ts +1 -1
- package/package.json +1 -1
- package/common/components/intractive-image/index.d.ts +0 -6
- package/common/components/intractive-image/index.js +0 -7
- package/common/components/intractive-image/index.js.map +0 -1
- package/common/components/intractive-image/interactive-image-util.scss +0 -10
- package/common/components/intractive-image/interactive-image.d.ts +0 -17
- package/common/components/intractive-image/interactive-image.js +0 -58
- package/common/components/intractive-image/interactive-image.js.map +0 -1
- package/common/components/intractive-image/interactive-image.module.scss +0 -47
- package/common/components/intractive-image/types.d.ts +0 -27
- package/common/components/intractive-image/types.js +0 -3
- package/common/components/intractive-image/types.js.map +0 -1
- package/desktop/components/modifiers/button/index.d.ts +0 -22
- package/desktop/components/modifiers/button/index.js +0 -21
- package/desktop/components/modifiers/button/index.js.map +0 -1
- package/desktop/components/modifiers/button/modifier-button.module.scss +0 -85
- package/desktop/components/modifiers/group/index.d.ts +0 -15
- package/desktop/components/modifiers/group/index.js +0 -46
- package/desktop/components/modifiers/group/index.js.map +0 -1
- package/desktop/components/modifiers/group/modifiers-group.module.scss +0 -33
- package/desktop/components/modifiers/group/utils.d.ts +0 -20
- package/desktop/components/modifiers/group/utils.js +0 -74
- package/desktop/components/modifiers/group/utils.js.map +0 -1
- package/desktop/components/modifiers/modifiers.scss +0 -8
- package/mobile/components/modifiers-list/index.d.ts +0 -22
- package/mobile/components/modifiers-list/index.js +0 -23
- package/mobile/components/modifiers-list/index.js.map +0 -1
- package/mobile/components/modifiers-list/modifier-item/index.d.ts +0 -28
- package/mobile/components/modifiers-list/modifier-item/index.js +0 -24
- package/mobile/components/modifiers-list/modifier-item/index.js.map +0 -1
- package/mobile/components/modifiers-list/modifier-item/modifier-item.module.scss +0 -70
- package/mobile/components/modifiers-list/modifiers-list.module.scss +0 -21
- package/mobile/components/pseudo-input/index.d.ts +0 -11
- package/mobile/components/pseudo-input/index.js +0 -19
- package/mobile/components/pseudo-input/index.js.map +0 -1
- package/mobile/components/pseudo-input/pseudo-input.module.scss +0 -24
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export type { PaginationData, PaginationControlsProps } from './types';
|
|
2
|
-
export { PaginationControls, PageButtons, PageForm,
|
|
2
|
+
export { PaginationControls, PageButtons, PageForm, PageFormInput } from './pagination-controls';
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PageFormInput = exports.
|
|
3
|
+
exports.PageFormInput = exports.PageForm = exports.PageButtons = exports.PaginationControls = void 0;
|
|
4
4
|
var pagination_controls_1 = require("./pagination-controls");
|
|
5
5
|
Object.defineProperty(exports, "PaginationControls", { enumerable: true, get: function () { return pagination_controls_1.PaginationControls; } });
|
|
6
6
|
Object.defineProperty(exports, "PageButtons", { enumerable: true, get: function () { return pagination_controls_1.PageButtons; } });
|
|
7
7
|
Object.defineProperty(exports, "PageForm", { enumerable: true, get: function () { return pagination_controls_1.PageForm; } });
|
|
8
|
-
Object.defineProperty(exports, "PageFormSubmit", { enumerable: true, get: function () { return pagination_controls_1.PageFormSubmit; } });
|
|
9
8
|
Object.defineProperty(exports, "PageFormInput", { enumerable: true, get: function () { return pagination_controls_1.PageFormInput; } });
|
|
10
9
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/common/components/pagination-controls/index.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/common/components/pagination-controls/index.ts"],"names":[],"mappings":";;;AACA,6DAAiG;AAAxF,yHAAA,kBAAkB,OAAA;AAAE,kHAAA,WAAW,OAAA;AAAE,+GAAA,QAAQ,OAAA;AAAE,oHAAA,aAAa,OAAA"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { PaginationControlsProps } from './types';
|
|
2
2
|
import { InputProps } from '@sima-land/ui-nucleons/input';
|
|
3
|
-
import { TextButtonProps } from '@sima-land/ui-nucleons/text-button';
|
|
4
3
|
/**
|
|
5
4
|
* Блок управления пагинацией.
|
|
6
5
|
* @param props Свойства.
|
|
@@ -23,12 +22,6 @@ export declare function PageButtons({ total, current, onPageChange, }: {
|
|
|
23
22
|
* @return Элемент.
|
|
24
23
|
*/
|
|
25
24
|
export declare function PageForm({ total, onPageChange }: any): import("react/jsx-runtime").JSX.Element;
|
|
26
|
-
/**
|
|
27
|
-
* Кнопка отправки формы страницы. Только стилизует TextButton.
|
|
28
|
-
* @param props Свойства.
|
|
29
|
-
* @return Элемент.
|
|
30
|
-
*/
|
|
31
|
-
export declare function PageFormSubmit({ className, ...restProps }: TextButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
32
25
|
/**
|
|
33
26
|
* Поле ввода номера страницы. Только стилизует Input.
|
|
34
27
|
* @param props Свойства.
|
|
@@ -3,13 +3,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.PageFormInput = exports.
|
|
6
|
+
exports.PageFormInput = exports.PageForm = exports.PageButtons = exports.PaginationControls = void 0;
|
|
7
7
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
8
|
const react_1 = require("react");
|
|
9
9
|
const input_1 = require("@sima-land/ui-nucleons/input");
|
|
10
10
|
const pagination_1 = require("@sima-land/ui-nucleons/pagination");
|
|
11
|
-
const
|
|
12
|
-
const Search_1 = __importDefault(require("@sima-land/ui-quarks/icons/24x24/Stroked/Search"));
|
|
11
|
+
const Right_1 = __importDefault(require("@sima-land/ui-quarks/icons/16x16/Stroked/Arrows/Right"));
|
|
13
12
|
const bind_1 = __importDefault(require("classnames/bind"));
|
|
14
13
|
const pagination_controls_module_scss_1 = __importDefault(require("./pagination-controls.module.scss"));
|
|
15
14
|
const cx = bind_1.default.bind(pagination_controls_module_scss_1.default);
|
|
@@ -28,7 +27,7 @@ flow = 'horizontal', Buttons = PageButtons, Form = PageForm, withForm: withFormP
|
|
|
28
27
|
const handlePageChange = (0, react_1.useCallback)((page) => {
|
|
29
28
|
onPageChange === null || onPageChange === void 0 ? void 0 : onPageChange(Math.max(1, Math.min(total, page)));
|
|
30
29
|
}, [onPageChange]);
|
|
31
|
-
return ((0, jsx_runtime_1.jsxs)("div", { className: cx('layout', `flow-${flow}`, className), ...restProps, children: [(0, jsx_runtime_1.jsx)("div", { className: cx('slot-buttons'), children: (0, jsx_runtime_1.jsx)(Buttons, { current: current, total: total, onPageChange: handlePageChange }) }), withForm && ((0, jsx_runtime_1.jsx)("div", { className: cx('slot-form'), children: (0, jsx_runtime_1.jsx)(Form, { current: current, total: total, onPageChange: handlePageChange }) }))] }));
|
|
30
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: cx('layout', flow !== 'unset' && `flow-${flow}`, className), ...restProps, children: [(0, jsx_runtime_1.jsx)("div", { className: cx('slot-buttons'), children: (0, jsx_runtime_1.jsx)(Buttons, { current: current, total: total, onPageChange: handlePageChange }) }), withForm && ((0, jsx_runtime_1.jsx)("div", { className: cx('slot-form'), children: (0, jsx_runtime_1.jsx)(Form, { current: current, total: total, onPageChange: handlePageChange }) }))] }));
|
|
32
31
|
}
|
|
33
32
|
exports.PaginationControls = PaginationControls;
|
|
34
33
|
/**
|
|
@@ -58,18 +57,9 @@ function PageForm({ total, onPageChange }) {
|
|
|
58
57
|
const handleChange = (0, react_1.useCallback)(event => {
|
|
59
58
|
setValue(event.target.value.replace(/\D/g, ''));
|
|
60
59
|
}, []);
|
|
61
|
-
return ((0, jsx_runtime_1.jsxs)("form", { onSubmit: handleSubmit, className: cx('form'), children: [(0, jsx_runtime_1.jsx)(
|
|
60
|
+
return ((0, jsx_runtime_1.jsxs)("form", { onSubmit: handleSubmit, className: cx('form'), children: [(0, jsx_runtime_1.jsx)("span", { className: cx('label'), children: "\u041A \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u0435" }), (0, jsx_runtime_1.jsx)(PageFormInput, { value: value, onChange: handleChange, adornmentEnd: (0, jsx_runtime_1.jsx)("button", { disabled: value.length === 0, type: 'submit', className: cx('submit'), onMouseDown: event => event.preventDefault(), children: (0, jsx_runtime_1.jsx)(Right_1.default, { fill: 'currentColor' }) }) })] }));
|
|
62
61
|
}
|
|
63
62
|
exports.PageForm = PageForm;
|
|
64
|
-
/**
|
|
65
|
-
* Кнопка отправки формы страницы. Только стилизует TextButton.
|
|
66
|
-
* @param props Свойства.
|
|
67
|
-
* @return Элемент.
|
|
68
|
-
*/
|
|
69
|
-
function PageFormSubmit({ className, ...restProps }) {
|
|
70
|
-
return ((0, jsx_runtime_1.jsx)(text_button_1.TextButton, { size: 's', color: 'basic-gray87', children: '\u041F\u0435\u0440\u0435\u0439\u0442\u0438 \u043D\u0430 \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u0443', ...restProps, className: cx('submit', className) }));
|
|
71
|
-
}
|
|
72
|
-
exports.PageFormSubmit = PageFormSubmit;
|
|
73
63
|
/**
|
|
74
64
|
* Поле ввода номера страницы. Только стилизует Input.
|
|
75
65
|
* @param props Свойства.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pagination-controls.js","sourceRoot":"","sources":["../../../../src/common/components/pagination-controls/pagination-controls.tsx"],"names":[],"mappings":";;;;;;;AAAA,iCAA6F;AAE7F,wDAAiE;AACjE,kEAAwF;AACxF,
|
|
1
|
+
{"version":3,"file":"pagination-controls.js","sourceRoot":"","sources":["../../../../src/common/components/pagination-controls/pagination-controls.tsx"],"names":[],"mappings":";;;;;;;AAAA,iCAA6F;AAE7F,wDAAiE;AACjE,kEAAwF;AACxF,kGAA6E;AAC7E,2DAAyC;AACzC,wGAAuD;AAEvD,MAAM,EAAE,GAAG,cAAU,CAAC,IAAI,CAAC,yCAAM,CAAC,CAAC;AAEnC;;;;GAIG;AACH,SAAgB,kBAAkB,CAAC;AACjC,aAAa;AACb,OAAO,EAAE,WAAW,EACpB,KAAK,EAAE,SAAS,EAChB,YAAY;AAEZ,aAAa;AACb,IAAI,GAAG,YAAY,EACnB,OAAO,GAAG,WAAW,EACrB,IAAI,GAAG,QAAQ,EACf,QAAQ,EAAE,YAAY,EACtB,SAAS,EACT,GAAG,SAAS,EACY;IACxB,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,IAAA,eAAO,EAChC,GAAG,EAAE,CAAC,IAAA,oCAAuB,EAAC,EAAE,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,EACzE,CAAC,WAAW,EAAE,SAAS,CAAC,CACzB,CAAC;IACF,MAAM,QAAQ,GAAG,YAAY,aAAZ,YAAY,cAAZ,YAAY,GAAI,KAAK,IAAI,CAAC,CAAC;IAE5C,MAAM,gBAAgB,GAAG,IAAA,mBAAW,EAClC,CAAC,IAAY,EAAE,EAAE;QACf,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC;IACrD,CAAC,EACD,CAAC,YAAY,CAAC,CACf,CAAC;IAEF,OAAO,CACL,iCAAK,SAAS,EAAE,EAAE,CAAC,QAAQ,EAAE,IAAI,KAAK,OAAO,IAAI,QAAQ,IAAI,EAAE,EAAE,SAAS,CAA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C7B,CAAC;IAEF,MAAM,YAAY,GAAG,IAAA,mBAAW,EAAuC,KAAK,CAAC,EAAE;QAC7E,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,CAAC;IAClD,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,CACL,kCAAM,QAAQ,EAAE,YAAY,EAAE,SAAS,EAAE,EAAE,CAAC,MAAM,CAAC,aACjD,iCAAM,SAAS,EAAE,EAAE,CAAC,OAAO,CAAC,wEAAmB,EAC/C,uBAAC,aAAa,IACZ,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,YAAY,EACtB,YAAY,EACV,mCACE,QAAQ,EAAE,KAAK,CAAC,MAAM,KAAK,CAAC,EAC5B,IAAI,EAAC,QAAQ,EACb,SAAS,EAAE,EAAE,CAAC,QAAQ,CAAC,EACvB,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,cAAc,EAAE,YAE5C,uBAAC,eAAQ,IAAC,IAAI,EAAC,cAAc,GAAG,GACzB,GAEX,IACG,CACR,CAAC;AACJ,CAAC;AAxCD,4BAwCC;AAED;;;;GAIG;AACH,SAAgB,aAAa,CAAC,EAAE,SAAS,EAAE,GAAG,SAAS,EAAc;IACnE,OAAO,uBAAC,aAAK,IAAC,IAAI,EAAC,GAAG,KAAK,SAAS,EAAE,SAAS,EAAE,EAAE,CAAC,OAAO,EAAE,SAAS,CAAC,GAAI,CAAC;AAC9E,CAAC;AAFD,sCAEC"}
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
@use 'node_modules/@sima-land/ui-nucleons/colors';
|
|
2
|
+
@use 'node_modules/@sima-land/ui-nucleons/utils';
|
|
3
|
+
|
|
1
4
|
.layout {
|
|
2
5
|
display: flex;
|
|
3
6
|
&.flow-vertical {
|
|
@@ -24,11 +27,44 @@
|
|
|
24
27
|
display: flex;
|
|
25
28
|
align-items: center;
|
|
26
29
|
justify-content: center;
|
|
27
|
-
.
|
|
28
|
-
margin-left:
|
|
30
|
+
.label + .input {
|
|
31
|
+
margin-left: 8px;
|
|
29
32
|
}
|
|
30
33
|
}
|
|
31
34
|
|
|
35
|
+
.label {
|
|
36
|
+
white-space: nowrap;
|
|
37
|
+
font-size: 16px;
|
|
38
|
+
line-height: 24px;
|
|
39
|
+
color: colors.$basic-gray38;
|
|
40
|
+
}
|
|
41
|
+
|
|
32
42
|
.input {
|
|
33
|
-
width:
|
|
43
|
+
width: 100px;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.input .submit {
|
|
47
|
+
margin: -4px -8px;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.submit {
|
|
51
|
+
@include utils.reset-button;
|
|
52
|
+
width: 32px;
|
|
53
|
+
height: 32px;
|
|
54
|
+
display: flex;
|
|
55
|
+
align-items: center;
|
|
56
|
+
justify-content: center;
|
|
57
|
+
background: colors.$basic-gray87;
|
|
58
|
+
color: #fff;
|
|
59
|
+
border-radius: 4px;
|
|
60
|
+
&:hover {
|
|
61
|
+
cursor: pointer;
|
|
62
|
+
}
|
|
63
|
+
&:disabled {
|
|
64
|
+
background: colors.$basic-gray8;
|
|
65
|
+
color: colors.$basic-gray24;
|
|
66
|
+
}
|
|
67
|
+
&:focus-visible {
|
|
68
|
+
@include utils.focus-visible-style;
|
|
69
|
+
}
|
|
34
70
|
}
|
|
@@ -5,7 +5,7 @@ export interface PaginationData {
|
|
|
5
5
|
onPageChange: (page: number) => void;
|
|
6
6
|
}
|
|
7
7
|
export interface PaginationControlsProps extends Partial<PaginationData>, HTMLAttributes<HTMLDivElement> {
|
|
8
|
-
flow?: 'horizontal' | 'vertical';
|
|
8
|
+
flow?: 'horizontal' | 'vertical' | 'unset';
|
|
9
9
|
withForm?: boolean;
|
|
10
10
|
Buttons?: ComponentType<{
|
|
11
11
|
total: number;
|
package/package.json
CHANGED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { InteractiveImageStyle, InteractiveImageProps, InteractiveImageImageProps, InteractiveImagePointProps } from './types';
|
|
2
|
-
import { InteractiveImage, Parts } from './interactive-image';
|
|
3
|
-
/** @deprecated */
|
|
4
|
-
export type { InteractiveImageStyle, InteractiveImageProps, InteractiveImageImageProps, InteractiveImagePointProps, };
|
|
5
|
-
/** @deprecated */
|
|
6
|
-
export { InteractiveImage, Parts };
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Parts = exports.InteractiveImage = void 0;
|
|
4
|
-
const interactive_image_1 = require("./interactive-image");
|
|
5
|
-
Object.defineProperty(exports, "InteractiveImage", { enumerable: true, get: function () { return interactive_image_1.InteractiveImage; } });
|
|
6
|
-
Object.defineProperty(exports, "Parts", { enumerable: true, get: function () { return interactive_image_1.Parts; } });
|
|
7
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/common/components/intractive-image/index.ts"],"names":[],"mappings":";;;AAMA,2DAA8D;AAWrD,iGAXA,oCAAgB,OAWA;AAAE,sFAXA,yBAAK,OAWA"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { AnchorHTMLAttributes } from 'react';
|
|
2
|
-
import { InteractiveImageProps, InteractiveImageImageProps, InteractiveImagePointProps } from './types';
|
|
3
|
-
/** @deprecated */
|
|
4
|
-
export declare const InteractiveImage: import("react").ForwardRefExoticComponent<InteractiveImageProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
5
|
-
/**
|
|
6
|
-
* Обертка-ссылка для картинки.
|
|
7
|
-
* @param props Свойства.
|
|
8
|
-
* @return Элемент.
|
|
9
|
-
*/
|
|
10
|
-
declare function ImageAnchor({ children, className, ...rest }: AnchorHTMLAttributes<HTMLAnchorElement>): import("react/jsx-runtime").JSX.Element;
|
|
11
|
-
/** @deprecated */
|
|
12
|
-
export declare const Parts: {
|
|
13
|
-
readonly ImageAnchor: typeof ImageAnchor;
|
|
14
|
-
readonly Image: import("react").ForwardRefExoticComponent<InteractiveImageImageProps & import("react").RefAttributes<HTMLImageElement>>;
|
|
15
|
-
readonly Point: import("react").ForwardRefExoticComponent<InteractiveImagePointProps & import("react").RefAttributes<HTMLAnchorElement>>;
|
|
16
|
-
};
|
|
17
|
-
export {};
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.Parts = exports.InteractiveImage = void 0;
|
|
7
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
-
const react_1 = require("react");
|
|
9
|
-
const bind_1 = __importDefault(require("classnames/bind"));
|
|
10
|
-
const interactive_image_module_scss_1 = __importDefault(require("./interactive-image.module.scss"));
|
|
11
|
-
const cx = bind_1.default.bind(interactive_image_module_scss_1.default);
|
|
12
|
-
/** @deprecated */
|
|
13
|
-
exports.InteractiveImage = (0, react_1.forwardRef)(({ children, 'data-testid': testId, className, dotSize, ...rest }, ref) => {
|
|
14
|
-
const rootClassName = cx('root', {
|
|
15
|
-
'dot-size-unset': dotSize === 'unset',
|
|
16
|
-
}, className);
|
|
17
|
-
validateChildren(children);
|
|
18
|
-
return ((0, jsx_runtime_1.jsx)("div", { ref: ref, className: rootClassName, ...rest, "data-testid": testId, children: react_1.Children.toArray(children).filter(child => (0, react_1.isValidElement)(child) &&
|
|
19
|
-
(child.type === ImageAnchor || child.type === Image || child.type === Point)) }));
|
|
20
|
-
});
|
|
21
|
-
/**
|
|
22
|
-
* Проверка валидности содержимого, переданного в InteractiveImage.
|
|
23
|
-
* @param children Содержимое.
|
|
24
|
-
*/
|
|
25
|
-
function validateChildren(children) {
|
|
26
|
-
let counter = 0;
|
|
27
|
-
for (const child of react_1.Children.toArray(children)) {
|
|
28
|
-
if ((0, react_1.isValidElement)(child) && (child.type === ImageAnchor || child.type === Image)) {
|
|
29
|
-
counter++;
|
|
30
|
-
}
|
|
31
|
-
if (counter > 1) {
|
|
32
|
-
throw new Error('[InteractiveImage] Either Image or ImageAnchor allowed. Not both.');
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* Обертка-ссылка для картинки.
|
|
38
|
-
* @param props Свойства.
|
|
39
|
-
* @return Элемент.
|
|
40
|
-
*/
|
|
41
|
-
function ImageAnchor({ children, className, ...rest }) {
|
|
42
|
-
return ((0, jsx_runtime_1.jsx)("a", { ...rest, className: cx('image-anchor', className), "data-testid": 'interactive-image:image-anchor', children: react_1.Children.toArray(children).filter(child => (0, react_1.isValidElement)(child) && child.type === Image) }));
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* Изображение на котором будут располагаться точки.
|
|
46
|
-
* @param props Свойства.
|
|
47
|
-
* @return Элемент.
|
|
48
|
-
*/
|
|
49
|
-
const Image = (0, react_1.forwardRef)(({ className, 'data-testid': testId = 'interactive-image:image', ...rest }, ref) => ((0, jsx_runtime_1.jsx)("img", { ref: ref, className: cx('image', className), "data-testid": testId, ...rest })));
|
|
50
|
-
/**
|
|
51
|
-
* Точка которая будет располагаться на изображении.
|
|
52
|
-
* @param props Свойства.
|
|
53
|
-
* @return Элемент.
|
|
54
|
-
*/
|
|
55
|
-
const Point = (0, react_1.forwardRef)(({ x, y, className, style, 'data-testid': testId = 'interactive-image:point', ...rest }, ref) => ((0, jsx_runtime_1.jsx)("a", { ref: ref, "aria-label": '\u0422\u043E\u0447\u043A\u0430 \u043D\u0430 \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0438', "data-testid": testId, className: cx('point', className), style: { ...style, top: `${y}%`, left: `${x}%` }, ...rest })));
|
|
56
|
-
/** @deprecated */
|
|
57
|
-
exports.Parts = { ImageAnchor, Image, Point };
|
|
58
|
-
//# sourceMappingURL=interactive-image.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"interactive-image.js","sourceRoot":"","sources":["../../../../src/common/components/intractive-image/interactive-image.tsx"],"names":[],"mappings":";;;;;;;AAAA,iCAA8F;AAM9F,2DAAyC;AACzC,oGAAqD;AAErD,MAAM,EAAE,GAAG,cAAU,CAAC,IAAI,CAAC,uCAAM,CAAC,CAAC;AAEnC,kBAAkB;AACL,QAAA,gBAAgB,GAAG,IAAA,kBAAU,EACxC,CAAC,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,GAAG,IAAI,EAAE,EAAE,GAAG,EAAE,EAAE;IACxE,MAAM,aAAa,GAAG,EAAE,CACtB,MAAM,EACN;QACE,gBAAgB,EAAE,OAAO,KAAK,OAAO;KACtC,EACD,SAAS,CACV,CAAC;IAEF,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IAE3B,OAAO,CACL,gCAAK,GAAG,EAAE,GAAG,EAAE,SAAS,EAAE,aAAa,KAAM,IAAI,iBAAe,MAAM,YACnE,gBAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,MAAM,CAChC,KAAK,CAAC,EAAE,CACN,IAAA,sBAAc,EAAC,KAAK,CAAC;YACrB,CAAC,KAAK,CAAC,IAAI,KAAK,WAAW,IAAI,KAAK,CAAC,IAAI,KAAK,KAAK,IAAI,KAAK,CAAC,IAAI,KAAK,KAAK,CAAC,CAC/E,GACG,CACP,CAAC;AACJ,CAAC,CACF,CAAC;AAEF;;;GAGG;AACH,SAAS,gBAAgB,CAAC,QAAmB;IAC3C,IAAI,OAAO,GAAG,CAAC,CAAC;IAEhB,KAAK,MAAM,KAAK,IAAI,gBAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE;QAC9C,IAAI,IAAA,sBAAc,EAAC,KAAK,CAAC,IAAI,CAAC,KAA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AAG,KAAK,EAAE,GAAG,EAAE,GAAG,CAAC,GAAG,EAAE,IAAI,EAAE,GAAG,CAAC,GAAG,EAAE,KAC5C,IAAI,GACR,CACH,CACF,CAAC;AAEF,kBAAkB;AACL,QAAA,KAAK,GAAG,EAAE,WAAW,EAAE,KAAK,EAAE,KAAK,EAAW,CAAC"}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
@use 'node_modules/@sima-land/ui-nucleons/colors';
|
|
2
|
-
@use 'node_modules/@sima-land/ui-nucleons/breakpoints';
|
|
3
|
-
@use './interactive-image-util';
|
|
4
|
-
|
|
5
|
-
.root {
|
|
6
|
-
display: inline-block;
|
|
7
|
-
font-size: 0;
|
|
8
|
-
position: relative;
|
|
9
|
-
overflow: hidden;
|
|
10
|
-
background: colors.$basic-gray4;
|
|
11
|
-
&:not(.dot-size-unset) {
|
|
12
|
-
@include interactive-image-util.dot-size-default;
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
.image-anchor,
|
|
17
|
-
.image {
|
|
18
|
-
display: block;
|
|
19
|
-
max-width: 100%;
|
|
20
|
-
max-height: 100%;
|
|
21
|
-
min-width: 100%;
|
|
22
|
-
min-height: 100%;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
.point {
|
|
26
|
-
position: absolute;
|
|
27
|
-
display: flex;
|
|
28
|
-
justify-content: center;
|
|
29
|
-
align-items: center;
|
|
30
|
-
width: var(--dot-size, 32px);
|
|
31
|
-
height: var(--dot-size, 32px);
|
|
32
|
-
background: rgba(colors.$basic-gray87, 0.4);
|
|
33
|
-
border-radius: 50%;
|
|
34
|
-
transform: translate(-50%, -50%);
|
|
35
|
-
&:hover {
|
|
36
|
-
cursor: pointer;
|
|
37
|
-
background: rgba(colors.$basic-gray87, 0.64);
|
|
38
|
-
}
|
|
39
|
-
&::after {
|
|
40
|
-
content: '';
|
|
41
|
-
display: block;
|
|
42
|
-
width: var(--dot-size-core, 12px);
|
|
43
|
-
height: var(--dot-size-core, 12px);
|
|
44
|
-
background: #fff;
|
|
45
|
-
border-radius: 50%;
|
|
46
|
-
}
|
|
47
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import type { HTMLAttributes, AnchorHTMLAttributes, ImgHTMLAttributes, CSSProperties } from 'react';
|
|
2
|
-
/** @deprecated */
|
|
3
|
-
export interface InteractiveImageStyle extends CSSProperties {
|
|
4
|
-
'--dot-size'?: string;
|
|
5
|
-
'--dot-size-core'?: string;
|
|
6
|
-
}
|
|
7
|
-
/** @deprecated */
|
|
8
|
-
export interface InteractiveImageProps extends HTMLAttributes<HTMLDivElement> {
|
|
9
|
-
/** Размер точек. При указании "unset" можно задать css-переменные через className или style. */
|
|
10
|
-
dotSize?: 'unset';
|
|
11
|
-
/** Стили с возможностью указания размера точек через css-переменные. */
|
|
12
|
-
style?: InteractiveImageStyle;
|
|
13
|
-
/** Идентификатор для систем автоматизированного тестирования. */
|
|
14
|
-
'data-testid'?: string;
|
|
15
|
-
}
|
|
16
|
-
/** @deprecated */
|
|
17
|
-
export interface InteractiveImageImageProps extends ImgHTMLAttributes<HTMLImageElement> {
|
|
18
|
-
/** Идентификатор для систем автоматизированного тестирования. */
|
|
19
|
-
'data-testid'?: string;
|
|
20
|
-
}
|
|
21
|
-
/** @deprecated */
|
|
22
|
-
export interface InteractiveImagePointProps extends AnchorHTMLAttributes<HTMLAnchorElement> {
|
|
23
|
-
x: number;
|
|
24
|
-
y: number;
|
|
25
|
-
/** Идентификатор для систем автоматизированного тестирования. */
|
|
26
|
-
'data-testid'?: string;
|
|
27
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/common/components/intractive-image/types.ts"],"names":[],"mappings":""}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { CSSProperties, MouseEventHandler } from 'react';
|
|
2
|
-
import { ModifierType } from '../../../../common/types';
|
|
3
|
-
export interface Modifier {
|
|
4
|
-
count?: number;
|
|
5
|
-
content: string;
|
|
6
|
-
color?: string;
|
|
7
|
-
image?: string;
|
|
8
|
-
type?: ModifierType;
|
|
9
|
-
isMarkdown?: boolean;
|
|
10
|
-
selected?: boolean;
|
|
11
|
-
}
|
|
12
|
-
export interface ModifierButtonProps extends Modifier {
|
|
13
|
-
className?: string;
|
|
14
|
-
style?: CSSProperties;
|
|
15
|
-
onClick?: MouseEventHandler<HTMLDivElement>;
|
|
16
|
-
squared?: boolean;
|
|
17
|
-
'data-testid'?: string;
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* Компонент модификатора.
|
|
21
|
-
*/
|
|
22
|
-
export declare const ModifierButton: import("react").ForwardRefExoticComponent<ModifierButtonProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.ModifierButton = void 0;
|
|
7
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
-
const react_1 = require("react");
|
|
9
|
-
const lodash_1 = require("lodash");
|
|
10
|
-
const modifier_button_module_scss_1 = __importDefault(require("./modifier-button.module.scss"));
|
|
11
|
-
const bind_1 = __importDefault(require("classnames/bind"));
|
|
12
|
-
const constants_1 = require("../../../../common/constants");
|
|
13
|
-
const cx = bind_1.default.bind(modifier_button_module_scss_1.default);
|
|
14
|
-
/**
|
|
15
|
-
* Компонент модификатора.
|
|
16
|
-
*/
|
|
17
|
-
exports.ModifierButton = (0, react_1.forwardRef)(function ModifierButton({ count = null, content, selected, color, image, type = 'text', className, style, onClick, isMarkdown: hasMarkdown, squared = [constants_1.MODIFIER_TYPE.color, constants_1.MODIFIER_TYPE.image].includes(type), 'data-testid': testId = 'modifier-button', }, ref) {
|
|
18
|
-
const hasCount = (0, lodash_1.isNumber)(count) && count >= 0;
|
|
19
|
-
return ((0, jsx_runtime_1.jsxs)("div", { ref: ref, className: cx('modifier-button', squared && 'squared', selected && 'selected', className), style: color ? { ...style, background: color } : style, onClick: onClick, "data-testid": testId, children: [(hasCount || hasMarkdown) && ((0, jsx_runtime_1.jsxs)("span", { className: cx('label', hasCount && 'with-count'), "data-testid": 'modifier-button:badge', children: [hasCount && (count > 99 ? '99+' : count), hasMarkdown && (hasCount ? '(У)' : 'У')] })), [constants_1.MODIFIER_TYPE.text, constants_1.MODIFIER_TYPE.image].includes(type) && ((0, jsx_runtime_1.jsxs)("div", { className: cx('content'), children: [type === constants_1.MODIFIER_TYPE.text && ((0, jsx_runtime_1.jsx)("span", { className: cx('text', !squared && 'guttered'), children: String(content || '') })), type === constants_1.MODIFIER_TYPE.image && (0, jsx_runtime_1.jsx)("img", { src: image, alt: content, className: cx('image') })] }))] }));
|
|
20
|
-
});
|
|
21
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/desktop/components/modifiers/button/index.tsx"],"names":[],"mappings":";;;;;;;AAAA,iCAAqE;AACrE,mCAAkC;AAClC,gGAAoD;AACpD,2DAAyC;AAEzC,4DAAqE;AAoBrE,MAAM,EAAE,GAAG,cAAU,CAAC,IAAI,CAAC,qCAAO,CAAC,CAAC;AAEpC;;GAEG;AACU,QAAA,cAAc,GAAG,IAAA,kBAAU,EACtC,SAAS,cAAc,CACrB,EACE,KAAK,GAAG,IAAI,EACZ,OAAO,EACP,QAAQ,EACR,KAAK,EACL,KAAK,EACL,IAAI,GAAG,MAAM,EACb,SAAS,EACT,KAAK,EACL,OAAO,EACP,UAAU,EAAE,WAAW,EACvB,OAAO,GAAG,CAAC,yBAAI,CAAC,KAAK,EAAE,yBAAI,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,EACjD,aAAa,E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,CACP,IACG,CACP,CAAC;AACJ,CAAC,CACF,CAAC"}
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
@use 'node_modules/@sima-land/ui-nucleons/colors';
|
|
2
|
-
@import 'node_modules/@sima-land/ui-nucleons/styling/shadows.module';
|
|
3
|
-
@import '../modifiers';
|
|
4
|
-
|
|
5
|
-
.modifier-button {
|
|
6
|
-
max-width: 100%;
|
|
7
|
-
position: relative;
|
|
8
|
-
display: inline-block;
|
|
9
|
-
font-size: 0;
|
|
10
|
-
line-height: 0;
|
|
11
|
-
border-radius: 4px;
|
|
12
|
-
min-width: $minSize;
|
|
13
|
-
height: $minSize;
|
|
14
|
-
cursor: pointer;
|
|
15
|
-
&.squared {
|
|
16
|
-
width: $minSize;
|
|
17
|
-
}
|
|
18
|
-
&::before {
|
|
19
|
-
content: '';
|
|
20
|
-
position: absolute;
|
|
21
|
-
top: 0;
|
|
22
|
-
left: 0;
|
|
23
|
-
width: 100%;
|
|
24
|
-
height: 100%;
|
|
25
|
-
border-radius: inherit;
|
|
26
|
-
box-shadow: inset 0 0 0 1px colors.$basic-gray12;
|
|
27
|
-
}
|
|
28
|
-
&:hover::before {
|
|
29
|
-
box-shadow: inset 0 0 0 2px colors.$basic-gray12;
|
|
30
|
-
}
|
|
31
|
-
&.selected::before {
|
|
32
|
-
box-shadow: inset 0 0 0 2px colors.$basic-blue;
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
.content {
|
|
37
|
-
display: flex;
|
|
38
|
-
align-items: center;
|
|
39
|
-
justify-content: center;
|
|
40
|
-
overflow: hidden;
|
|
41
|
-
border-radius: inherit;
|
|
42
|
-
height: 100%;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
.image {
|
|
46
|
-
display: block;
|
|
47
|
-
width: auto;
|
|
48
|
-
height: calc(100% - 2px);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
.text {
|
|
52
|
-
font-size: 14px;
|
|
53
|
-
line-height: 20px;
|
|
54
|
-
text-overflow: ellipsis;
|
|
55
|
-
white-space: nowrap;
|
|
56
|
-
overflow: hidden;
|
|
57
|
-
&.guttered {
|
|
58
|
-
margin: 0 16px;
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
.label {
|
|
63
|
-
position: absolute;
|
|
64
|
-
top: -4px;
|
|
65
|
-
right: -4px;
|
|
66
|
-
display: block;
|
|
67
|
-
min-width: 16px;
|
|
68
|
-
height: 16px;
|
|
69
|
-
text-align: center;
|
|
70
|
-
padding: 0 4px;
|
|
71
|
-
line-height: 16px;
|
|
72
|
-
border-radius: 32px;
|
|
73
|
-
background-color: #fff;
|
|
74
|
-
color: colors.$basic-gray54;
|
|
75
|
-
font-size: 12px;
|
|
76
|
-
font-weight: 600;
|
|
77
|
-
box-sizing: border-box;
|
|
78
|
-
&.with-count {
|
|
79
|
-
background-color: colors.$basic-blue;
|
|
80
|
-
color: #fff;
|
|
81
|
-
}
|
|
82
|
-
&:not(.with-count) {
|
|
83
|
-
@extend .shadow-z1;
|
|
84
|
-
}
|
|
85
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { MouseEventHandler, ReactNode } from 'react';
|
|
2
|
-
export interface ModifiersGroupProps {
|
|
3
|
-
/** Кнопки модификаторов. */
|
|
4
|
-
children?: ReactNode;
|
|
5
|
-
/** Надо ли сразу показывать весь список не ограничивая двумя строками. */
|
|
6
|
-
defaultOpened?: boolean;
|
|
7
|
-
/** Будет вызвана после нажатия на кнопку показа всех модификаторов. */
|
|
8
|
-
onShowAll?: MouseEventHandler<HTMLDivElement>;
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* Блок списка кнопок модификаторов.
|
|
12
|
-
* @param props Свойства.
|
|
13
|
-
* @return Элемент.
|
|
14
|
-
*/
|
|
15
|
-
export declare const ModifiersGroup: ({ children, defaultOpened, onShowAll, }: ModifiersGroupProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.ModifiersGroup = void 0;
|
|
7
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
-
const react_1 = require("react");
|
|
9
|
-
const button_1 = require("../button");
|
|
10
|
-
const utils_1 = require("./utils");
|
|
11
|
-
const bind_1 = __importDefault(require("classnames/bind"));
|
|
12
|
-
const modifiers_group_module_scss_1 = __importDefault(require("./modifiers-group.module.scss"));
|
|
13
|
-
const cx = bind_1.default.bind(modifiers_group_module_scss_1.default);
|
|
14
|
-
/**
|
|
15
|
-
* Блок списка кнопок модификаторов.
|
|
16
|
-
* @param props Свойства.
|
|
17
|
-
* @return Элемент.
|
|
18
|
-
*/
|
|
19
|
-
const ModifiersGroup = ({ children, defaultOpened = false, onShowAll, }) => {
|
|
20
|
-
const [opened, setOpened] = (0, react_1.useState)(defaultOpened);
|
|
21
|
-
const rootRef = (0, react_1.useRef)(null);
|
|
22
|
-
const openerRef = (0, react_1.useRef)(null);
|
|
23
|
-
const showAll = (0, react_1.useCallback)(event => {
|
|
24
|
-
setOpened(true);
|
|
25
|
-
onShowAll === null || onShowAll === void 0 ? void 0 : onShowAll(event);
|
|
26
|
-
}, [onShowAll]);
|
|
27
|
-
const viewState = (0, utils_1.useViewState)(rootRef, openerRef);
|
|
28
|
-
const items = react_1.Children.toArray(children).reduce((result, child, index) => {
|
|
29
|
-
if ((0, react_1.isValidElement)(child) && child.type === button_1.ModifierButton) {
|
|
30
|
-
const needHideItems = viewState.lastVisibleIndex !== -1 && !opened;
|
|
31
|
-
const isDisplayed = !needHideItems || index < viewState.lastVisibleIndex;
|
|
32
|
-
result.push((0, jsx_runtime_1.jsx)(GroupItem, { hidden: !isDisplayed, children: child }, index));
|
|
33
|
-
}
|
|
34
|
-
return result;
|
|
35
|
-
}, []);
|
|
36
|
-
return ((0, jsx_runtime_1.jsxs)("div", { ref: rootRef, className: cx('root', { opened }), children: [items, !opened && ((0, jsx_runtime_1.jsx)(GroupItem, { ref: openerRef, invisible: viewState.lastVisibleIndex === -1, children: (0, jsx_runtime_1.jsx)(OpenButton, { count: items.length - viewState.lastVisibleIndex, onClick: showAll }) }))] }));
|
|
37
|
-
};
|
|
38
|
-
exports.ModifiersGroup = ModifiersGroup;
|
|
39
|
-
const GroupItem = (0, react_1.forwardRef)(({ children, hidden, invisible }, ref) => ((0, jsx_runtime_1.jsx)("div", { ref: ref, className: cx('item', { hidden, invisible }), "data-testid": 'modifier-group:item', children: children })));
|
|
40
|
-
/**
|
|
41
|
-
* Кнопка показа скрытых модификаторов.
|
|
42
|
-
* @param props Свойства.
|
|
43
|
-
* @return Элемент.
|
|
44
|
-
*/
|
|
45
|
-
const OpenButton = ({ count, onClick }) => ((0, jsx_runtime_1.jsx)(button_1.ModifierButton, { squared: true, onClick: onClick, content: `+${count}`, className: cx('opener'), "data-testid": 'modifier-group:show-all-button' }));
|
|
46
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/desktop/components/modifiers/group/index.tsx"],"names":[],"mappings":";;;;;;;AAAA,iCASe;AACf,sCAAgE;AAChE,mCAAuC;AACvC,2DAAyC;AACzC,gGAAmD;AAwBnD,MAAM,EAAE,GAAG,cAAU,CAAC,IAAI,CAAC,qCAAM,CAAC,CAAC;AAEnC;;;;GAIG;AACI,MAAM,cAAc,GAAG,CAAC,EAC7B,QAAQ,EACR,aAAa,GAAG,KAAK,EACrB,SAAS,GACW,EAAE,EAAE;IACxB,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,IAAA,gBAAQ,EAAU,aAAa,CAAC,CAAC;IAC7D,MAAM,OAAO,GAAG,IAAA,cAAM,EA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SAAS,CAAC,gBAAgB,EAAE,OAAO,EAAE,OAAO,GAAI,GACxE,CACb,IACG,CACP,CAAC;AACJ,CAAC,CAAC;AA7CW,QAAA,cAAc,kBA6CzB;AAEF,MAAM,SAAS,GAAG,IAAA,kBAAU,EAC1B,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,EAAE,GAAG,EAAE,EAAE,CAAC,CACxC,gCAAK,GAAG,EAAE,GAAG,EAAE,SAAS,EAAE,EAAE,CAAC,MAAM,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC,iBAAc,qBAAqB,YAC3F,QAAQ,GACL,CACP,CACF,CAAC;AAEF;;;;GAIG;AACH,MAAM,UAAU,GAAG,CAAC,EAAE,KAAK,EAAE,OAAO,EAAmB,EAAE,EAAE,CAAC,CAC1D,uBAAC,uBAAc,IACb,OAAO,QACP,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,IAAI,KAAK,EAAE,EACpB,SAAS,EAAE,EAAE,CAAC,QAAQ,CAAC,iBACX,gCAAgC,GAC5C,CACH,CAAC"}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
@use 'node_modules/@sima-land/ui-nucleons/colors';
|
|
2
|
-
@use '../modifiers';
|
|
3
|
-
|
|
4
|
-
.root {
|
|
5
|
-
position: relative;
|
|
6
|
-
display: flex;
|
|
7
|
-
flex-wrap: wrap;
|
|
8
|
-
flex-direction: row;
|
|
9
|
-
margin: -#{modifiers.$gutter};
|
|
10
|
-
font-size: 0;
|
|
11
|
-
overflow: hidden;
|
|
12
|
-
&:not(.opened) {
|
|
13
|
-
max-height: modifiers.$groupMaxHeight;
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
.item {
|
|
18
|
-
height: modifiers.$minSize;
|
|
19
|
-
margin: modifiers.$gutter;
|
|
20
|
-
max-width: 100%;
|
|
21
|
-
&.hidden {
|
|
22
|
-
display: none;
|
|
23
|
-
}
|
|
24
|
-
&.invisible {
|
|
25
|
-
opacity: 0;
|
|
26
|
-
cursor: default;
|
|
27
|
-
pointer-events: none;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
.opener {
|
|
32
|
-
color: colors.$basic-blue;
|
|
33
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { RefObject } from 'react';
|
|
2
|
-
export interface ViewState {
|
|
3
|
-
phase: 'default' | 'ready';
|
|
4
|
-
lastVisibleIndex: number;
|
|
5
|
-
}
|
|
6
|
-
export declare const initialViewState: ViewState;
|
|
7
|
-
/**
|
|
8
|
-
* Хук состояния отображения блока модификаторов.
|
|
9
|
-
* @param containerRef Ref элемента-контейнера.
|
|
10
|
-
* @param openerRef Ref элемента кнопки, показывающей весь список модификаторов.
|
|
11
|
-
* @return Состояние.
|
|
12
|
-
*/
|
|
13
|
-
export declare function useViewState(containerRef: RefObject<HTMLElement>, openerRef: RefObject<HTMLElement>): ViewState;
|
|
14
|
-
/**
|
|
15
|
-
* Определяет индекс последней видимой кнопки-модификатора для свернутого списка модификаторов.
|
|
16
|
-
* @param containerRef Ref элемента-контейнера.
|
|
17
|
-
* @param openerRef Ref элемента кнопки, показывающей весь список модификаторов.
|
|
18
|
-
* @return Состояние.
|
|
19
|
-
*/
|
|
20
|
-
export declare function defineViewState(containerRef: RefObject<HTMLElement>, openerRef: RefObject<HTMLElement>): ViewState;
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.defineViewState = exports.useViewState = exports.initialViewState = void 0;
|
|
7
|
-
const react_1 = require("react");
|
|
8
|
-
const hooks_1 = require("@sima-land/ui-nucleons/hooks");
|
|
9
|
-
const on_1 = __importDefault(require("@sima-land/ui-nucleons/helpers/on"));
|
|
10
|
-
exports.initialViewState = {
|
|
11
|
-
phase: 'default',
|
|
12
|
-
lastVisibleIndex: -1,
|
|
13
|
-
};
|
|
14
|
-
/**
|
|
15
|
-
* Хук состояния отображения блока модификаторов.
|
|
16
|
-
* @param containerRef Ref элемента-контейнера.
|
|
17
|
-
* @param openerRef Ref элемента кнопки, показывающей весь список модификаторов.
|
|
18
|
-
* @return Состояние.
|
|
19
|
-
*/
|
|
20
|
-
function useViewState(containerRef, openerRef) {
|
|
21
|
-
const [viewState, setViewState] = (0, react_1.useState)(exports.initialViewState);
|
|
22
|
-
(0, react_1.useEffect)(() => {
|
|
23
|
-
const off = (0, on_1.default)(window, 'resize', () => {
|
|
24
|
-
setViewState(exports.initialViewState);
|
|
25
|
-
});
|
|
26
|
-
return off;
|
|
27
|
-
}, []);
|
|
28
|
-
(0, hooks_1.useIsomorphicLayoutEffect)(() => {
|
|
29
|
-
if (viewState.phase === 'default') {
|
|
30
|
-
setViewState(defineViewState(containerRef, openerRef));
|
|
31
|
-
}
|
|
32
|
-
}, [viewState.phase, containerRef, openerRef]);
|
|
33
|
-
return viewState;
|
|
34
|
-
}
|
|
35
|
-
exports.useViewState = useViewState;
|
|
36
|
-
/**
|
|
37
|
-
* Определяет индекс последней видимой кнопки-модификатора для свернутого списка модификаторов.
|
|
38
|
-
* @param containerRef Ref элемента-контейнера.
|
|
39
|
-
* @param openerRef Ref элемента кнопки, показывающей весь список модификаторов.
|
|
40
|
-
* @return Состояние.
|
|
41
|
-
*/
|
|
42
|
-
function defineViewState(containerRef, openerRef) {
|
|
43
|
-
const state = {
|
|
44
|
-
phase: 'ready',
|
|
45
|
-
lastVisibleIndex: -1,
|
|
46
|
-
};
|
|
47
|
-
const container = containerRef.current;
|
|
48
|
-
const opener = openerRef.current;
|
|
49
|
-
if (container && opener) {
|
|
50
|
-
const parentRect = container.getBoundingClientRect();
|
|
51
|
-
const childList = [...container.children];
|
|
52
|
-
const firstHiddenNodeIndex = childList
|
|
53
|
-
.filter(child => child !== opener)
|
|
54
|
-
.findIndex(child => {
|
|
55
|
-
const childRect = child.getBoundingClientRect();
|
|
56
|
-
return childRect.top - parentRect.top >= parentRect.height;
|
|
57
|
-
});
|
|
58
|
-
if (firstHiddenNodeIndex !== -1) {
|
|
59
|
-
const lastVisibleIndex = firstHiddenNodeIndex - 1;
|
|
60
|
-
const lastVisible = childList[lastVisibleIndex];
|
|
61
|
-
if (lastVisible) {
|
|
62
|
-
const rightBound = lastVisible.getBoundingClientRect().right;
|
|
63
|
-
const rightContainerBound = container.getBoundingClientRect().right;
|
|
64
|
-
// проверяем, хватает ли кнопке места (с запасом в половину) после последнего видимого дочернего элемента
|
|
65
|
-
const isOpenerFit = rightContainerBound - rightBound >= opener.clientWidth * 1.5;
|
|
66
|
-
// если хватает места - ставим кнопку после последнего, иначе - вместо
|
|
67
|
-
state.lastVisibleIndex = lastVisibleIndex + Number(isOpenerFit);
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
return state;
|
|
72
|
-
}
|
|
73
|
-
exports.defineViewState = defineViewState;
|
|
74
|
-
//# sourceMappingURL=utils.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../../src/desktop/components/modifiers/group/utils.ts"],"names":[],"mappings":";;;;;;AAAA,iCAAuD;AACvD,wDAAyE;AACzE,2EAAmD;AAOtC,QAAA,gBAAgB,GAAc;IACzC,KAAK,EAAE,SAAS;IAChB,gBAAgB,EAAE,CAAC,CAAC;CACZ,CAAC;AAEX;;;;;GAKG;AACH,SAAgB,YAAY,CAC1B,YAAoC,EACpC,SAAiC;IAEjC,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,IAAA,gBAAQ,EAAY,wBAAgB,CAAC,CAAC;IAExE,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,MAAM,GAAG,GAAG,IAAA,YAAE,EAAC,MAAM,EAAE,QAAQ,EAAE,GAAG,EAAE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ClD,MAAM,WAAW,GAAG,SAAS,CAAC,gBAAgB,CAAC,CAAC;YAEhD,IAAI,WAAW,EAAE;gBACf,MAAM,UAAU,GAAG,WAAW,CAAC,qBAAqB,EAAE,CAAC,KAAK,CAAC;gBAC7D,MAAM,mBAAmB,GAAG,SAAS,CAAC,qBAAqB,EAAE,CAAC,KAAK,CAAC;gBAEpE,yGAAyG;gBACzG,MAAM,WAAW,GAAY,mBAAmB,GAAG,UAAU,IAAI,MAAM,CAAC,WAAW,GAAG,GAAG,CAAC;gBAE1F,sEAAsE;gBACtE,KAAK,CAAC,gBAAgB,GAAG,gBAAgB,GAAG,MAAM,CAAC,WAAW,CAAC,CAAC;aACjE;SACF;KACF;IAED,OAAO,KAAK,CAAC;AACf,CAAC;AAzCD,0CAyCC"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { HTMLAttributes } from 'react';
|
|
2
|
-
import { ModifierItemProps } from './modifier-item';
|
|
3
|
-
export interface ModifierListProps {
|
|
4
|
-
/** Массив данных модификаторов. */
|
|
5
|
-
items?: ModifierItemProps[];
|
|
6
|
-
/** Графема валюты пользователя. */
|
|
7
|
-
currencyGrapheme?: string;
|
|
8
|
-
/** Url таблицы размеров. */
|
|
9
|
-
sizesTableUrl?: string;
|
|
10
|
-
/** Свойства блока-обертки. */
|
|
11
|
-
wrapperProps?: HTMLAttributes<HTMLDivElement>;
|
|
12
|
-
/** Свойства блока-обертки списка модификаторов. */
|
|
13
|
-
itemsContainerProps?: HTMLAttributes<HTMLDivElement>;
|
|
14
|
-
/** Обработчик клика на модификатор. */
|
|
15
|
-
onItemClick?: (item: ModifierItemProps) => void;
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* Компонент списка модификаторов.
|
|
19
|
-
* @param props Свойства.
|
|
20
|
-
* @return Элемент.
|
|
21
|
-
*/
|
|
22
|
-
export declare function ModifiersList({ items, currencyGrapheme, sizesTableUrl, wrapperProps, itemsContainerProps, onItemClick, }: ModifierListProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.ModifiersList = void 0;
|
|
7
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
-
const modifier_item_1 = require("./modifier-item");
|
|
9
|
-
const link_1 = require("@sima-land/ui-nucleons/link");
|
|
10
|
-
const Statement_1 = __importDefault(require("@sima-land/ui-quarks/icons/24x24/Stroked/Statement"));
|
|
11
|
-
const bind_1 = __importDefault(require("classnames/bind"));
|
|
12
|
-
const modifiers_list_module_scss_1 = __importDefault(require("./modifiers-list.module.scss"));
|
|
13
|
-
const cx = bind_1.default.bind(modifiers_list_module_scss_1.default);
|
|
14
|
-
/**
|
|
15
|
-
* Компонент списка модификаторов.
|
|
16
|
-
* @param props Свойства.
|
|
17
|
-
* @return Элемент.
|
|
18
|
-
*/
|
|
19
|
-
function ModifiersList({ items, currencyGrapheme, sizesTableUrl, wrapperProps, itemsContainerProps, onItemClick, }) {
|
|
20
|
-
return ((0, jsx_runtime_1.jsxs)("div", { ...wrapperProps, children: [sizesTableUrl && ((0, jsx_runtime_1.jsx)("div", { className: cx('sizes-table-wrapper'), children: (0, jsx_runtime_1.jsxs)(link_1.Link, { className: cx('sizes-table-link'), href: sizesTableUrl, children: ["\u0422\u0430\u0431\u043B\u0438\u0446\u0430 \u0440\u0430\u0437\u043C\u0435\u0440\u043E\u0432", (0, jsx_runtime_1.jsx)(Statement_1.default, { role: 'presentation', className: cx('sizes-table-icon') })] }) })), Array.isArray(items) && ((0, jsx_runtime_1.jsx)("div", { ...itemsContainerProps, children: items.map((item, index) => ((0, jsx_runtime_1.jsx)(modifier_item_1.ModifierItem, { ...item, onClick: () => onItemClick && onItemClick(item), currencyGrapheme: currencyGrapheme }, index))) }))] }));
|
|
21
|
-
}
|
|
22
|
-
exports.ModifiersList = ModifiersList;
|
|
23
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/mobile/components/modifiers-list/index.tsx"],"names":[],"mappings":";;;;;;;AACA,mDAAkE;AAClE,sDAAmD;AACnD,mGAA8E;AAC9E,2DAAyC;AACzC,8FAAkD;AAsBlD,MAAM,EAAE,GAAG,cAAU,CAAC,IAAI,CAAC,oCAAM,CAAC,CAAC;AAEnC;;;;GAIG;AACH,SAAgB,aAAa,CAAC,EAC5B,KAAK,EACL,gBAAgB,EAChB,aAAa,EACb,YAAY,EACZ,mBAAmB,EACnB,WAAW,GACO;IAClB,OAAO,CACL,oCAAS,YAAY,aAClB,aAAa,IAAI,CAChB,gCAAK,SAAS,EAAE,EAAE,CAAC,qBAAqB,CAAC,YACvC,wBAAC,WAAI,IAAC,SAAS,EAAE,EAAE,CAAC,kBAAkB,CAAC,EAAE,IAAI,EAAE,aAAa,4GAE1D,uBAAC,mBAAY,IAAC,IAAI,EAAC,cAAc,EAAC,SAAS,EAAE,EAAE,CAAC,kBAAkB,CAAC,GAAI,IAClE,GACH,CACP,EAEA,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CACvB,mCAAS,mBAAmB,YACzB,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,CAC1B,uBAAC,4BAAY,OAEP,IAAI,EACR,OAAO,EAAE,GAAG,EAAE,CAAC,WAAW,IAAI,WAAW,CAAC,IAAI,CAAC,EAC/C,gBAAgB,EAAE,gBAAgB,IAH7B,KAAK,CAIV,CACH,CAAC,GACE,CACP,IACG,CACP,CAAC;AACJ,CAAC;AAjCD,sCAiCC"}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { MouseEventHandler } from 'react';
|
|
2
|
-
import { ModifierType } from '../../../../common/types';
|
|
3
|
-
export interface ModifierItemProps {
|
|
4
|
-
/** Наименование модификатора. */
|
|
5
|
-
name: string;
|
|
6
|
-
/** Выбран ли модификатор. */
|
|
7
|
-
selected?: boolean;
|
|
8
|
-
/** Тип модификатора. */
|
|
9
|
-
type?: ModifierType;
|
|
10
|
-
/** Цвет модификатора. */
|
|
11
|
-
color?: string;
|
|
12
|
-
/** URL изображения модификатора. */
|
|
13
|
-
image?: string;
|
|
14
|
-
/** Цена товара-модификатора. */
|
|
15
|
-
price: number;
|
|
16
|
-
/** Графема валюты пользователя. */
|
|
17
|
-
currencyGrapheme?: string;
|
|
18
|
-
/** Дополнительный текст. */
|
|
19
|
-
additionalText?: string;
|
|
20
|
-
/** Обработчик клика на модификатор. */
|
|
21
|
-
onClick?: MouseEventHandler<HTMLDivElement>;
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* Компонент модификатора в списке.
|
|
25
|
-
* @param props Свойства.
|
|
26
|
-
* @return Элемент.
|
|
27
|
-
*/
|
|
28
|
-
export declare function ModifierItem({ name, selected, type, color, image, price, currencyGrapheme, additionalText, onClick, }: ModifierItemProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.ModifierItem = void 0;
|
|
7
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
-
const price_1 = require("@sima-land/ui-nucleons/price");
|
|
9
|
-
const text_1 = require("@sima-land/ui-nucleons/text");
|
|
10
|
-
const constants_1 = require("../../../../common/constants");
|
|
11
|
-
const Check_1 = __importDefault(require("@sima-land/ui-quarks/icons/24x24/Stroked/Check"));
|
|
12
|
-
const bind_1 = __importDefault(require("classnames/bind"));
|
|
13
|
-
const modifier_item_module_scss_1 = __importDefault(require("./modifier-item.module.scss"));
|
|
14
|
-
const cx = bind_1.default.bind(modifier_item_module_scss_1.default);
|
|
15
|
-
/**
|
|
16
|
-
* Компонент модификатора в списке.
|
|
17
|
-
* @param props Свойства.
|
|
18
|
-
* @return Элемент.
|
|
19
|
-
*/
|
|
20
|
-
function ModifierItem({ name, selected, type = 'text', color, image, price, currencyGrapheme, additionalText, onClick, }) {
|
|
21
|
-
return ((0, jsx_runtime_1.jsxs)("div", { className: cx('wrapper', selected && 'selected'), onClick: onClick, children: [Boolean(type === constants_1.MODIFIER_TYPE.image && image) && ((0, jsx_runtime_1.jsx)("img", { className: cx('adornment'), src: image, alt: name })), Boolean(type === constants_1.MODIFIER_TYPE.color && color) && ((0, jsx_runtime_1.jsx)("div", { className: cx('adornment', 'color'), style: { backgroundColor: color } })), (0, jsx_runtime_1.jsxs)("div", { className: cx('info'), children: [(0, jsx_runtime_1.jsx)("span", { className: cx('name'), children: name }), Boolean(price) && ((0, jsx_runtime_1.jsx)(price_1.Price, { value: price, currencyGrapheme: currencyGrapheme, className: cx('price', additionalText && 'additional') })), Boolean(additionalText) && ((0, jsx_runtime_1.jsx)(text_1.Text, { color: 'basic-gray38', children: additionalText, size: 12, lineHeight: 16 }))] }), (0, jsx_runtime_1.jsx)("div", { className: cx('icon-wrapper'), children: selected && ((0, jsx_runtime_1.jsx)("div", { className: cx('icon'), children: (0, jsx_runtime_1.jsx)(Check_1.default, { fill: '#fff', role: 'presentation' }) })) })] }));
|
|
22
|
-
}
|
|
23
|
-
exports.ModifierItem = ModifierItem;
|
|
24
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/mobile/components/modifiers-list/modifier-item/index.tsx"],"names":[],"mappings":";;;;;;;AACA,wDAAqD;AACrD,sDAAmD;AAEnD,4DAA6D;AAC7D,2FAAsE;AACtE,2DAAyC;AACzC,4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E,CAAC,cAAc,CAAC,YAC/B,QAAQ,IAAI,CACX,gCAAK,SAAS,EAAE,EAAE,CAAC,MAAM,CAAC,YACxB,uBAAC,eAAQ,IAAC,IAAI,EAAC,MAAM,EAAC,IAAI,EAAC,cAAc,GAAG,GACxC,CACP,GACG,IACF,CACP,CAAC;AACJ,CAAC;AA9CD,oCA8CC"}
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
@use 'node_modules/@sima-land/ui-nucleons/colors';
|
|
2
|
-
|
|
3
|
-
.wrapper {
|
|
4
|
-
box-sizing: border-box;
|
|
5
|
-
cursor: pointer;
|
|
6
|
-
display: flex;
|
|
7
|
-
padding: 16px;
|
|
8
|
-
width: 100%;
|
|
9
|
-
&:not(:last-child) {
|
|
10
|
-
box-shadow: inset 0 -1px 0 colors.$basic-gray12;
|
|
11
|
-
}
|
|
12
|
-
&.selected {
|
|
13
|
-
background: colors.$basic-gray4;
|
|
14
|
-
cursor: auto;
|
|
15
|
-
pointer-events: none;
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
.adornment {
|
|
20
|
-
flex-shrink: 0;
|
|
21
|
-
display: block;
|
|
22
|
-
width: 48px;
|
|
23
|
-
height: 48px;
|
|
24
|
-
margin-right: 16px;
|
|
25
|
-
border-radius: 4px;
|
|
26
|
-
&.color {
|
|
27
|
-
box-sizing: border-box;
|
|
28
|
-
border: 1px solid #e0e0e0;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
.info {
|
|
33
|
-
flex-grow: 1;
|
|
34
|
-
display: flex;
|
|
35
|
-
flex-direction: column;
|
|
36
|
-
.name {
|
|
37
|
-
&::first-letter {
|
|
38
|
-
text-transform: capitalize;
|
|
39
|
-
}
|
|
40
|
-
font-size: 16px;
|
|
41
|
-
line-height: 24px;
|
|
42
|
-
font-weight: 600;
|
|
43
|
-
padding-bottom: 4px;
|
|
44
|
-
}
|
|
45
|
-
.price {
|
|
46
|
-
font-size: 14px;
|
|
47
|
-
line-height: 20px;
|
|
48
|
-
&.additional {
|
|
49
|
-
padding-bottom: 12px;
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
.icon-wrapper {
|
|
55
|
-
flex-shrink: 0;
|
|
56
|
-
margin-left: 16px;
|
|
57
|
-
width: 48px;
|
|
58
|
-
height: 48px;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
.icon {
|
|
62
|
-
width: 100%;
|
|
63
|
-
height: 100%;
|
|
64
|
-
display: flex;
|
|
65
|
-
align-items: center;
|
|
66
|
-
justify-content: center;
|
|
67
|
-
box-sizing: border-box;
|
|
68
|
-
border-radius: 50%;
|
|
69
|
-
background-color: colors.$additional-teal;
|
|
70
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
@use 'node_modules/@sima-land/ui-nucleons/colors';
|
|
2
|
-
|
|
3
|
-
.sizes-table-wrapper {
|
|
4
|
-
box-shadow: inset 0 -1px 0 colors.$basic-gray12;
|
|
5
|
-
padding: 16px;
|
|
6
|
-
font-size: 16px;
|
|
7
|
-
font-weight: 600;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
.sizes-table-icon {
|
|
11
|
-
vertical-align: middle;
|
|
12
|
-
fill: currentColor;
|
|
13
|
-
margin-left: 8px;
|
|
14
|
-
padding-bottom: 4px;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
.sizes-table-link {
|
|
18
|
-
display: inline-block;
|
|
19
|
-
vertical-align: middle;
|
|
20
|
-
height: 24px;
|
|
21
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { HTMLAttributes } from 'react';
|
|
2
|
-
export interface PseudoInputProps extends HTMLAttributes<HTMLDivElement> {
|
|
3
|
-
/** Текст, введенный в поле. */
|
|
4
|
-
text?: string;
|
|
5
|
-
}
|
|
6
|
-
/**
|
|
7
|
-
* Псевдо-поле поиска.
|
|
8
|
-
* @param props Свойства.
|
|
9
|
-
* @return Элемент.
|
|
10
|
-
*/
|
|
11
|
-
export declare const PseudoInput: ({ text, className, ...rest }: PseudoInputProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.PseudoInput = void 0;
|
|
7
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
-
const bind_1 = __importDefault(require("classnames/bind"));
|
|
9
|
-
const Search_1 = __importDefault(require("@sima-land/ui-quarks/icons/24x24/Stroked/Search"));
|
|
10
|
-
const pseudo_input_module_scss_1 = __importDefault(require("./pseudo-input.module.scss"));
|
|
11
|
-
const cx = bind_1.default.bind(pseudo_input_module_scss_1.default);
|
|
12
|
-
/**
|
|
13
|
-
* Псевдо-поле поиска.
|
|
14
|
-
* @param props Свойства.
|
|
15
|
-
* @return Элемент.
|
|
16
|
-
*/
|
|
17
|
-
const PseudoInput = ({ text, className, ...rest }) => ((0, jsx_runtime_1.jsxs)("div", { ...rest, role: 'button', className: cx('input', className), children: [(0, jsx_runtime_1.jsx)(Search_1.default, { className: cx('icon'), "aria-hidden": 'true' }), (0, jsx_runtime_1.jsx)("span", { className: cx('text'), children: text })] }));
|
|
18
|
-
exports.PseudoInput = PseudoInput;
|
|
19
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/mobile/components/pseudo-input/index.tsx"],"names":[],"mappings":";;;;;;;AAAA,2DAAyC;AACzC,6FAAwE;AACxE,0FAAgD;AAQhD,MAAM,EAAE,GAAG,cAAU,CAAC,IAAI,CAAC,kCAAM,CAAC,CAAC;AAEnC;;;;GAIG;AACI,MAAM,WAAW,GAAG,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,GAAG,IAAI,EAAoB,EAAE,EAAE,CAAC,CAC7E,oCAAS,IAAI,EAAE,IAAI,EAAC,QAAQ,EAAC,SAAS,EAAE,EAAE,CAAC,OAAO,EAAE,SAAS,CAAC,aAC5D,uBAAC,gBAAS,IAAC,SAAS,EAAE,EAAE,CAAC,MAAM,CAAC,iBAAc,MAAM,GAAG,EACvD,iCAAM,SAAS,EAAE,EAAE,CAAC,MAAM,CAAC,YAAG,IAAI,GAAQ,IACtC,CACP,CAAC;AALW,QAAA,WAAW,eAKtB"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
@use 'node_modules/@sima-land/ui-nucleons/colors';
|
|
2
|
-
|
|
3
|
-
.input {
|
|
4
|
-
display: flex;
|
|
5
|
-
align-items: center;
|
|
6
|
-
height: 40px;
|
|
7
|
-
padding: 0 16px 0 12px;
|
|
8
|
-
border-radius: 8px;
|
|
9
|
-
background-color: colors.$basic-gray4;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
.icon {
|
|
13
|
-
display: block;
|
|
14
|
-
flex-shrink: 0;
|
|
15
|
-
fill: colors.$basic-gray38;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
.text {
|
|
19
|
-
display: block;
|
|
20
|
-
margin-left: 12px;
|
|
21
|
-
font-size: 16px;
|
|
22
|
-
line-height: 24px;
|
|
23
|
-
color: colors.$basic-gray38;
|
|
24
|
-
}
|