ecomlab-components-next 0.1.28 → 0.1.29
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/components/ConstructorComponents/HeaderMain/DropMenuItem/DropMenuItem.js +162 -0
- package/dist/components/ConstructorComponents/HeaderMain/DropMenuItem/DropMenuItem.scss +392 -0
- package/dist/components/ConstructorComponents/HeaderMain/DropMenuItem/img/cases.svg +3 -0
- package/dist/components/ConstructorComponents/HeaderMain/DropMenuItem/img/examples.svg +3 -0
- package/dist/components/ConstructorComponents/HeaderMain/DropMenuMobileVersion/DropMenuMobileVersion.js +139 -0
- package/dist/components/ConstructorComponents/HeaderMain/DropMenuMobileVersion/DropMenuMobileVersion.scss +149 -0
- package/dist/components/ConstructorComponents/HeaderMain/DropMenuMobileVersion/img/drop.svg +4 -0
- package/dist/components/ConstructorComponents/HeaderMain/Header.js +441 -0
- package/dist/components/ConstructorComponents/HeaderMain/Header.scss +551 -0
- package/dist/components/ConstructorComponents/HeaderMain/HeaderMain.stories.js +16 -0
- package/dist/components/ConstructorComponents/HeaderMain/Logo/Logo.js +26 -0
- package/dist/components/ConstructorComponents/HeaderMain/Logo/Logo.scss +15 -0
- package/dist/components/ConstructorComponents/HeaderMain/Logo/img/Header-img.svg +9 -0
- package/dist/components/ConstructorComponents/HeaderMain/Logo/img/Logo.svg +9 -0
- package/dist/components/ConstructorComponents/HeaderMain/img/ArrowGreen.js +21 -0
- package/dist/components/ConstructorComponents/HeaderMain/img/Banner.png +0 -0
- package/dist/components/ConstructorComponents/HeaderMain/img/Burger.js +21 -0
- package/dist/components/ConstructorComponents/HeaderMain/img/HeaderImg.svg +29 -0
- package/dist/components/ConstructorComponents/HeaderMain/img/Services-and-Solutions/banner_yandex.svg +32 -0
- package/dist/components/ConstructorComponents/HeaderMain/img/Services-and-Solutions//320/220/320/262/321/202/320/276/320/274/320/260/321/202/320/270/320/267/320/260/321/206/320/270/321/217 /320/274/320/260/321/200/320/272/320/265/321/202/320/277/320/273/320/265/320/271/321/201/320/276/320/262.svg" +12 -0
- package/dist/components/ConstructorComponents/HeaderMain/img/Services-and-Solutions//320/220/320/262/321/202/320/276/320/274/320/260/321/202/320/270/321/207/320/265/321/201/320/272/320/276/320/265 /321/203/320/273/321/203/321/207/321/210/320/265/320/275/320/270/320/265 /320/272/320/260/321/200/321/202/320/276/321/207/320/265/320/272 /321/202/320/276/320/262/320/260/321/200/320/276/320/262.svg" +11 -0
- package/dist/components/ConstructorComponents/HeaderMain/img/Services-and-Solutions//320/220/320/262/321/202/320/276/320/274/320/260/321/202/321/200/320/270/320/267/320/260/321/206/320/270/321/217_/320/272/320/276/320/275/321/202/320/265/320/275/321/202/320/260.svg +9 -0
- package/dist/components/ConstructorComponents/HeaderMain/img/Services-and-Solutions//320/220/320/262/321/202/320/276/320/277/320/276/320/264/320/261/320/276/321/200 /320/272/320/273/321/216/321/207/320/265/320/262/321/213/321/205 /321/201/320/273/320/276/320/262.svg" +5 -0
- package/dist/components/ConstructorComponents/HeaderMain/img/Services-and-Solutions//320/220/320/275/320/260/320/273/320/270/320/267 /320/272/320/276/320/275/320/272/321/203/321/200/320/265/320/275/321/202/320/276/320/262 /320/262 eCommerce.svg" +12 -0
- package/dist/components/ConstructorComponents/HeaderMain/img/Services-and-Solutions//320/225/320/264/320/270/320/275/320/260/321/217 /321/201/320/270/321/201/321/202/320/265/320/274/320/260 /321/203/320/277/321/200/320/260/320/262/320/273/320/265/320/275/320/270/321/217 /320/272/320/276/320/275/321/202/320/265/320/275/321/202/320/276/320/274.svg" +4 -0
- package/dist/components/ConstructorComponents/HeaderMain/img/Services-and-Solutions//320/230/320/267/320/276/320/261/321/200/320/260/320/266/320/265/320/275/320/270/320/265 /320/220/320/262/321/202/320/276/320/274/320/260/321/202/321/200/320/270/320/267/320/260/321/206/320/270/321/217 /320/272/320/276/320/275/321/202/320/265/320/275/321/202/320/260.svg" +9 -0
- package/dist/components/ConstructorComponents/HeaderMain/img/Services-and-Solutions//320/230/320/267/320/276/320/261/321/200/320/260/320/266/320/265/320/275/320/270/320/265 /320/237/320/276/320/264/320/272/320/273/321/216/321/207/320/270/321/201/321/214 /320/272 /320/257/320/275/320/264/320/265/320/272/321/201 /320/234/320/260/321/200/320/272/320/265/321/202.svg" +9 -0
- package/dist/components/ConstructorComponents/HeaderMain/img/Services-and-Solutions//320/234/320/260/321/200/320/272/320/265/321/202/320/277/320/273/320/265/320/271/321/201/321/213 /320/277/320/276/320/264 /320/272/320/273/321/216/321/207.svg" +11 -0
- package/dist/components/ConstructorComponents/HeaderMain/img/Services-and-Solutions//320/237/320/260/321/200/321/201/320/270/320/275/320/263 /321/201/320/260/320/271/321/202/320/276/320/262.svg" +11 -0
- package/dist/components/ConstructorComponents/HeaderMain/img/Services-and-Solutions//320/237/320/260/321/200/321/201/320/270/320/275/320/263_/320/272/320/276/320/275/320/272/321/203/321/200/320/265/320/275/321/202/320/276/320/262.svg +9 -0
- package/dist/components/ConstructorComponents/HeaderMain/img/Services-and-Solutions//320/237/320/265/321/200/321/201/320/276/320/275/320/260/320/273/321/214/320/275/321/213/320/271 /320/274/320/265/320/275/320/265/320/264/320/266/320/265/321/200 /320/274/320/260/321/200/320/272/320/265/321/202/320/277/320/273/320/265/320/271/321/201/320/276/320/262.svg" +4 -0
- package/dist/components/ConstructorComponents/HeaderMain/img/Services-and-Solutions//320/237/320/276/320/264/320/272/320/273/321/216/321/207/320/270/321/201/321/214 /320/272 /320/257/320/275/320/264/320/265/320/272/321/201 /320/234/320/260/321/200/320/272/320/265/321/202.svg" +9 -0
- package/dist/components/ConstructorComponents/HeaderMain/img/Services-and-Solutions//320/240/320/260/320/261/320/276/321/202/320/260 /321/201 /320/272/320/276/320/275/321/202/320/265/320/275/321/202/320/276/320/274.svg" +6 -0
- package/dist/components/ConstructorComponents/HeaderMain/img/Services-and-Solutions//320/240/320/260/320/267/321/200/320/260/320/261/320/276/321/202/320/272/320/260 /320/264/320/260/321/210/320/261/320/276/321/200/320/264/320/276/320/262.svg" +15 -0
- package/dist/components/ConstructorComponents/HeaderMain/img/Services-and-Solutions//320/240/320/265/320/272/320/273/320/260/320/274/320/260, /320/277/321/200/320/276/320/264/320/262/320/270/320/266/320/265/320/275/320/270/320/265 /320/270 /320/274/320/260/321/200/320/272/320/265/321/202/320/270/320/275/320/263.svg" +11 -0
- package/dist/components/ConstructorComponents/HeaderMain/img/Services-and-Solutions//320/243/320/277/321/200/320/260/320/262/320/273/320/265/320/275/320/270/320/265 /320/276/321/201/321/202/320/260/321/202/320/272/320/260/320/274/320/270.svg" +11 -0
- package/dist/components/ConstructorComponents/HeaderMain/img/Services-and-Solutions//320/246/320/265/320/275/320/276/320/276/320/261/321/200/320/260/320/267/320/276/320/262/320/260/320/275/320/270/320/265.svg +13 -0
- package/dist/components/ConstructorComponents/HeaderMain/img/Services-and-Solutions//320/260/320/262/321/202/320/276/320/274/320/260/321/202/320/270/321/207/320/265/321/201/320/272/320/270/320/271 /320/277/320/265/321/200/320/265/320/275/320/276/321/201.svg" +4 -0
- package/dist/components/ConstructorComponents/HeaderMain/img/Telegram.js +21 -0
- package/dist/components/ConstructorComponents/HeaderMain/img/UserCircle.js +23 -0
- package/dist/components/ConstructorComponents/HeaderMain/img/Whatsapp.js +23 -0
- package/dist/components/ConstructorComponents/HeaderMain/img/burger.svg +3 -0
- package/dist/components/ConstructorComponents/HeaderMain/img/bx-briefcase.svg +5 -0
- package/dist/components/ConstructorComponents/HeaderMain/img/bx-building.svg +6 -0
- package/dist/components/ConstructorComponents/HeaderMain/img/bx-chat.svg +4 -0
- package/dist/components/ConstructorComponents/HeaderMain/img/bx-detail.svg +6 -0
- package/dist/components/ConstructorComponents/HeaderMain/img/bx-grid-alt.svg +5 -0
- package/dist/components/ConstructorComponents/HeaderMain/img/bx-meteor.svg +6 -0
- package/dist/components/ConstructorComponents/HeaderMain/img/bx-spreadsheet.svg +6 -0
- package/dist/components/ConstructorComponents/HeaderMain/img/bx-user-circle.svg +13 -0
- package/dist/components/ConstructorComponents/HeaderMain/img/bx-user-pin.svg +6 -0
- package/dist/components/ConstructorComponents/HeaderMain/img/bxl-telegram.svg +5 -0
- package/dist/components/ConstructorComponents/HeaderMain/img/bxl-whatsapp.svg +5 -0
- package/dist/components/ConstructorComponents/HeaderMain/img/bxs-down-arrow.svg +5 -0
- package/dist/components/ConstructorComponents/HeaderMain/img/cases.svg +3 -0
- package/dist/components/ConstructorComponents/HeaderMain/img/close.svg +5 -0
- package/dist/components/ConstructorComponents/HeaderMain/img/done.svg +9 -0
- package/dist/components/ConstructorComponents/HeaderMain/img/drop.svg +9 -0
- package/dist/components/ConstructorComponents/HeaderMain/img/en.svg +9 -0
- package/dist/components/ConstructorComponents/HeaderMain/img/examples.svg +3 -0
- package/dist/components/ConstructorComponents/HeaderMain/img/industries/FMCG.svg +10 -0
- package/dist/components/ConstructorComponents/HeaderMain/img/industries//320/220/320/262/321/202/320/276/320/274/320/260/321/202/321/200/320/270/320/267/320/260/321/206/320/270/321/217 /320/272/320/276/320/275/321/202/320/265/320/275/321/202/320/260.svg" +3 -0
- package/dist/components/ConstructorComponents/HeaderMain/img/industries//320/220/320/263/320/265/320/275/321/201/321/202/320/262/320/260/320/274.svg +3 -0
- package/dist/components/ConstructorComponents/HeaderMain/img/industries//320/221/321/200/320/265/320/275/320/264/320/260/320/274.svg +6 -0
- package/dist/components/ConstructorComponents/HeaderMain/img/industries//320/230/320/267/320/276/320/261/321/200/320/260/320/266/320/265/320/275/320/270/320/265 /320/220/320/262/321/202/320/276/320/274/320/260/321/202/321/200/320/270/320/267/320/260/321/206/320/270/321/217 /320/272/320/276/320/275/321/202/320/265/320/275/321/202/320/260.svg" +9 -0
- package/dist/components/ConstructorComponents/HeaderMain/img/industries//320/230/320/267/320/276/320/261/321/200/320/260/320/266/320/265/320/275/320/270/320/265 /320/237/320/260/321/200/321/201/320/270/320/275/320/263 /320/272/320/276/320/275/320/272/321/203/321/200/320/265/320/275/321/202/320/276/320/262.svg" +9 -0
- package/dist/components/ConstructorComponents/HeaderMain/img/industries//320/236/320/264/320/265/320/266/320/264/320/260.svg +3 -0
- package/dist/components/ConstructorComponents/HeaderMain/img/industries//320/237/320/260/321/200/321/201/320/270/320/275/320/263 /320/272/320/276/320/275/320/272/321/203/321/200/320/265/320/275/321/202/320/276/320/262.svg" +3 -0
- package/dist/components/ConstructorComponents/HeaderMain/img/industries//320/237/320/276/321/201/321/202/320/260/320/262/321/211/320/270/320/272/320/260/320/274.svg +5 -0
- package/dist/components/ConstructorComponents/HeaderMain/img/industries//320/237/321/200/320/276/320/270/320/267/320/262/320/276/320/264/320/270/321/202/320/265/320/273/321/217/320/274.svg +11 -0
- package/dist/components/ConstructorComponents/HeaderMain/img/industries//320/244/320/260/321/200/320/274/320/260/321/206/320/265/320/262/321/202/320/270/320/272/320/260.svg +3 -0
- package/dist/components/ConstructorComponents/HeaderMain/img/industries//320/244/321/203/320/273/321/204/320/270/320/273/320/274/320/265/320/275/321/202 /320/246/320/265/320/275/321/202/321/200/320/260/320/274.svg" +11 -0
- package/dist/components/ConstructorComponents/HeaderMain/img/industries//320/255/320/273/320/265/320/272/321/202/321/200/320/276/320/275/320/270/320/272/320/260.svg +10 -0
- package/dist/components/ConstructorComponents/HeaderMain/img/lang.svg +10 -0
- package/dist/components/ConstructorComponents/HeaderMain/img/profile.svg +3 -0
- package/dist/components/ConstructorComponents/HeaderMain/img/search.svg +10 -0
- package/dist/components/ConstructorComponents/HeaderMain/img/service/analytics.svg +6 -0
- package/dist/components/ConstructorComponents/HeaderMain/img/service/calendar.svg +6 -0
- package/dist/components/ConstructorComponents/HeaderMain/img/service/competitors.svg +7 -0
- package/dist/components/ConstructorComponents/HeaderMain/img/service/crm.svg +5 -0
- package/dist/components/ConstructorComponents/HeaderMain/img/service/feedback.svg +6 -0
- package/dist/components/ConstructorComponents/HeaderMain/img/service/keyword.svg +6 -0
- package/dist/components/ConstructorComponents/HeaderMain/img/service/marketing.svg +6 -0
- package/dist/components/ConstructorComponents/HeaderMain/img/service/network.svg +5 -0
- package/dist/components/ConstructorComponents/HeaderMain/img/service/product.svg +5 -0
- package/dist/components/ConstructorComponents/HeaderMain/img/service/stocks.svg +3 -0
- package/dist/components/ConstructorComponents/HeaderMain/img/service/task.svg +6 -0
- package/dist/components/ConstructorComponents/HeaderMain/img/service/tools.svg +5 -0
- package/dist/components/ConstructorComponents/HeaderMain/img/service/wiki.svg +5 -0
- package/dist/components/ConstructorComponents/HeaderMain/img/service_icon.svg +5 -0
- package/dist/components/ConstructorComponents/HeaderMain/img/tur.svg +9 -0
- package/dist/components/ConstructorComponents/HeaderMain/img//321/203/320/277/321/200/320/260/320/262/320/273/320/265/320/275/320/270/320/265 /321/206/320/265/320/275/320/260/320/274/320/270.svg" +9 -0
- package/dist/components/Table/ButtonColumn/ButtonColumn.js +116 -0
- package/dist/components/Table/ButtonColumn/ButtonColumn.scss +117 -0
- package/dist/components/Table/ButtonColumn/img/column.svg +7 -0
- package/dist/components/Table/ButtonCopy/ButtonCopy.js +41 -0
- package/dist/components/Table/ButtonCopy/ButtonCopy.scss +43 -0
- package/dist/components/Table/ButtonCopy/img/copy.svg +3 -0
- package/dist/components/Table/ButtonExport/ButtonExport.js +87 -0
- package/dist/components/Table/ButtonExport/ButtonExport.scss +111 -0
- package/dist/components/Table/ButtonExport/img/export.svg +8 -0
- package/dist/components/Table/ButtonExport/img/pdf.svg +12 -0
- package/dist/components/Table/ButtonExport/img/xlc.svg +11 -0
- package/dist/components/Table/ButtonUpload/ButtonUpload.js +27 -0
- package/dist/components/Table/ButtonUpload/ButtonUpload.scss +45 -0
- package/dist/components/Table/ButtonUpload/img/upload_icon.svg +8 -0
- package/dist/components/Table/CheckboxToggle/CheckboxToggle.js +58 -0
- package/dist/components/Table/CheckboxToggle/CheckboxToggle.scss +117 -0
- package/dist/components/Table/Paginator/Paginator.js +260 -0
- package/dist/components/Table/Paginator/Paginator.scss +198 -0
- package/dist/components/Table/Paginator/img/arrow_blue.svg +3 -0
- package/dist/components/Table/Paginator/img/arrow_next.svg +3 -0
- package/dist/components/Table/Paginator/img/arrow_prev.svg +3 -0
- package/dist/components/Table/Table/Filters/OptionsDate.js +211 -0
- package/dist/components/Table/Table/Filters/OptionsImage.js +95 -0
- package/dist/components/Table/Table/Filters/OptionsImage.scss +10 -0
- package/dist/components/Table/Table/Filters/OptionsList.js +247 -0
- package/dist/components/Table/Table/Filters/OptionsNumber.js +226 -0
- package/dist/components/Table/Table/Filters/OptionsNumber.scss +100 -0
- package/dist/components/Table/Table/Filters/OptionsText.js +169 -0
- package/dist/components/Table/Table/Filters/OptionsText.scss +71 -0
- package/dist/components/Table/Table/Filters/img/FilterDefault.js +26 -0
- package/dist/components/Table/Table/Filters/img/FilterReset.js +41 -0
- package/dist/components/Table/Table/Filters/img/dropFilters.png +0 -0
- package/dist/components/Table/Table/Filters/img/filterDefault.svg +3 -0
- package/dist/components/Table/Table/Filters/img/filter_blue.svg +3 -0
- package/dist/components/Table/Table/Filters/img/filter_blue_background.svg +5 -0
- package/dist/components/Table/Table/Filters/img/filter_reset.svg +7 -0
- package/dist/components/Table/Table/InputWithState/InputWithState.js +40 -0
- package/dist/components/Table/Table/RenderFiltersTh/RenderFiltersTh.js +143 -0
- package/dist/components/Table/Table/RenderTd/RenderTd.js +23 -0
- package/dist/components/Table/Table/RenderTh/RenderTh.js +116 -0
- package/dist/components/Table/Table/Table.js +1569 -0
- package/dist/components/Table/Table/Table.scss +1524 -0
- package/dist/components/Table/Table/TableChartTd/TableChartTd.js +175 -0
- package/dist/components/Table/Table/TableChartTd/TableChartTd.scss +0 -0
- package/dist/components/Table/Table/TableInput/TableInput.js +107 -0
- package/dist/components/Table/Table/TableInput/TableInput.scss +35 -0
- package/dist/components/Table/Table/TableWithoutData/TableWithoutData.js +27 -0
- package/dist/components/Table/Table/TableWithoutData/TableWithoutData.scss +32 -0
- package/dist/components/Table/Table/TableWithoutData/img/doc_icon.png +0 -0
- package/dist/components/Table/Table/TdDate/TdDate.js +39 -0
- package/dist/components/Table/Table/TdDate/TdDate.scss +0 -0
- package/dist/components/Table/Table/TdDate.js +35 -0
- package/dist/components/Table/Table/TypeTdImage.js +90 -0
- package/dist/components/Table/Table/img/Search.png +0 -0
- package/dist/components/Table/Table/img/SortArrow.js +12 -0
- package/dist/components/Table/Table/img/SortArrowUp.js +12 -0
- package/dist/components/Table/Table/img/SortTable.js +14 -0
- package/dist/components/Table/Table/img/close_icon.svg +7 -0
- package/dist/components/Table/Table/img/close_white.svg +3 -0
- package/dist/components/Table/Table/img/context-menu.svg +6 -0
- package/dist/components/Table/Table/img/contextMenuBtn.png +0 -0
- package/dist/components/Table/Table/img/delete_icon.svg +8 -0
- package/dist/components/Table/Table/img/dropFilters.png +0 -0
- package/dist/components/Table/Table/img/filter.png +0 -0
- package/dist/components/Table/Table/img/filterDefault.png +0 -0
- package/dist/components/Table/Table/img/filter_blue.svg +3 -0
- package/dist/components/Table/Table/img/filter_blue_background.svg +5 -0
- package/dist/components/Table/Table/img/imageNotFound.svg +3 -0
- package/dist/components/Table/Table/img/location.svg +3 -0
- package/dist/components/Table/Table/img/sort_arrow_down.svg +6 -0
- package/dist/components/Table/Table/img/sort_arrow_up.svg +4 -0
- package/dist/components/Table/Table/img/sort_table.svg +8 -0
- package/dist/components/Table/Table/svg_img.js +8 -0
- package/dist/components/Table/TableBox/TableBox.js +310 -0
- package/dist/components/Table/TableBox/TableBox.scss +418 -0
- package/dist/components/Table/TableBox/TableBox.stories.js +339 -0
- package/dist/components/Table/TableBox/img/delete_icon.svg +9 -0
- package/dist/components/Table/TableBox/img/forward_icon.svg +9 -0
- package/dist/components/Table/TableBox/img/more_icon.svg +10 -0
- package/dist/components/Table/TableBox/img_stories/tag_icon.svg +5 -0
- package/dist/components/Table/TableInput/TableInput.js +107 -0
- package/dist/components/Table/TableInput/TableInput.scss +35 -0
- package/dist/components/Table/TableWithoutData/TableWithoutData.js +27 -0
- package/dist/components/Table/TableWithoutData/TableWithoutData.scss +32 -0
- package/dist/components/Table/TableWithoutData/img/doc_icon.png +0 -0
- package/dist/index.js +7 -0
- package/package.json +14 -9
|
@@ -0,0 +1,1569 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
'use client';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports["default"] = void 0;
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
var _link3 = _interopRequireDefault(require("next/link"));
|
|
10
|
+
var _deepEqual = _interopRequireDefault(require("deep-equal"));
|
|
11
|
+
var _sort_arrow_down = _interopRequireDefault(require("./img/sort_arrow_down.svg"));
|
|
12
|
+
var _sort_table = _interopRequireDefault(require("./img/sort_table.svg"));
|
|
13
|
+
var _sort_arrow_up = _interopRequireDefault(require("./img/sort_arrow_up.svg"));
|
|
14
|
+
var _TableChartTd = _interopRequireDefault(require("./TableChartTd/TableChartTd"));
|
|
15
|
+
var _contextMenu = _interopRequireDefault(require("./img/context-menu.svg"));
|
|
16
|
+
var _TdDate = require("./TdDate/TdDate");
|
|
17
|
+
var _reactSpinners = require("react-spinners");
|
|
18
|
+
var _utils = require("../../../common/utils");
|
|
19
|
+
var _TypeTdImage = require("./TypeTdImage");
|
|
20
|
+
var _RenderFiltersTh = require("./RenderFiltersTh/RenderFiltersTh");
|
|
21
|
+
var _ButtonCopy = require("../ButtonCopy/ButtonCopy");
|
|
22
|
+
var _TableWithoutData = require("../TableWithoutData/TableWithoutData");
|
|
23
|
+
var _Checkbox = _interopRequireDefault(require("../../Checkbox/Checkbox/Checkbox"));
|
|
24
|
+
var _TableInput = _interopRequireDefault(require("../TableInput/TableInput"));
|
|
25
|
+
var _CheckboxToggle = _interopRequireDefault(require("../CheckboxToggle/CheckboxToggle"));
|
|
26
|
+
require("./Table.scss");
|
|
27
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
28
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
29
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
|
|
30
|
+
function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
|
|
31
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
32
|
+
function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
|
|
33
|
+
function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
|
|
34
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
35
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
36
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
37
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
38
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
39
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
40
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
41
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
42
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
43
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
44
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
45
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; } // import Rating from '@mui/material/Rating'
|
|
46
|
+
// import StarIcon from '@mui/icons-material/Star'
|
|
47
|
+
var imageNotFound = require('./img/imageNotFound.svg');
|
|
48
|
+
var SORT_DIRECTIONS = {
|
|
49
|
+
ascending: 'ASC',
|
|
50
|
+
descending: 'DESC'
|
|
51
|
+
};
|
|
52
|
+
var DEFAULT_COL_WIDTH_PX = '150px';
|
|
53
|
+
var _Table = function Table(_ref) {
|
|
54
|
+
var _headers$tooltips, _headers$tooltips2, _headers$header3, _fetchedData$;
|
|
55
|
+
var noDataText = _ref.noDataText,
|
|
56
|
+
loading = _ref.loading,
|
|
57
|
+
_ref$fetchedData = _ref.fetchedData,
|
|
58
|
+
fetchedData = _ref$fetchedData === void 0 ? [] : _ref$fetchedData,
|
|
59
|
+
headers = _ref.headers,
|
|
60
|
+
selectedHeaders = _ref.selectedHeaders,
|
|
61
|
+
onCheck = _ref.onCheck,
|
|
62
|
+
onInputHandler = _ref.onInputHandler,
|
|
63
|
+
_ref$setCheckedStateE = _ref.setCheckedStateEmpty,
|
|
64
|
+
setCheckedStateEmpty = _ref$setCheckedStateE === void 0 ? false : _ref$setCheckedStateE,
|
|
65
|
+
_ref$setState = _ref.setState,
|
|
66
|
+
setState = _ref$setState === void 0 ? false : _ref$setState,
|
|
67
|
+
_ref$isSortable = _ref.isSortable,
|
|
68
|
+
isSortable = _ref$isSortable === void 0 ? true : _ref$isSortable,
|
|
69
|
+
_ref$onBooleanCheckbo = _ref.onBooleanCheckbox,
|
|
70
|
+
onBooleanCheckbox = _ref$onBooleanCheckbo === void 0 ? false : _ref$onBooleanCheckbo,
|
|
71
|
+
_ref$onAction = _ref.onAction,
|
|
72
|
+
onAction = _ref$onAction === void 0 ? false : _ref$onAction,
|
|
73
|
+
_ref$onActionInfo = _ref.onActionInfo,
|
|
74
|
+
onActionInfo = _ref$onActionInfo === void 0 ? false : _ref$onActionInfo,
|
|
75
|
+
_ref$onRedirectInfo = _ref.onRedirectInfo,
|
|
76
|
+
onRedirectInfo = _ref$onRedirectInfo === void 0 ? false : _ref$onRedirectInfo,
|
|
77
|
+
_ref$onToggle = _ref.onToggle,
|
|
78
|
+
onToggle = _ref$onToggle === void 0 ? false : _ref$onToggle,
|
|
79
|
+
_ref$postDataTd = _ref.postDataTd,
|
|
80
|
+
postDataTd = _ref$postDataTd === void 0 ? false : _ref$postDataTd,
|
|
81
|
+
_ref$sortingFunc = _ref.sortingFunc,
|
|
82
|
+
_sortingFunc = _ref$sortingFunc === void 0 ? false : _ref$sortingFunc,
|
|
83
|
+
_ref$sort = _ref.sort,
|
|
84
|
+
sort = _ref$sort === void 0 ? false : _ref$sort,
|
|
85
|
+
_ref$isInsideTable = _ref.isInsideTable,
|
|
86
|
+
isInsideTable = _ref$isInsideTable === void 0 ? false : _ref$isInsideTable,
|
|
87
|
+
_ref$nestedTable = _ref.nestedTable,
|
|
88
|
+
nestedTable = _ref$nestedTable === void 0 ? false : _ref$nestedTable,
|
|
89
|
+
params = _ref.params,
|
|
90
|
+
_ref$columnSize = _ref.columnSize,
|
|
91
|
+
columnSize = _ref$columnSize === void 0 ? false : _ref$columnSize,
|
|
92
|
+
_setParams = _ref.setParams,
|
|
93
|
+
fileFilters = _ref.fileFilters,
|
|
94
|
+
_setFileFilters = _ref.setFileFilters,
|
|
95
|
+
_ref$staticTD = _ref.staticTD,
|
|
96
|
+
staticTD = _ref$staticTD === void 0 ? true : _ref$staticTD,
|
|
97
|
+
_ref$onRedirect = _ref.onRedirect,
|
|
98
|
+
onRedirect = _ref$onRedirect === void 0 ? false : _ref$onRedirect,
|
|
99
|
+
paginatorBoxRef = _ref.paginatorBoxRef,
|
|
100
|
+
refDiv = _ref.refDiv,
|
|
101
|
+
refContainer = _ref.refContainer,
|
|
102
|
+
_ref$hideFilters = _ref.hideFilters,
|
|
103
|
+
hideFilters = _ref$hideFilters === void 0 ? false : _ref$hideFilters,
|
|
104
|
+
hideSorting = _ref.hideSorting,
|
|
105
|
+
total = _ref.total,
|
|
106
|
+
topHeader = _ref.topHeader,
|
|
107
|
+
page = _ref.page,
|
|
108
|
+
contextMenuArr = _ref.contextMenuArr,
|
|
109
|
+
maxHeight = _ref.maxHeight;
|
|
110
|
+
////////////////////TRANSLATE////////////////////////
|
|
111
|
+
|
|
112
|
+
var _useState = (0, _react.useState)('ru'),
|
|
113
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
114
|
+
lang = _useState2[0],
|
|
115
|
+
setLang = _useState2[1];
|
|
116
|
+
// useEffect(() => {
|
|
117
|
+
// setLang(localStorage.getItem("lang"))
|
|
118
|
+
// }, [localStorage.getItem("lang")]);
|
|
119
|
+
|
|
120
|
+
var translateNoData = function translateNoData() {
|
|
121
|
+
if (lang == 'eng') return 'Select options to load the table';
|
|
122
|
+
return 'Выберите параметры для загрузки данных таблицы';
|
|
123
|
+
};
|
|
124
|
+
var translateTextСopied = function translateTextСopied() {
|
|
125
|
+
if (lang == 'eng') return 'Text copied';
|
|
126
|
+
return 'Текст скопирован';
|
|
127
|
+
};
|
|
128
|
+
var translateCopyText = function translateCopyText() {
|
|
129
|
+
if (lang == 'eng') return 'Copy text';
|
|
130
|
+
return 'Скопировать текст';
|
|
131
|
+
};
|
|
132
|
+
var translateNoDataTable = function translateNoDataTable() {
|
|
133
|
+
if (lang == 'eng') return 'No data';
|
|
134
|
+
return 'Нет данных';
|
|
135
|
+
};
|
|
136
|
+
var translateContext = function translateContext(label) {
|
|
137
|
+
switch (label) {
|
|
138
|
+
case 'Удалить':
|
|
139
|
+
return 'Delete';
|
|
140
|
+
case 'Редактировать':
|
|
141
|
+
return 'Edit';
|
|
142
|
+
case 'Delete':
|
|
143
|
+
return 'Удалить';
|
|
144
|
+
case 'Edit':
|
|
145
|
+
return 'Редактировать';
|
|
146
|
+
default:
|
|
147
|
+
return label;
|
|
148
|
+
}
|
|
149
|
+
};
|
|
150
|
+
var translateNoParametr = function translateNoParametr() {
|
|
151
|
+
if (lang == 'eng') return 'No data was found for the specified parameters, try changing the parameters';
|
|
152
|
+
if (lang == 'tur') return "Makaleler Türkçe'ye çevrilme aşamasında olup, İngilizce versiyonlarını web sitesinde okuyabilirsiniz.";
|
|
153
|
+
return 'По заданым параметрам не найдено данных, попробуйте поменять параметры';
|
|
154
|
+
};
|
|
155
|
+
var refTable = (0, _react.useRef)();
|
|
156
|
+
var _useState3 = (0, _react.useState)({}),
|
|
157
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
158
|
+
selectedItems = _useState4[0],
|
|
159
|
+
setSelectedItems = _useState4[1];
|
|
160
|
+
var _useState5 = (0, _react.useState)({}),
|
|
161
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
162
|
+
selectedBooleanItems = _useState6[0],
|
|
163
|
+
setSelectedBooleanItems = _useState6[1];
|
|
164
|
+
var _useState7 = (0, _react.useState)(noDataText ? noDataText : translateNoData()),
|
|
165
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
166
|
+
textTable = _useState8[0],
|
|
167
|
+
setTextTable = _useState8[1];
|
|
168
|
+
var _useState9 = (0, _react.useState)(headers !== null && headers !== void 0 && headers.filters ? headers === null || headers === void 0 ? void 0 : headers.filters : []),
|
|
169
|
+
_useState10 = _slicedToArray(_useState9, 2),
|
|
170
|
+
filters = _useState10[0],
|
|
171
|
+
_setFilters = _useState10[1];
|
|
172
|
+
var _useState11 = (0, _react.useState)(false),
|
|
173
|
+
_useState12 = _slicedToArray(_useState11, 2),
|
|
174
|
+
showAllImages = _useState12[0],
|
|
175
|
+
_setShowAllImages = _useState12[1];
|
|
176
|
+
var _useState13 = (0, _react.useState)(null),
|
|
177
|
+
_useState14 = _slicedToArray(_useState13, 2),
|
|
178
|
+
activeItem = _useState14[0],
|
|
179
|
+
_setActiveItem = _useState14[1];
|
|
180
|
+
var _useState15 = (0, _react.useState)(null),
|
|
181
|
+
_useState16 = _slicedToArray(_useState15, 2),
|
|
182
|
+
showOption = _useState16[0],
|
|
183
|
+
_setShowOption = _useState16[1];
|
|
184
|
+
var _useState17 = (0, _react.useState)(sort ? sort : []),
|
|
185
|
+
_useState18 = _slicedToArray(_useState17, 2),
|
|
186
|
+
sortDirection = _useState18[0],
|
|
187
|
+
setSortDirection = _useState18[1];
|
|
188
|
+
var activeSortColumn = (0, _react.useRef)();
|
|
189
|
+
var _useState19 = (0, _react.useState)(sort ? sort : []),
|
|
190
|
+
_useState20 = _slicedToArray(_useState19, 2),
|
|
191
|
+
sortParam = _useState20[0],
|
|
192
|
+
setSortParam = _useState20[1];
|
|
193
|
+
var _useState21 = (0, _react.useState)(headers !== null && headers !== void 0 && headers.filters ? [sortParam, headers === null || headers === void 0 ? void 0 : headers.filters] : []),
|
|
194
|
+
_useState22 = _slicedToArray(_useState21, 2),
|
|
195
|
+
filtersTable = _useState22[0],
|
|
196
|
+
_setFiltersTable = _useState22[1];
|
|
197
|
+
var _useState23 = (0, _react.useState)([]),
|
|
198
|
+
_useState24 = _slicedToArray(_useState23, 2),
|
|
199
|
+
fetchedDataInside = _useState24[0],
|
|
200
|
+
setFetchedDataInside = _useState24[1];
|
|
201
|
+
var _useState25 = (0, _react.useState)([]),
|
|
202
|
+
_useState26 = _slicedToArray(_useState25, 2),
|
|
203
|
+
headersInside = _useState26[0],
|
|
204
|
+
setHeadersInside = _useState26[1];
|
|
205
|
+
var _useState27 = (0, _react.useState)({}),
|
|
206
|
+
_useState28 = _slicedToArray(_useState27, 2),
|
|
207
|
+
sortInside = _useState28[0],
|
|
208
|
+
setSortInside = _useState28[1];
|
|
209
|
+
var _useState29 = (0, _react.useState)(false),
|
|
210
|
+
_useState30 = _slicedToArray(_useState29, 2),
|
|
211
|
+
loadingInside = _useState30[0],
|
|
212
|
+
setLoadingInside = _useState30[1];
|
|
213
|
+
var _useState31 = (0, _react.useState)(true),
|
|
214
|
+
_useState32 = _slicedToArray(_useState31, 2),
|
|
215
|
+
initialSorting = _useState32[0],
|
|
216
|
+
setInitialSorting = _useState32[1];
|
|
217
|
+
var _useState33 = (0, _react.useState)(true),
|
|
218
|
+
_useState34 = _slicedToArray(_useState33, 2),
|
|
219
|
+
initialSort = _useState34[0],
|
|
220
|
+
setInitialSort = _useState34[1];
|
|
221
|
+
var _useState35 = (0, _react.useState)(0),
|
|
222
|
+
_useState36 = _slicedToArray(_useState35, 2),
|
|
223
|
+
rowCount = _useState36[0],
|
|
224
|
+
setRowCount = _useState36[1];
|
|
225
|
+
var _useState37 = (0, _react.useState)({}),
|
|
226
|
+
_useState38 = _slicedToArray(_useState37, 2),
|
|
227
|
+
inputState = _useState38[0],
|
|
228
|
+
setInputState = _useState38[1];
|
|
229
|
+
var _useState39 = (0, _react.useState)(null),
|
|
230
|
+
_useState40 = _slicedToArray(_useState39, 2),
|
|
231
|
+
indTr = _useState40[0],
|
|
232
|
+
setIndTr = _useState40[1];
|
|
233
|
+
var tableId = (0, _react.useId)();
|
|
234
|
+
var _useState41 = (0, _react.useState)(false),
|
|
235
|
+
_useState42 = _slicedToArray(_useState41, 2),
|
|
236
|
+
showContext = _useState42[0],
|
|
237
|
+
setShowContext = _useState42[1];
|
|
238
|
+
var _useState43 = (0, _react.useState)(0),
|
|
239
|
+
_useState44 = _slicedToArray(_useState43, 2),
|
|
240
|
+
contextLeft = _useState44[0],
|
|
241
|
+
setContextLeft = _useState44[1];
|
|
242
|
+
var _useState45 = (0, _react.useState)(0),
|
|
243
|
+
_useState46 = _slicedToArray(_useState45, 2),
|
|
244
|
+
contextTop = _useState46[0],
|
|
245
|
+
setContextTop = _useState46[1];
|
|
246
|
+
var _useState47 = (0, _react.useState)([]),
|
|
247
|
+
_useState48 = _slicedToArray(_useState47, 2),
|
|
248
|
+
contextArr = _useState48[0],
|
|
249
|
+
setContextArr = _useState48[1];
|
|
250
|
+
var _useState49 = (0, _react.useState)(''),
|
|
251
|
+
_useState50 = _slicedToArray(_useState49, 2),
|
|
252
|
+
contextId = _useState50[0],
|
|
253
|
+
setContextId = _useState50[1];
|
|
254
|
+
var _useState51 = (0, _react.useState)(null),
|
|
255
|
+
_useState52 = _slicedToArray(_useState51, 2),
|
|
256
|
+
activeBuffer = _useState52[0],
|
|
257
|
+
setActiveBuffer = _useState52[1];
|
|
258
|
+
var _useState53 = (0, _react.useState)(false),
|
|
259
|
+
_useState54 = _slicedToArray(_useState53, 2),
|
|
260
|
+
checkedAll = _useState54[0],
|
|
261
|
+
_setCheckedAll = _useState54[1];
|
|
262
|
+
var refBody = (0, _react.useRef)();
|
|
263
|
+
var refThead = (0, _react.useRef)();
|
|
264
|
+
var typeIndexArr = selectedHeaders !== null && selectedHeaders !== void 0 && selectedHeaders.type ? selectedHeaders === null || selectedHeaders === void 0 ? void 0 : selectedHeaders.type : headers === null || headers === void 0 ? void 0 : headers.type;
|
|
265
|
+
var hiddenHeaders = typeIndexArr === null || typeIndexArr === void 0 ? void 0 : typeIndexArr.map(function (el, ind) {
|
|
266
|
+
return el === 'hidden' ? ind : -1;
|
|
267
|
+
}).filter(function (el) {
|
|
268
|
+
return el !== -1;
|
|
269
|
+
});
|
|
270
|
+
var tooltips = (headers === null || headers === void 0 || (_headers$tooltips = headers.tooltips) === null || _headers$tooltips === void 0 ? void 0 : _headers$tooltips.length) > 0 ? headers === null || headers === void 0 || (_headers$tooltips2 = headers.tooltips) === null || _headers$tooltips2 === void 0 ? void 0 : _headers$tooltips2.filter(function (el) {
|
|
271
|
+
return el !== 'hidden';
|
|
272
|
+
}) : false;
|
|
273
|
+
var _useState55 = (0, _react.useState)(0),
|
|
274
|
+
_useState56 = _slicedToArray(_useState55, 2),
|
|
275
|
+
leftPosition = _useState56[0],
|
|
276
|
+
setLeftPosition = _useState56[1];
|
|
277
|
+
var _useState57 = (0, _react.useState)(0),
|
|
278
|
+
_useState58 = _slicedToArray(_useState57, 2),
|
|
279
|
+
widtContainer = _useState58[0],
|
|
280
|
+
setWidtContainer = _useState58[1];
|
|
281
|
+
var _useState59 = (0, _react.useState)(0),
|
|
282
|
+
_useState60 = _slicedToArray(_useState59, 2),
|
|
283
|
+
scrollWidth = _useState60[0],
|
|
284
|
+
setScrollWidth = _useState60[1];
|
|
285
|
+
var _useState61 = (0, _react.useState)(0),
|
|
286
|
+
_useState62 = _slicedToArray(_useState61, 2),
|
|
287
|
+
isFixed = _useState62[0],
|
|
288
|
+
setIsFixed = _useState62[1];
|
|
289
|
+
var _useState63 = (0, _react.useState)(0),
|
|
290
|
+
_useState64 = _slicedToArray(_useState63, 2),
|
|
291
|
+
widthTable = _useState64[0],
|
|
292
|
+
setWidthTable = _useState64[1];
|
|
293
|
+
var _useState65 = (0, _react.useState)(0),
|
|
294
|
+
_useState66 = _slicedToArray(_useState65, 2),
|
|
295
|
+
bottom = _useState66[0],
|
|
296
|
+
setBottom = _useState66[1];
|
|
297
|
+
var _useState67 = (0, _react.useState)(false),
|
|
298
|
+
_useState68 = _slicedToArray(_useState67, 2),
|
|
299
|
+
isVisible = _useState68[0],
|
|
300
|
+
setIsVisible = _useState68[1];
|
|
301
|
+
|
|
302
|
+
// Keys
|
|
303
|
+
var _getId = function getId(data, prefix) {
|
|
304
|
+
return data === null || data === void 0 ? void 0 : data.reduce(function (result, current) {
|
|
305
|
+
var valueToAdd;
|
|
306
|
+
if (Array.isArray(current)) {
|
|
307
|
+
valueToAdd = _getId(current, "");
|
|
308
|
+
} else {
|
|
309
|
+
valueToAdd = _typeof(current) === 'object' ? '' : current === null || current === void 0 ? void 0 : current.toString();
|
|
310
|
+
}
|
|
311
|
+
return result + valueToAdd;
|
|
312
|
+
}, prefix);
|
|
313
|
+
};
|
|
314
|
+
var getCheckboxId = function getCheckboxId(data) {
|
|
315
|
+
return _getId(data, 'checkbox');
|
|
316
|
+
};
|
|
317
|
+
|
|
318
|
+
// Table row object
|
|
319
|
+
var getRowObj = function getRowObj(data) {
|
|
320
|
+
var rowObj = {};
|
|
321
|
+
headers === null || headers === void 0 || headers.header.forEach(function (el, index) {
|
|
322
|
+
if (_typeof(el) === 'object') {
|
|
323
|
+
el = headers === null || headers === void 0 ? void 0 : headers.type[index];
|
|
324
|
+
rowObj[el] = data[index];
|
|
325
|
+
} else {
|
|
326
|
+
var type = headers === null || headers === void 0 ? void 0 : headers.type[index];
|
|
327
|
+
if (type === 'currency') {
|
|
328
|
+
var _data$index;
|
|
329
|
+
rowObj[el] = Array.isArray(data) ? (_data$index = data[index]) === null || _data$index === void 0 ? void 0 : _data$index[0] : data[index];
|
|
330
|
+
} else {
|
|
331
|
+
rowObj[el] = data[index];
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
});
|
|
335
|
+
return rowObj;
|
|
336
|
+
};
|
|
337
|
+
|
|
338
|
+
// Update checkbox state
|
|
339
|
+
var getUpdatedOnCheckState = function getUpdatedOnCheckState(newState, data, rowObj) {
|
|
340
|
+
var _Object$keys, _Object$keys2;
|
|
341
|
+
var id = getCheckboxId(data);
|
|
342
|
+
var all_check_length = fetchedData.map(function (arr) {
|
|
343
|
+
return getRowObj(arr);
|
|
344
|
+
}).length;
|
|
345
|
+
if (newState[id]) {
|
|
346
|
+
delete newState[id];
|
|
347
|
+
} else {
|
|
348
|
+
newState[id] = rowObj;
|
|
349
|
+
}
|
|
350
|
+
if (((_Object$keys = Object.keys(newState)) === null || _Object$keys === void 0 ? void 0 : _Object$keys.length) == all_check_length && ((_Object$keys2 = Object.keys(newState)) === null || _Object$keys2 === void 0 ? void 0 : _Object$keys2.length) != 0) {
|
|
351
|
+
_setCheckedAll(true);
|
|
352
|
+
} else _setCheckedAll(false);
|
|
353
|
+
return newState;
|
|
354
|
+
};
|
|
355
|
+
var onCheckCheckboxData = function onCheckCheckboxData(arr, extraValue) {
|
|
356
|
+
if (extraValue) {
|
|
357
|
+
return selectedBooleanItems[extraValue];
|
|
358
|
+
} else {
|
|
359
|
+
var rowObj = getRowObj(arr);
|
|
360
|
+
var selectedItem = selectedItems[getCheckboxId(arr)];
|
|
361
|
+
return (0, _deepEqual["default"])(rowObj, selectedItem);
|
|
362
|
+
}
|
|
363
|
+
};
|
|
364
|
+
|
|
365
|
+
// Getting row data by check handler
|
|
366
|
+
var onCheckboxChange = function onCheckboxChange(arr, extraValue) {
|
|
367
|
+
var rowObj = null;
|
|
368
|
+
if (extraValue) {
|
|
369
|
+
headers === null || headers === void 0 || headers.header.forEach(function (el, index) {
|
|
370
|
+
return rowObj[extraValue] = arr[index][0];
|
|
371
|
+
});
|
|
372
|
+
} else {
|
|
373
|
+
rowObj = getRowObj(arr);
|
|
374
|
+
}
|
|
375
|
+
if (extraValue) {
|
|
376
|
+
setSelectedBooleanItems(function (prev) {
|
|
377
|
+
var obj;
|
|
378
|
+
if (prev[extraValue]) {
|
|
379
|
+
obj = _objectSpread(_objectSpread({}, prev), {}, _defineProperty({}, extraValue, !prev[extraValue]));
|
|
380
|
+
} else {
|
|
381
|
+
obj = _objectSpread(_objectSpread({}, prev), rowObj);
|
|
382
|
+
}
|
|
383
|
+
return obj;
|
|
384
|
+
});
|
|
385
|
+
} else {
|
|
386
|
+
var newState = getUpdatedOnCheckState(_objectSpread({}, selectedItems), arr, rowObj);
|
|
387
|
+
setSelectedItems(newState);
|
|
388
|
+
if (onCheck) onCheck(Object.values(newState));
|
|
389
|
+
}
|
|
390
|
+
return rowObj;
|
|
391
|
+
};
|
|
392
|
+
|
|
393
|
+
// Check all handler
|
|
394
|
+
var onCheckAll = function onCheckAll() {
|
|
395
|
+
var newState = {};
|
|
396
|
+
fetchedData.forEach(function (arr) {
|
|
397
|
+
getUpdatedOnCheckState(newState, arr, getRowObj(arr));
|
|
398
|
+
});
|
|
399
|
+
setSelectedItems(newState);
|
|
400
|
+
if (onCheck) onCheck(Object.values(newState));
|
|
401
|
+
_setCheckedAll(true);
|
|
402
|
+
};
|
|
403
|
+
|
|
404
|
+
// Uncheck all handler
|
|
405
|
+
var _onUncheckAll = function onUncheckAll() {
|
|
406
|
+
setSelectedItems({});
|
|
407
|
+
onCheck([]);
|
|
408
|
+
_setCheckedAll(false);
|
|
409
|
+
};
|
|
410
|
+
|
|
411
|
+
// Table context menu handler
|
|
412
|
+
var _onContextMenu = function onContextMenu(event, arr, trGetId) {
|
|
413
|
+
var isContext = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
|
|
414
|
+
event.stopPropagation();
|
|
415
|
+
if (showContext == trGetId) {
|
|
416
|
+
setShowContext(false);
|
|
417
|
+
} else setShowContext(trGetId);
|
|
418
|
+
setContextLeft('50%');
|
|
419
|
+
setContextTop('50%');
|
|
420
|
+
setContextId(trGetId);
|
|
421
|
+
setContextArr(onCheckboxChange(arr));
|
|
422
|
+
};
|
|
423
|
+
|
|
424
|
+
// Table column sort logic
|
|
425
|
+
var columnSort = function columnSort(el) {
|
|
426
|
+
var sortActual;
|
|
427
|
+
if (initialSorting) {
|
|
428
|
+
sortActual = [el, SORT_DIRECTIONS.descending];
|
|
429
|
+
setInitialSorting(false);
|
|
430
|
+
} else {
|
|
431
|
+
if (_sortingFunc) {
|
|
432
|
+
if (el === sort[0]) {
|
|
433
|
+
if (sort[1] == SORT_DIRECTIONS.descending) {
|
|
434
|
+
sortActual = [el, SORT_DIRECTIONS.ascending];
|
|
435
|
+
} else {
|
|
436
|
+
setInitialSorting(true);
|
|
437
|
+
sortActual = initialSort;
|
|
438
|
+
}
|
|
439
|
+
} else {
|
|
440
|
+
sortActual = [el, SORT_DIRECTIONS.descending];
|
|
441
|
+
}
|
|
442
|
+
}
|
|
443
|
+
}
|
|
444
|
+
setSortParam(sortActual);
|
|
445
|
+
setSortDirection(sortActual);
|
|
446
|
+
_sortingFunc([sortActual, filtersTable]);
|
|
447
|
+
_setParams([sortActual, filtersTable]);
|
|
448
|
+
};
|
|
449
|
+
|
|
450
|
+
// Formatting table data by types
|
|
451
|
+
var typesTd = function typesTd(arr, rowInd) {
|
|
452
|
+
var tdList = arr === null || arr === void 0 ? void 0 : arr.map(function (el, ind) {
|
|
453
|
+
var _ref2;
|
|
454
|
+
var currentType = typeIndexArr === null || typeIndexArr === void 0 ? void 0 : typeIndexArr[ind];
|
|
455
|
+
var currentWidth = (_ref2 = (columnSize === null || columnSize === void 0 ? void 0 : columnSize.length) > 0 ? columnSize[ind] : DEFAULT_COL_WIDTH_PX) !== null && _ref2 !== void 0 ? _ref2 : DEFAULT_COL_WIDTH_PX;
|
|
456
|
+
if ((typeIndexArr === null || typeIndexArr === void 0 ? void 0 : typeIndexArr.length) > 0) {
|
|
457
|
+
if (currentType === 'link') {
|
|
458
|
+
return /*#__PURE__*/_react["default"].createElement("td", {
|
|
459
|
+
className: "".concat(staticTD && ind === 0 ? 'sticky_th' : ''),
|
|
460
|
+
key: _getId([tableId, el, ind], 'link'),
|
|
461
|
+
onContextMenu: function onContextMenu(e) {
|
|
462
|
+
return e.stopPropagation();
|
|
463
|
+
}
|
|
464
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
465
|
+
className: "type-td_link"
|
|
466
|
+
}, /*#__PURE__*/_react["default"].createElement(_link3["default"], {
|
|
467
|
+
href: el,
|
|
468
|
+
target: "_blank",
|
|
469
|
+
rel: "noopener noreferrer",
|
|
470
|
+
className: "link__blue"
|
|
471
|
+
}, (el === null || el === void 0 ? void 0 : el.length) > 20 ? el.slice(0, 20) + '...' : el), (el === null || el === void 0 ? void 0 : el.length) > 20 && /*#__PURE__*/_react["default"].createElement(_link3["default"], {
|
|
472
|
+
href: el,
|
|
473
|
+
target: "_blank",
|
|
474
|
+
rel: "noopener noreferrer",
|
|
475
|
+
className: "link__blue popup-td"
|
|
476
|
+
}, el)));
|
|
477
|
+
}
|
|
478
|
+
if (currentType === 'stringLayers') {
|
|
479
|
+
if (!Array.isArray(el)) return '';
|
|
480
|
+
var stringArr = el === null || el === void 0 ? void 0 : el.map(function (item, itemInd) {
|
|
481
|
+
var styles;
|
|
482
|
+
if (Array.isArray(headers === null || headers === void 0 ? void 0 : headers.styles)) {
|
|
483
|
+
var _headers$styles, _headers$styles2;
|
|
484
|
+
styles = headers !== null && headers !== void 0 && (_headers$styles = headers.styles) !== null && _headers$styles !== void 0 && (_headers$styles = _headers$styles[rowInd]) !== null && _headers$styles !== void 0 && (_headers$styles = _headers$styles[ind]) !== null && _headers$styles !== void 0 && _headers$styles[itemInd] ? headers === null || headers === void 0 || (_headers$styles2 = headers.styles) === null || _headers$styles2 === void 0 || (_headers$styles2 = _headers$styles2[rowInd]) === null || _headers$styles2 === void 0 || (_headers$styles2 = _headers$styles2[ind]) === null || _headers$styles2 === void 0 ? void 0 : _headers$styles2[itemInd] : {};
|
|
485
|
+
}
|
|
486
|
+
if (Array.isArray(item)) {
|
|
487
|
+
return /*#__PURE__*/_react["default"].createElement("p", null, item.map(function (str, strInd) {
|
|
488
|
+
var strItemStyles;
|
|
489
|
+
if (styles) {
|
|
490
|
+
var _styles;
|
|
491
|
+
strItemStyles = (_styles = styles) === null || _styles === void 0 ? void 0 : _styles[strInd];
|
|
492
|
+
}
|
|
493
|
+
var checkedStyles = _typeof(strItemStyles) === 'object' && !Array.isArray(strItemStyles) ? strItemStyles : {};
|
|
494
|
+
return /*#__PURE__*/_react["default"].createElement("span", {
|
|
495
|
+
className: 'text_grey',
|
|
496
|
+
style: checkedStyles
|
|
497
|
+
}, str);
|
|
498
|
+
}));
|
|
499
|
+
} else {
|
|
500
|
+
return /*#__PURE__*/_react["default"].createElement("p", {
|
|
501
|
+
className: 'text_grey',
|
|
502
|
+
style: Array.isArray(styles) ? styles[itemInd] : styles
|
|
503
|
+
}, item);
|
|
504
|
+
}
|
|
505
|
+
});
|
|
506
|
+
return /*#__PURE__*/_react["default"].createElement("td", {
|
|
507
|
+
className: "type-td_string-layers ".concat(staticTD && ind === 0 ? 'sticky_th' : ''),
|
|
508
|
+
key: _getId([tableId, el, ind], 'stringLayers')
|
|
509
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
510
|
+
className: "type-td_string-layers__content"
|
|
511
|
+
}, stringArr));
|
|
512
|
+
}
|
|
513
|
+
if (currentType === 'toggleStatus') {
|
|
514
|
+
if (!Array.isArray(el)) return 'ㅤ';
|
|
515
|
+
var _el = _slicedToArray(el, 2),
|
|
516
|
+
value = _el[0],
|
|
517
|
+
id = _el[1];
|
|
518
|
+
return /*#__PURE__*/_react["default"].createElement("td", {
|
|
519
|
+
className: "type-td_toggle_status ".concat(staticTD && ind === 0 ? 'sticky_th' : ''),
|
|
520
|
+
key: _getId([tableId, el, ind], 'toggleStatus')
|
|
521
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
522
|
+
className: "text-box"
|
|
523
|
+
}, /*#__PURE__*/_react["default"].createElement(_CheckboxToggle["default"], {
|
|
524
|
+
value: value,
|
|
525
|
+
onChange: function onChange(e) {
|
|
526
|
+
if (onToggle) {
|
|
527
|
+
onToggle(getRowObj(arr));
|
|
528
|
+
}
|
|
529
|
+
}
|
|
530
|
+
})));
|
|
531
|
+
}
|
|
532
|
+
if (currentType === 'collectInfo') {
|
|
533
|
+
if (!Array.isArray(el)) return 'ㅤ';
|
|
534
|
+
var _el2 = _slicedToArray(el, 6),
|
|
535
|
+
imgLink = _el2[0],
|
|
536
|
+
name = _el2[1],
|
|
537
|
+
desc = _el2[2],
|
|
538
|
+
brand = _el2[3],
|
|
539
|
+
offerId = _el2[4],
|
|
540
|
+
count = _el2[5];
|
|
541
|
+
var isNameArr = Array.isArray(name);
|
|
542
|
+
var isDescArr = Array.isArray(desc);
|
|
543
|
+
var isBrandArr = Array.isArray(brand);
|
|
544
|
+
var isOfferArr = Array.isArray(offerId);
|
|
545
|
+
return /*#__PURE__*/_react["default"].createElement("td", {
|
|
546
|
+
className: "type-td_collect-info ".concat(staticTD && ind === 0 ? 'sticky_th' : ''),
|
|
547
|
+
key: _getId([tableId, el, ind], 'collectInfo')
|
|
548
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
549
|
+
className: "collect_info_box"
|
|
550
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
551
|
+
className: "img-box"
|
|
552
|
+
}, /*#__PURE__*/_react["default"].createElement("img", {
|
|
553
|
+
className: "collect_info_img",
|
|
554
|
+
src: imgLink.src,
|
|
555
|
+
onError: function onError(e) {
|
|
556
|
+
return e.target.src = imageNotFound;
|
|
557
|
+
},
|
|
558
|
+
alt: "table_info_img"
|
|
559
|
+
})), /*#__PURE__*/_react["default"].createElement("div", {
|
|
560
|
+
className: "text_info_box"
|
|
561
|
+
}, /*#__PURE__*/_react["default"].createElement("p", {
|
|
562
|
+
className: "text_info_name",
|
|
563
|
+
onClick: isNameArr ? function (e) {
|
|
564
|
+
return onAction(['name', name]);
|
|
565
|
+
} : function () {},
|
|
566
|
+
style: isNameArr ? {
|
|
567
|
+
color: '#0009E8'
|
|
568
|
+
} : {}
|
|
569
|
+
}, name ? isNameArr ? name === null || name === void 0 ? void 0 : name[0] : name : '-'), /*#__PURE__*/_react["default"].createElement("p", {
|
|
570
|
+
className: "text_info_desc",
|
|
571
|
+
onClick: isDescArr ? function (e) {
|
|
572
|
+
return onAction(['desc', desc]);
|
|
573
|
+
} : function () {},
|
|
574
|
+
style: isDescArr ? {
|
|
575
|
+
color: '#0009E8'
|
|
576
|
+
} : {}
|
|
577
|
+
}, desc ? isDescArr ? desc === null || desc === void 0 ? void 0 : desc[0] : desc : '-'), /*#__PURE__*/_react["default"].createElement("p", {
|
|
578
|
+
className: "text_info_brand",
|
|
579
|
+
onClick: isBrandArr ? function (e) {
|
|
580
|
+
return onAction(['brand', brand]);
|
|
581
|
+
} : function () {},
|
|
582
|
+
style: isBrandArr ? {
|
|
583
|
+
color: '#0009E8'
|
|
584
|
+
} : {}
|
|
585
|
+
}, brand ? isBrandArr ? brand === null || brand === void 0 ? void 0 : brand[0] : brand : '-'), /*#__PURE__*/_react["default"].createElement("div", {
|
|
586
|
+
className: "text_info_sub_desc_box"
|
|
587
|
+
}, /*#__PURE__*/_react["default"].createElement("p", {
|
|
588
|
+
className: "text_info_sub_desc",
|
|
589
|
+
onClick: isOfferArr ? function (e) {
|
|
590
|
+
return onAction(['offerId', offerId]);
|
|
591
|
+
} : function () {},
|
|
592
|
+
style: isOfferArr ? {
|
|
593
|
+
color: '#0009E8'
|
|
594
|
+
} : {}
|
|
595
|
+
}, "\u0410\u0440\u0442: ", /*#__PURE__*/_react["default"].createElement("span", null, offerId ? isOfferArr ? offerId === null || offerId === void 0 ? void 0 : offerId[0] : offerId : '-')), count && /*#__PURE__*/_react["default"].createElement("p", {
|
|
596
|
+
className: "text_sum"
|
|
597
|
+
}, count, /*#__PURE__*/_react["default"].createElement("span", null, "\u0448\u0442")), /*#__PURE__*/_react["default"].createElement(_ButtonCopy.ButtonCopy, {
|
|
598
|
+
value: el === null || el === void 0 ? void 0 : el[(el === null || el === void 0 ? void 0 : el.length) - 1]
|
|
599
|
+
})))));
|
|
600
|
+
}
|
|
601
|
+
if (currentType === 'imageWithText') {
|
|
602
|
+
if (!Array.isArray(el)) return 'ㅤ';
|
|
603
|
+
var _el3 = _slicedToArray(el, 2),
|
|
604
|
+
link = _el3[0],
|
|
605
|
+
text = _el3[1];
|
|
606
|
+
return /*#__PURE__*/_react["default"].createElement("td", {
|
|
607
|
+
className: "".concat(staticTD && ind === 0 ? 'sticky_th' : ''),
|
|
608
|
+
key: _getId([tableId, el, ind], 'imageWithText')
|
|
609
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
610
|
+
className: "type-td_image-with-text",
|
|
611
|
+
style: {
|
|
612
|
+
justifyContent: text ? 'flex-start' : 'center'
|
|
613
|
+
}
|
|
614
|
+
}, /*#__PURE__*/_react["default"].createElement("img", {
|
|
615
|
+
src: link,
|
|
616
|
+
alt: "table_icon",
|
|
617
|
+
onError: function onError(e) {
|
|
618
|
+
return e.target.src = imageNotFound;
|
|
619
|
+
}
|
|
620
|
+
}), /*#__PURE__*/_react["default"].createElement("p", null, text)));
|
|
621
|
+
}
|
|
622
|
+
if (currentType === 'author') {
|
|
623
|
+
return /*#__PURE__*/_react["default"].createElement("td", {
|
|
624
|
+
className: "".concat(staticTD && ind === 0 ? 'sticky_th' : ''),
|
|
625
|
+
key: _getId([tableId, el, ind], 'author')
|
|
626
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
627
|
+
className: "type-td_image-with-text",
|
|
628
|
+
style: {
|
|
629
|
+
justifyContent: el ? 'flex-start' : 'center'
|
|
630
|
+
}
|
|
631
|
+
}, /*#__PURE__*/_react["default"].createElement("p", null, lang === 'eng' ? (0, _utils.transliter)(el) : el)));
|
|
632
|
+
}
|
|
633
|
+
if (currentType === 'name') {
|
|
634
|
+
var _fullName$split$, _fullName$split$2;
|
|
635
|
+
if (!Array.isArray(el)) return 'ㅤ';
|
|
636
|
+
var _el4 = _slicedToArray(el, 2),
|
|
637
|
+
fullName = _el4[0],
|
|
638
|
+
color = _el4[1];
|
|
639
|
+
var _name = fullName === null || fullName === void 0 || (_fullName$split$ = fullName.split(' ')[0]) === null || _fullName$split$ === void 0 || (_fullName$split$ = _fullName$split$.substr(0, 1)) === null || _fullName$split$ === void 0 ? void 0 : _fullName$split$.toUpperCase();
|
|
640
|
+
var surname = fullName === null || fullName === void 0 || (_fullName$split$2 = fullName.split(' ')[1]) === null || _fullName$split$2 === void 0 || (_fullName$split$2 = _fullName$split$2.substr(0, 1)) === null || _fullName$split$2 === void 0 ? void 0 : _fullName$split$2.toUpperCase();
|
|
641
|
+
return /*#__PURE__*/_react["default"].createElement("td", {
|
|
642
|
+
className: "".concat(staticTD && ind === 0 ? 'sticky_th' : ''),
|
|
643
|
+
key: _getId([tableId, el, ind], 'name')
|
|
644
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
645
|
+
className: "type-td_name",
|
|
646
|
+
style: {
|
|
647
|
+
justifyContent: el ? 'flex-start' : 'center'
|
|
648
|
+
}
|
|
649
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
650
|
+
className: "icon-name",
|
|
651
|
+
style: {
|
|
652
|
+
background: color
|
|
653
|
+
}
|
|
654
|
+
}, "".concat(_name ? _name : '').concat(surname ? surname : '')), /*#__PURE__*/_react["default"].createElement("p", {
|
|
655
|
+
className: "text_name"
|
|
656
|
+
}, fullName)));
|
|
657
|
+
}
|
|
658
|
+
if (currentType === 'stringLayersWithLink') {
|
|
659
|
+
if (!Array.isArray(el)) return 'ㅤ';
|
|
660
|
+
var _stringArr = el === null || el === void 0 ? void 0 : el.map(function (el, strInd) {
|
|
661
|
+
if (Array.isArray(el)) {
|
|
662
|
+
if ((el === null || el === void 0 ? void 0 : el.length) > 1) {
|
|
663
|
+
var _el5 = _slicedToArray(el, 2),
|
|
664
|
+
_text = _el5[0],
|
|
665
|
+
_link = _el5[1];
|
|
666
|
+
return /*#__PURE__*/_react["default"].createElement("a", {
|
|
667
|
+
// style={headers?.styles?.[rowInd]?.[ind] ? headers?.styles?.[rowInd]?.[ind] : {}}
|
|
668
|
+
key: _getId([tableId, el, ind], 'stringLayersWithLink'),
|
|
669
|
+
href: _link,
|
|
670
|
+
target: "_blank",
|
|
671
|
+
rel: "noopener noreferrer",
|
|
672
|
+
className: "btn"
|
|
673
|
+
}, _text);
|
|
674
|
+
}
|
|
675
|
+
}
|
|
676
|
+
});
|
|
677
|
+
return /*#__PURE__*/_react["default"].createElement("td", {
|
|
678
|
+
className: "type-td_string-layers ".concat(staticTD && ind === 0 ? 'sticky_th' : ''),
|
|
679
|
+
key: _getId([tableId, el, ind], 'stringLayersWithLink'),
|
|
680
|
+
onContextMenu: function onContextMenu(e) {
|
|
681
|
+
return e.stopPropagation();
|
|
682
|
+
}
|
|
683
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
684
|
+
className: "copy-box"
|
|
685
|
+
}, /*#__PURE__*/_react["default"].createElement("p", {
|
|
686
|
+
className: "text"
|
|
687
|
+
}, el[0]), /*#__PURE__*/_react["default"].createElement(_ButtonCopy.ButtonCopy, {
|
|
688
|
+
value: el[0]
|
|
689
|
+
})), _stringArr && /*#__PURE__*/_react["default"].createElement("div", {
|
|
690
|
+
className: "text-box"
|
|
691
|
+
}, _stringArr));
|
|
692
|
+
}
|
|
693
|
+
if (currentType === 'copyText') {
|
|
694
|
+
return /*#__PURE__*/_react["default"].createElement("td", {
|
|
695
|
+
className: "".concat(staticTD && ind === 0 ? 'sticky_th' : ''),
|
|
696
|
+
key: _getId([tableId, el, ind], 'stringLayersWithLink'),
|
|
697
|
+
onContextMenu: function onContextMenu(e) {
|
|
698
|
+
return e.stopPropagation();
|
|
699
|
+
}
|
|
700
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
701
|
+
className: "type-td_copy-text"
|
|
702
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
703
|
+
className: "copy-box"
|
|
704
|
+
}, /*#__PURE__*/_react["default"].createElement("p", {
|
|
705
|
+
className: "text"
|
|
706
|
+
}, el), /*#__PURE__*/_react["default"].createElement(_ButtonCopy.ButtonCopy, {
|
|
707
|
+
value: el
|
|
708
|
+
}), /*#__PURE__*/_react["default"].createElement("div", {
|
|
709
|
+
className: "tooltip-box"
|
|
710
|
+
}, /*#__PURE__*/_react["default"].createElement("button", {
|
|
711
|
+
className: "btn-copy",
|
|
712
|
+
onClick: function onClick() {
|
|
713
|
+
navigator.clipboard.writeText(el[0]);
|
|
714
|
+
setActiveBuffer(el[0]);
|
|
715
|
+
}
|
|
716
|
+
}), /*#__PURE__*/_react["default"].createElement("div", {
|
|
717
|
+
className: "tooltip_black"
|
|
718
|
+
}, activeBuffer == el[0] ? translateTextСopied() : translateCopyText())))));
|
|
719
|
+
}
|
|
720
|
+
if (currentType === 'textWithLink') {
|
|
721
|
+
if (!Array.isArray(el)) return 'ㅤ';
|
|
722
|
+
var _el6 = _slicedToArray(el, 2),
|
|
723
|
+
_text2 = _el6[0],
|
|
724
|
+
_link2 = _el6[1];
|
|
725
|
+
var type_link = _link2 !== null && _link2 !== void 0 && _link2.includes('http') ? '_blank' : false;
|
|
726
|
+
return /*#__PURE__*/_react["default"].createElement("td", {
|
|
727
|
+
className: "".concat(staticTD && ind === 0 ? 'sticky_th' : ''),
|
|
728
|
+
key: _getId([tableId, el, ind], 'textWithLink'),
|
|
729
|
+
onContextMenu: function onContextMenu(e) {
|
|
730
|
+
return e.stopPropagation();
|
|
731
|
+
}
|
|
732
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
733
|
+
className: "type-td_image-with-text"
|
|
734
|
+
}, /*#__PURE__*/_react["default"].createElement(_link3["default"], {
|
|
735
|
+
onClick: function onClick(e) {
|
|
736
|
+
if (typeof onRedirect === 'function') {
|
|
737
|
+
var _headers$header;
|
|
738
|
+
e.preventDefault();
|
|
739
|
+
onRedirect(onRedirectInfo ? [getRowObj(arr), el, headers === null || headers === void 0 || (_headers$header = headers.header) === null || _headers$header === void 0 ? void 0 : _headers$header[ind]] : [getRowObj(arr), _link2]);
|
|
740
|
+
} else {
|
|
741
|
+
window.open(_link2, type_link);
|
|
742
|
+
}
|
|
743
|
+
},
|
|
744
|
+
href: "#"
|
|
745
|
+
// style={headers?.styles?.[rowInd]?.[ind] ? headers?.styles?.[rowInd]?.[ind] : {}}
|
|
746
|
+
}, _text2)));
|
|
747
|
+
}
|
|
748
|
+
if (currentType === 'statusWithColor') {
|
|
749
|
+
if (!Array.isArray(el)) return 'ㅤ';
|
|
750
|
+
var _el7 = _slicedToArray(el, 3),
|
|
751
|
+
_text3 = _el7[0],
|
|
752
|
+
_color = _el7[1],
|
|
753
|
+
backgroundColor = _el7[2];
|
|
754
|
+
return /*#__PURE__*/_react["default"].createElement("td", {
|
|
755
|
+
className: "".concat(staticTD && ind === 0 ? 'sticky_th' : ''),
|
|
756
|
+
key: _getId([_text3 + ind]),
|
|
757
|
+
style: {
|
|
758
|
+
background: backgroundColor ? '#' + backgroundColor : ''
|
|
759
|
+
}
|
|
760
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
761
|
+
className: "type-td_status-with-color",
|
|
762
|
+
style: {
|
|
763
|
+
justifyContent: el ? 'flex-start' : 'center'
|
|
764
|
+
}
|
|
765
|
+
}, /*#__PURE__*/_react["default"].createElement("p", {
|
|
766
|
+
className: "text",
|
|
767
|
+
style: {
|
|
768
|
+
color: _color ? '#' + _color : ''
|
|
769
|
+
}
|
|
770
|
+
}, _text3 ? _text3 : '-')));
|
|
771
|
+
}
|
|
772
|
+
if (currentType === 'image') {
|
|
773
|
+
var _el$, _el$2, _el$3, _el$4;
|
|
774
|
+
var isArray = Array.isArray(el);
|
|
775
|
+
var denominator = isArray ? el === null || el === void 0 ? void 0 : el.length : 1;
|
|
776
|
+
var imgWidthPercents = showAllImages ? 100 / denominator : 100;
|
|
777
|
+
return /*#__PURE__*/_react["default"].createElement("td", {
|
|
778
|
+
className: "type-td_image ".concat(staticTD && ind === 0 ? 'sticky_th' : ''),
|
|
779
|
+
key: _getId([tableId, el, ind], 'image')
|
|
780
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
781
|
+
className: "img-box"
|
|
782
|
+
}, showAllImages && isArray ? el === null || el === void 0 ? void 0 : el.map(function (el, index) {
|
|
783
|
+
return /*#__PURE__*/_react["default"].createElement(_TypeTdImage.TypeTdImage, {
|
|
784
|
+
imgWidthPercents: imgWidthPercents,
|
|
785
|
+
src: el ? el : imageNotFound,
|
|
786
|
+
key: JSON.stringify(el) + index
|
|
787
|
+
});
|
|
788
|
+
}) : isArray ? /*#__PURE__*/_react["default"].createElement(_TypeTdImage.TypeTdImage, {
|
|
789
|
+
imgWidthPercents: imgWidthPercents,
|
|
790
|
+
key: JSON.stringify(el === null || el === void 0 ? void 0 : el[0]),
|
|
791
|
+
src: el !== null && el !== void 0 && (_el$ = el[0]) !== null && _el$ !== void 0 && _el$.value ? el === null || el === void 0 || (_el$2 = el[0]) === null || _el$2 === void 0 ? void 0 : _el$2.value : imageNotFound,
|
|
792
|
+
alt: el !== null && el !== void 0 && (_el$3 = el[0]) !== null && _el$3 !== void 0 && _el$3.alt ? el === null || el === void 0 || (_el$4 = el[0]) === null || _el$4 === void 0 ? void 0 : _el$4.alt : ''
|
|
793
|
+
}) : /*#__PURE__*/_react["default"].createElement(_TypeTdImage.TypeTdImage, {
|
|
794
|
+
imgWidthPercents: imgWidthPercents,
|
|
795
|
+
key: el,
|
|
796
|
+
src: el ? el : imageNotFound
|
|
797
|
+
})));
|
|
798
|
+
}
|
|
799
|
+
if (currentType === 'num') {
|
|
800
|
+
return /*#__PURE__*/_react["default"].createElement("td", {
|
|
801
|
+
// style={headers?.styles?.[rowInd]?.[ind] ? headers?.styles?.[rowInd]?.[ind] : {}}
|
|
802
|
+
className: "type-td_num ".concat(staticTD && ind === 0 ? 'sticky_th' : ''),
|
|
803
|
+
key: _getId([tableId, el, ind], 'num')
|
|
804
|
+
}, el === null || el === void 0 ? void 0 : el.toLocaleString());
|
|
805
|
+
}
|
|
806
|
+
if (currentType === 'postDataTd') {
|
|
807
|
+
return /*#__PURE__*/_react["default"].createElement("td", {
|
|
808
|
+
onClick: function onClick(e) {
|
|
809
|
+
e.preventDefault();
|
|
810
|
+
if (postDataTd) postDataTd(getRowObj(arr));
|
|
811
|
+
},
|
|
812
|
+
className: "type-td_num ".concat(staticTD && ind === 0 ? 'sticky_th' : ''),
|
|
813
|
+
key: _getId([tableId, el, ind], 'num')
|
|
814
|
+
}, el === null || el === void 0 ? void 0 : el.toLocaleString());
|
|
815
|
+
}
|
|
816
|
+
if (currentType === 'bar') {
|
|
817
|
+
if (!Array.isArray(el)) return 'ㅤ';
|
|
818
|
+
var _el8 = _slicedToArray(el, 2),
|
|
819
|
+
_count = _el8[0],
|
|
820
|
+
out_of = _el8[1];
|
|
821
|
+
return /*#__PURE__*/_react["default"].createElement("td", {
|
|
822
|
+
className: "".concat(staticTD && ind === 0 ? 'sticky_th' : ''),
|
|
823
|
+
key: _getId([tableId, el, ind], 'bar')
|
|
824
|
+
}, /*#__PURE__*/_react["default"].createElement("span", null, _count, " \u0438\u0437 ", out_of));
|
|
825
|
+
}
|
|
826
|
+
if (currentType === 'chart') {
|
|
827
|
+
// if(!el?.datasets) return 'ㅤ'
|
|
828
|
+
var datasets = el.datasets,
|
|
829
|
+
labels = el.labels,
|
|
830
|
+
label = el.label;
|
|
831
|
+
return /*#__PURE__*/_react["default"].createElement("td", {
|
|
832
|
+
className: "".concat(staticTD && ind === 0 ? 'sticky_th' : ''),
|
|
833
|
+
key: _getId([tableId, el, ind], 'chart')
|
|
834
|
+
}, /*#__PURE__*/_react["default"].createElement(_TableChartTd["default"], {
|
|
835
|
+
labels_prop: labels,
|
|
836
|
+
datasets_prop: datasets,
|
|
837
|
+
label: label
|
|
838
|
+
}));
|
|
839
|
+
}
|
|
840
|
+
if (currentType === 'input') {
|
|
841
|
+
if (!Array.isArray(el)) return 'ㅤ';
|
|
842
|
+
return /*#__PURE__*/_react["default"].createElement(_TableInput["default"], {
|
|
843
|
+
props: el,
|
|
844
|
+
getId: function getId(e) {
|
|
845
|
+
return _getId(e);
|
|
846
|
+
},
|
|
847
|
+
staticTD: staticTD,
|
|
848
|
+
ind: ind,
|
|
849
|
+
tableId: tableId,
|
|
850
|
+
state: inputState,
|
|
851
|
+
setState: function setState(e) {
|
|
852
|
+
return setInputState(e);
|
|
853
|
+
}
|
|
854
|
+
});
|
|
855
|
+
}
|
|
856
|
+
if (currentType === 'email') {
|
|
857
|
+
var regexEmail = /^((([0-9A-Za-z]{1}[-0-9A-z\.]{0,30}[0-9A-Za-z]?)|([0-9А-Яа-я]{1}[-0-9А-я\.]{0,30}[0-9А-Яа-я]?))@([-A-Za-z]{1,}\.){1,}[-A-Za-z]{2,})$/;
|
|
858
|
+
return /*#__PURE__*/_react["default"].createElement("td", {
|
|
859
|
+
className: "".concat(staticTD && ind === 0 ? 'sticky_th' : ''),
|
|
860
|
+
key: _getId([tableId, el, ind], 'email')
|
|
861
|
+
}, /*#__PURE__*/_react["default"].createElement("input", {
|
|
862
|
+
type: "text",
|
|
863
|
+
style: !regexEmail.test(el) ? {
|
|
864
|
+
outlineColor: 'red'
|
|
865
|
+
} : {},
|
|
866
|
+
value: el
|
|
867
|
+
}));
|
|
868
|
+
}
|
|
869
|
+
if (currentType === 'editableDate') {
|
|
870
|
+
return /*#__PURE__*/_react["default"].createElement("td", {
|
|
871
|
+
// style={headers?.styles?.[rowInd]?.[ind] ? headers?.styles?.[rowInd]?.[ind] : {}}
|
|
872
|
+
className: "type-td_date ".concat(staticTD && ind === 0 ? 'sticky_th' : ''),
|
|
873
|
+
key: _getId([tableId, el, ind], 'editableDate')
|
|
874
|
+
}, /*#__PURE__*/_react["default"].createElement(_TdDate.TdDate, {
|
|
875
|
+
date: el
|
|
876
|
+
}));
|
|
877
|
+
}
|
|
878
|
+
if (currentType === 'date') {
|
|
879
|
+
var _Date;
|
|
880
|
+
if (!el) return 'ㅤ';
|
|
881
|
+
return /*#__PURE__*/_react["default"].createElement("td", {
|
|
882
|
+
// style={headers?.styles?.[rowInd]?.[ind] ? headers?.styles?.[rowInd]?.[ind] : {}}
|
|
883
|
+
className: "type-td_date ".concat(staticTD && ind === 0 ? 'sticky_th' : ''),
|
|
884
|
+
key: _getId([tableId, el, ind], 'date')
|
|
885
|
+
}, (_Date = new Date(el)) === null || _Date === void 0 ? void 0 : _Date.toLocaleDateString('ru-RU'));
|
|
886
|
+
}
|
|
887
|
+
if (currentType === 'fullDate') {
|
|
888
|
+
var _Date2, _Date3;
|
|
889
|
+
return /*#__PURE__*/_react["default"].createElement("td", {
|
|
890
|
+
// style={headers?.styles?.[rowInd]?.[ind] ? headers?.styles?.[rowInd]?.[ind] : {}}
|
|
891
|
+
className: "type-td_date ".concat(staticTD && ind === 0 ? 'sticky_th' : ''),
|
|
892
|
+
key: _getId([tableId, el, ind], 'date')
|
|
893
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
894
|
+
className: "date-with-time"
|
|
895
|
+
}, /*#__PURE__*/_react["default"].createElement("span", null, ((_Date2 = new Date(el)) === null || _Date2 === void 0 ? void 0 : _Date2.toLocaleDateString('ru-RU')) + ' ', /*#__PURE__*/_react["default"].createElement("br", null), /*#__PURE__*/_react["default"].createElement("span", {
|
|
896
|
+
style: {
|
|
897
|
+
color: '#9298CF'
|
|
898
|
+
}
|
|
899
|
+
}, ' ' + ((_Date3 = new Date(el)) === null || _Date3 === void 0 ? void 0 : _Date3.toLocaleTimeString('ru-RU', {
|
|
900
|
+
hour: '2-digit',
|
|
901
|
+
minute: '2-digit'
|
|
902
|
+
}))))));
|
|
903
|
+
}
|
|
904
|
+
|
|
905
|
+
// if (currentType === 'rating') {
|
|
906
|
+
// let value
|
|
907
|
+
// if (el) value = Number(el)
|
|
908
|
+
// return <td className={`${(staticTD && ind === 0) ? 'sticky_th' : ''}`} key={getId([tableId, el, ind], 'rating')}>
|
|
909
|
+
// <div className='type-td_rating' style={{ justifyContent: 'flex-end' }}>
|
|
910
|
+
// {
|
|
911
|
+
// el ?
|
|
912
|
+
// <>
|
|
913
|
+
// <Rating
|
|
914
|
+
// name={`rating-comp-${ind + el}`}
|
|
915
|
+
// precision={0.2}
|
|
916
|
+
// defaultValue={Math.floor(value) * 0.2}
|
|
917
|
+
// max={1}
|
|
918
|
+
// readOnly
|
|
919
|
+
// emptyIcon={<StarIcon style={{ opacity: '.1' }} />}
|
|
920
|
+
// icon={<StarIcon style={{ fill: '#faaf00' }} />}
|
|
921
|
+
// size="large"
|
|
922
|
+
// />
|
|
923
|
+
// <span style={{ fontSize: '16px' }}>{el}</span>
|
|
924
|
+
// </>
|
|
925
|
+
// :
|
|
926
|
+
// <span>-</span>
|
|
927
|
+
// }
|
|
928
|
+
// </div>
|
|
929
|
+
// </td>
|
|
930
|
+
// }
|
|
931
|
+
|
|
932
|
+
if (currentType === 'checkbox') {
|
|
933
|
+
var _id = getCheckboxId(arr);
|
|
934
|
+
return /*#__PURE__*/_react["default"].createElement("td", {
|
|
935
|
+
className: "".concat(staticTD && ind === 0 ? 'sticky_th' : ''),
|
|
936
|
+
key: getCheckboxId([tableId].concat(_toConsumableArray(arr))),
|
|
937
|
+
style: {
|
|
938
|
+
textAlign: 'center',
|
|
939
|
+
padding: 0
|
|
940
|
+
}
|
|
941
|
+
}, /*#__PURE__*/_react["default"].createElement(_Checkbox["default"], {
|
|
942
|
+
id: _id,
|
|
943
|
+
value: onCheckCheckboxData(arr),
|
|
944
|
+
onChange: function onChange(e) {
|
|
945
|
+
return onCheckboxChange(arr);
|
|
946
|
+
}
|
|
947
|
+
}));
|
|
948
|
+
}
|
|
949
|
+
if (currentType === 'booleanCheckbox') {
|
|
950
|
+
if (!Array.isArray(el)) return 'ㅤ';
|
|
951
|
+
var _el9 = _slicedToArray(el, 2),
|
|
952
|
+
_value = _el9[0],
|
|
953
|
+
extraValue = _el9[1];
|
|
954
|
+
if (selectedBooleanItems[extraValue] === undefined & _value) onCheckboxChange(arr, extraValue);
|
|
955
|
+
return /*#__PURE__*/_react["default"].createElement("td", {
|
|
956
|
+
className: "".concat(staticTD && ind === 0 ? 'sticky_th' : ''),
|
|
957
|
+
key: _getId([tableId, el, ind], 'booleanCheckbox')
|
|
958
|
+
}, /*#__PURE__*/_react["default"].createElement(_Checkbox["default"], {
|
|
959
|
+
id: getCheckboxId(arr),
|
|
960
|
+
value: onCheckCheckboxData(arr, extraValue),
|
|
961
|
+
onChange: function onChange(e) {
|
|
962
|
+
if (onBooleanCheckbox) {
|
|
963
|
+
onBooleanCheckbox(selectedBooleanItems);
|
|
964
|
+
onCheckboxChange(arr, extraValue);
|
|
965
|
+
}
|
|
966
|
+
}
|
|
967
|
+
}));
|
|
968
|
+
}
|
|
969
|
+
if (currentType === 'actionBtn') {
|
|
970
|
+
if (Array.isArray(el)) return /*#__PURE__*/_react["default"].createElement("td", {
|
|
971
|
+
onClick: function onClick(e) {
|
|
972
|
+
if (onAction) {
|
|
973
|
+
onAction(getRowObj(arr));
|
|
974
|
+
}
|
|
975
|
+
}
|
|
976
|
+
}, el);
|
|
977
|
+
if ((el === null || el === void 0 ? void 0 : el.length) > 0) {
|
|
978
|
+
var render_element = '';
|
|
979
|
+
if (el !== null && el !== void 0 && el.match('https')) {
|
|
980
|
+
render_element = /*#__PURE__*/_react["default"].createElement("button", {
|
|
981
|
+
className: "btn__action",
|
|
982
|
+
style: {
|
|
983
|
+
backgroundImage: "url(".concat(el, ")")
|
|
984
|
+
}
|
|
985
|
+
});
|
|
986
|
+
} else {
|
|
987
|
+
render_element = /*#__PURE__*/_react["default"].createElement("p", {
|
|
988
|
+
// style={headers?.styles?.[rowInd]?.[ind] ? headers?.styles?.[rowInd]?.[ind] : {}}
|
|
989
|
+
className: "text_blue"
|
|
990
|
+
}, el);
|
|
991
|
+
}
|
|
992
|
+
return /*#__PURE__*/_react["default"].createElement("td", {
|
|
993
|
+
className: "".concat(staticTD && ind === 0 ? 'sticky_th' : ''),
|
|
994
|
+
key: _getId([tableId, el, ind], 'actionBtn'),
|
|
995
|
+
onClick: function onClick(e) {
|
|
996
|
+
var _headers$header2;
|
|
997
|
+
e.stopPropagation();
|
|
998
|
+
if (onAction) onAction(onActionInfo ? [getRowObj(arr), el, headers === null || headers === void 0 || (_headers$header2 = headers.header) === null || _headers$header2 === void 0 ? void 0 : _headers$header2[ind]] : getRowObj(arr));
|
|
999
|
+
}
|
|
1000
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
1001
|
+
className: "type-td_action-btn"
|
|
1002
|
+
}, (el === null || el === void 0 ? void 0 : el.length) > 0 && render_element));
|
|
1003
|
+
}
|
|
1004
|
+
}
|
|
1005
|
+
if (currentType === 'currency') {
|
|
1006
|
+
if (!Array.isArray(el)) return '';
|
|
1007
|
+
var _el10 = _slicedToArray(el, 2),
|
|
1008
|
+
_value2 = _el10[0],
|
|
1009
|
+
curr = _el10[1];
|
|
1010
|
+
var currency;
|
|
1011
|
+
if (typeof _value2 === 'number') {
|
|
1012
|
+
var _Number;
|
|
1013
|
+
_value2 = (_Number = Number(_value2)) === null || _Number === void 0 ? void 0 : _Number.toLocaleString();
|
|
1014
|
+
currency = /*#__PURE__*/_react["default"].createElement("span", {
|
|
1015
|
+
className: "val"
|
|
1016
|
+
}, /*#__PURE__*/_react["default"].createElement("span", null, curr), " ", _value2);
|
|
1017
|
+
} else {
|
|
1018
|
+
currency = /*#__PURE__*/_react["default"].createElement("span", {
|
|
1019
|
+
className: "curr"
|
|
1020
|
+
}, /*#__PURE__*/_react["default"].createElement("span", null, _value2), " ", curr);
|
|
1021
|
+
}
|
|
1022
|
+
return /*#__PURE__*/_react["default"].createElement("td", {
|
|
1023
|
+
className: "".concat(staticTD && ind === 0 ? 'sticky_th' : ''),
|
|
1024
|
+
key: _getId([tableId, el, ind], 'currency')
|
|
1025
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
1026
|
+
// style={headers?.styles?.[rowInd]?.[ind] ? headers?.styles?.[rowInd]?.[ind] : {}}
|
|
1027
|
+
className: "type-td_currency"
|
|
1028
|
+
}, currency));
|
|
1029
|
+
}
|
|
1030
|
+
if (currentType === 'hidden') {
|
|
1031
|
+
return;
|
|
1032
|
+
}
|
|
1033
|
+
if (currentType === 'contextMenu') {
|
|
1034
|
+
var prefix = 'nested-table';
|
|
1035
|
+
var trGetId = _getId(arr, prefix);
|
|
1036
|
+
return /*#__PURE__*/_react["default"].createElement("td", {
|
|
1037
|
+
key: _getId([tableId, el, ind], 'contextMenu'),
|
|
1038
|
+
"data-value": el,
|
|
1039
|
+
className: "type-td_context-menu ".concat(staticTD && ind === 0 ? 'sticky_th' : ''),
|
|
1040
|
+
onClick: function onClick(e) {
|
|
1041
|
+
e.preventDefault();
|
|
1042
|
+
e.stopPropagation();
|
|
1043
|
+
_onContextMenu(e, arr, trGetId);
|
|
1044
|
+
},
|
|
1045
|
+
onContextMenu: function onContextMenu(e) {
|
|
1046
|
+
e.preventDefault();
|
|
1047
|
+
e.stopPropagation();
|
|
1048
|
+
_onContextMenu(e, arr, trGetId);
|
|
1049
|
+
}
|
|
1050
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
1051
|
+
style: {
|
|
1052
|
+
display: 'flex',
|
|
1053
|
+
justifyContent: 'center',
|
|
1054
|
+
alignItems: 'center',
|
|
1055
|
+
position: 'relative'
|
|
1056
|
+
}
|
|
1057
|
+
}, /*#__PURE__*/_react["default"].createElement("img", {
|
|
1058
|
+
src: _contextMenu["default"],
|
|
1059
|
+
alt: "context menu button",
|
|
1060
|
+
style: {
|
|
1061
|
+
objectFit: 'contain',
|
|
1062
|
+
width: '1.75em',
|
|
1063
|
+
height: '1.75em'
|
|
1064
|
+
}
|
|
1065
|
+
}), contextId === trGetId ? /*#__PURE__*/_react["default"].createElement("div", {
|
|
1066
|
+
className: "drop-context-menu",
|
|
1067
|
+
style: {
|
|
1068
|
+
display: showContext ? 'flex' : 'none'
|
|
1069
|
+
}
|
|
1070
|
+
}, contextMenuArr === null || contextMenuArr === void 0 ? void 0 : contextMenuArr.map(function (el) {
|
|
1071
|
+
var label = el.label,
|
|
1072
|
+
_onClick = el.onClick,
|
|
1073
|
+
type = el.type;
|
|
1074
|
+
return /*#__PURE__*/_react["default"].createElement("button", {
|
|
1075
|
+
className: "drop-context-menu__btn ".concat(type === 'delete' ? 'btn-delete' : ''),
|
|
1076
|
+
onClick: function onClick(e) {
|
|
1077
|
+
e.preventDefault();
|
|
1078
|
+
e.stopPropagation();
|
|
1079
|
+
setShowContext(false);
|
|
1080
|
+
_onClick(contextArr, label);
|
|
1081
|
+
}
|
|
1082
|
+
}, translateContext(label));
|
|
1083
|
+
})) : null));
|
|
1084
|
+
}
|
|
1085
|
+
}
|
|
1086
|
+
return /*#__PURE__*/_react["default"].createElement("td", {
|
|
1087
|
+
className: "type-td_text ".concat(staticTD && ind === 0 ? 'sticky_th' : ''),
|
|
1088
|
+
key: _getId([tableId, el, ind], 'td'),
|
|
1089
|
+
style: {
|
|
1090
|
+
textAlign: 'left',
|
|
1091
|
+
width: currentWidth ? currentWidth : ''
|
|
1092
|
+
}
|
|
1093
|
+
}, /*#__PURE__*/_react["default"].createElement("p", {
|
|
1094
|
+
className: "text"
|
|
1095
|
+
// style={headers?.styles?.[rowInd]?.[ind] ? headers?.styles?.[rowInd]?.[ind] : {}}
|
|
1096
|
+
}, Array.isArray(el) ? el.join(', ') : el));
|
|
1097
|
+
});
|
|
1098
|
+
return tdList;
|
|
1099
|
+
};
|
|
1100
|
+
|
|
1101
|
+
// Nested table request template
|
|
1102
|
+
var fetchDataInsideFunc = function fetchDataInsideFunc(params) {
|
|
1103
|
+
// let sort;
|
|
1104
|
+
// let filtersParam;
|
|
1105
|
+
|
|
1106
|
+
// if (params) {
|
|
1107
|
+
// [sort, filtersParam] = params
|
|
1108
|
+
// }
|
|
1109
|
+
// setLoadingInside(true)
|
|
1110
|
+
|
|
1111
|
+
// let url
|
|
1112
|
+
// if (!window.location.hostname.match('localhost')) {
|
|
1113
|
+
// url = `${OlegHttps}/api/v1/account/all_account${sort?.length > 0 ? '?order_param=' + sort[0] + '&order_param_direction=' + sort[1] : ''}`
|
|
1114
|
+
// } else {
|
|
1115
|
+
// url = `${OlegHttp}/api/v1/account/all_account${sort?.length > 0 ? '?order_param=' + sort[0] + '&order_param_direction=' + sort[1] : ''}`
|
|
1116
|
+
// }
|
|
1117
|
+
|
|
1118
|
+
// const body = JSON.stringify({
|
|
1119
|
+
// page: 1,
|
|
1120
|
+
// limit: 25,
|
|
1121
|
+
// filters: filtersParam
|
|
1122
|
+
// })
|
|
1123
|
+
|
|
1124
|
+
// fetch(url, { body, method: 'POST', headers })
|
|
1125
|
+
// .then(res => res.json())
|
|
1126
|
+
// .then(json => {
|
|
1127
|
+
// const { data, labels, total, sort } = json
|
|
1128
|
+
// if (sort) setSortInside(sort)
|
|
1129
|
+
// if (labels) setHeadersInside(labels)
|
|
1130
|
+
// setFetchedDataInside(data.length > 0 ? data : [[]])
|
|
1131
|
+
// setLoadingInside(false)
|
|
1132
|
+
// })
|
|
1133
|
+
// .catch(err => {
|
|
1134
|
+
// setLoadingInside(false)
|
|
1135
|
+
// console.error(err)
|
|
1136
|
+
// })
|
|
1137
|
+
};
|
|
1138
|
+
|
|
1139
|
+
// Table body row logic
|
|
1140
|
+
var bodyRowsList = _toConsumableArray(fetchedData === null || fetchedData === void 0 ? void 0 : fetchedData.map(function (arr, ind) {
|
|
1141
|
+
if (Array !== null && Array !== void 0 && Array.isArray(arr)) {
|
|
1142
|
+
var prefix = 'nested-table';
|
|
1143
|
+
var tdList = typesTd(arr, ind);
|
|
1144
|
+
var trGetId = _getId(arr, prefix);
|
|
1145
|
+
|
|
1146
|
+
// buttonTd(tdList, arr)
|
|
1147
|
+
|
|
1148
|
+
return indTr !== trGetId ? /*#__PURE__*/_react["default"].createElement("tr", {
|
|
1149
|
+
key: _getId([tableId].concat(_toConsumableArray(arr), [ind]), 'tr'),
|
|
1150
|
+
style: {
|
|
1151
|
+
backgroundColor: nestedTable ? 'rgb(70, 231, 240, 0.1)' : '',
|
|
1152
|
+
cursor: 'pointer'
|
|
1153
|
+
},
|
|
1154
|
+
onClick: function onClick(e) {
|
|
1155
|
+
var productId = arr[hiddenHeaders[ind]];
|
|
1156
|
+
setShowContext(false);
|
|
1157
|
+
if (setState) {
|
|
1158
|
+
setState(productId);
|
|
1159
|
+
}
|
|
1160
|
+
if (isInsideTable) {
|
|
1161
|
+
fetchDataInsideFunc();
|
|
1162
|
+
if (ind === indTr) {
|
|
1163
|
+
setIndTr(null);
|
|
1164
|
+
} else {
|
|
1165
|
+
setIndTr(trGetId);
|
|
1166
|
+
}
|
|
1167
|
+
}
|
|
1168
|
+
},
|
|
1169
|
+
onContextMenu: function onContextMenu(e) {
|
|
1170
|
+
e.preventDefault();
|
|
1171
|
+
_onContextMenu(e, arr, trGetId, true);
|
|
1172
|
+
}
|
|
1173
|
+
}, tdList) : /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement("tr", {
|
|
1174
|
+
id: ind + tableId,
|
|
1175
|
+
key: _getId([tableId].concat(_toConsumableArray(arr), [ind]), 'tr'),
|
|
1176
|
+
style: {
|
|
1177
|
+
backgroundColor: 'rgb(70, 231, 240, 0.1)',
|
|
1178
|
+
outline: '3px solid rgb(70, 231, 240, 0.4)'
|
|
1179
|
+
},
|
|
1180
|
+
onClick: function onClick(e) {
|
|
1181
|
+
var productId = arr[hiddenHeaders[ind]];
|
|
1182
|
+
if (setState) {
|
|
1183
|
+
setState(productId);
|
|
1184
|
+
}
|
|
1185
|
+
setIndTr(null);
|
|
1186
|
+
}
|
|
1187
|
+
}, tdList), /*#__PURE__*/_react["default"].createElement(_Table, {
|
|
1188
|
+
loading: loadingInside,
|
|
1189
|
+
isSortable: isSortable,
|
|
1190
|
+
fetchedData: fetchedDataInside,
|
|
1191
|
+
headers: headersInside,
|
|
1192
|
+
sort: sortInside,
|
|
1193
|
+
paginator: false,
|
|
1194
|
+
sortingFunc: function sortingFunc(e) {
|
|
1195
|
+
return fetchDataInsideFunc(e);
|
|
1196
|
+
},
|
|
1197
|
+
nestedTable: true,
|
|
1198
|
+
paginatorDependepcies: []
|
|
1199
|
+
}));
|
|
1200
|
+
}
|
|
1201
|
+
}));
|
|
1202
|
+
|
|
1203
|
+
// Table header row logic
|
|
1204
|
+
var headerRowList = headers === null || headers === void 0 || (_headers$header3 = headers.header) === null || _headers$header3 === void 0 ? void 0 : _headers$header3.map(function (el, ind) {
|
|
1205
|
+
var classPostfix = activeSortColumn.current === el ? " ".concat(sortDirection) : '';
|
|
1206
|
+
var currentWidth = (columnSize === null || columnSize === void 0 ? void 0 : columnSize.length) > 0 ? columnSize[ind] : DEFAULT_COL_WIDTH_PX;
|
|
1207
|
+
if (hiddenHeaders !== null && hiddenHeaders !== void 0 && hiddenHeaders.includes(ind)) return null;
|
|
1208
|
+
if ((typeIndexArr === null || typeIndexArr === void 0 ? void 0 : typeIndexArr[ind]) === 'image') {
|
|
1209
|
+
return /*#__PURE__*/_react["default"].createElement("th", {
|
|
1210
|
+
key: _getId([tableId, el, ind], 'th'),
|
|
1211
|
+
style: {
|
|
1212
|
+
padding: '9px 12px'
|
|
1213
|
+
},
|
|
1214
|
+
className: "col col".concat(ind + classPostfix, " \n ").concat(staticTD && ind == 0 ? 'sticky_th' : '')
|
|
1215
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
1216
|
+
className: "text-and-icon"
|
|
1217
|
+
}, /*#__PURE__*/_react["default"].createElement("p", {
|
|
1218
|
+
className: "td-text-table"
|
|
1219
|
+
}, el)), tooltips && tooltips[ind] ? /*#__PURE__*/_react["default"].createElement("div", {
|
|
1220
|
+
className: "tooltip_black"
|
|
1221
|
+
}, tooltips[ind]) : null);
|
|
1222
|
+
}
|
|
1223
|
+
if (typeIndexArr[ind] === 'contextMenu') {
|
|
1224
|
+
return /*#__PURE__*/_react["default"].createElement("th", {
|
|
1225
|
+
className: "".concat(staticTD && ind === 0 ? 'sticky_th' : ''),
|
|
1226
|
+
key: _getId([tableId, el, ind], 'contextMenu th')
|
|
1227
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
1228
|
+
className: "col-th-border col-th-border_context",
|
|
1229
|
+
style: {
|
|
1230
|
+
resize: 'none',
|
|
1231
|
+
borderRight: staticTD && ind == 0 ? 'none' : ''
|
|
1232
|
+
}
|
|
1233
|
+
}));
|
|
1234
|
+
}
|
|
1235
|
+
if (typeIndexArr[ind] === 'checkbox') {
|
|
1236
|
+
return /*#__PURE__*/_react["default"].createElement("th", {
|
|
1237
|
+
key: "check-".concat(tableId),
|
|
1238
|
+
className: "th-check col".concat(ind, " ").concat(staticTD && ind === 0 ? 'sticky_th' : '')
|
|
1239
|
+
}, /*#__PURE__*/_react["default"].createElement(_Checkbox["default"], {
|
|
1240
|
+
id: getCheckboxId(fetchedData),
|
|
1241
|
+
value: checkedAll,
|
|
1242
|
+
onChange: function onChange(e) {
|
|
1243
|
+
if (checkedAll) {
|
|
1244
|
+
_onUncheckAll();
|
|
1245
|
+
} else {
|
|
1246
|
+
onCheckAll();
|
|
1247
|
+
}
|
|
1248
|
+
}
|
|
1249
|
+
}));
|
|
1250
|
+
}
|
|
1251
|
+
return /*#__PURE__*/_react["default"].createElement("th", {
|
|
1252
|
+
key: _getId([tableId, el, ind], 'th'),
|
|
1253
|
+
className: "col col".concat(ind + classPostfix, " ").concat(staticTD && ind == 0 ? 'sticky_th' : '')
|
|
1254
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
1255
|
+
className: "col-th-border",
|
|
1256
|
+
style: {
|
|
1257
|
+
borderRight: staticTD && ind == 0 ? 'none' : '',
|
|
1258
|
+
resize: 'horizontal',
|
|
1259
|
+
overflow: 'hidden',
|
|
1260
|
+
width: currentWidth
|
|
1261
|
+
}
|
|
1262
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
1263
|
+
className: "text-and-icon",
|
|
1264
|
+
onClick: function onClick() {
|
|
1265
|
+
return columnSort(el);
|
|
1266
|
+
}
|
|
1267
|
+
}, /*#__PURE__*/_react["default"].createElement("p", {
|
|
1268
|
+
className: "td-text-table"
|
|
1269
|
+
}, el !== null && el !== void 0 && el.includes('http') ? /*#__PURE__*/_react["default"].createElement("img", {
|
|
1270
|
+
className: "header-img",
|
|
1271
|
+
src: el
|
|
1272
|
+
}) : !Array.isArray(el) ? el : null, (el === null || el === void 0 ? void 0 : el.length) > 10 & !(el !== null && el !== void 0 && el.includes('http')) & !Array.isArray(el) ? /*#__PURE__*/_react["default"].createElement("span", {
|
|
1273
|
+
className: "popup-th"
|
|
1274
|
+
}, el) : null, Array.isArray(el) ? el === null || el === void 0 ? void 0 : el.map(function (item) {
|
|
1275
|
+
if (el !== null && el !== void 0 && el.includes('http')) {
|
|
1276
|
+
return /*#__PURE__*/_react["default"].createElement("img", {
|
|
1277
|
+
className: "header-img",
|
|
1278
|
+
src: item
|
|
1279
|
+
});
|
|
1280
|
+
} else {
|
|
1281
|
+
return /*#__PURE__*/_react["default"].createElement("p", null, item);
|
|
1282
|
+
}
|
|
1283
|
+
}) : null), !hideSorting && /*#__PURE__*/_react["default"].createElement("img", {
|
|
1284
|
+
style: {
|
|
1285
|
+
width: '13px',
|
|
1286
|
+
height: '13px'
|
|
1287
|
+
},
|
|
1288
|
+
src: (sortDirection === null || sortDirection === void 0 ? void 0 : sortDirection.length) > 1 && sortDirection[0] === el & typeof sortDirection[1] === 'string' ? (sortDirection === null || sortDirection === void 0 ? void 0 : sortDirection.length) > 1 && sortDirection[1] === SORT_DIRECTIONS.ascending ? _sort_arrow_up["default"] : _sort_arrow_down["default"] : _sort_table["default"]
|
|
1289
|
+
}))), tooltips && tooltips[ind] ? /*#__PURE__*/_react["default"].createElement("div", {
|
|
1290
|
+
className: "tooltip_black"
|
|
1291
|
+
}, tooltips[ind]) : null);
|
|
1292
|
+
});
|
|
1293
|
+
|
|
1294
|
+
// Formatting table headers and column filters logic
|
|
1295
|
+
var tableHeaders = /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement("tr", {
|
|
1296
|
+
className: "tr-col-headers"
|
|
1297
|
+
}, headerRowList), !hideFilters && /*#__PURE__*/_react["default"].createElement("tr", {
|
|
1298
|
+
className: "tr-col-filters"
|
|
1299
|
+
}, /*#__PURE__*/_react["default"].createElement(_RenderFiltersTh.RenderFiltersTh, {
|
|
1300
|
+
onUncheckAll: function onUncheckAll(e) {
|
|
1301
|
+
return _onUncheckAll(e);
|
|
1302
|
+
},
|
|
1303
|
+
setCheckedAll: function setCheckedAll(e) {
|
|
1304
|
+
return _setCheckedAll(e);
|
|
1305
|
+
},
|
|
1306
|
+
lang: lang,
|
|
1307
|
+
staticTD: staticTD,
|
|
1308
|
+
fetchedData: fetchedData,
|
|
1309
|
+
onCheck: onCheck,
|
|
1310
|
+
activeItem: activeItem,
|
|
1311
|
+
headers: selectedHeaders !== null && selectedHeaders !== void 0 && selectedHeaders.type ? selectedHeaders : headers,
|
|
1312
|
+
showOption: showOption,
|
|
1313
|
+
setShowOption: function setShowOption(e) {
|
|
1314
|
+
return _setShowOption(e);
|
|
1315
|
+
},
|
|
1316
|
+
filters: filters,
|
|
1317
|
+
filterTypes: headers === null || headers === void 0 ? void 0 : headers.filterTypes,
|
|
1318
|
+
filterList: headers === null || headers === void 0 ? void 0 : headers.filterList,
|
|
1319
|
+
setFilters: function setFilters(e) {
|
|
1320
|
+
return _setFilters(e);
|
|
1321
|
+
},
|
|
1322
|
+
sort: sort,
|
|
1323
|
+
setFiltersTable: function setFiltersTable(e) {
|
|
1324
|
+
return _setFiltersTable(e);
|
|
1325
|
+
},
|
|
1326
|
+
sortingFunc: function sortingFunc(e) {
|
|
1327
|
+
return _sortingFunc(e);
|
|
1328
|
+
},
|
|
1329
|
+
sortParam: sortParam,
|
|
1330
|
+
setActiveItem: function setActiveItem(e) {
|
|
1331
|
+
return _setActiveItem(e);
|
|
1332
|
+
},
|
|
1333
|
+
filtersTable: filtersTable,
|
|
1334
|
+
params: params,
|
|
1335
|
+
setParams: function setParams(e) {
|
|
1336
|
+
return _setParams(e);
|
|
1337
|
+
},
|
|
1338
|
+
fileFilters: fileFilters,
|
|
1339
|
+
setFileFilters: function setFileFilters(e) {
|
|
1340
|
+
return _setFileFilters(e);
|
|
1341
|
+
},
|
|
1342
|
+
showAllImages: showAllImages,
|
|
1343
|
+
setShowAllImages: function setShowAllImages(e) {
|
|
1344
|
+
return _setShowAllImages(e);
|
|
1345
|
+
}
|
|
1346
|
+
})));
|
|
1347
|
+
|
|
1348
|
+
// onScroll handler
|
|
1349
|
+
var scroll = function scroll() {
|
|
1350
|
+
var _refBody$current;
|
|
1351
|
+
scrollBottom();
|
|
1352
|
+
var tbody = refBody === null || refBody === void 0 || (_refBody$current = refBody.current) === null || _refBody$current === void 0 ? void 0 : _refBody$current.getBoundingClientRect();
|
|
1353
|
+
var thead = refThead === null || refThead === void 0 ? void 0 : refThead.current;
|
|
1354
|
+
var top = tbody === null || tbody === void 0 ? void 0 : tbody.top;
|
|
1355
|
+
var height = thead === null || thead === void 0 ? void 0 : thead.getBoundingClientRect().height;
|
|
1356
|
+
if (top <= height) {
|
|
1357
|
+
setRowCount(-top + height);
|
|
1358
|
+
} else {
|
|
1359
|
+
setRowCount(0);
|
|
1360
|
+
}
|
|
1361
|
+
};
|
|
1362
|
+
(0, _react.useEffect)(function () {
|
|
1363
|
+
if (typeof onInputHandler === 'function') {
|
|
1364
|
+
onInputHandler(inputState);
|
|
1365
|
+
}
|
|
1366
|
+
}, [inputState]);
|
|
1367
|
+
|
|
1368
|
+
// Attach the scroll listener to the div
|
|
1369
|
+
(0, _react.useEffect)(function () {
|
|
1370
|
+
window.addEventListener("scroll", scroll);
|
|
1371
|
+
return function () {
|
|
1372
|
+
return window.removeEventListener('scroll', scroll);
|
|
1373
|
+
};
|
|
1374
|
+
}, []);
|
|
1375
|
+
(0, _react.useEffect)(function () {
|
|
1376
|
+
if (typeof setCheckedStateEmpty == 'function') {
|
|
1377
|
+
_onUncheckAll();
|
|
1378
|
+
setCheckedStateEmpty(false);
|
|
1379
|
+
}
|
|
1380
|
+
}, [setCheckedStateEmpty]);
|
|
1381
|
+
(0, _react.useEffect)(function () {
|
|
1382
|
+
if (initialSort) {
|
|
1383
|
+
setInitialSort(sort);
|
|
1384
|
+
}
|
|
1385
|
+
}, [initialSort]);
|
|
1386
|
+
|
|
1387
|
+
// Обработчик на клик вне элемента,для закрытия блока с options
|
|
1388
|
+
(0, _react.useEffect)(function () {
|
|
1389
|
+
if (typeof document !== 'undefined') {
|
|
1390
|
+
var showFilterOptions = function showFilterOptions(e) {
|
|
1391
|
+
var el = e.target;
|
|
1392
|
+
if (!el.closest('.filter-btn-box') && !el.closest('.date-box-filter-table')) {
|
|
1393
|
+
_setActiveItem(null);
|
|
1394
|
+
_setShowOption(false);
|
|
1395
|
+
}
|
|
1396
|
+
};
|
|
1397
|
+
document.addEventListener('click', showFilterOptions);
|
|
1398
|
+
return function () {
|
|
1399
|
+
document.addEventListener('click', showFilterOptions);
|
|
1400
|
+
};
|
|
1401
|
+
}
|
|
1402
|
+
}, []);
|
|
1403
|
+
|
|
1404
|
+
// Horizontal scroll resize handler
|
|
1405
|
+
// const observer = new ResizeObserver((entries) => {
|
|
1406
|
+
// const { width } = entries[0].contentRect;
|
|
1407
|
+
// setWidthTable(width);
|
|
1408
|
+
// })
|
|
1409
|
+
|
|
1410
|
+
// useEffect(() => {
|
|
1411
|
+
// if (refTable?.current) {
|
|
1412
|
+
// // observer.observe(refTable?.current);
|
|
1413
|
+
// }
|
|
1414
|
+
// }, [refTable]);
|
|
1415
|
+
|
|
1416
|
+
// Horizontal onScroll handler
|
|
1417
|
+
var scrollBottom = function scrollBottom() {
|
|
1418
|
+
if (typeof document !== 'undefined') {
|
|
1419
|
+
var _paginatorBoxRef$curr, _paginatorBoxRef$curr2, _paginatorBoxRef$curr3, _paginatorBoxRef$curr4, _refTable$current, _refContainer$current;
|
|
1420
|
+
positionScroll();
|
|
1421
|
+
var top = paginatorBoxRef === null || paginatorBoxRef === void 0 || (_paginatorBoxRef$curr = paginatorBoxRef.current) === null || _paginatorBoxRef$curr === void 0 ? void 0 : _paginatorBoxRef$curr.getBoundingClientRect().top;
|
|
1422
|
+
var left = paginatorBoxRef === null || paginatorBoxRef === void 0 || (_paginatorBoxRef$curr2 = paginatorBoxRef.current) === null || _paginatorBoxRef$curr2 === void 0 ? void 0 : _paginatorBoxRef$curr2.getBoundingClientRect().left;
|
|
1423
|
+
var width = paginatorBoxRef === null || paginatorBoxRef === void 0 || (_paginatorBoxRef$curr3 = paginatorBoxRef.current) === null || _paginatorBoxRef$curr3 === void 0 ? void 0 : _paginatorBoxRef$curr3.getBoundingClientRect().width;
|
|
1424
|
+
var _scrollWidth = paginatorBoxRef === null || paginatorBoxRef === void 0 || (_paginatorBoxRef$curr4 = paginatorBoxRef.current) === null || _paginatorBoxRef$curr4 === void 0 ? void 0 : _paginatorBoxRef$curr4.scrollWidth;
|
|
1425
|
+
|
|
1426
|
+
// Ширина таблицы
|
|
1427
|
+
var _widthTable = refTable === null || refTable === void 0 || (_refTable$current = refTable.current) === null || _refTable$current === void 0 ? void 0 : _refTable$current.getBoundingClientRect().width;
|
|
1428
|
+
setWidthTable(_widthTable);
|
|
1429
|
+
setLeftPosition(left); //left
|
|
1430
|
+
setWidtContainer(width); //right
|
|
1431
|
+
setScrollWidth(_scrollWidth); //width
|
|
1432
|
+
|
|
1433
|
+
// Видимость скроллбара
|
|
1434
|
+
var heightDocument = document.documentElement.clientHeight;
|
|
1435
|
+
setBottom(refContainer === null || refContainer === void 0 || (_refContainer$current = refContainer.current) === null || _refContainer$current === void 0 ? void 0 : _refContainer$current.getBoundingClientRect().bottom);
|
|
1436
|
+
if (heightDocument) {
|
|
1437
|
+
var _refContainer$current2;
|
|
1438
|
+
var pointBottom = (refContainer === null || refContainer === void 0 || (_refContainer$current2 = refContainer.current) === null || _refContainer$current2 === void 0 ? void 0 : _refContainer$current2.getBoundingClientRect().bottom) > document.documentElement.clientHeight;
|
|
1439
|
+
var pointTop = (refContainer === null || refContainer === void 0 ? void 0 : refContainer.top) > 0;
|
|
1440
|
+
setIsFixed(pointBottom || pointTop ? true : false);
|
|
1441
|
+
}
|
|
1442
|
+
|
|
1443
|
+
//верхняя точка скроллбара
|
|
1444
|
+
if (heightDocument) {
|
|
1445
|
+
var _refContainer$current3;
|
|
1446
|
+
var _pointTop = (refContainer === null || refContainer === void 0 || (_refContainer$current3 = refContainer.current) === null || _refContainer$current3 === void 0 ? void 0 : _refContainer$current3.getBoundingClientRect().top) > document.documentElement.clientHeight;
|
|
1447
|
+
setIsVisible(_pointTop ? false : true);
|
|
1448
|
+
}
|
|
1449
|
+
}
|
|
1450
|
+
};
|
|
1451
|
+
|
|
1452
|
+
// Синхронизируем скролл
|
|
1453
|
+
var positionScroll = function positionScroll() {
|
|
1454
|
+
if (paginatorBoxRef !== null && paginatorBoxRef !== void 0 && paginatorBoxRef.current && refDiv !== null && refDiv !== void 0 && refDiv.current) {
|
|
1455
|
+
var _refTable$current2;
|
|
1456
|
+
paginatorBoxRef.current.scrollLeft = refDiv.current.scrollLeft;
|
|
1457
|
+
var _widthTable2 = (_refTable$current2 = refTable.current) === null || _refTable$current2 === void 0 ? void 0 : _refTable$current2.getBoundingClientRect().width;
|
|
1458
|
+
setWidthTable(_widthTable2);
|
|
1459
|
+
}
|
|
1460
|
+
};
|
|
1461
|
+
|
|
1462
|
+
// скролл таблицы shift + wheel
|
|
1463
|
+
var scrollWheel = function scrollWheel(e) {
|
|
1464
|
+
var isShift = e === null || e === void 0 ? void 0 : e.shiftKey;
|
|
1465
|
+
if (paginatorBoxRef !== null && paginatorBoxRef !== void 0 && paginatorBoxRef.current && refDiv !== null && refDiv !== void 0 && refDiv.current && isShift) {
|
|
1466
|
+
refDiv.current.scrollLeft = paginatorBoxRef.current.scrollLeft;
|
|
1467
|
+
}
|
|
1468
|
+
};
|
|
1469
|
+
(0, _react.useEffect)(function () {
|
|
1470
|
+
var _paginatorBoxRef$curr5;
|
|
1471
|
+
window.addEventListener("scroll", scrollBottom);
|
|
1472
|
+
window.addEventListener("resize", scrollBottom);
|
|
1473
|
+
paginatorBoxRef === null || paginatorBoxRef === void 0 || (_paginatorBoxRef$curr5 = paginatorBoxRef.current) === null || _paginatorBoxRef$curr5 === void 0 || _paginatorBoxRef$curr5.addEventListener('wheel', scrollWheel);
|
|
1474
|
+
return function () {
|
|
1475
|
+
var _paginatorBoxRef$curr6;
|
|
1476
|
+
window.removeEventListener('scroll', scrollBottom);
|
|
1477
|
+
window.removeEventListener("resize", scrollBottom);
|
|
1478
|
+
paginatorBoxRef === null || paginatorBoxRef === void 0 || (_paginatorBoxRef$curr6 = paginatorBoxRef.current) === null || _paginatorBoxRef$curr6 === void 0 || _paginatorBoxRef$curr6.removeEventListener('wheel', scrollWheel);
|
|
1479
|
+
};
|
|
1480
|
+
}, []);
|
|
1481
|
+
(0, _react.useEffect)(function () {
|
|
1482
|
+
positionScroll();
|
|
1483
|
+
scrollBottom();
|
|
1484
|
+
}, []);
|
|
1485
|
+
(0, _react.useEffect)(function () {
|
|
1486
|
+
scrollBottom();
|
|
1487
|
+
}, [total, page]);
|
|
1488
|
+
|
|
1489
|
+
// Attach the scroll listener to the div
|
|
1490
|
+
(0, _react.useEffect)(function () {
|
|
1491
|
+
var _paginatorBoxRef$curr7, _paginatorBoxRef$curr8;
|
|
1492
|
+
var left = paginatorBoxRef === null || paginatorBoxRef === void 0 || (_paginatorBoxRef$curr7 = paginatorBoxRef.current) === null || _paginatorBoxRef$curr7 === void 0 ? void 0 : _paginatorBoxRef$curr7.getBoundingClientRect().left;
|
|
1493
|
+
var right = paginatorBoxRef === null || paginatorBoxRef === void 0 || (_paginatorBoxRef$curr8 = paginatorBoxRef.current) === null || _paginatorBoxRef$curr8 === void 0 ? void 0 : _paginatorBoxRef$curr8.getBoundingClientRect().width;
|
|
1494
|
+
setWidtContainer(right);
|
|
1495
|
+
setLeftPosition(left);
|
|
1496
|
+
}, [selectedHeaders, widthTable]);
|
|
1497
|
+
(0, _react.useEffect)(function () {
|
|
1498
|
+
if (paginatorBoxRef !== null && paginatorBoxRef !== void 0 && paginatorBoxRef.current && refDiv !== null && refDiv !== void 0 && refDiv.current) {
|
|
1499
|
+
paginatorBoxRef.current.scrollLeft = 0;
|
|
1500
|
+
refDiv.current.scrollLeft = 0;
|
|
1501
|
+
}
|
|
1502
|
+
}, [selectedHeaders]);
|
|
1503
|
+
return loading && !(headers !== null && headers !== void 0 && headers.header) ? /*#__PURE__*/_react["default"].createElement("div", {
|
|
1504
|
+
className: "loader-table"
|
|
1505
|
+
}, /*#__PURE__*/_react["default"].createElement(_reactSpinners.MoonLoader, {
|
|
1506
|
+
color: "#1890FF",
|
|
1507
|
+
speedMultiplier: 0.5
|
|
1508
|
+
})) : headers !== null && headers !== void 0 && headers.header ? !nestedTable ? /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement("table", {
|
|
1509
|
+
className: "table-ver-3",
|
|
1510
|
+
ref: refTable
|
|
1511
|
+
}, /*#__PURE__*/_react["default"].createElement("thead", {
|
|
1512
|
+
ref: refThead,
|
|
1513
|
+
className: "thead",
|
|
1514
|
+
style: {
|
|
1515
|
+
backgroundColor: 'white',
|
|
1516
|
+
transform: "translateY(".concat(rowCount + (topHeader ? topHeader : 0), "px)"),
|
|
1517
|
+
transition: '.3s'
|
|
1518
|
+
}
|
|
1519
|
+
}, tableHeaders), /*#__PURE__*/_react["default"].createElement("tbody", {
|
|
1520
|
+
ref: refBody,
|
|
1521
|
+
className: "tbody",
|
|
1522
|
+
style: {
|
|
1523
|
+
position: 'relative'
|
|
1524
|
+
}
|
|
1525
|
+
}, ((_fetchedData$ = fetchedData[0]) === null || _fetchedData$ === void 0 ? void 0 : _fetchedData$.length) > 0 ? bodyRowsList : /*#__PURE__*/_react["default"].createElement("tr", null, /*#__PURE__*/_react["default"].createElement("td", {
|
|
1526
|
+
className: "loader-box-tr",
|
|
1527
|
+
colSpan: "88",
|
|
1528
|
+
style: {
|
|
1529
|
+
padding: '24px'
|
|
1530
|
+
}
|
|
1531
|
+
}, /*#__PURE__*/_react["default"].createElement("p", {
|
|
1532
|
+
className: "text_grey"
|
|
1533
|
+
}, translateNoParametr()))))), isVisible && /*#__PURE__*/_react["default"].createElement("div", {
|
|
1534
|
+
className: "scrollbar",
|
|
1535
|
+
ref: refDiv,
|
|
1536
|
+
onScroll: function onScroll(e) {
|
|
1537
|
+
scrollBottom();
|
|
1538
|
+
positionScroll();
|
|
1539
|
+
},
|
|
1540
|
+
style: {
|
|
1541
|
+
height: '16px',
|
|
1542
|
+
position: "fixed",
|
|
1543
|
+
bottom: isFixed ? 0 : '',
|
|
1544
|
+
top: !isFixed ? bottom : '',
|
|
1545
|
+
left: leftPosition + 'px',
|
|
1546
|
+
maxWidth: widtContainer + 'px',
|
|
1547
|
+
width: '100%',
|
|
1548
|
+
overflowX: 'scroll',
|
|
1549
|
+
overflowY: 'hidden'
|
|
1550
|
+
}
|
|
1551
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
1552
|
+
style: {
|
|
1553
|
+
minWidth: widthTable,
|
|
1554
|
+
maxWidth: widthTable
|
|
1555
|
+
}
|
|
1556
|
+
}))) : /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, tableHeaders, fetchedData[0].length > 0 ? bodyRowsList : /*#__PURE__*/_react["default"].createElement("tr", null, /*#__PURE__*/_react["default"].createElement("td", {
|
|
1557
|
+
className: "loader-box-tr",
|
|
1558
|
+
colSpan: "88",
|
|
1559
|
+
style: {
|
|
1560
|
+
padding: '24px'
|
|
1561
|
+
}
|
|
1562
|
+
}, /*#__PURE__*/_react["default"].createElement("p", {
|
|
1563
|
+
className: "text_grey"
|
|
1564
|
+
}, translateNoParametr())))) : /*#__PURE__*/_react["default"].createElement(_TableWithoutData.TableWithoutData, {
|
|
1565
|
+
maxHeight: maxHeight,
|
|
1566
|
+
text: noDataText ? noDataText : textTable
|
|
1567
|
+
});
|
|
1568
|
+
};
|
|
1569
|
+
var _default = exports["default"] = _Table;
|