@megafon/ui-lk-vas 0.10.9 → 0.10.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/dist/es/components/BottomBar/BottomBar.css +1 -0
- package/dist/es/components/BottomBar/BottomBar.d.ts +28 -0
- package/dist/es/components/BottomBar/BottomBar.js +48 -0
- package/dist/es/components/Cards/CardBig/CardBig.css +1 -0
- package/dist/es/components/Cards/CardBig/CardBig.d.ts +13 -0
- package/dist/es/components/Cards/CardBig/CardBig.js +31 -0
- package/dist/es/components/Cards/CardSmall/CardSmall.css +1 -0
- package/dist/es/components/Cards/CardSmall/CardSmall.d.ts +36 -0
- package/dist/es/components/Cards/CardSmall/CardSmall.js +68 -0
- package/dist/es/components/Cards/components/_CardCell/CardCell.css +1 -0
- package/dist/es/components/Cards/components/_CardCell/CardCell.d.ts +41 -0
- package/dist/es/components/Cards/components/_CardCell/CardCell.js +110 -0
- package/dist/es/components/Charts/Chart/Chart.css +1 -0
- package/dist/es/components/Charts/Chart/Chart.d.ts +5 -0
- package/dist/es/components/Charts/Chart/Chart.js +104 -0
- package/dist/es/components/Charts/Chart/components/_ChartBar/ChartBar.css +1 -0
- package/dist/es/components/Charts/Chart/components/_ChartBar/ChartBar.d.ts +9 -0
- package/dist/es/components/Charts/Chart/components/_ChartBar/ChartBar.js +110 -0
- package/dist/es/components/Charts/Chart/components/_ChartBase/ChartBase.d.ts +12 -0
- package/dist/es/components/Charts/Chart/components/_ChartBase/ChartBase.js +41 -0
- package/dist/es/components/Charts/Chart/components/_ChartBase/helpers.d.ts +2 -0
- package/dist/es/components/Charts/Chart/components/_ChartBase/helpers.js +49 -0
- package/dist/es/components/Charts/Chart/components/_ChartDoughnut/ChartDoughnut.css +1 -0
- package/dist/es/components/Charts/Chart/components/_ChartDoughnut/ChartDoughnut.d.ts +9 -0
- package/dist/es/components/Charts/Chart/components/_ChartDoughnut/ChartDoughnut.js +65 -0
- package/dist/es/components/Charts/Chart/components/_ChartLegend/ChartLegend.css +1 -0
- package/dist/es/components/Charts/Chart/components/_ChartLegend/ChartLegend.d.ts +12 -0
- package/dist/es/components/Charts/Chart/components/_ChartLegend/ChartLegend.js +29 -0
- package/dist/es/components/Charts/Chart/components/_ChartLine/ChartLine.css +1 -0
- package/dist/es/components/Charts/Chart/components/_ChartLine/ChartLine.d.ts +9 -0
- package/dist/es/components/Charts/Chart/components/_ChartLine/ChartLine.js +112 -0
- package/dist/es/components/Charts/Chart/components/chartColors.d.ts +16 -0
- package/dist/es/components/Charts/Chart/components/chartColors.js +42 -0
- package/dist/es/components/Charts/Chart/img/chart.png +0 -0
- package/dist/es/components/Charts/Chart/types.d.ts +40 -0
- package/dist/es/components/Charts/Chart/types.js +1 -0
- package/dist/es/components/Header/Header.css +1 -0
- package/dist/es/components/Header/Header.d.ts +33 -0
- package/dist/es/components/Header/Header.js +48 -0
- package/dist/es/components/Header/components/_HeaderAccount/HeaderAccount.css +1 -0
- package/dist/es/components/Header/components/_HeaderAccount/HeaderAccount.d.ts +21 -0
- package/dist/es/components/Header/components/_HeaderAccount/HeaderAccount.js +43 -0
- package/dist/es/components/Header/components/_HeaderButton/HeaderButton.css +1 -0
- package/dist/es/components/Header/components/_HeaderButton/HeaderButton.d.ts +20 -0
- package/dist/es/components/Header/components/_HeaderButton/HeaderButton.js +82 -0
- package/dist/es/components/Header/components/_HeaderFavorites/HeaderFavorites.css +1 -0
- package/dist/es/components/Header/components/_HeaderFavorites/HeaderFavorites.d.ts +19 -0
- package/dist/es/components/Header/components/_HeaderFavorites/HeaderFavorites.js +40 -0
- package/dist/es/components/Header/components/_HeaderFinance/HeaderFinance.css +1 -0
- package/dist/es/components/Header/components/_HeaderFinance/HeaderFinance.d.ts +28 -0
- package/dist/es/components/Header/components/_HeaderFinance/HeaderFinance.js +23 -0
- package/dist/es/components/Header/components/_HeaderLkSelect/HeaderLkSelect.css +1 -0
- package/dist/es/components/Header/components/_HeaderLkSelect/HeaderLkSelect.d.ts +19 -0
- package/dist/es/components/Header/components/_HeaderLkSelect/HeaderLkSelect.js +51 -0
- package/dist/es/components/Header/components/_HeaderLogo/HeaderLogo.css +1 -0
- package/dist/es/components/Header/components/_HeaderLogo/HeaderLogo.d.ts +18 -0
- package/dist/es/components/Header/components/_HeaderLogo/HeaderLogo.js +59 -0
- package/dist/es/components/Header/components/_HeaderSupport/HeaderSupport.d.ts +19 -0
- package/dist/es/components/Header/components/_HeaderSupport/HeaderSupport.js +38 -0
- package/dist/es/components/Layout/Layout.css +1 -0
- package/dist/es/components/Layout/Layout.d.ts +10 -0
- package/dist/es/components/Layout/Layout.js +23 -0
- package/dist/es/components/NavBar/NavBar.css +1 -0
- package/dist/es/components/NavBar/NavBar.d.ts +23 -0
- package/dist/es/components/NavBar/NavBar.js +31 -0
- package/dist/es/components/NavBar/components/_NavBarItem/NavBarItem.css +1 -0
- package/dist/es/components/NavBar/components/_NavBarItem/NavBarItem.d.ts +22 -0
- package/dist/es/components/NavBar/components/_NavBarItem/NavBarItem.js +37 -0
- package/dist/es/components/Table/Table.css +1 -0
- package/dist/es/components/Table/Table.d.ts +15 -0
- package/dist/es/components/Table/Table.js +76 -0
- package/dist/es/components/Table/components/TableBody/TableBody.d.ts +11 -0
- package/dist/es/components/Table/components/TableBody/TableBody.js +13 -0
- package/dist/es/components/Table/components/TableHead/TableHead.d.ts +11 -0
- package/dist/es/components/Table/components/TableHead/TableHead.js +13 -0
- package/dist/es/components/Table/components/TableSettings/TableSettings.css +1 -0
- package/dist/es/components/Table/components/TableSettings/TableSettings.d.ts +23 -0
- package/dist/es/components/Table/components/TableSettings/TableSettings.js +50 -0
- package/dist/es/components/Table/components/TableTd/TableTd.css +1 -0
- package/dist/es/components/Table/components/TableTd/TableTd.d.ts +18 -0
- package/dist/es/components/Table/components/TableTd/TableTd.js +26 -0
- package/dist/es/components/Table/components/TableTh/TableTh.css +1 -0
- package/dist/es/components/Table/components/TableTh/TableTh.d.ts +45 -0
- package/dist/es/components/Table/components/TableTh/TableTh.js +81 -0
- package/dist/es/components/Table/components/TableTooltip/TableTooltip.css +1 -0
- package/dist/es/components/Table/components/TableTooltip/TableTooltip.d.ts +27 -0
- package/dist/es/components/Table/components/TableTooltip/TableTooltip.js +38 -0
- package/dist/es/components/Table/components/TableTr/TableTr.css +1 -0
- package/dist/es/components/Table/components/TableTr/TableTr.d.ts +12 -0
- package/dist/es/components/Table/components/TableTr/TableTr.js +14 -0
- package/dist/es/components/Table/contexts/TableContext.d.ts +6 -0
- package/dist/es/components/Table/contexts/TableContext.js +8 -0
- package/dist/es/components/Table/helpers.d.ts +2 -0
- package/dist/es/components/Table/helpers.js +12 -0
- package/dist/es/components/Table/types.d.ts +5 -0
- package/dist/es/components/Table/types.js +1 -0
- package/dist/es/components/_Dropdown/Dropdown.css +1 -0
- package/dist/es/components/_Dropdown/Dropdown.d.ts +12 -0
- package/dist/es/components/_Dropdown/Dropdown.js +54 -0
- package/dist/es/components/_DropdownInfo/DropdownInfo.css +1 -0
- package/dist/es/components/_DropdownInfo/DropdownInfo.d.ts +9 -0
- package/dist/es/components/_DropdownInfo/DropdownInfo.js +22 -0
- package/dist/es/components/_DropdownItem/DropdownItem.css +1 -0
- package/dist/es/components/_DropdownItem/DropdownItem.d.ts +34 -0
- package/dist/es/components/_DropdownItem/DropdownItem.js +39 -0
- package/dist/es/helpers/setRelAttribute.d.ts +3 -0
- package/dist/es/helpers/setRelAttribute.js +9 -0
- package/dist/es/hooks/useCssVariable.d.ts +2 -0
- package/dist/es/hooks/useCssVariable.js +22 -0
- package/dist/es/index.d.ts +33 -0
- package/dist/es/index.js +33 -0
- package/dist/es/styles/constants.css +0 -0
- package/dist/lib/components/BottomBar/BottomBar.css +1 -0
- package/dist/lib/components/BottomBar/BottomBar.d.ts +28 -0
- package/dist/lib/components/BottomBar/BottomBar.js +57 -0
- package/dist/lib/components/Cards/CardBig/CardBig.css +1 -0
- package/dist/lib/components/Cards/CardBig/CardBig.d.ts +13 -0
- package/dist/lib/components/Cards/CardBig/CardBig.js +40 -0
- package/dist/lib/components/Cards/CardSmall/CardSmall.css +1 -0
- package/dist/lib/components/Cards/CardSmall/CardSmall.d.ts +36 -0
- package/dist/lib/components/Cards/CardSmall/CardSmall.js +77 -0
- package/dist/lib/components/Cards/components/_CardCell/CardCell.css +1 -0
- package/dist/lib/components/Cards/components/_CardCell/CardCell.d.ts +41 -0
- package/dist/lib/components/Cards/components/_CardCell/CardCell.js +119 -0
- package/dist/lib/components/Charts/Chart/Chart.css +1 -0
- package/dist/lib/components/Charts/Chart/Chart.d.ts +5 -0
- package/dist/lib/components/Charts/Chart/Chart.js +113 -0
- package/dist/lib/components/Charts/Chart/components/_ChartBar/ChartBar.css +1 -0
- package/dist/lib/components/Charts/Chart/components/_ChartBar/ChartBar.d.ts +9 -0
- package/dist/lib/components/Charts/Chart/components/_ChartBar/ChartBar.js +119 -0
- package/dist/lib/components/Charts/Chart/components/_ChartBase/ChartBase.d.ts +12 -0
- package/dist/lib/components/Charts/Chart/components/_ChartBase/ChartBase.js +51 -0
- package/dist/lib/components/Charts/Chart/components/_ChartBase/helpers.d.ts +2 -0
- package/dist/lib/components/Charts/Chart/components/_ChartBase/helpers.js +55 -0
- package/dist/lib/components/Charts/Chart/components/_ChartDoughnut/ChartDoughnut.css +1 -0
- package/dist/lib/components/Charts/Chart/components/_ChartDoughnut/ChartDoughnut.d.ts +9 -0
- package/dist/lib/components/Charts/Chart/components/_ChartDoughnut/ChartDoughnut.js +74 -0
- package/dist/lib/components/Charts/Chart/components/_ChartLegend/ChartLegend.css +1 -0
- package/dist/lib/components/Charts/Chart/components/_ChartLegend/ChartLegend.d.ts +12 -0
- package/dist/lib/components/Charts/Chart/components/_ChartLegend/ChartLegend.js +37 -0
- package/dist/lib/components/Charts/Chart/components/_ChartLine/ChartLine.css +1 -0
- package/dist/lib/components/Charts/Chart/components/_ChartLine/ChartLine.d.ts +9 -0
- package/dist/lib/components/Charts/Chart/components/_ChartLine/ChartLine.js +121 -0
- package/dist/lib/components/Charts/Chart/components/chartColors.d.ts +16 -0
- package/dist/lib/components/Charts/Chart/components/chartColors.js +48 -0
- package/dist/lib/components/Charts/Chart/img/chart.png +0 -0
- package/dist/lib/components/Charts/Chart/types.d.ts +40 -0
- package/dist/lib/components/Charts/Chart/types.js +5 -0
- package/dist/lib/components/Header/Header.css +1 -0
- package/dist/lib/components/Header/Header.d.ts +33 -0
- package/dist/lib/components/Header/Header.js +57 -0
- package/dist/lib/components/Header/components/_HeaderAccount/HeaderAccount.css +1 -0
- package/dist/lib/components/Header/components/_HeaderAccount/HeaderAccount.d.ts +21 -0
- package/dist/lib/components/Header/components/_HeaderAccount/HeaderAccount.js +52 -0
- package/dist/lib/components/Header/components/_HeaderButton/HeaderButton.css +1 -0
- package/dist/lib/components/Header/components/_HeaderButton/HeaderButton.d.ts +20 -0
- package/dist/lib/components/Header/components/_HeaderButton/HeaderButton.js +91 -0
- package/dist/lib/components/Header/components/_HeaderFavorites/HeaderFavorites.css +1 -0
- package/dist/lib/components/Header/components/_HeaderFavorites/HeaderFavorites.d.ts +19 -0
- package/dist/lib/components/Header/components/_HeaderFavorites/HeaderFavorites.js +49 -0
- package/dist/lib/components/Header/components/_HeaderFinance/HeaderFinance.css +1 -0
- package/dist/lib/components/Header/components/_HeaderFinance/HeaderFinance.d.ts +28 -0
- package/dist/lib/components/Header/components/_HeaderFinance/HeaderFinance.js +32 -0
- package/dist/lib/components/Header/components/_HeaderLkSelect/HeaderLkSelect.css +1 -0
- package/dist/lib/components/Header/components/_HeaderLkSelect/HeaderLkSelect.d.ts +19 -0
- package/dist/lib/components/Header/components/_HeaderLkSelect/HeaderLkSelect.js +60 -0
- package/dist/lib/components/Header/components/_HeaderLogo/HeaderLogo.css +1 -0
- package/dist/lib/components/Header/components/_HeaderLogo/HeaderLogo.d.ts +18 -0
- package/dist/lib/components/Header/components/_HeaderLogo/HeaderLogo.js +68 -0
- package/dist/lib/components/Header/components/_HeaderSupport/HeaderSupport.d.ts +19 -0
- package/dist/lib/components/Header/components/_HeaderSupport/HeaderSupport.js +48 -0
- package/dist/lib/components/Layout/Layout.css +1 -0
- package/dist/lib/components/Layout/Layout.d.ts +10 -0
- package/dist/lib/components/Layout/Layout.js +31 -0
- package/dist/lib/components/NavBar/NavBar.css +1 -0
- package/dist/lib/components/NavBar/NavBar.d.ts +23 -0
- package/dist/lib/components/NavBar/NavBar.js +40 -0
- package/dist/lib/components/NavBar/components/_NavBarItem/NavBarItem.css +1 -0
- package/dist/lib/components/NavBar/components/_NavBarItem/NavBarItem.d.ts +22 -0
- package/dist/lib/components/NavBar/components/_NavBarItem/NavBarItem.js +45 -0
- package/dist/lib/components/Table/Table.css +1 -0
- package/dist/lib/components/Table/Table.d.ts +15 -0
- package/dist/lib/components/Table/Table.js +85 -0
- package/dist/lib/components/Table/components/TableBody/TableBody.d.ts +11 -0
- package/dist/lib/components/Table/components/TableBody/TableBody.js +23 -0
- package/dist/lib/components/Table/components/TableHead/TableHead.d.ts +11 -0
- package/dist/lib/components/Table/components/TableHead/TableHead.js +23 -0
- package/dist/lib/components/Table/components/TableSettings/TableSettings.css +1 -0
- package/dist/lib/components/Table/components/TableSettings/TableSettings.d.ts +23 -0
- package/dist/lib/components/Table/components/TableSettings/TableSettings.js +59 -0
- package/dist/lib/components/Table/components/TableTd/TableTd.css +1 -0
- package/dist/lib/components/Table/components/TableTd/TableTd.d.ts +18 -0
- package/dist/lib/components/Table/components/TableTd/TableTd.js +35 -0
- package/dist/lib/components/Table/components/TableTh/TableTh.css +1 -0
- package/dist/lib/components/Table/components/TableTh/TableTh.d.ts +45 -0
- package/dist/lib/components/Table/components/TableTh/TableTh.js +90 -0
- package/dist/lib/components/Table/components/TableTooltip/TableTooltip.css +1 -0
- package/dist/lib/components/Table/components/TableTooltip/TableTooltip.d.ts +27 -0
- package/dist/lib/components/Table/components/TableTooltip/TableTooltip.js +46 -0
- package/dist/lib/components/Table/components/TableTr/TableTr.css +1 -0
- package/dist/lib/components/Table/components/TableTr/TableTr.d.ts +12 -0
- package/dist/lib/components/Table/components/TableTr/TableTr.js +23 -0
- package/dist/lib/components/Table/contexts/TableContext.d.ts +6 -0
- package/dist/lib/components/Table/contexts/TableContext.js +14 -0
- package/dist/lib/components/Table/helpers.d.ts +2 -0
- package/dist/lib/components/Table/helpers.js +18 -0
- package/dist/lib/components/Table/types.d.ts +5 -0
- package/dist/lib/components/Table/types.js +5 -0
- package/dist/lib/components/_Dropdown/Dropdown.css +1 -0
- package/dist/lib/components/_Dropdown/Dropdown.d.ts +12 -0
- package/dist/lib/components/_Dropdown/Dropdown.js +63 -0
- package/dist/lib/components/_DropdownInfo/DropdownInfo.css +1 -0
- package/dist/lib/components/_DropdownInfo/DropdownInfo.d.ts +9 -0
- package/dist/lib/components/_DropdownInfo/DropdownInfo.js +30 -0
- package/dist/lib/components/_DropdownItem/DropdownItem.css +1 -0
- package/dist/lib/components/_DropdownItem/DropdownItem.d.ts +34 -0
- package/dist/lib/components/_DropdownItem/DropdownItem.js +48 -0
- package/dist/lib/helpers/setRelAttribute.d.ts +3 -0
- package/dist/lib/helpers/setRelAttribute.js +15 -0
- package/dist/lib/hooks/useCssVariable.d.ts +2 -0
- package/dist/lib/hooks/useCssVariable.js +29 -0
- package/dist/lib/index.d.ts +33 -0
- package/dist/lib/index.js +237 -0
- package/dist/lib/styles/constants.css +0 -0
- package/package.json +5 -5
|
@@ -0,0 +1 @@
|
|
|
1
|
+
h1,h2,h3,h4,h5{margin:0}.mfui-lkvas-bottom-bar{background-color:var(--base);border-top:1px solid var(--spbSky1);bottom:0;-webkit-box-sizing:border-box;box-sizing:border-box;display:-webkit-box;display:-ms-flexbox;display:flex;gap:32px;height:96px;left:264px;padding:12px 40px 31px 32px;position:fixed;right:12px;z-index:100}.mfui-lkvas-bottom-bar__back-button{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:transparent;border:none;border-radius:0;-webkit-box-sizing:border-box;box-sizing:border-box;color:var(--content);cursor:pointer;display:block;font:inherit;outline:none;padding:0;text-align:center;text-decoration:none}.mfui-lkvas-bottom-bar__back-button:hover{text-decoration:none}.mfui-lkvas-bottom-bar__back-button-inner{display:-webkit-box;display:-ms-flexbox;display:flex;font-size:15px;font-weight:500;gap:12px;line-height:24px;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}.mfui-lkvas-bottom-bar__arrow-back{display:block;height:20px;width:40px;fill:var(--content)}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import './BottomBar.scss';
|
|
3
|
+
export interface IBottomBar {
|
|
4
|
+
/** Дополнительный класс корневого элемента */
|
|
5
|
+
className?: string;
|
|
6
|
+
/** Поведение кнопки */
|
|
7
|
+
actionButtonType?: 'button' | 'reset' | 'submit';
|
|
8
|
+
/** Название кнопки действия */
|
|
9
|
+
actionButtonTitle: string;
|
|
10
|
+
/** Показать кнопку действия в состоянии загрузки */
|
|
11
|
+
showActionButtonLoader?: boolean;
|
|
12
|
+
/** Отключение кнопки действия */
|
|
13
|
+
disableActionButton?: boolean;
|
|
14
|
+
/** Обработчик клика кнопки действия */
|
|
15
|
+
onActionButtonClick: (e: React.SyntheticEvent<EventTarget>) => void;
|
|
16
|
+
/** Название кнопки возврата */
|
|
17
|
+
backButtonTitle?: string;
|
|
18
|
+
/** Обработчик клика кнопки возврата */
|
|
19
|
+
onBackButtonClick: (e: React.SyntheticEvent<EventTarget>) => void;
|
|
20
|
+
/** Дополнительные data атрибуты к внутренним элементам */
|
|
21
|
+
dataAttrs?: {
|
|
22
|
+
root?: Record<string, string>;
|
|
23
|
+
actionButton?: Record<string, string>;
|
|
24
|
+
backButton?: Record<string, string>;
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
declare const BottomBar: React.FC<IBottomBar>;
|
|
28
|
+
export default BottomBar;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { Button } from '@megafon/ui-core';
|
|
4
|
+
import { cnCreate, filterDataAttrs } from '@megafon/ui-helpers';
|
|
5
|
+
import "./BottomBar.css";
|
|
6
|
+
var ArrowBackIcon = function ArrowBackIcon(props) {
|
|
7
|
+
return /*#__PURE__*/React.createElement("svg", _extends({
|
|
8
|
+
viewBox: "0 0 40 20"
|
|
9
|
+
}, props), /*#__PURE__*/React.createElement("path", {
|
|
10
|
+
d: "M36 11H7.8l5.6 5.6L12 18l-8-8 8-8 1.4 1.4L7.8 9H36z"
|
|
11
|
+
}));
|
|
12
|
+
};
|
|
13
|
+
var cn = cnCreate('mfui-lkvas-bottom-bar');
|
|
14
|
+
var BottomBar = function BottomBar(_ref) {
|
|
15
|
+
var className = _ref.className,
|
|
16
|
+
_ref$actionButtonType = _ref.actionButtonType,
|
|
17
|
+
actionButtonType = _ref$actionButtonType === void 0 ? 'button' : _ref$actionButtonType,
|
|
18
|
+
actionButtonTitle = _ref.actionButtonTitle,
|
|
19
|
+
_ref$backButtonTitle = _ref.backButtonTitle,
|
|
20
|
+
backButtonTitle = _ref$backButtonTitle === void 0 ? 'Назад' : _ref$backButtonTitle,
|
|
21
|
+
_ref$showActionButton = _ref.showActionButtonLoader,
|
|
22
|
+
showActionButtonLoader = _ref$showActionButton === void 0 ? false : _ref$showActionButton,
|
|
23
|
+
_ref$disableActionBut = _ref.disableActionButton,
|
|
24
|
+
disableActionButton = _ref$disableActionBut === void 0 ? false : _ref$disableActionBut,
|
|
25
|
+
onActionButtonClick = _ref.onActionButtonClick,
|
|
26
|
+
onBackButtonClick = _ref.onBackButtonClick,
|
|
27
|
+
dataAttrs = _ref.dataAttrs;
|
|
28
|
+
return /*#__PURE__*/React.createElement("div", _extends({
|
|
29
|
+
className: cn([className])
|
|
30
|
+
}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root)), /*#__PURE__*/React.createElement("button", _extends({
|
|
31
|
+
className: cn('back-button', [className]),
|
|
32
|
+
type: "button",
|
|
33
|
+
onClick: onBackButtonClick
|
|
34
|
+
}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.backButton)), /*#__PURE__*/React.createElement("div", {
|
|
35
|
+
className: cn('back-button-inner')
|
|
36
|
+
}, /*#__PURE__*/React.createElement(ArrowBackIcon, {
|
|
37
|
+
className: cn('arrow-back')
|
|
38
|
+
}), backButtonTitle)), /*#__PURE__*/React.createElement(Button, {
|
|
39
|
+
actionType: actionButtonType,
|
|
40
|
+
showLoader: showActionButtonLoader,
|
|
41
|
+
disabled: disableActionButton,
|
|
42
|
+
dataAttrs: {
|
|
43
|
+
root: dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.actionButton
|
|
44
|
+
},
|
|
45
|
+
onClick: onActionButtonClick
|
|
46
|
+
}, actionButtonTitle));
|
|
47
|
+
};
|
|
48
|
+
export default BottomBar;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
h1,h2,h3,h4,h5{margin:0}.mfui-lkvas-card-big{background-color:var(--base);border:1px solid var(--spbSky2);border-radius:12px;-webkit-box-sizing:border-box;box-sizing:border-box;display:grid;grid-auto-columns:minmax(0,1fr);grid-auto-flow:column;grid-template-rows:1fr;overflow:hidden;width:100%}.mfui-lkvas-card-big__item{padding:16px 12px}.mfui-lkvas-card-big__item:first-child{padding-left:24px;padding-right:24px}.mfui-lkvas-card-big__item:nth-child(2){padding-left:24px}.mfui-lkvas-card-big__item:last-child{padding-right:24px}.mfui-lkvas-card-big_multiline{grid-template-rows:repeat(2,-webkit-min-content);grid-template-rows:repeat(2,min-content)}.mfui-lkvas-card-big_multiline .mfui-lkvas-card-big__item:nth-child(2){padding-left:24px;padding-right:24px}.mfui-lkvas-card-big_multiline .mfui-lkvas-card-big__item:nth-child(3),.mfui-lkvas-card-big_multiline .mfui-lkvas-card-big__item:nth-child(4){padding-left:24px}.mfui-lkvas-card-big_multiline .mfui-lkvas-card-big__item:nth-last-child(2){padding-right:24px}.mfui-lkvas-card-big_multiline .mfui-lkvas-card-big__item:nth-child(2n){padding-top:6px}.mfui-lkvas-card-big_multiline .mfui-lkvas-card-big__item:nth-child(odd){padding-bottom:6px}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { type CardCellType } from '../components/_CardCell/CardCell';
|
|
3
|
+
import './CardBig.scss';
|
|
4
|
+
export interface ICardBig {
|
|
5
|
+
/** Дополнительный класс корневого элемента */
|
|
6
|
+
className?: string;
|
|
7
|
+
/** Массив элементов */
|
|
8
|
+
items: CardCellType[];
|
|
9
|
+
/** Расположение элементов в 2 строки. Элементы размещаются последовательно по каждому столбцу, начиная с первого. */
|
|
10
|
+
isTwoLine?: boolean;
|
|
11
|
+
}
|
|
12
|
+
declare const CardSmall: React.FC<ICardBig>;
|
|
13
|
+
export default CardSmall;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import "core-js/modules/es.array.map.js";
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { cnCreate } from '@megafon/ui-helpers';
|
|
5
|
+
import CardCell from "../components/_CardCell/CardCell";
|
|
6
|
+
import "./CardBig.css";
|
|
7
|
+
var cn = cnCreate('mfui-lkvas-card-big');
|
|
8
|
+
var CardSmall = function CardSmall(_ref) {
|
|
9
|
+
var className = _ref.className,
|
|
10
|
+
_ref$items = _ref.items,
|
|
11
|
+
items = _ref$items === void 0 ? [] : _ref$items,
|
|
12
|
+
_ref$isTwoLine = _ref.isTwoLine,
|
|
13
|
+
isTwoLine = _ref$isTwoLine === void 0 ? false : _ref$isTwoLine;
|
|
14
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
15
|
+
className: cn({
|
|
16
|
+
multiline: isTwoLine
|
|
17
|
+
}, [className])
|
|
18
|
+
}, items.map(function (item, index) {
|
|
19
|
+
var isFirstItem = index === 0;
|
|
20
|
+
var isSecondItem = index === 1;
|
|
21
|
+
var isFirstColumn = isFirstItem || isTwoLine && isSecondItem;
|
|
22
|
+
return /*#__PURE__*/React.createElement(CardCell, _extends({
|
|
23
|
+
key: index,
|
|
24
|
+
className: cn('item')
|
|
25
|
+
}, item, {
|
|
26
|
+
isFirstCell: isFirstItem,
|
|
27
|
+
hasBackgroundFill: isFirstColumn
|
|
28
|
+
}));
|
|
29
|
+
}));
|
|
30
|
+
};
|
|
31
|
+
export default CardSmall;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
h1,h2,h3,h4,h5{margin:0}.mfui-lkvas-card-small{display:-webkit-box;display:-ms-flexbox;display:flex;position:relative;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-webkit-box-pack:justify;-ms-flex-pack:justify;background-color:var(--base);border:1px solid var(--spbSky2);border-radius:12px;-webkit-box-sizing:border-box;box-sizing:border-box;justify-content:space-between;padding:16px;width:233px}.mfui-lkvas-card-small_adaptive{max-width:100%;width:100%}.mfui-lkvas-card-small__close-button{background-color:var(--spbSky0);border:none;border-radius:50%;-webkit-box-sizing:border-box;box-sizing:border-box;cursor:pointer;height:28px;min-width:28px;padding:4px;position:absolute;right:8px;top:8px;width:28px}.mfui-lkvas-card-small__close-icon{height:100%;width:100%;fill:var(--spbSky3)}.mfui-lkvas-card-small__buttons,.mfui-lkvas-card-small__items{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;gap:12px;-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start}.mfui-lkvas-card-small__item:first-child{padding-right:28px}.mfui-lkvas-card-small__buttons{border-top:1px solid var(--spbSky1);margin-top:16px;padding-top:16px}.mfui-lkvas-card-small__button{background-color:transparent;border:none;-webkit-box-sizing:border-box;box-sizing:border-box;color:var(--systemBlue);cursor:pointer;font:inherit;padding:0;text-decoration:none}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { type CardCellType } from '../components/_CardCell/CardCell';
|
|
3
|
+
import './CardSmall.scss';
|
|
4
|
+
export type ButtonType = {
|
|
5
|
+
/** Название */
|
|
6
|
+
title: string;
|
|
7
|
+
/** Ссылка */
|
|
8
|
+
href?: string;
|
|
9
|
+
/** Атрибут ссылки target */
|
|
10
|
+
target?: '_self' | '_blank' | '_parent' | '_top';
|
|
11
|
+
/** Атрибут ссылки rel */
|
|
12
|
+
rel?: string;
|
|
13
|
+
/** Обработчик клика */
|
|
14
|
+
onClick?: (e: React.SyntheticEvent<EventTarget>) => void;
|
|
15
|
+
};
|
|
16
|
+
export type CardSmallCellType = Pick<CardCellType, 'title' | 'titleColor' | 'subtitle'>;
|
|
17
|
+
export interface ICardSmall {
|
|
18
|
+
/** Дополнительный класс корневого элемента */
|
|
19
|
+
className?: string;
|
|
20
|
+
/** Массив элементов */
|
|
21
|
+
items: CardSmallCellType[];
|
|
22
|
+
/** Кнопки действий */
|
|
23
|
+
actionButtons: ButtonType[];
|
|
24
|
+
/** Обработчик клика по кнопке-крестику "Закрыть" */
|
|
25
|
+
onCloseButtonClick?: () => void;
|
|
26
|
+
/** Растягивать компонент на всю ширину */
|
|
27
|
+
isAdaptive?: boolean;
|
|
28
|
+
/** Дополнительные data атрибуты к внутренним элементам */
|
|
29
|
+
dataAttrs?: {
|
|
30
|
+
root?: Record<string, string>;
|
|
31
|
+
actionButton?: Record<string, string>;
|
|
32
|
+
closeButton?: Record<string, string>;
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
declare const CardSmall: React.FC<ICardSmall>;
|
|
36
|
+
export default CardSmall;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import "core-js/modules/es.array.map.js";
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { cnCreate, filterDataAttrs } from '@megafon/ui-helpers';
|
|
5
|
+
import { setRelAttribute } from "../../../helpers/setRelAttribute";
|
|
6
|
+
import CardCell from "../components/_CardCell/CardCell";
|
|
7
|
+
import "./CardSmall.css";
|
|
8
|
+
var CancelIcon = function CancelIcon(props) {
|
|
9
|
+
return /*#__PURE__*/React.createElement("svg", _extends({
|
|
10
|
+
viewBox: "0 0 20 20"
|
|
11
|
+
}, props), /*#__PURE__*/React.createElement("path", {
|
|
12
|
+
className: "CancelIcon__st0",
|
|
13
|
+
d: "M10 8.8L6.2 5 5 6.2 8.8 10 5 13.8 6.2 15l3.8-3.8 3.8 3.8 1.2-1.2-3.8-3.8L15 6.2 13.8 5 10 8.8z"
|
|
14
|
+
}));
|
|
15
|
+
};
|
|
16
|
+
var cn = cnCreate('mfui-lkvas-card-small');
|
|
17
|
+
var CardSmall = function CardSmall(_ref) {
|
|
18
|
+
var className = _ref.className,
|
|
19
|
+
_ref$actionButtons = _ref.actionButtons,
|
|
20
|
+
actionButtons = _ref$actionButtons === void 0 ? [] : _ref$actionButtons,
|
|
21
|
+
onCloseButtonClick = _ref.onCloseButtonClick,
|
|
22
|
+
_ref$items = _ref.items,
|
|
23
|
+
items = _ref$items === void 0 ? [] : _ref$items,
|
|
24
|
+
_ref$isAdaptive = _ref.isAdaptive,
|
|
25
|
+
isAdaptive = _ref$isAdaptive === void 0 ? false : _ref$isAdaptive,
|
|
26
|
+
dataAttrs = _ref.dataAttrs;
|
|
27
|
+
var hasCloseButton = !!onCloseButtonClick;
|
|
28
|
+
return /*#__PURE__*/React.createElement("div", _extends({
|
|
29
|
+
className: cn({
|
|
30
|
+
adaptive: isAdaptive
|
|
31
|
+
}, [className])
|
|
32
|
+
}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root)), hasCloseButton && /*#__PURE__*/React.createElement("button", _extends({
|
|
33
|
+
className: cn('close-button')
|
|
34
|
+
}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.closeButton), {
|
|
35
|
+
type: "button",
|
|
36
|
+
onClick: onCloseButtonClick
|
|
37
|
+
}), /*#__PURE__*/React.createElement(CancelIcon, {
|
|
38
|
+
className: cn('close-icon')
|
|
39
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
40
|
+
className: cn('items')
|
|
41
|
+
}, items.map(function (item, index) {
|
|
42
|
+
var isFirstItem = index === 0;
|
|
43
|
+
return /*#__PURE__*/React.createElement(CardCell, _extends({
|
|
44
|
+
key: index,
|
|
45
|
+
className: cn('item')
|
|
46
|
+
}, item, {
|
|
47
|
+
isFirstCell: isFirstItem
|
|
48
|
+
}));
|
|
49
|
+
})), !!(actionButtons === null || actionButtons === void 0 ? void 0 : actionButtons.length) && /*#__PURE__*/React.createElement("div", {
|
|
50
|
+
className: cn('buttons')
|
|
51
|
+
}, actionButtons.map(function (_ref2, index) {
|
|
52
|
+
var title = _ref2.title,
|
|
53
|
+
href = _ref2.href,
|
|
54
|
+
target = _ref2.target,
|
|
55
|
+
rel = _ref2.rel,
|
|
56
|
+
onClick = _ref2.onClick;
|
|
57
|
+
var ElementType = href ? 'a' : 'button';
|
|
58
|
+
return /*#__PURE__*/React.createElement(ElementType, _extends({
|
|
59
|
+
key: title + index,
|
|
60
|
+
className: cn('button')
|
|
61
|
+
}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.actionButton, index + 1), {
|
|
62
|
+
href: href,
|
|
63
|
+
rel: setRelAttribute(rel, target),
|
|
64
|
+
onClick: onClick
|
|
65
|
+
}), title);
|
|
66
|
+
})));
|
|
67
|
+
};
|
|
68
|
+
export default CardSmall;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
h1,h2,h3,h4,h5{margin:0}.mfui-lkvas-card-cell{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:left;-ms-flex-pack:left;-webkit-box-sizing:border-box;box-sizing:border-box;justify-content:left;width:100%}.mfui-lkvas-card-cell__text-box{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;overflow:hidden}.mfui-lkvas-card-cell__actions-box,.mfui-lkvas-card-cell__switcher-box{display:-webkit-box;display:-ms-flexbox;display:flex;gap:4px;-webkit-box-align:center;-ms-flex-align:center;align-items:center;padding:9px 0}.mfui-lkvas-card-cell__switcher-box,.mfui-lkvas-card-cell__text-box{color:var(--spbSky3);font-size:12px;font-weight:400;line-height:18px}.mfui-lkvas-card-cell__actions-box{-webkit-box-pack:end;-ms-flex-pack:end;justify-content:end}.mfui-lkvas-card-cell__text-box-title{color:var(--content);font-size:15px;font-weight:400;line-height:24px;margin-top:4px}.mfui-lkvas-card-cell__text-box-title_color_green{color:var(--brandGreen)}.mfui-lkvas-card-cell__text-box_highlight,.mfui-lkvas-card-cell__text-box_highlight .mfui-lkvas-card-cell__text-box-title{font-weight:500}.mfui-lkvas-card-cell__actions-box-button{background-color:var(--spbSky0);border:none;border-radius:50%;-webkit-box-sizing:border-box;box-sizing:border-box;color:inherit;cursor:pointer;font:inherit;height:28px;min-width:28px;padding:4px;width:28px}.mfui-lkvas-card-cell__actions-box-icon{height:100%;width:100%;fill:var(--content)}.mfui-lkvas-card-cell__actions-box-icon_type_cancel{fill:var(--spbSky3)}.mfui-lkvas-card-cell_fill{background-color:var(--spbSky0)}.mfui-lkvas-card-cell_align_center{-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}.mfui-lkvas-card-cell_align_right{-webkit-box-pack:right;-ms-flex-pack:right;justify-content:right}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Switcher } from '@megafon/ui-core';
|
|
3
|
+
import './CardCell.scss';
|
|
4
|
+
type SwitcherPropsType = React.ComponentProps<typeof Switcher>;
|
|
5
|
+
export type ActionItemIconType = 'settings' | 'edit' | 'cancel';
|
|
6
|
+
export type ActionItemType = {
|
|
7
|
+
/** Тип иконки */
|
|
8
|
+
iconType: ActionItemIconType;
|
|
9
|
+
/** Обработчик клика */
|
|
10
|
+
onClick: (e: React.SyntheticEvent<EventTarget>) => void;
|
|
11
|
+
};
|
|
12
|
+
export type CardCellType = {
|
|
13
|
+
/** Тип */
|
|
14
|
+
type?: 'default' | 'switcher' | 'actions';
|
|
15
|
+
/** Заголовок */
|
|
16
|
+
title?: string;
|
|
17
|
+
/** Цвет заголовка */
|
|
18
|
+
titleColor?: 'default' | 'green';
|
|
19
|
+
/** Дополнительный текст */
|
|
20
|
+
subtitle?: string;
|
|
21
|
+
/** Параметры переключателя (Switcher ui-core) */
|
|
22
|
+
switcherProps?: SwitcherPropsType;
|
|
23
|
+
/** Текст переключателя */
|
|
24
|
+
switcherText?: string;
|
|
25
|
+
/** Элементы действий */
|
|
26
|
+
actionsItems?: ActionItemType[];
|
|
27
|
+
/** Горизонтальное выравнивание для 'switcher' | 'actions' */
|
|
28
|
+
align?: 'left' | 'center' | 'right';
|
|
29
|
+
};
|
|
30
|
+
interface ICardCell extends CardCellType {
|
|
31
|
+
className?: string;
|
|
32
|
+
isFirstCell?: boolean;
|
|
33
|
+
hasBackgroundFill?: boolean;
|
|
34
|
+
dataAttrs?: {
|
|
35
|
+
default?: Record<string, string>;
|
|
36
|
+
switcher?: Record<string, string>;
|
|
37
|
+
actions?: Record<string, string>;
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
declare const CardCell: React.FC<ICardCell>;
|
|
41
|
+
export default CardCell;
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import "core-js/modules/es.array.map.js";
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { Switcher } from '@megafon/ui-core';
|
|
5
|
+
import { cnCreate, filterDataAttrs } from '@megafon/ui-helpers';
|
|
6
|
+
import "./CardCell.css";
|
|
7
|
+
var EditIcon = function EditIcon(props) {
|
|
8
|
+
return /*#__PURE__*/React.createElement("svg", _extends({
|
|
9
|
+
viewBox: "0 0 20 20"
|
|
10
|
+
}, props), /*#__PURE__*/React.createElement("path", {
|
|
11
|
+
d: "M17.1 2.9c-1.2-1.2-3.2-1.2-4.5 0L3.5 12 2 17l1 1 5-1.5 9.1-9.1c.6-.6.9-1.4.9-2.3s-.3-1.6-.9-2.2zM7.5 15.5l-4.3 1.3-.1-.1 1.3-4.3L11 5.8l3 3-6.5 6.7zm8.9-8.8l-1.5 1.5-3-3 1.5-1.5c.8-.8 2.2-.8 3 0 .4.3.6.9.6 1.4 0 .6-.2 1.2-.6 1.6z"
|
|
12
|
+
}));
|
|
13
|
+
};
|
|
14
|
+
var SettingsIcon = function SettingsIcon(props) {
|
|
15
|
+
return /*#__PURE__*/React.createElement("svg", _extends({
|
|
16
|
+
viewBox: "0 0 20 20"
|
|
17
|
+
}, props), /*#__PURE__*/React.createElement("path", {
|
|
18
|
+
d: "M10 13a3 3 0 113-3 3 3 0 01-3 3zm0-5a2 2 0 102 2 2 2 0 00-2-2zm1.37 10H8.63L8 16.89a1.3 1.3 0 00-1.54-.64l-1.19.37-1.9-1.94.37-1.19a1.3 1.3 0 00-.64-1.54L2 11.37V8.62L3.1 8a1.3 1.3 0 00.64-1.5l-.37-1.19 1.94-1.94 1.19.37A1.3 1.3 0 008 3.1L8.63 2h2.75L12 3.1a1.31 1.31 0 001.54.64l1.19-.37 1.94 1.94-.41 1.19A1.3 1.3 0 0016.9 8l1.1.58v2.75l-1.1.58a1.3 1.3 0 00-.64 1.54l.37 1.19-1.94 1.94-1.19-.37a1.31 1.31 0 00-1.54.64zm-2.14-1h1.54l.3-.57a2.3 2.3 0 012.73-1.13l.61.19 1.09-1.09-.19-.61a2.3 2.3 0 011.13-2.73l.57-.3V9.23l-.57-.3A2.3 2.3 0 0115.3 6.2l.19-.61-1.08-1.09-.61.19a2.3 2.3 0 01-2.73-1.13l-.3-.56H9.23l-.3.57a2.3 2.3 0 01-2.72 1.12l-.62-.19-1.08 1.09.19.61a2.3 2.3 0 01-1.13 2.73l-.57.3v1.54l.57.3a2.3 2.3 0 011.13 2.72l-.19.61 1.09 1.09.61-.19a2.3 2.3 0 012.73 1.13z"
|
|
19
|
+
}));
|
|
20
|
+
};
|
|
21
|
+
var CancelIcon = function CancelIcon(props) {
|
|
22
|
+
return /*#__PURE__*/React.createElement("svg", _extends({
|
|
23
|
+
viewBox: "0 0 20 20"
|
|
24
|
+
}, props), /*#__PURE__*/React.createElement("path", {
|
|
25
|
+
className: "CancelIcon__st0",
|
|
26
|
+
d: "M10 8.8L6.2 5 5 6.2 8.8 10 5 13.8 6.2 15l3.8-3.8 3.8 3.8 1.2-1.2-3.8-3.8L15 6.2 13.8 5 10 8.8z"
|
|
27
|
+
}));
|
|
28
|
+
};
|
|
29
|
+
var cn = cnCreate('mfui-lkvas-card-cell');
|
|
30
|
+
var CardCell = function CardCell(_ref) {
|
|
31
|
+
var className = _ref.className,
|
|
32
|
+
_ref$type = _ref.type,
|
|
33
|
+
type = _ref$type === void 0 ? 'default' : _ref$type,
|
|
34
|
+
title = _ref.title,
|
|
35
|
+
_ref$titleColor = _ref.titleColor,
|
|
36
|
+
titleColor = _ref$titleColor === void 0 ? 'default' : _ref$titleColor,
|
|
37
|
+
subtitle = _ref.subtitle,
|
|
38
|
+
switcherProps = _ref.switcherProps,
|
|
39
|
+
switcherText = _ref.switcherText,
|
|
40
|
+
actionsItems = _ref.actionsItems,
|
|
41
|
+
_ref$align = _ref.align,
|
|
42
|
+
align = _ref$align === void 0 ? 'left' : _ref$align,
|
|
43
|
+
isFirstCell = _ref.isFirstCell,
|
|
44
|
+
_ref$hasBackgroundFil = _ref.hasBackgroundFill,
|
|
45
|
+
hasBackgroundFill = _ref$hasBackgroundFil === void 0 ? false : _ref$hasBackgroundFil,
|
|
46
|
+
dataAttrs = _ref.dataAttrs;
|
|
47
|
+
var currentAlign = type !== 'default' ? align : 'left';
|
|
48
|
+
var getActionIcon = function getActionIcon(iconType) {
|
|
49
|
+
switch (iconType) {
|
|
50
|
+
case 'settings':
|
|
51
|
+
return SettingsIcon;
|
|
52
|
+
case 'edit':
|
|
53
|
+
return EditIcon;
|
|
54
|
+
default:
|
|
55
|
+
return CancelIcon;
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
var renderActionsContent = function renderActionsContent() {
|
|
59
|
+
return /*#__PURE__*/React.createElement("div", _extends({
|
|
60
|
+
className: cn('actions-box')
|
|
61
|
+
}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.actions)), !!(actionsItems === null || actionsItems === void 0 ? void 0 : actionsItems.length) && actionsItems.map(function (_ref2, index) {
|
|
62
|
+
var iconType = _ref2.iconType,
|
|
63
|
+
onClick = _ref2.onClick;
|
|
64
|
+
var CurrentIcon = getActionIcon(iconType);
|
|
65
|
+
return /*#__PURE__*/React.createElement("button", {
|
|
66
|
+
key: iconType + index,
|
|
67
|
+
className: cn('actions-box-button'),
|
|
68
|
+
type: "button",
|
|
69
|
+
onClick: onClick
|
|
70
|
+
}, /*#__PURE__*/React.createElement(CurrentIcon, {
|
|
71
|
+
className: cn('actions-box-icon', {
|
|
72
|
+
type: iconType
|
|
73
|
+
})
|
|
74
|
+
}));
|
|
75
|
+
}));
|
|
76
|
+
};
|
|
77
|
+
var renderTextContent = function renderTextContent() {
|
|
78
|
+
return /*#__PURE__*/React.createElement("div", _extends({
|
|
79
|
+
className: cn('text-box', {
|
|
80
|
+
highlight: isFirstCell
|
|
81
|
+
})
|
|
82
|
+
}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs["default"])), /*#__PURE__*/React.createElement("div", null, subtitle), /*#__PURE__*/React.createElement("div", {
|
|
83
|
+
className: cn('text-box-title', {
|
|
84
|
+
color: titleColor
|
|
85
|
+
})
|
|
86
|
+
}, title));
|
|
87
|
+
};
|
|
88
|
+
var renderSwitcherContent = function renderSwitcherContent() {
|
|
89
|
+
return /*#__PURE__*/React.createElement("div", _extends({
|
|
90
|
+
className: cn('switcher-box')
|
|
91
|
+
}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.switcher)), switcherText, /*#__PURE__*/React.createElement(Switcher, switcherProps));
|
|
92
|
+
};
|
|
93
|
+
var renderContent = function renderContent() {
|
|
94
|
+
switch (type) {
|
|
95
|
+
case 'switcher':
|
|
96
|
+
return renderSwitcherContent();
|
|
97
|
+
case 'actions':
|
|
98
|
+
return renderActionsContent();
|
|
99
|
+
default:
|
|
100
|
+
return renderTextContent();
|
|
101
|
+
}
|
|
102
|
+
};
|
|
103
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
104
|
+
className: cn({
|
|
105
|
+
align: currentAlign,
|
|
106
|
+
fill: hasBackgroundFill
|
|
107
|
+
}, [className])
|
|
108
|
+
}, renderContent());
|
|
109
|
+
};
|
|
110
|
+
export default CardCell;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
h1,h2,h3,h4,h5{margin:0}.mfui-lkvas-chart{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;background-color:var(--base);border-radius:12px;-webkit-box-shadow:0 2px 12px rgba(0,0,0,.1);box-shadow:0 2px 12px rgba(0,0,0,.1);-webkit-box-sizing:border-box;box-sizing:border-box;-ms-flex-direction:column;flex-direction:column;gap:24px;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;padding:24px 32px 32px}.mfui-lkvas-chart,.mfui-lkvas-chart__header{-webkit-box-align:center;-ms-flex-align:center;align-items:center;width:100%}.mfui-lkvas-chart__header{display:grid;gap:20px;grid-template-columns:1fr auto minmax(-webkit-min-content,1fr);grid-template-columns:1fr auto minmax(min-content,1fr)}.mfui-lkvas-chart__title{font-size:18px;font-weight:500;grid-column-start:2;letter-spacing:.5px;line-height:24px;text-align:center}@media screen and (min-width:1280px){.mfui-lkvas-chart__title{font-size:20px;line-height:28px}}.mfui-lkvas-chart__button{grid-column-start:3;justify-self:end}.mfui-lkvas-chart__image{background-image:url(img/chart.png);background-repeat:no-repeat;background-size:cover;display:block;height:96px;width:96px}.mfui-lkvas-chart__empty-text{font-size:15px;font-weight:400;line-height:24px}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { Button } from '@megafon/ui-core';
|
|
5
|
+
import { cnCreate, filterDataAttrs } from '@megafon/ui-helpers';
|
|
6
|
+
import useCssVariable from "../../../hooks/useCssVariable";
|
|
7
|
+
import ChartBar from "./components/_ChartBar/ChartBar";
|
|
8
|
+
import ChartDoughnut from "./components/_ChartDoughnut/ChartDoughnut";
|
|
9
|
+
import ChartLine from "./components/_ChartLine/ChartLine";
|
|
10
|
+
import "./Chart.css";
|
|
11
|
+
var DownloadIcon = function DownloadIcon(props) {
|
|
12
|
+
return /*#__PURE__*/React.createElement("svg", _extends({
|
|
13
|
+
viewBox: "0 0 32 32"
|
|
14
|
+
}, props), /*#__PURE__*/React.createElement("path", {
|
|
15
|
+
d: "M15.04 5.99L14.97 17l-1.26-1.49-1.42 1.41L15.37 20h1.26l3.08-3.08-1.42-1.41-1.32 1.55.07-11.05-2-.02z"
|
|
16
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
17
|
+
d: "M8 17H6a10 10 0 0020 0h-2a8 8 0 01-16 0z"
|
|
18
|
+
}));
|
|
19
|
+
};
|
|
20
|
+
var cn = cnCreate('mfui-lkvas-chart');
|
|
21
|
+
var Chart = function Chart(_ref) {
|
|
22
|
+
var className = _ref.className,
|
|
23
|
+
type = _ref.type,
|
|
24
|
+
title = _ref.title,
|
|
25
|
+
labels = _ref.labels,
|
|
26
|
+
datasets = _ref.datasets,
|
|
27
|
+
scales = _ref.scales,
|
|
28
|
+
downloadLink = _ref.downloadLink,
|
|
29
|
+
_ref$hideLegend = _ref.hideLegend,
|
|
30
|
+
hideLegend = _ref$hideLegend === void 0 ? false : _ref$hideLegend,
|
|
31
|
+
dataAttrs = _ref.dataAttrs;
|
|
32
|
+
var _React$useState = React.useState(),
|
|
33
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
34
|
+
bgColor = _React$useState2[0],
|
|
35
|
+
setBgColor = _React$useState2[1];
|
|
36
|
+
var rootRef = React.useRef(null);
|
|
37
|
+
var ticksColor = useCssVariable('--content');
|
|
38
|
+
var scaleColor = useCssVariable('--spbSky1');
|
|
39
|
+
var scalesColor = {
|
|
40
|
+
ticksColor: ticksColor,
|
|
41
|
+
scaleColor: scaleColor
|
|
42
|
+
};
|
|
43
|
+
var showChart = !!datasets.length && !!labels.length;
|
|
44
|
+
React.useEffect(function () {
|
|
45
|
+
if (type === 'doughnut' && rootRef.current) {
|
|
46
|
+
var rootNodeStyle = window.getComputedStyle(rootRef.current);
|
|
47
|
+
setBgColor(rootNodeStyle.getPropertyValue('background-color'));
|
|
48
|
+
}
|
|
49
|
+
}, [type]);
|
|
50
|
+
var renderChart = function renderChart() {
|
|
51
|
+
if (type === 'line') {
|
|
52
|
+
return /*#__PURE__*/React.createElement(ChartLine, {
|
|
53
|
+
type: type,
|
|
54
|
+
datasets: datasets,
|
|
55
|
+
labels: labels,
|
|
56
|
+
scales: scales,
|
|
57
|
+
hideLegend: hideLegend,
|
|
58
|
+
scalesColors: scalesColor
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
if (type === 'bar') {
|
|
62
|
+
return /*#__PURE__*/React.createElement(ChartBar, {
|
|
63
|
+
type: type,
|
|
64
|
+
datasets: datasets,
|
|
65
|
+
labels: labels,
|
|
66
|
+
scales: scales,
|
|
67
|
+
hideLegend: hideLegend,
|
|
68
|
+
scalesColors: scalesColor
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
return /*#__PURE__*/React.createElement(ChartDoughnut, {
|
|
72
|
+
type: type,
|
|
73
|
+
datasets: datasets,
|
|
74
|
+
labels: labels,
|
|
75
|
+
hideLegend: hideLegend,
|
|
76
|
+
bgColor: bgColor
|
|
77
|
+
});
|
|
78
|
+
};
|
|
79
|
+
var emptyContent = /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
80
|
+
className: cn('image')
|
|
81
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
82
|
+
className: cn('empty-text')
|
|
83
|
+
}, "\u0414\u0430\u043D\u043D\u044B\u0445 \u043D\u0435\u0442"));
|
|
84
|
+
return /*#__PURE__*/React.createElement("div", _extends({
|
|
85
|
+
className: cn([className])
|
|
86
|
+
}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root), {
|
|
87
|
+
ref: rootRef
|
|
88
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
89
|
+
className: cn('header')
|
|
90
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
91
|
+
className: cn('title')
|
|
92
|
+
}, title), !!downloadLink && /*#__PURE__*/React.createElement(Button, {
|
|
93
|
+
className: cn('button'),
|
|
94
|
+
theme: "green",
|
|
95
|
+
type: "text",
|
|
96
|
+
href: downloadLink,
|
|
97
|
+
download: true,
|
|
98
|
+
icon: /*#__PURE__*/React.createElement(DownloadIcon, null),
|
|
99
|
+
dataAttrs: {
|
|
100
|
+
root: dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.downloadButton
|
|
101
|
+
}
|
|
102
|
+
}, "\u0421\u043A\u0430\u0447\u0430\u0442\u044C")), showChart ? renderChart() : emptyContent);
|
|
103
|
+
};
|
|
104
|
+
export default Chart;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
h1,h2,h3,h4,h5{margin:0}.mfui-lkvas-chart-bar{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;gap:24px;-webkit-box-align:center;-ms-flex-align:center;align-items:center;width:100%}.mfui-lkvas-chart-bar__chart{cursor:pointer;height:230px;width:100%}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { IChart, IScalesColors } from '../../types';
|
|
3
|
+
import './ChartBar.scss';
|
|
4
|
+
interface IChartBar extends Pick<IChart, 'datasets' | 'labels' | 'hideLegend' | 'scales'> {
|
|
5
|
+
type: 'bar';
|
|
6
|
+
scalesColors: IScalesColors;
|
|
7
|
+
}
|
|
8
|
+
declare const ChartBar: React.FC<IChartBar>;
|
|
9
|
+
export default ChartBar;
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import "core-js/modules/es.array.map.js";
|
|
3
|
+
import "core-js/modules/es.array.reduce.js";
|
|
4
|
+
import "core-js/modules/es.object.to-string.js";
|
|
5
|
+
import * as React from 'react';
|
|
6
|
+
import { cnCreate } from '@megafon/ui-helpers';
|
|
7
|
+
import ChartBase from "../_ChartBase/ChartBase";
|
|
8
|
+
import ChartLegend from "../_ChartLegend/ChartLegend";
|
|
9
|
+
import { CHART_BAR_COLORS, SCALES_COLORS, POINT_BORDER_COLOR } from "../chartColors";
|
|
10
|
+
import "./ChartBar.css";
|
|
11
|
+
var cn = cnCreate('mfui-lkvas-chart-bar');
|
|
12
|
+
var ChartBar = function ChartBar(_ref) {
|
|
13
|
+
var type = _ref.type,
|
|
14
|
+
datasets = _ref.datasets,
|
|
15
|
+
labels = _ref.labels,
|
|
16
|
+
_ref$scales = _ref.scales,
|
|
17
|
+
_ref$scales2 = _ref$scales === void 0 ? {} : _ref$scales,
|
|
18
|
+
_ref$scales2$skipTick = _ref$scales2.skipTicksX,
|
|
19
|
+
skipTicksX = _ref$scales2$skipTick === void 0 ? 1 : _ref$scales2$skipTick,
|
|
20
|
+
_ref$scales2$skipTick2 = _ref$scales2.skipTicksY,
|
|
21
|
+
skipTicksY = _ref$scales2$skipTick2 === void 0 ? 1 : _ref$scales2$skipTick2,
|
|
22
|
+
_ref$hideLegend = _ref.hideLegend,
|
|
23
|
+
hideLegend = _ref$hideLegend === void 0 ? false : _ref$hideLegend,
|
|
24
|
+
_ref$scalesColors = _ref.scalesColors,
|
|
25
|
+
_ref$scalesColors$tic = _ref$scalesColors.ticksColor,
|
|
26
|
+
ticksColor = _ref$scalesColors$tic === void 0 ? SCALES_COLORS.ticks : _ref$scalesColors$tic,
|
|
27
|
+
_ref$scalesColors$sca = _ref$scalesColors.scaleColor,
|
|
28
|
+
scaleColor = _ref$scalesColors$sca === void 0 ? SCALES_COLORS.scale : _ref$scalesColors$sca;
|
|
29
|
+
var chartData = {
|
|
30
|
+
labels: labels,
|
|
31
|
+
datasets: datasets.map(function (dataset, index) {
|
|
32
|
+
var _a, _b;
|
|
33
|
+
return _extends(_extends({}, dataset), {
|
|
34
|
+
backgroundColor: (_a = CHART_BAR_COLORS[index]) === null || _a === void 0 ? void 0 : _a.main,
|
|
35
|
+
hoverBackgroundColor: (_b = CHART_BAR_COLORS[index]) === null || _b === void 0 ? void 0 : _b.hover,
|
|
36
|
+
categoryPercentage: 0.5,
|
|
37
|
+
pointBorderColor: POINT_BORDER_COLOR
|
|
38
|
+
});
|
|
39
|
+
})
|
|
40
|
+
};
|
|
41
|
+
var chartOptions = {
|
|
42
|
+
responsive: true,
|
|
43
|
+
maintainAspectRatio: false,
|
|
44
|
+
scales: {
|
|
45
|
+
y: {
|
|
46
|
+
display: true,
|
|
47
|
+
beginAtZero: true,
|
|
48
|
+
type: 'linear',
|
|
49
|
+
position: 'left',
|
|
50
|
+
grid: {
|
|
51
|
+
color: scaleColor
|
|
52
|
+
},
|
|
53
|
+
border: {
|
|
54
|
+
color: scaleColor
|
|
55
|
+
},
|
|
56
|
+
ticks: {
|
|
57
|
+
autoSkip: true,
|
|
58
|
+
maxRotation: 0,
|
|
59
|
+
color: ticksColor,
|
|
60
|
+
callback: function callback(value, index) {
|
|
61
|
+
return index % skipTicksY === 0 ? value : '';
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
x: {
|
|
66
|
+
grid: {
|
|
67
|
+
display: false
|
|
68
|
+
},
|
|
69
|
+
border: {
|
|
70
|
+
color: scaleColor
|
|
71
|
+
},
|
|
72
|
+
ticks: {
|
|
73
|
+
autoSkip: true,
|
|
74
|
+
maxRotation: 0,
|
|
75
|
+
color: ticksColor,
|
|
76
|
+
callback: function callback(_value, index) {
|
|
77
|
+
return index % skipTicksX === 0 ? labels[index] : '';
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
var legendItems = datasets.map(function (_ref2, index) {
|
|
84
|
+
var _ref2$label = _ref2.label,
|
|
85
|
+
label = _ref2$label === void 0 ? '' : _ref2$label,
|
|
86
|
+
data = _ref2.data,
|
|
87
|
+
unit = _ref2.unit;
|
|
88
|
+
var _a;
|
|
89
|
+
var sumValue = data.reduce(function (sum, current) {
|
|
90
|
+
return sum + current;
|
|
91
|
+
}, 0);
|
|
92
|
+
return {
|
|
93
|
+
title: label,
|
|
94
|
+
value: unit ? sumValue + unit : sumValue,
|
|
95
|
+
color: (_a = CHART_BAR_COLORS[index]) === null || _a === void 0 ? void 0 : _a.main
|
|
96
|
+
};
|
|
97
|
+
});
|
|
98
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
99
|
+
className: cn()
|
|
100
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
101
|
+
className: cn('chart')
|
|
102
|
+
}, /*#__PURE__*/React.createElement(ChartBase, {
|
|
103
|
+
type: type,
|
|
104
|
+
data: chartData,
|
|
105
|
+
options: chartOptions
|
|
106
|
+
})), !hideLegend && /*#__PURE__*/React.createElement(ChartLegend, {
|
|
107
|
+
items: legendItems
|
|
108
|
+
}));
|
|
109
|
+
};
|
|
110
|
+
export default ChartBar;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { ChartOptions, ChartData, ChartType, UpdateMode } from 'chart.js';
|
|
3
|
+
export interface IChartBase {
|
|
4
|
+
data: ChartData;
|
|
5
|
+
options: ChartOptions;
|
|
6
|
+
type: ChartType;
|
|
7
|
+
updateMode?: UpdateMode;
|
|
8
|
+
height?: number;
|
|
9
|
+
width?: number;
|
|
10
|
+
}
|
|
11
|
+
declare const ChartBase: React.FC<IChartBase>;
|
|
12
|
+
export default ChartBase;
|