@tap-payments/os-micro-frontend-shared 0.1.438-test.27 → 0.1.438-test.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.
@@ -9,7 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  };
10
10
  import { useCallback, useEffect, useMemo, useState } from 'react';
11
11
  import { OTHER_SECTION_CODE } from '../constants';
12
- import { handleTemplateUpdate, mapColumnsToLayoutSection, convertTemplateToColumnsView, convertTemplatesToColumnsView, isTemplateMatchingId, replaceTemplateInList, updateCurrentTemplate, addRequiredColumns, hasLayoutSectionForMode, } from '../utils';
12
+ import { handleTemplateUpdate, mapColumnsToLayoutSection, convertTemplateToColumnsView, isTemplateMatchingId, replaceTemplateInList, updateCurrentTemplate, addRequiredColumns, } from '../utils';
13
13
  import { updateColumnSelection } from '../../../../utils/index.js';
14
14
  export function useCustomTableViews({ templates, setTemplates, createTemplate, updateTemplate, deleteTemplate, tableMode, lang = 'en', columnModifiers, }) {
15
15
  const [selectedTemplateId, setSelectedTemplateId] = useState(undefined);
@@ -92,13 +92,9 @@ export function useCustomTableViews({ templates, setTemplates, createTemplate, u
92
92
  var _a;
93
93
  const selectedTemplate = (_a = templates.find((t) => (selectedTemplateId ? isTemplateMatchingId(t, selectedTemplateId) : false))) !== null && _a !== void 0 ? _a : defaultTemplate;
94
94
  let templateColumnsView = [];
95
- const hasSelectedModeLayoutSection = hasLayoutSectionForMode(selectedTemplate, tableMode);
96
95
  if (selectedTemplate) {
97
96
  templateColumnsView = convertTemplateToColumnsView(selectedTemplate, tableMode);
98
97
  }
99
- if (templateColumnsView.length === 0 && (templates === null || templates === void 0 ? void 0 : templates.length) > 0 && !hasSelectedModeLayoutSection) {
100
- templateColumnsView = convertTemplatesToColumnsView(templates, tableMode);
101
- }
102
98
  if (templateColumnsView.length === 0) {
103
99
  return [];
104
100
  }
@@ -4,13 +4,7 @@ export declare function updateColumnSelection({ columnsViewData, columnsName, se
4
4
  columnsName: string[];
5
5
  selected: boolean;
6
6
  }): ColumnsView[];
7
- export declare function filterShownColumns<T>(columns: Array<IColumnProps<T & {
8
- actions: string;
9
- action_icon?: string;
10
- }>>, tableViews: ColumnViewProps[]): IColumnProps<T & {
11
- actions: string;
12
- action_icon?: string | undefined;
13
- }>[];
7
+ export declare function filterShownColumns(columns: IColumnProps[], tableViews: ColumnViewProps[]): IColumnProps<any>[];
14
8
  export declare function isParameterSelected(columns: ColumnViewProps[], columnId: string, parameter: string): boolean;
15
9
  export declare function mapDataToViews(columnData?: ColumnsView[], language?: string): ColumnViewProps[];
16
10
  export declare function mapViewsToData(columns: ColumnViewProps[]): ColumnsView[];
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@tap-payments/os-micro-frontend-shared",
3
3
  "description": "Shared components and utilities for Tap Payments micro frontends",
4
- "version": "0.1.438-test.27",
5
- "testVersion": 27,
4
+ "version": "0.1.438-test.29",
5
+ "testVersion": 29,
6
6
  "type": "module",
7
7
  "main": "build/index.js",
8
8
  "module": "build/index.js",