@qiwi/pijma-desktop-extra 0.1.0 → 0.1.3

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/README.md CHANGED
@@ -0,0 +1,32 @@
1
+ # @qiwi/pijma-desktop-extra
2
+
3
+ Pijma desktop extra UI components.
4
+
5
+ ## Install
6
+ ```bash
7
+ npm i --save @qiwi/pijma-desktop-extra
8
+ yarn add @qiwi/pijma-desktop-extra
9
+ ```
10
+
11
+ ## Usage
12
+ ```javascript
13
+ import React from 'react'
14
+ import { cache, themes, fonts, reset, CacheProvider, ThemeProvider, Global } from '@qiwi/pijma-desktop'
15
+ import { Table } from '@qiwi/pijma-desktop-extra'
16
+
17
+ export const App = () => (
18
+ <CacheProvider value={cache}>
19
+ <ThemeProvider theme={themes.orange}>
20
+ <Global styles={[reset, fonts]}/>
21
+ <Table
22
+ columns={columns}
23
+ data={data}
24
+ onSelect={onSelect}
25
+ />
26
+ </ThemeProvider>
27
+ </CacheProvider>
28
+ )
29
+ ```
30
+
31
+ ## License
32
+ [MIT](../../LICENSE)
@@ -1,3 +1,5 @@
1
- export declare const getMonths: (t: (str: string) => string) => string[];
2
- export declare const getWeekDaysLong: (t: (str: string) => string) => string[];
3
- export declare const getWeekDaysShort: (t: (str: string) => string) => string[];
1
+ export declare const locales: {
2
+ en: Locale;
3
+ ru: Locale;
4
+ };
5
+ export declare type TLanguage = keyof typeof locales;
@@ -5,10 +5,6 @@ export declare const PickerDropdown: import("@emotion/styled").StyledComponent<{
5
5
  theme?: import("@emotion/react").Theme | undefined;
6
6
  as?: React.ElementType<any> | undefined;
7
7
  }, React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
8
- export declare const PickerCellContainer: import("@emotion/styled").StyledComponent<{
9
- theme?: import("@emotion/react").Theme | undefined;
10
- as?: React.ElementType<any> | undefined;
11
- }, React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
12
8
  declare const DateRangePicker: React.ComponentType<Omit<Pick<import("react-i18next").Subtract<DateRangerPickerProps & WithTranslation<"translation", undefined>, import("react-i18next").WithTranslationProps>, "title" | "onChange" | "t" | "tReady" | "dateFrom" | "dateTo" | "inputValue" | "minDate" | "maxDate" | "dayPickerProps"> & {
13
9
  numberOfMonths?: number | undefined;
14
10
  } & {}, keyof WithTranslation<N, undefined>> & import("react-i18next").WithTranslationProps>;
@@ -8,8 +8,6 @@ export declare const CheckBoxContainer: import("@emotion/styled").StyledComponen
8
8
  theme?: import("@emotion/react").Theme | undefined;
9
9
  as?: React.ElementType<any> | undefined;
10
10
  }, React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
