@alfalab/core-components-pure-cell 4.5.2 → 4.6.1
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/component-d0c38540.d.ts +211 -0
- package/component-d0c38540.js +200 -0
- package/{component-5a229016.d.ts → component-fd7196d2.d.ts} +1 -0
- package/component.js +3 -15
- package/components/addon/component.d.ts +0 -24
- package/components/addon/component.js +5 -15
- package/components/addon/index.css +11 -11
- package/components/addon/index.d.ts +1 -1
- package/components/addon/index.js +1 -4
- package/components/amount/component.d.ts +0 -25
- package/components/amount/component.js +8 -19
- package/components/amount/index.css +3 -3
- package/components/amount/index.d.ts +1 -1
- package/components/amount/index.js +2 -8
- package/components/amount-title/component.d.ts +0 -22
- package/components/amount-title/component.js +8 -20
- package/components/amount-title/index.css +4 -4
- package/components/amount-title/index.d.ts +1 -1
- package/components/amount-title/index.js +2 -8
- package/components/category/component.d.ts +0 -25
- package/components/category/component.js +5 -19
- package/components/category/index.css +6 -6
- package/components/category/index.d.ts +1 -1
- package/components/category/index.js +2 -5
- package/components/content/component.js +2 -17
- package/components/content/index.css +4 -4
- package/components/content/index.d.ts +1 -1
- package/components/content/index.js +2 -20
- package/components/footer/component.d.ts +0 -20
- package/components/footer/component.js +5 -15
- package/components/footer/index.css +5 -5
- package/components/footer/index.d.ts +1 -1
- package/components/footer/index.js +2 -5
- package/components/footer-button/component.d.ts +0 -14
- package/components/footer-button/component.js +6 -15
- package/components/footer-button/index.css +3 -3
- package/components/footer-button/index.d.ts +1 -1
- package/components/footer-button/index.js +2 -6
- package/components/footer-text/component.d.ts +0 -21
- package/components/footer-text/component.js +5 -11
- package/components/footer-text/index.d.ts +1 -1
- package/components/footer-text/index.js +2 -5
- package/components/graphics/component.d.ts +0 -20
- package/components/graphics/component.js +5 -15
- package/components/graphics/index.css +6 -6
- package/components/graphics/index.d.ts +1 -1
- package/components/graphics/index.js +2 -5
- package/components/main/component.js +2 -17
- package/components/main/index.css +5 -5
- package/components/main/index.d.ts +1 -1
- package/components/main/index.js +2 -20
- package/components/text/component.js +2 -16
- package/components/text/index.css +8 -8
- package/components/text/index.d.ts +1 -1
- package/components/text/index.js +2 -20
- package/cssm/component-4445c77d.d.ts +211 -0
- package/cssm/component-4445c77d.js +189 -0
- package/{modern/component-5a229016.d.ts → cssm/component-fd7196d2.d.ts} +1 -0
- package/cssm/component.js +3 -25
- package/cssm/components/addon/component.d.ts +0 -24
- package/cssm/components/addon/component.js +6 -14
- package/cssm/components/addon/index.d.ts +1 -1
- package/cssm/components/addon/index.js +1 -5
- package/cssm/components/addon/index.module.css +1 -1
- package/cssm/components/amount/component.d.ts +0 -25
- package/cssm/components/amount/component.js +9 -18
- package/cssm/components/amount/index.d.ts +1 -1
- package/cssm/components/amount/index.js +2 -9
- package/cssm/components/amount/index.module.css +1 -1
- package/cssm/components/amount-title/component.d.ts +0 -22
- package/cssm/components/amount-title/component.js +9 -19
- package/cssm/components/amount-title/index.d.ts +1 -1
- package/cssm/components/amount-title/index.js +2 -9
- package/cssm/components/amount-title/index.module.css +1 -1
- package/cssm/components/category/component.d.ts +0 -25
- package/cssm/components/category/component.js +6 -18
- package/cssm/components/category/index.d.ts +1 -1
- package/cssm/components/category/index.js +2 -6
- package/cssm/components/category/index.module.css +1 -1
- package/cssm/components/content/component.js +2 -27
- package/cssm/components/content/index.d.ts +1 -1
- package/cssm/components/content/index.js +2 -31
- package/cssm/components/content/index.module.css +1 -1
- package/cssm/components/footer/component.d.ts +0 -20
- package/cssm/components/footer/component.js +6 -14
- package/cssm/components/footer/index.d.ts +1 -1
- package/cssm/components/footer/index.js +2 -6
- package/cssm/components/footer/index.module.css +1 -1
- package/cssm/components/footer-button/component.d.ts +0 -14
- package/cssm/components/footer-button/component.js +7 -14
- package/cssm/components/footer-button/index.d.ts +1 -1
- package/cssm/components/footer-button/index.js +2 -7
- package/cssm/components/footer-button/index.module.css +1 -1
- package/cssm/components/footer-text/component.d.ts +0 -21
- package/cssm/components/footer-text/component.js +5 -11
- package/cssm/components/footer-text/index.d.ts +1 -1
- package/cssm/components/footer-text/index.js +2 -5
- package/cssm/components/graphics/component.d.ts +0 -20
- package/cssm/components/graphics/component.js +6 -14
- package/cssm/components/graphics/index.d.ts +1 -1
- package/cssm/components/graphics/index.js +2 -6
- package/cssm/components/graphics/index.module.css +1 -1
- package/cssm/components/main/component.js +2 -27
- package/cssm/components/main/index.d.ts +1 -1
- package/cssm/components/main/index.js +2 -31
- package/cssm/components/main/index.module.css +1 -1
- package/cssm/components/text/component.js +2 -26
- package/cssm/components/text/index.d.ts +1 -1
- package/cssm/components/text/index.js +2 -31
- package/cssm/components/text/index.module.css +1 -1
- package/cssm/index.d.ts +1 -1
- package/cssm/index.js +2 -31
- package/cssm/index.module.css +1 -1
- package/cssm/shared/index.d.ts +1 -0
- package/cssm/shared/index.js +9 -0
- package/cssm/utils.d.ts +20 -0
- package/cssm/utils.js +29 -0
- package/esm/component-38be6257.d.ts +211 -0
- package/esm/component-38be6257.js +180 -0
- package/esm/{component-5a229016.d.ts → component-fd7196d2.d.ts} +1 -0
- package/esm/component.js +1 -13
- package/esm/components/addon/component.d.ts +0 -24
- package/esm/components/addon/component.js +4 -13
- package/esm/components/addon/index.css +11 -11
- package/esm/components/addon/index.d.ts +1 -1
- package/esm/components/addon/index.js +1 -4
- package/esm/components/amount/component.d.ts +0 -25
- package/esm/components/amount/component.js +7 -17
- package/esm/components/amount/index.css +3 -3
- package/esm/components/amount/index.d.ts +1 -1
- package/esm/components/amount/index.js +1 -7
- package/esm/components/amount-title/component.d.ts +0 -22
- package/esm/components/amount-title/component.js +7 -18
- package/esm/components/amount-title/index.css +4 -4
- package/esm/components/amount-title/index.d.ts +1 -1
- package/esm/components/amount-title/index.js +1 -7
- package/esm/components/category/component.d.ts +0 -25
- package/esm/components/category/component.js +4 -18
- package/esm/components/category/index.css +6 -6
- package/esm/components/category/index.d.ts +1 -1
- package/esm/components/category/index.js +1 -4
- package/esm/components/content/component.js +1 -16
- package/esm/components/content/index.css +4 -4
- package/esm/components/content/index.d.ts +1 -1
- package/esm/components/content/index.js +1 -19
- package/esm/components/footer/component.d.ts +0 -20
- package/esm/components/footer/component.js +4 -13
- package/esm/components/footer/index.css +5 -5
- package/esm/components/footer/index.d.ts +1 -1
- package/esm/components/footer/index.js +1 -4
- package/esm/components/footer-button/component.d.ts +0 -14
- package/esm/components/footer-button/component.js +5 -14
- package/esm/components/footer-button/index.css +3 -3
- package/esm/components/footer-button/index.d.ts +1 -1
- package/esm/components/footer-button/index.js +1 -5
- package/esm/components/footer-text/component.d.ts +0 -21
- package/esm/components/footer-text/component.js +4 -10
- package/esm/components/footer-text/index.d.ts +1 -1
- package/esm/components/footer-text/index.js +1 -4
- package/esm/components/graphics/component.d.ts +0 -20
- package/esm/components/graphics/component.js +4 -13
- package/esm/components/graphics/index.css +6 -6
- package/esm/components/graphics/index.d.ts +1 -1
- package/esm/components/graphics/index.js +1 -4
- package/esm/components/main/component.js +1 -16
- package/esm/components/main/index.css +5 -5
- package/esm/components/main/index.d.ts +1 -1
- package/esm/components/main/index.js +1 -19
- package/esm/components/text/component.js +1 -15
- package/esm/components/text/index.css +8 -8
- package/esm/components/text/index.d.ts +1 -1
- package/esm/components/text/index.js +1 -19
- package/esm/index.css +22 -22
- package/esm/index.d.ts +1 -1
- package/esm/index.js +1 -19
- package/esm/shared/index.d.ts +1 -0
- package/esm/shared/index.js +1 -0
- package/esm/utils.d.ts +20 -0
- package/esm/utils.js +25 -0
- package/index.css +22 -22
- package/index.d.ts +1 -1
- package/index.js +2 -20
- package/modern/component-d22a8098.d.ts +211 -0
- package/modern/component-d22a8098.js +169 -0
- package/{cssm/component-5a229016.d.ts → modern/component-fd7196d2.d.ts} +1 -0
- package/modern/component.js +1 -13
- package/modern/components/addon/component.d.ts +0 -24
- package/modern/components/addon/component.js +4 -10
- package/modern/components/addon/index.css +11 -11
- package/modern/components/addon/index.d.ts +1 -1
- package/modern/components/addon/index.js +1 -4
- package/modern/components/amount/component.d.ts +0 -25
- package/modern/components/amount/component.js +6 -13
- package/modern/components/amount/index.css +3 -3
- package/modern/components/amount/index.d.ts +1 -1
- package/modern/components/amount/index.js +1 -6
- package/modern/components/amount-title/component.d.ts +0 -22
- package/modern/components/amount-title/component.js +6 -21
- package/modern/components/amount-title/index.css +4 -4
- package/modern/components/amount-title/index.d.ts +1 -1
- package/modern/components/amount-title/index.js +1 -6
- package/modern/components/category/component.d.ts +0 -25
- package/modern/components/category/component.js +4 -15
- package/modern/components/category/index.css +6 -6
- package/modern/components/category/index.d.ts +1 -1
- package/modern/components/category/index.js +1 -4
- package/modern/components/content/component.js +1 -15
- package/modern/components/content/index.css +4 -4
- package/modern/components/content/index.d.ts +1 -1
- package/modern/components/content/index.js +1 -18
- package/modern/components/footer/component.d.ts +0 -20
- package/modern/components/footer/component.js +4 -10
- package/modern/components/footer/index.css +5 -5
- package/modern/components/footer/index.d.ts +1 -1
- package/modern/components/footer/index.js +1 -4
- package/modern/components/footer-button/component.d.ts +0 -14
- package/modern/components/footer-button/component.js +4 -10
- package/modern/components/footer-button/index.css +3 -3
- package/modern/components/footer-button/index.d.ts +1 -1
- package/modern/components/footer-button/index.js +1 -4
- package/modern/components/footer-text/component.d.ts +0 -21
- package/modern/components/footer-text/component.js +4 -7
- package/modern/components/footer-text/index.d.ts +1 -1
- package/modern/components/footer-text/index.js +1 -4
- package/modern/components/graphics/component.d.ts +0 -20
- package/modern/components/graphics/component.js +4 -10
- package/modern/components/graphics/index.css +6 -6
- package/modern/components/graphics/index.d.ts +1 -1
- package/modern/components/graphics/index.js +1 -4
- package/modern/components/main/component.js +1 -15
- package/modern/components/main/index.css +5 -5
- package/modern/components/main/index.d.ts +1 -1
- package/modern/components/main/index.js +1 -18
- package/modern/components/text/component.js +1 -14
- package/modern/components/text/index.css +8 -8
- package/modern/components/text/index.d.ts +1 -1
- package/modern/components/text/index.js +1 -18
- package/modern/index.css +22 -22
- package/modern/index.d.ts +1 -1
- package/modern/index.js +1 -18
- package/modern/shared/index.d.ts +1 -0
- package/modern/shared/index.js +1 -0
- package/modern/utils.d.ts +20 -0
- package/modern/utils.js +25 -0
- package/package.json +4 -4
- package/shared/index.d.ts +1 -0
- package/shared/index.js +9 -0
- package/shared/package.json +3 -0
- package/src/component.tsx +4 -3
- package/src/components/addon/component.tsx +14 -9
- package/src/components/amount/component.tsx +21 -16
- package/src/components/amount-title/component.tsx +9 -3
- package/src/components/category/component.tsx +42 -27
- package/src/components/content/component.tsx +2 -2
- package/src/components/footer/component.tsx +14 -9
- package/src/components/footer-button/component.tsx +18 -12
- package/src/components/footer-text/component.tsx +16 -10
- package/src/components/graphics/component.tsx +14 -9
- package/src/components/main/component.tsx +2 -2
- package/src/components/text/component.tsx +3 -3
- package/src/shared/index.ts +1 -0
- package/src/shared/package.json +3 -0
- package/src/utils.ts +23 -0
- package/utils.d.ts +20 -0
- package/utils.js +29 -0
- package/component-6fbf202b.d.ts +0 -74
- package/component-6fbf202b.js +0 -121
- package/cssm/component-3ca297e4.d.ts +0 -74
- package/cssm/component-3ca297e4.js +0 -117
- package/esm/component-609a6e2f.d.ts +0 -74
- package/esm/component-609a6e2f.js +0 -109
- package/modern/component-f75dd263.d.ts +0 -74
- package/modern/component-f75dd263.js +0 -101
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import React from "react";
|
|
3
|
-
import { ReactNode } from "react";
|
|
4
|
-
import { MainElement, ContentElement } from "./components/types";
|
|
5
|
-
import { Color } from "@alfalab/core-components-typography";
|
|
6
|
-
type Props = {
|
|
7
|
-
/**
|
|
8
|
-
* Компоненты
|
|
9
|
-
*/
|
|
10
|
-
children: MainElement;
|
|
11
|
-
/**
|
|
12
|
-
* Позволяет изменить расположение блоков внутри main
|
|
13
|
-
*/
|
|
14
|
-
isReverse?: boolean;
|
|
15
|
-
/**
|
|
16
|
-
* Дополнительный класс
|
|
17
|
-
*/
|
|
18
|
-
className?: string;
|
|
19
|
-
/**
|
|
20
|
-
* Идентификатор для систем автоматизированного тестирования.
|
|
21
|
-
* Используется модификатор -main
|
|
22
|
-
*/
|
|
23
|
-
dataTestId?: string;
|
|
24
|
-
};
|
|
25
|
-
declare const Main: React.FC<Props>;
|
|
26
|
-
type Props$0 = {
|
|
27
|
-
/**
|
|
28
|
-
* Компоненты
|
|
29
|
-
*/
|
|
30
|
-
children: ContentElement;
|
|
31
|
-
/**
|
|
32
|
-
* Идентификатор для систем автоматизированного тестирования.
|
|
33
|
-
* Используется модификатор -content
|
|
34
|
-
*/
|
|
35
|
-
dataTestId?: string;
|
|
36
|
-
};
|
|
37
|
-
declare const Content: React.FC<Props$0>;
|
|
38
|
-
type Props$1 = {
|
|
39
|
-
/**
|
|
40
|
-
* Контент
|
|
41
|
-
*/
|
|
42
|
-
children?: ReactNode;
|
|
43
|
-
/**
|
|
44
|
-
* Количество строк
|
|
45
|
-
*/
|
|
46
|
-
rowLimit?: 1 | 2;
|
|
47
|
-
/**
|
|
48
|
-
* Размер текста
|
|
49
|
-
*/
|
|
50
|
-
view?: 'primary-large' | 'primary-medium' | 'primary-small' | 'component' | 'component-primary';
|
|
51
|
-
/**
|
|
52
|
-
* Толщина title
|
|
53
|
-
*/
|
|
54
|
-
titleWeight?: 'regular' | 'bold';
|
|
55
|
-
/**
|
|
56
|
-
* Цвет title
|
|
57
|
-
*/
|
|
58
|
-
titleColor: Color;
|
|
59
|
-
/**
|
|
60
|
-
* Value ячейки
|
|
61
|
-
*/
|
|
62
|
-
value?: ReactNode;
|
|
63
|
-
/**
|
|
64
|
-
* Цвет value
|
|
65
|
-
*/
|
|
66
|
-
valueColor?: Color;
|
|
67
|
-
/**
|
|
68
|
-
* Идентификатор для систем автоматизированного тестирования.
|
|
69
|
-
* Для контента используется модификатор -text_content, для value ячейки -text_value
|
|
70
|
-
*/
|
|
71
|
-
dataTestId?: string;
|
|
72
|
-
};
|
|
73
|
-
declare const Text: React.FC<Props$1>;
|
|
74
|
-
export { Main, Content, Text };
|
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
import { __rest, __assign } from 'tslib';
|
|
2
|
-
import React, { useContext, forwardRef, useRef } from 'react';
|
|
3
|
-
import mergeRefs from 'react-merge-refs';
|
|
4
|
-
import cn from 'classnames';
|
|
5
|
-
import { Comment } from '@alfalab/core-components-comment/esm';
|
|
6
|
-
import { useFocus } from '@alfalab/hooks';
|
|
7
|
-
import { Addon } from './components/addon/component.js';
|
|
8
|
-
import { Amount } from './components/amount/component.js';
|
|
9
|
-
import { AmountTitle } from './components/amount-title/component.js';
|
|
10
|
-
import { Category } from './components/category/component.js';
|
|
11
|
-
import { getDataTestId } from '@alfalab/core-components-shared/esm';
|
|
12
|
-
import { Footer } from './components/footer/component.js';
|
|
13
|
-
import { FooterButton } from './components/footer-button/component.js';
|
|
14
|
-
import { FooterText } from './components/footer-text/component.js';
|
|
15
|
-
import { Graphics } from './components/graphics/component.js';
|
|
16
|
-
import { Typography } from '@alfalab/core-components-typography/esm';
|
|
17
|
-
|
|
18
|
-
var styles$3 = {"component":"pure-cell__component_15r7a","horizontal":"pure-cell__horizontal_15r7a"};
|
|
19
|
-
require('./components/content/index.css')
|
|
20
|
-
|
|
21
|
-
var Content = function (_a) {
|
|
22
|
-
var _b;
|
|
23
|
-
var children = _a.children, dataTestId = _a.dataTestId;
|
|
24
|
-
var direction = useContext(PureCellContext).direction;
|
|
25
|
-
return (React.createElement("section", { className: cn(styles$3.component, (_b = {}, _b[styles$3.horizontal] = direction === 'horizontal', _b)), "data-test-id": getDataTestId(dataTestId, 'content') }, children));
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
var styles$2 = {"component":"pure-cell__component_151x2","vertical":"pure-cell__vertical_151x2","reverse":"pure-cell__reverse_151x2"};
|
|
29
|
-
require('./components/main/index.css')
|
|
30
|
-
|
|
31
|
-
var Main = function (_a) {
|
|
32
|
-
var _b;
|
|
33
|
-
var children = _a.children, isReverse = _a.isReverse, className = _a.className, dataTestId = _a.dataTestId;
|
|
34
|
-
var _c = useContext(PureCellContext).direction, direction = _c === void 0 ? 'horizontal' : _c;
|
|
35
|
-
return (React.createElement("div", { className: cn(styles$2.component, styles$2[direction], (_b = {},
|
|
36
|
-
_b[styles$2.reverse] = isReverse,
|
|
37
|
-
_b), className), "data-test-id": getDataTestId(dataTestId, 'main') }, children));
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
var styles$1 = {"horizontal":"pure-cell__horizontal_3wsa5","rowLimit1":"pure-cell__rowLimit1_3wsa5","rowLimit2":"pure-cell__rowLimit2_3wsa5","component":"pure-cell__component_3wsa5","vertical":"pure-cell__vertical_3wsa5","title":"pure-cell__title_3wsa5","value":"pure-cell__value_3wsa5"};
|
|
41
|
-
require('./components/text/index.css')
|
|
42
|
-
|
|
43
|
-
var Text = function (_a) {
|
|
44
|
-
var _b;
|
|
45
|
-
var children = _a.children, value = _a.value, rowLimit = _a.rowLimit, _c = _a.view, view = _c === void 0 ? 'component-primary' : _c, titleWeight = _a.titleWeight, titleColor = _a.titleColor, valueColor = _a.valueColor, dataTestId = _a.dataTestId;
|
|
46
|
-
var _d = useContext(PureCellContext).direction, direction = _d === void 0 ? 'horizontal' : _d;
|
|
47
|
-
var className = rowLimit && styles$1["rowLimit".concat(rowLimit)];
|
|
48
|
-
return (React.createElement("div", { className: cn(styles$1.component, (_b = {},
|
|
49
|
-
_b[styles$1.vertical] = direction !== 'horizontal',
|
|
50
|
-
_b)) },
|
|
51
|
-
React.createElement("div", { className: styles$1.title },
|
|
52
|
-
React.createElement(Typography.Text, { view: view, weight: titleWeight, tag: 'div', color: titleColor, className: className, "data-test-id": getDataTestId(dataTestId, 'text_content') }, children)),
|
|
53
|
-
value && (React.createElement("div", { className: styles$1.value },
|
|
54
|
-
React.createElement(Typography.Text, { view: view, tag: 'div', color: valueColor, className: className, "data-test-id": getDataTestId(dataTestId, 'text_value') }, value)))));
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
var styles = {"component":"pure-cell__component_3dtp8","horizontal":"pure-cell__horizontal_3dtp8","vertical":"pure-cell__vertical_3dtp8","button":"pure-cell__button_3dtp8","link":"pure-cell__link_3dtp8","none":"pure-cell__none_3dtp8","airy":"pure-cell__airy_3dtp8","defaultPadding":"pure-cell__defaultPadding_3dtp8","compact":"pure-cell__compact_3dtp8","tiny":"pure-cell__tiny_3dtp8","left":"pure-cell__left_3dtp8","right":"pure-cell__right_3dtp8","both":"pure-cell__both_3dtp8","focused":"pure-cell__focused_3dtp8"};
|
|
58
|
-
require('./index.css')
|
|
59
|
-
|
|
60
|
-
// eslint-disable-next-line @typescript-eslint/no-redeclare
|
|
61
|
-
var PureCellContext = React.createContext({});
|
|
62
|
-
var PureCellComponent = forwardRef(function (_a, ref) {
|
|
63
|
-
var _b, _c;
|
|
64
|
-
var className = _a.className, dataTestId = _a.dataTestId, onClick = _a.onClick, href = _a.href, _d = _a.tag, Component = _d === void 0 ? (href && 'a') || (onClick && 'button') || 'section' : _d, children = _a.children, _e = _a.horizontalPadding, horizontalPadding = _e === void 0 ? 'none' : _e, _f = _a.verticalPadding, verticalPadding = _f === void 0 ? 'none' : _f, _g = _a.direction, direction = _g === void 0 ? 'horizontal' : _g, restProps = __rest(_a, ["className", "dataTestId", "onClick", "href", "tag", "children", "horizontalPadding", "verticalPadding", "direction"]);
|
|
65
|
-
var cellRef = useRef(null);
|
|
66
|
-
var focused = useFocus(cellRef, 'keyboard')[0];
|
|
67
|
-
var addClasses = (_b = {},
|
|
68
|
-
_b[styles.component] = true,
|
|
69
|
-
_b[styles.focused] = focused,
|
|
70
|
-
_b[styles[direction]] = true,
|
|
71
|
-
_b[styles.defaultPadding] = verticalPadding === 'default',
|
|
72
|
-
_b[styles[verticalPadding]] = verticalPadding !== 'default',
|
|
73
|
-
_b[styles[horizontalPadding]] = true,
|
|
74
|
-
_b);
|
|
75
|
-
if (href) {
|
|
76
|
-
var target = restProps.target;
|
|
77
|
-
// Для совместимости с react-router-dom, меняем href на to
|
|
78
|
-
var hrefProps = (_c = {}, _c[typeof Component === 'string' ? 'href' : 'to'] = href, _c);
|
|
79
|
-
return (React.createElement(Component, __assign({ rel: target === '_blank' ? 'noreferrer noopener' : undefined }, restProps, hrefProps, { ref: mergeRefs([cellRef, ref]), className: cn(styles.link, addClasses, className), "data-test-id": dataTestId, onClick: onClick }),
|
|
80
|
-
React.createElement(PureCellContext.Provider, { value: { direction: direction } }, children)));
|
|
81
|
-
}
|
|
82
|
-
if (onClick) {
|
|
83
|
-
return (React.createElement(Component, __assign({}, restProps, { ref: mergeRefs([cellRef, ref]), className: cn(styles.button, addClasses, className), "data-test-id": dataTestId, onClick: onClick }),
|
|
84
|
-
React.createElement(PureCellContext.Provider, { value: { direction: direction } }, children)));
|
|
85
|
-
}
|
|
86
|
-
return (React.createElement(Component, __assign({}, restProps, { ref: ref, tabIndex: 0, className: cn(addClasses, className), "data-test-id": dataTestId }),
|
|
87
|
-
React.createElement(PureCellContext.Provider, { value: { direction: direction } }, children)));
|
|
88
|
-
});
|
|
89
|
-
/**
|
|
90
|
-
* Универсальный конструктор для сборки любой ячейки.
|
|
91
|
-
*
|
|
92
|
-
* [Макет](https://www.figma.com/file/KlFOLLkKO8rtvvQE3RXuhq/Click-Library?node-id=43525%3A240018)
|
|
93
|
-
*/
|
|
94
|
-
var PureCell = Object.assign(PureCellComponent, {
|
|
95
|
-
Main: Main,
|
|
96
|
-
Graphics: Graphics,
|
|
97
|
-
Content: Content,
|
|
98
|
-
Text: Text,
|
|
99
|
-
Amount: Amount,
|
|
100
|
-
AmountTitle: AmountTitle,
|
|
101
|
-
Addon: Addon,
|
|
102
|
-
Footer: Footer,
|
|
103
|
-
ExtraSubtitle: FooterText,
|
|
104
|
-
FooterButton: FooterButton,
|
|
105
|
-
Comment: Comment,
|
|
106
|
-
Category: Category,
|
|
107
|
-
});
|
|
108
|
-
|
|
109
|
-
export { Content as C, Main as M, PureCell as P, Text as T, PureCellContext as a };
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import React from "react";
|
|
3
|
-
import { ReactNode } from "react";
|
|
4
|
-
import { MainElement, ContentElement } from "./components/types";
|
|
5
|
-
import { Color } from "@alfalab/core-components-typography";
|
|
6
|
-
type Props = {
|
|
7
|
-
/**
|
|
8
|
-
* Компоненты
|
|
9
|
-
*/
|
|
10
|
-
children: MainElement;
|
|
11
|
-
/**
|
|
12
|
-
* Позволяет изменить расположение блоков внутри main
|
|
13
|
-
*/
|
|
14
|
-
isReverse?: boolean;
|
|
15
|
-
/**
|
|
16
|
-
* Дополнительный класс
|
|
17
|
-
*/
|
|
18
|
-
className?: string;
|
|
19
|
-
/**
|
|
20
|
-
* Идентификатор для систем автоматизированного тестирования.
|
|
21
|
-
* Используется модификатор -main
|
|
22
|
-
*/
|
|
23
|
-
dataTestId?: string;
|
|
24
|
-
};
|
|
25
|
-
declare const Main: React.FC<Props>;
|
|
26
|
-
type Props$0 = {
|
|
27
|
-
/**
|
|
28
|
-
* Компоненты
|
|
29
|
-
*/
|
|
30
|
-
children: ContentElement;
|
|
31
|
-
/**
|
|
32
|
-
* Идентификатор для систем автоматизированного тестирования.
|
|
33
|
-
* Используется модификатор -content
|
|
34
|
-
*/
|
|
35
|
-
dataTestId?: string;
|
|
36
|
-
};
|
|
37
|
-
declare const Content: React.FC<Props$0>;
|
|
38
|
-
type Props$1 = {
|
|
39
|
-
/**
|
|
40
|
-
* Контент
|
|
41
|
-
*/
|
|
42
|
-
children?: ReactNode;
|
|
43
|
-
/**
|
|
44
|
-
* Количество строк
|
|
45
|
-
*/
|
|
46
|
-
rowLimit?: 1 | 2;
|
|
47
|
-
/**
|
|
48
|
-
* Размер текста
|
|
49
|
-
*/
|
|
50
|
-
view?: 'primary-large' | 'primary-medium' | 'primary-small' | 'component' | 'component-primary';
|
|
51
|
-
/**
|
|
52
|
-
* Толщина title
|
|
53
|
-
*/
|
|
54
|
-
titleWeight?: 'regular' | 'bold';
|
|
55
|
-
/**
|
|
56
|
-
* Цвет title
|
|
57
|
-
*/
|
|
58
|
-
titleColor: Color;
|
|
59
|
-
/**
|
|
60
|
-
* Value ячейки
|
|
61
|
-
*/
|
|
62
|
-
value?: ReactNode;
|
|
63
|
-
/**
|
|
64
|
-
* Цвет value
|
|
65
|
-
*/
|
|
66
|
-
valueColor?: Color;
|
|
67
|
-
/**
|
|
68
|
-
* Идентификатор для систем автоматизированного тестирования.
|
|
69
|
-
* Для контента используется модификатор -text_content, для value ячейки -text_value
|
|
70
|
-
*/
|
|
71
|
-
dataTestId?: string;
|
|
72
|
-
};
|
|
73
|
-
declare const Text: React.FC<Props$1>;
|
|
74
|
-
export { Main, Content, Text };
|
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
import React, { useContext, forwardRef, useRef } from 'react';
|
|
2
|
-
import mergeRefs from 'react-merge-refs';
|
|
3
|
-
import cn from 'classnames';
|
|
4
|
-
import { Comment } from '@alfalab/core-components-comment/modern';
|
|
5
|
-
import { useFocus } from '@alfalab/hooks';
|
|
6
|
-
import { Addon } from './components/addon/component.js';
|
|
7
|
-
import { Amount } from './components/amount/component.js';
|
|
8
|
-
import { AmountTitle } from './components/amount-title/component.js';
|
|
9
|
-
import { Category } from './components/category/component.js';
|
|
10
|
-
import { getDataTestId } from '@alfalab/core-components-shared/modern';
|
|
11
|
-
import { Footer } from './components/footer/component.js';
|
|
12
|
-
import { FooterButton } from './components/footer-button/component.js';
|
|
13
|
-
import { FooterText } from './components/footer-text/component.js';
|
|
14
|
-
import { Graphics } from './components/graphics/component.js';
|
|
15
|
-
import { Typography } from '@alfalab/core-components-typography/modern';
|
|
16
|
-
|
|
17
|
-
const styles$3 = {"component":"pure-cell__component_15r7a","horizontal":"pure-cell__horizontal_15r7a"};
|
|
18
|
-
require('./components/content/index.css')
|
|
19
|
-
|
|
20
|
-
const Content = ({ children, dataTestId }) => {
|
|
21
|
-
const { direction } = useContext(PureCellContext);
|
|
22
|
-
return (React.createElement("section", { className: cn(styles$3.component, { [styles$3.horizontal]: direction === 'horizontal' }), "data-test-id": getDataTestId(dataTestId, 'content') }, children));
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
const styles$2 = {"component":"pure-cell__component_151x2","vertical":"pure-cell__vertical_151x2","reverse":"pure-cell__reverse_151x2"};
|
|
26
|
-
require('./components/main/index.css')
|
|
27
|
-
|
|
28
|
-
const Main = ({ children, isReverse, className, dataTestId }) => {
|
|
29
|
-
const { direction = 'horizontal' } = useContext(PureCellContext);
|
|
30
|
-
return (React.createElement("div", { className: cn(styles$2.component, styles$2[direction], {
|
|
31
|
-
[styles$2.reverse]: isReverse,
|
|
32
|
-
}, className), "data-test-id": getDataTestId(dataTestId, 'main') }, children));
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
const styles$1 = {"horizontal":"pure-cell__horizontal_3wsa5","rowLimit1":"pure-cell__rowLimit1_3wsa5","rowLimit2":"pure-cell__rowLimit2_3wsa5","component":"pure-cell__component_3wsa5","vertical":"pure-cell__vertical_3wsa5","title":"pure-cell__title_3wsa5","value":"pure-cell__value_3wsa5"};
|
|
36
|
-
require('./components/text/index.css')
|
|
37
|
-
|
|
38
|
-
const Text = ({ children, value, rowLimit, view = 'component-primary', titleWeight, titleColor, valueColor, dataTestId, }) => {
|
|
39
|
-
const { direction = 'horizontal' } = useContext(PureCellContext);
|
|
40
|
-
const className = rowLimit && styles$1[`rowLimit${rowLimit}`];
|
|
41
|
-
return (React.createElement("div", { className: cn(styles$1.component, {
|
|
42
|
-
[styles$1.vertical]: direction !== 'horizontal',
|
|
43
|
-
}) },
|
|
44
|
-
React.createElement("div", { className: styles$1.title },
|
|
45
|
-
React.createElement(Typography.Text, { view: view, weight: titleWeight, tag: 'div', color: titleColor, className: className, "data-test-id": getDataTestId(dataTestId, 'text_content') }, children)),
|
|
46
|
-
value && (React.createElement("div", { className: styles$1.value },
|
|
47
|
-
React.createElement(Typography.Text, { view: view, tag: 'div', color: valueColor, className: className, "data-test-id": getDataTestId(dataTestId, 'text_value') }, value)))));
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
const styles = {"component":"pure-cell__component_3dtp8","horizontal":"pure-cell__horizontal_3dtp8","vertical":"pure-cell__vertical_3dtp8","button":"pure-cell__button_3dtp8","link":"pure-cell__link_3dtp8","none":"pure-cell__none_3dtp8","airy":"pure-cell__airy_3dtp8","defaultPadding":"pure-cell__defaultPadding_3dtp8","compact":"pure-cell__compact_3dtp8","tiny":"pure-cell__tiny_3dtp8","left":"pure-cell__left_3dtp8","right":"pure-cell__right_3dtp8","both":"pure-cell__both_3dtp8","focused":"pure-cell__focused_3dtp8"};
|
|
51
|
-
require('./index.css')
|
|
52
|
-
|
|
53
|
-
/* eslint-disable react/jsx-no-constructed-context-values */
|
|
54
|
-
// eslint-disable-next-line @typescript-eslint/no-redeclare
|
|
55
|
-
const PureCellContext = React.createContext({});
|
|
56
|
-
const PureCellComponent = forwardRef(({ className, dataTestId, onClick, href, tag: Component = (href && 'a') || (onClick && 'button') || 'section', children, horizontalPadding = 'none', verticalPadding = 'none', direction = 'horizontal', ...restProps }, ref) => {
|
|
57
|
-
const cellRef = useRef(null);
|
|
58
|
-
const [focused] = useFocus(cellRef, 'keyboard');
|
|
59
|
-
const addClasses = {
|
|
60
|
-
[styles.component]: true,
|
|
61
|
-
[styles.focused]: focused,
|
|
62
|
-
[styles[direction]]: true,
|
|
63
|
-
[styles.defaultPadding]: verticalPadding === 'default',
|
|
64
|
-
[styles[verticalPadding]]: verticalPadding !== 'default',
|
|
65
|
-
[styles[horizontalPadding]]: true,
|
|
66
|
-
};
|
|
67
|
-
if (href) {
|
|
68
|
-
const { target } = restProps;
|
|
69
|
-
// Для совместимости с react-router-dom, меняем href на to
|
|
70
|
-
const hrefProps = { [typeof Component === 'string' ? 'href' : 'to']: href };
|
|
71
|
-
return (React.createElement(Component, { rel: target === '_blank' ? 'noreferrer noopener' : undefined, ...restProps, ...hrefProps, ref: mergeRefs([cellRef, ref]), className: cn(styles.link, addClasses, className), "data-test-id": dataTestId, onClick: onClick },
|
|
72
|
-
React.createElement(PureCellContext.Provider, { value: { direction } }, children)));
|
|
73
|
-
}
|
|
74
|
-
if (onClick) {
|
|
75
|
-
return (React.createElement(Component, { ...restProps, ref: mergeRefs([cellRef, ref]), className: cn(styles.button, addClasses, className), "data-test-id": dataTestId, onClick: onClick },
|
|
76
|
-
React.createElement(PureCellContext.Provider, { value: { direction } }, children)));
|
|
77
|
-
}
|
|
78
|
-
return (React.createElement(Component, { ...restProps, ref: ref, tabIndex: 0, className: cn(addClasses, className), "data-test-id": dataTestId },
|
|
79
|
-
React.createElement(PureCellContext.Provider, { value: { direction } }, children)));
|
|
80
|
-
});
|
|
81
|
-
/**
|
|
82
|
-
* Универсальный конструктор для сборки любой ячейки.
|
|
83
|
-
*
|
|
84
|
-
* [Макет](https://www.figma.com/file/KlFOLLkKO8rtvvQE3RXuhq/Click-Library?node-id=43525%3A240018)
|
|
85
|
-
*/
|
|
86
|
-
const PureCell = Object.assign(PureCellComponent, {
|
|
87
|
-
Main,
|
|
88
|
-
Graphics,
|
|
89
|
-
Content,
|
|
90
|
-
Text,
|
|
91
|
-
Amount,
|
|
92
|
-
AmountTitle,
|
|
93
|
-
Addon,
|
|
94
|
-
Footer,
|
|
95
|
-
ExtraSubtitle: FooterText,
|
|
96
|
-
FooterButton,
|
|
97
|
-
Comment,
|
|
98
|
-
Category,
|
|
99
|
-
});
|
|
100
|
-
|
|
101
|
-
export { Content as C, Main as M, PureCell as P, Text as T, PureCellContext as a };
|