11
- export declare const ItemCss: string;
12
- export declare const ItemActiveCss: string;
13
11
  export declare const Item: import("@emotion/styled").StyledComponent<{
14
12
  theme?: import("@emotion/react").Theme | undefined;
15
13
  as?: React.ElementType<any> | undefined;
@@ -1,7 +1,10 @@
1
1
  import { ReactNode } from 'react';
2
2
  interface NavItem {
3
3
  name: string;
4
- path: string;
4
+ path: string | {
5
+ external: boolean;
6
+ value: string;
7
+ };
5
8
  node?: ReactNode;
6
9
  value?: string | number;
7
10
  }
@@ -18,7 +18,7 @@ var _pijmaCore = require("@qiwi/pijma-core");
18
18
  var _pijmaDesktop = require("@qiwi/pijma-desktop");
19
19
  var _dateFns = require("date-fns");
20
20
  var _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
21
- var _reactDayPicker = /*#__PURE__*/ _interopRequireDefault(require("react-day-picker"));
21
+ var _reactDayPicker = require("react-day-picker");
22
22
  var _reactI18Next = require("react-i18next");
23
23
  var _theme = require("../theme/index.js");
24
24
  var _locale = require("./locale.js");
@@ -26,7 +26,7 @@ var _wrap = /*#__PURE__*/ _interopRequireDefault(require("./wrap.js"));
26
26
  function _templateObject() {
27
27
  var data = _taggedTemplateLiteralLoose([
28
28
  "\n position: absolute;\n background: #fff;\n z-index: 10;\n box-shadow: ",
29
- ";\n border-radius: 8px;\n"
29
+ ";\n border-radius: 8px;\n\n .Selectable {\n .my-selected {\n padding: 0px;\n width: 40px;\n height: 40px;\n color: black;\n background-color: rgba(255, 140, 0);\n border-radius: 50%;\n }\n\n .my-head-cell {\n width: 40px;\n height: 40px;\n padding: 4px;\n }\n\n .my-month {\n margin: 1rem;\n }\n\n .my-caption {\n margin-bottom: 10px;\n margin-left: 8px;\n display: flex;\n justify-content: space-between;\n }\n\n .my-day {\n width: 40px;\n height: 40px;\n padding: 4px;\n }\n\n .my-today {\n color: rgb(208, 2, 27);\n }\n\n .my-today {\n color: rgb(208, 2, 27);\n }\n\n .my-caption-label {\n font-size: 20px;\n }\n }\n"
30
30
  ]);
31
31
  _templateObject = function _templateObject() {
32
32
  return data;
@@ -125,10 +125,7 @@ var _DatePicker = /*#__PURE__*/ function(Component) {
125
125
  };
126
126
  _proto.render = function render() {
127
127
  var _this = this;
128
- var t = this.props.t;
129
- var MONTHS = (0, _locale.getMonths)(t);
130
- var WEEKDAYS_LONG = (0, _locale.getWeekDaysLong)(t);
131
- var WEEKDAYS_SHORT = (0, _locale.getWeekDaysShort)(t);
128
+ var _props = this.props, t = _props.t, i18n = _props.i18n;
132
129
  return /*#__PURE__*/ (0, _jsxRuntime.jsxs)(_wrap.default, {
133
130
  onFocus: this.onFocus.bind(this),
134
131
  onBlur: this.onBlur.bind(this),
@@ -157,14 +154,22 @@ var _DatePicker = /*#__PURE__*/ function(Component) {
157
154
  children: function() {
158
155
  return /*#__PURE__*/ (0, _jsxRuntime.jsx)(PickerDropdown, {
159
156
  onFocus: _this.onFocus.bind(_this),
160
- children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_reactDayPicker.default, {
161
- months: MONTHS,
162
- weekdaysLong: WEEKDAYS_LONG,
163
- weekdaysShort: WEEKDAYS_SHORT,
157
+ children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_reactDayPicker.DayPicker, {
158
+ className: "Selectable",
164
159
  onDayClick: _this.handleDayClick.bind(_this),
165
- selectedDays: _this.state.date,
160
+ selected: _this.state.date,
166
161
  month: _this.state.date,
167
- firstDayOfWeek: 1
162
+ locale: _locale.locales[i18n.language],
163
+ modifiersClassNames: {
164
+ selected: "my-selected",
165
+ today: "my-today"
166
+ },
167
+ classNames: {
168
+ day: "my-day",
169
+ head_cell: "my-head-cell",
170
+ caption: "my-caption",
171
+ month: "my-month"
172
+ }
168
173
  })
169
174
  });
170
175
  }
@@ -2,58 +2,14 @@
2
2
  Object.defineProperty(exports, "__esModule", {
3
3
  value: true
4
4
  });
5
- function _export(target, all) {
6
- for(var name in all)Object.defineProperty(target, name, {
7
- enumerable: true,
8
- get: all[name]
9
- });
10
- }
11
- _export(exports, {
12
- getMonths: function() {
13
- return getMonths;
14
- },
15
- getWeekDaysLong: function() {
16
- return getWeekDaysLong;
17
- },
18
- getWeekDaysShort: function() {
19
- return getWeekDaysShort;
5
+ Object.defineProperty(exports, "locales", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return locales;
20
9
  }
21
10
  });
22
- var getMonths = function(t) {
23
- return [
24
- t("datePicker:jan"),
25
- t("datePicker:feb"),
26
- t("datePicker:mar"),
27
- t("datePicker:apr"),
28
- t("datePicker:may"),
29
- t("datePicker:jun"),
30
- t("datePicker:jul"),
31
- t("datePicker:aug"),
32
- t("datePicker:sep"),
33
- t("datePicker:oct"),
34
- t("datePicker:nov"),
35
- t("datePicker:dec"),
36
- ];
37
- };
38
- var getWeekDaysLong = function(t) {
39
- return [
40
- t("datePicker:sun"),
41
- t("datePicker:mon"),
42
- t("datePicker:tue"),
43
- t("datePicker:wen"),
44
- t("datePicker:thu"),
45
- t("datePicker:fri"),
46
- t("datePicker:sat"),
47
- ];
48
- };
49
- var getWeekDaysShort = function(t) {
50
- return [
51
- t("datePicker:sn"),
52
- t("datePicker:mn"),
53
- t("datePicker:tu"),
54
- t("datePicker:wn"),
55
- t("datePicker:th"),
56
- t("datePicker:fr"),
57
- t("datePicker:st"),
58
- ];
11
+ var _locale = require("date-fns/locale");
12
+ var locales = {
13
+ en: _locale.enUS,
14
+ ru: _locale.ru
59
15
  };
@@ -12,9 +12,6 @@ _export(exports, {
12
12
  PickerDropdown: function() {
13
13
  return PickerDropdown;
14
14
  },
15
- PickerCellContainer: function() {
16
- return PickerCellContainer;
17
- },
18
15
  DateRangePicker: function() {
19
16
  return DateRangePicker;
20
17
  }
@@ -29,15 +26,15 @@ var _pijmaCore = require("@qiwi/pijma-core");
29
26
  var _pijmaDesktop = require("@qiwi/pijma-desktop");
30
27
  var _dateFns = require("date-fns");
31
28
  var _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
32
- var _reactDayPicker = /*#__PURE__*/ _interopRequireDefault(require("react-day-picker"));
29
+ var _reactDayPicker = require("react-day-picker");
33
30
  var _reactI18Next = require("react-i18next");
34
- var _locale = require("../date-picker/locale.js");
35
31
  var _wrap = /*#__PURE__*/ _interopRequireDefault(require("../date-picker/wrap.js"));
36
32
  var _theme = require("../theme/index.js");
33
+ var _locale = require("../date-picker/locale.js");
37
34
  function _templateObject() {
38
35
  var data = _taggedTemplateLiteralLoose([
39
- "\n position: absolute;\n background: #fff;\n z-index: 10;\n width: 596px;\n border-radius: 8px;\n box-shadow: ",
40
- ";\n\n .Selectable .DayPicker-Day {\n border-radius: 0 !important;\n }\n .Selectable .DayPicker-Day--start {\n border-top-left-radius: 50% !important;\n border-bottom-left-radius: 50% !important;\n }\n .Selectable .DayPicker-Day--end {\n border-top-right-radius: 50% !important;\n border-bottom-right-radius: 50% !important;\n }\n .Selectable\n .DayPicker-Day--selected:not(.DayPicker-Day--start):not(.DayPicker-Day--end):not(.DayPicker-Day--outside) {\n background-color: #ff8c0066 !important;\n color: #000000;\n }\n .DayPicker-NavButton {\n margin: 0 0;\n right: 1.5rem;\n }\n .DayPicker-NavButton--prev {\n margin-right: 2rem;\n }\n"
36
+ "\n position: absolute;\n background: #fff;\n z-index: 10;\n border-radius: 8px;\n box-shadow: ",
37
+ ";\n\n .Selectable {\n .my-selected {\n padding: 0px;\n width: 40px;\n height: 40px;\n color: black;\n background-color: rgba(255, 140, 0, 0.4);\n border-radius: unset;\n }\n\n .my-range-start {\n background-color: rgb(255, 140, 0);\n border-radius: 50% 0px 0px 50%;\n }\n\n .my-range-middle {\n }\n\n .my-range-end {\n background-color: rgb(255, 140, 0);\n border-radius: 0px 50% 50% 0px;\n }\n\n .my-head-cell {\n width: 40px;\n height: 40px;\n padding: 4px;\n }\n\n .my-caption {\n margin-bottom: 10px;\n margin-left: 8px;\n }\n\n .my-month {\n margin: 1rem;\n }\n\n .my-months {\n margin: 0 12px;\n display: flex;\n position: relative;\n }\n\n .my-day {\n width: 40px;\n height: 40px;\n padding: 4px;\n }\n\n .my-nav {\n position: absolute;\n translateY(-50%);\n top: 50%;\n }\n\n .my-caption-start {\n .my-nav {\n left: -6px;\n }\n }\n\n .my-caption-end {\n .my-nav {\n right: -6px;\n }\n }\n\n .my-day.my-selected.my-range-end.my-range-start {\n border-radius: 50%;\n }\n\n .my-today {\n color: rgb(208, 2, 27);\n }\n\n .my-caption-label {\n font-size: 20px;\n }\n }\n"
41
38
  ]);
42
39
  _templateObject = function _templateObject() {
43
40
  return data;
@@ -46,7 +43,7 @@ function _templateObject() {
46
43
  }
47
44
  function _templateObject1() {
48
45
  var data = _taggedTemplateLiteralLoose([
49
- "\n width: 30px;\n height: 30px;\n display: flex;\n align-items: center;\n justify-content: center;\n"
46
+ "\n position: relative;\n width: 100%;\n"
50
47
  ]);
51
48
  _templateObject1 = function _templateObject1() {
52
49
  return data;
@@ -54,38 +51,28 @@ function _templateObject1() {
54
51
  return data;
55
52
  }
56
53
  function _templateObject2() {
57
- var data = _taggedTemplateLiteralLoose([
58
- "\n position: relative;\n width: 100%;\n"
59
- ]);
60
- _templateObject2 = function _templateObject2() {
61
- return data;
62
- };
63
- return data;
64
- }
65
- function _templateObject3() {
66
54
  var data = _taggedTemplateLiteralLoose([
67
55
  "\n color: ",
68
56
  ";\n"
69
57
  ]);
70
- _templateObject3 = function _templateObject3() {
58
+ _templateObject2 = function _templateObject2() {
71
59
  return data;
72
60
  };
73
61
  return data;
74
62
  }
75
- function _templateObject4() {
63
+ function _templateObject3() {
76
64
  var data = _taggedTemplateLiteralLoose([
77
65
  "\n input {\n color: transparent;\n text-shadow: 0 0 0 #000;\n }\n"
78
66
  ]);
79
- _templateObject4 = function _templateObject4() {
67
+ _templateObject3 = function _templateObject3() {
80
68
  return data;
81
69
  };
82
70
  return data;
83
71
  }
84
72
  var PickerDropdown = (0, _pijmaCore.styled)("div")(_templateObject(), _theme.COLOR.SHADOW.Z3);
85
- var PickerCellContainer = (0, _pijmaCore.styled)("div")(_templateObject1());
86
- var Container = (0, _pijmaCore.styled)("div")(_templateObject2());
87
- var RedHelpText = (0, _pijmaCore.styled)("div")(_templateObject3(), _theme.COLOR.TEXT.Error);
88
- var InputWrapper = (0, _pijmaCore.styled)("div")(_templateObject4());
73
+ var Container = (0, _pijmaCore.styled)("div")(_templateObject1());
74
+ var RedHelpText = (0, _pijmaCore.styled)("div")(_templateObject2(), _theme.COLOR.TEXT.Error);
75
+ var InputWrapper = (0, _pijmaCore.styled)("div")(_templateObject3());
89
76
  var DisabledInputDateRangePicker = /*#__PURE__*/ function(Component) {
90
77
  "use strict";
91
78
  _inherits(DisabledInputDateRangePicker, Component);
@@ -110,7 +97,7 @@ var DisabledInputDateRangePicker = /*#__PURE__*/ function(Component) {
110
97
  from: _this.props.dateFrom,
111
98
  to: _this.props.dateTo || _this.props.dateFrom
112
99
  };
113
- var range = _reactDayPicker.default.addToRange(date, normalizeDate);
100
+ var range = (0, _reactDayPicker.addToRange)(date, normalizeDate);
114
101
  var ref = range || normalizeDate, dateFrom = ref.from, dateTo = ref.to;
115
102
  if ((dateFrom || dateTo) && _this.props.onChange) {
116
103
  _this.props.onChange({
@@ -148,24 +135,18 @@ var DisabledInputDateRangePicker = /*#__PURE__*/ function(Component) {
148
135
  var _proto = DisabledInputDateRangePicker.prototype;
149
136
  _proto.render = function render() {
150
137
  var _this = this;
151
- var t = this.props.t;
152
- var MONTHS = (0, _locale.getMonths)(t);
153
- var WEEKDAYS_LONG = (0, _locale.getWeekDaysLong)(t);
154
- var WEEKDAYS_SHORT = (0, _locale.getWeekDaysShort)(t);
138
+ var _props = this.props, t = _props.t, i18n = _props.i18n;
155
139
  var _state = this.state, errorDate = _state.errorDate, helpText = _state.helpText, showPicker = _state.showPicker;
156
- var _props = this.props, minDate = _props.minDate, maxDate = _props.maxDate, dayPickerProps = _props.dayPickerProps, title = _props.title, numberOfMonths = _props.numberOfMonths, dateTo = _props.dateTo, dateFrom = _props.dateFrom, inputValue = _props.inputValue;
140
+ var _props1 = this.props, minDate = _props1.minDate, maxDate = _props1.maxDate, dayPickerProps = _props1.dayPickerProps, title = _props1.title, numberOfMonths = _props1.numberOfMonths, dateTo = _props1.dateTo, dateFrom = _props1.dateFrom, inputValue = _props1.inputValue;
157
141
  var modifiers = {
158
142
  start: dateFrom,
159
143
  end: dateTo
160
144
  };
161
145
  var disabled = {};
162
- var selectedDays = [
163
- dateFrom,
164
- {
165
- from: dateFrom,
166
- to: dateTo
167
- }
168
- ];
146
+ var selectedDays = {
147
+ from: dateFrom,
148
+ to: dateTo
149
+ };
169
150
  var value = inputValue || this.formatPeriod(dateFrom, dateTo);
170
151
  if (minDate) {
171
152
  disabled.before = minDate;
@@ -209,25 +190,33 @@ var DisabledInputDateRangePicker = /*#__PURE__*/ function(Component) {
209
190
  children: function() {
210
191
  return /*#__PURE__*/ (0, _jsxRuntime.jsx)(PickerDropdown, {
211
192
  onFocus: _this.onFocus,
212
- children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_reactDayPicker.default, _extends({
193
+ children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_reactDayPicker.DayPicker, _extends({
194
+ mode: "range",
213
195
  className: "Selectable",
214
- disabledDays: disabled,
215
- months: MONTHS,
216
- weekdaysLong: WEEKDAYS_LONG,
217
- weekdaysShort: WEEKDAYS_SHORT,
218
- // @ts-ignore
219
- renderDay: function(day) {
220
- return /*#__PURE__*/ (0, _jsxRuntime.jsx)(PickerCellContainer, {
221
- children: /*#__PURE__*/ (0, _jsxRuntime.jsx)("div", {
222
- children: day.getDate()
223
- })
224
- });
225
- },
196
+ disabled: disabled,
197
+ locale: _locale.locales[i18n.language],
226
198
  numberOfMonths: numberOfMonths,
227
- selectedDays: selectedDays,
199
+ selected: selectedDays,
228
200
  modifiers: modifiers,
229
201
  onDayClick: _this.handleDayClick,
230
- firstDayOfWeek: 1
202
+ modifiersClassNames: {
203
+ selected: "my-selected",
204
+ today: "my-today",
205
+ range_start: "my-range-start",
206
+ range_middle: "my-range-middle",
207
+ range_end: "my-range-end"
208
+ },
209
+ classNames: {
210
+ day: "my-day",
211
+ head_cell: "my-head-cell",
212
+ caption: "my-caption",
213
+ month: "my-month",
214
+ months: "my-months",
215
+ caption_start: "my-caption-start",
216
+ caption_end: "my-caption-end",
217
+ nav: "my-nav",
218
+ caption_label: "my-caption-label"
219
+ }
231
220
  }, dayPickerProps))
232
221
  });
233
222
  }
@@ -15,12 +15,6 @@ _export(exports, {
15
15
  CheckBoxContainer: function() {
16
16
  return CheckBoxContainer;
17
17
  },
18
- ItemCss: function() {
19
- return ItemCss;
20
- },
21
- ItemActiveCss: function() {
22
- return ItemActiveCss;
23
- },
24
18
  Item: function() {
25
19
  return Item;
26
20
  },
@@ -60,7 +54,8 @@ function _templateObject1() {
60
54
  }
61
55
  function _templateObject2() {
62
56
  var data = _taggedTemplateLiteralLoose([
63
- "\n padding: 10px 24px;\n width: 100%;\n cursor: pointer;\n :hover {\n background-color: #f5f5f5;\n }\n &--active {\n background-color: #e6e6e6 !important;\n }\n"
57
+ "\n box-sizing: border-box;\n padding: 10px 24px;\n width: 100%;\n cursor: pointer;\n :hover {\n background-color: #f5f5f5;\n }\n &--active {\n background-color: #e6e6e6 !important;\n }\n ",
58
+ "\n"
64
59
  ]);
65
60
  _templateObject2 = function _templateObject2() {
66
61
  return data;
@@ -68,39 +63,20 @@ function _templateObject2() {
68
63
  return data;
69
64
  }
70
65
  function _templateObject3() {
71
- var data = _taggedTemplateLiteralLoose([
72
- "\n ",
73
- "\n background-color: #E6E6E6 !important;\n"
74
- ]);
75
- _templateObject3 = function _templateObject3() {
76
- return data;
77
- };
78
- return data;
79
- }
80
- function _templateObject4() {
81
- var data = _taggedTemplateLiteralLoose([
82
- "\n box-sizing: border-box;\n"
83
- ]);
84
- _templateObject4 = function _templateObject4() {
85
- return data;
86
- };
87
- return data;
88
- }
89
- function _templateObject5() {
90
66
  var data = _taggedTemplateLiteralLoose([
91
67
  "\n position: relative;\n height: 100%;\n"
92
68
  ]);
93
- _templateObject5 = function _templateObject5() {
69
+ _templateObject3 = function _templateObject3() {
94
70
  return data;
95
71
  };
96
72
  return data;
97
73
  }
98
74
  var ListContainer = (0, _pijmaCore.styled)("div")(_templateObject(), _theme.COLOR.SHADOW.Z3);
99
75
  var CheckBoxContainer = (0, _pijmaCore.styled)("div")(_templateObject1());
100
- var ItemCss = (0, _pijmaCore.css)(_templateObject2());
101
- var ItemActiveCss = (0, _pijmaCore.css)(_templateObject3(), ItemCss);
102
- var Item = (0, _pijmaCore.styled)("div")(_templateObject4());
103
- var ScrollContainer = (0, _pijmaCore.styled)("div")(_templateObject5());
76
+ var Item = (0, _pijmaCore.styled)("div")(_templateObject2(), function(props) {
77
+ return props.active ? "background-color: #E6E6E6 !important;" : "";
78
+ });
79
+ var ScrollContainer = (0, _pijmaCore.styled)("div")(_templateObject3());
104
80
  var Container = /*#__PURE__*/ function(Component) {
105
81
  "use strict";
106
82
  _inherits(Container, Component);
@@ -126,9 +102,7 @@ var Container = /*#__PURE__*/ function(Component) {
126
102
  }) : items.map(function(el, index) {
127
103
  return /*#__PURE__*/ (0, _jsxRuntime.jsx)(Item, {
128
104
  // @ts-ignore
129
- css: [
130
- value === el.name ? ItemActiveCss : ItemCss
131
- ],
105
+ active: value === el.name,
132
106
  onMouseDown: function() {
133
107
  return onSelect(el);
134
108
  },
@@ -13,9 +13,9 @@ var _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcar
13
13
  var _taggedTemplateLiteralLoose = require("@swc/helpers/lib/_tagged_template_literal_loose.js").default;
14
14
  var _jsxRuntime = require("react/jsx-runtime");
15
15
  var _pijmaCore = require("@qiwi/pijma-core");
16
+ var _pijmaDesktop = require("@qiwi/pijma-desktop");
16
17
  var _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
17
18
  var _logo = require("../logo/index.js");
18
- var _navigationMenu = require("../navigation-menu/index.js");
19
19
  var _product = require("../product/index.js");
20
20
  var _spinner = require("../spinner/index.js");
21
21
  var _theme = require("../theme/index.js");
@@ -51,7 +51,19 @@ var Header = /*#__PURE__*/ function(Component) {
51
51
  }
52
52
  var _proto = Header.prototype;
53
53
  _proto.render = function render() {
54
- var _props = this.props, isLoading = _props.isLoading, title = _props.title, selectorData = _props.selectorData, link = _props.link, navItems = _props.navItems, navActiveItem = _props.navActiveItem, userName = _props.userName, onItemChange = _props.onItemChange, onLogout = _props.onLogout;
54
+ var _props = this.props, isLoading = _props.isLoading, title = _props.title, selectorData = _props.selectorData, navItems = _props.navItems, userName = _props.userName, onItemChange = _props.onItemChange, onLogout = _props.onLogout;
55
+ var menuItems = navItems.map(function(param) {
56
+ var name = param.name, path = param.path;
57
+ var href = typeof path === "string" ? path : path.value;
58
+ return {
59
+ href: href,
60
+ title: name,
61
+ active: location.pathname === path,
62
+ onClick: function() {
63
+ window.location.href = href;
64
+ }
65
+ };
66
+ });
55
67
  return /*#__PURE__*/ (0, _jsxRuntime.jsx)(HeaderContainer, {
56
68
  children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(HeaderContent, {
57
69
  children: isLoading ? /*#__PURE__*/ (0, _jsxRuntime.jsx)(_pijmaCore.Flex, {
@@ -85,10 +97,9 @@ var Header = /*#__PURE__*/ function(Component) {
85
97
  /*#__PURE__*/ (0, _jsxRuntime.jsx)(_pijmaCore.FlexItem, {
86
98
  ml: 10,
87
99
  p: 0,
88
- children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_navigationMenu.NavigationMenu, {
89
- link: link,
90
- items: navItems,
91
- active: navActiveItem && navActiveItem.pathname || ""
100
+ height: 20,
101
+ children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_pijmaDesktop.HeaderMenu, {
102
+ children: menuItems
92
103
  })
93
104
  })
94
105
  ]